GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - trikiman/ddnet-map-loader: Hot reload feature

BranchesTags
Open more actions menu

Latest commit

 

History

27 Commits
27 Commits

Folders and files

NameName
Last commit message
Last commit date
.devcontainer
.devcontainer
 
 
.planning
.planning
 
 
Image
Image
 
 
Project plan
Project plan
 
 
tools
tools
 
 
web
web
 
 
.cursorignore
.cursorignore
 
 
.gitignore
.gitignore
 
 
.windsurfrules
.windsurfrules
 
 
README.md
README.md
 
 
README_devin.cursorrules.md
README_devin.cursorrules.md
 
 
RELEASE_CHECKLIST.md
RELEASE_CHECKLIST.md
 
 
auto_uploader.ps1
auto_uploader.ps1
 
 
compile.bat
compile.bat
 
 
copy_dlls.bat
copy_dlls.bat
 
 
ddnet_control.cpp
ddnet_control.cpp
 
 
ddnet_control.exe
ddnet_control.exe
 
 
ddnet_control.rc
ddnet_control.rc
 
 
ddnet_loader.ico
ddnet_loader.ico
 
 
disk_cleanup.ps1
disk_cleanup.ps1
 
 
fix_file_association.bat
fix_file_association.bat
 
 
make_cert.bat
make_cert.bat
 
 
make_cert.ps1
make_cert.ps1
 
 
myServerconfig.cfg
myServerconfig.cfg
 
 
requirements.txt
requirements.txt
 
 
rules.md
rules.md
 
 
scratchpad.md
scratchpad.md
 
 
test.map
test.map
 
 
vcvars64.bat
vcvars64.bat
 
 

Repository files navigation

DDNet Map Loader (v2)

Source code for a helper tool that hot-reloads a DDNet server map and manages backups.

  • Language: C++ (single binary)
  • Main: ddnet_control.cpp
  • Icon/Resources: ddnet_control.rc (uses Image/ddnet_loader.ico)
  • Registry scripts (user-scope): registry/
  • Tools: tools/ (e.g., convert_ico.py for multi-size ICO generation)
  • Web UI assets (optional): web/

Build

Windows with MSVC (VS 2022 Build Tools):

compile.bat

On success: ddnet_control.exe is produced; see build.log.

Usage

Double-click a .map file (after association), or run from CLI to load a map and hot-reload:

ddnet_control.exe "C:\\Users\\<you>\\AppData\\Roaming\\DDNet\\maps\\mapsfortest\\Tutorial.map"

Behavior (high level):

  • Detect current server map via sv_map.
  • Ensure %APPDATA%/DDNet/maps structure (and backups/).
  • Copy new map into DDNet maps (LINEAR2) if needed.
  • Manage lastmapname.txt to decide backup/restore behavior.
  • Replace working current_map.map (LINEAR3) and send hot_reload.

File association (Current User)

Scripts are user-scope only, safe to run without admin:

  • Remove .map association and residues:
    registry\remove_map_association_current_user.bat
  • Associate .map to this build:
    registry\setup_map_association_current_user.bat

If Explorer icons look stale, restart Windows Explorer or clear the icon cache:

ie4uinit.exe -ClearIconCache

Icons

  • EXE embeds Image/ddnet_loader.ico via ddnet_control.rc.
  • If needed, generate a multi-size ICO:
    venv\Scripts\python.exe tools\convert_ico.py Image\ddnet_loader.ico Image\ddnet_loader_fixed.ico
    Then update ddnet_control.rc to use the fixed icon and rebuild.

Server connection (econ)

ddnet_control.exe talks to the local DDNet server over the external console (econ) TCP socket on 127.0.0.1:8303. It does not use the in-game RCON channel — sv_rcon_password is irrelevant here. The password it sends is ec_password.

The password is resolved at runtime, in this order (first non-empty wins):

  1. DDNETCONTROL_ECON_PASSWORD environment variable.
  2. econ_password=<value> in a ddnet_control.cfg file placed next to ddnet_control.exe.
  3. ec_password "<value>" from %APPDATA%\DDNet\autoexec_server.cfg (DDNet's USERDIR autoexec — overrides anything exec'd from it).
  4. ec_password "<value>" from the running DDNet-Server.exe's data/myServerConfig.cfg.
  5. ec_password "<value>" from the running DDNet-Server.exe's data/autoexec_server.cfg.
  6. Hardcoded fallback test123 (a WARNING is logged so you notice).

Within a single cfg file, the last ec_password line wins, matching DDNet's "later command overrides" semantics. The chosen source is logged to ddnet_control.log (the password value itself is never logged).

If your server uses a non-default ec_password, you don't need to recompile — set DDNETCONTROL_ECON_PASSWORD or drop a ddnet_control.cfg next to the EXE:

# ddnet_control.cfg (next to ddnet_control.exe)
econ_password=your-password-here

Host/port are still 127.0.0.1:8303 in the binary (matches DDNet's default ec_port/ec_bindaddr).

Development notes

  • Logs: ddnet_control.log (and build.log for builds). Default location is %APPDATA%\DDNet\maps\ddnet_control.log (the EXE's working directory when launched via .map double-click).
  • See scratchpad.md for current test plan and status.

License

MIT (or your preferred license).

About

Hot reload feature

Topics

ddnetddnet-clientddracegame-toolshot-reloadmap-loaderteeworlds

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.