Skip to content

Add sync log endpoint for desync log uploads#45

Draft
11EJDE11 wants to merge 2 commits intoCnCNet:mainfrom
11EJDE11:add-synclogging
Draft

Add sync log endpoint for desync log uploads#45
11EJDE11 wants to merge 2 commits intoCnCNet:mainfrom
11EJDE11:add-synclogging

Conversation

@11EJDE11
Copy link
Copy Markdown
Member

  • Adds a /sync-logs/ endpoint so xna-cncnet-client can upload SYNC*.TXT desync logs automatically after a desync occurs
  • All players in the same game session share a game_hash (derived client-side from map SHA1, random seed, and game slug), making it easy to group and compare logs across machines
  • Includes a browser-based side-by-side diff page at /sync-logs/compare/<hash>/view/ - no server-side file comparison required, diffs entirely in JS using jsdiff + diff2html
  • Django admin shows logs grouped by game slug with a direct link to the compare page per session

Endpoints

Method URL Auth Notes
POST /sync-logs/ None Upload a single SYNC*.TXT file
GET /sync-logs/session/<hash>/ None List all logs for a session
GET /sync-logs/compare/<hash>/view/ None HTML diff page
image image

11EJDE11 added 2 commits April 6, 2026 01:35
- SyncLog model with migrations (game_hash, player_name, slot index, map/game metadata, file, IP, 500 MB storage cap with LRU eviction)
- POST /sync-logs/ - unauthenticated upload endpoint
- GET /sync-logs/session/<hash>/ — lists logs for a session (IP omitted)
- GET /sync-logs/compare/<hash>/view/ - HTML page for client-side side-by-side diff of any two logs using jsdiff + diff2html
- Django admin with game slug column and per-game filtering
- Enable Django admin login (ModelBackend, has_perm, get_by_natural_key)
- nginx client_max_body_size raised to 15m to accommodate large logs
- Add .vs/ to .gitignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant