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(usesImage/ddnet_loader.ico) - Registry scripts (user-scope):
registry/ - Tools:
tools/(e.g.,convert_ico.pyfor multi-size ICO generation) - Web UI assets (optional):
web/
Windows with MSVC (VS 2022 Build Tools):
compile.batOn success: ddnet_control.exe is produced; see build.log.
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/mapsstructure (andbackups/). - Copy new map into DDNet maps (LINEAR2) if needed.
- Manage
lastmapname.txtto decide backup/restore behavior. - Replace working
current_map.map(LINEAR3) and sendhot_reload.
Scripts are user-scope only, safe to run without admin:
- Remove .map association and residues:
registry\remove_map_association_current_user.bat
- Associate
.mapto 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- EXE embeds
Image/ddnet_loader.icoviaddnet_control.rc. - If needed, generate a multi-size ICO:
Then update
venv\Scripts\python.exe tools\convert_ico.py Image\ddnet_loader.ico Image\ddnet_loader_fixed.ico
ddnet_control.rcto use the fixed icon and rebuild.
- RCON defaults in code: host
127.0.0.1:8303, passwordtest123(adjust as needed). - Logs:
ddnet_control.log(andbuild.logfor builds). - See
scratchpad.mdfor current test plan and status.
MIT (or your preferred license).