quake3live/code/server
serge_shubin f871cc004f Fix svdemo_play from in-game and devmap from demo playback
Multiple issues fixed for seamless transitions:

Server lifecycle:
- SV_Shutdown before devmap in SVD_Play_f: drops old clients so
  spectator doesn't land in slot 0 (recorded player collision)
- SVD_IsStarting flag prevents cleanup hooks from destroying demo
  state during our own SV_Shutdown/SV_SpawnServer calls
- SV_SpawnServer stops demo playback on non-demo map changes
  via SVD_CleanupPlayback (no disconnect, just state cleanup)
- SVD_CleanupPlayback made non-static for use from sv_init.c

Cvar handling:
- Use Cvar_Set2 with force=qtrue for CVAR_ROM sv_demoplaying
- Set cvar AFTER SV_Shutdown (old game module gone) but BEFORE
  devmap (so new G_InitGame reads correct value)
- Set CS_SVDEMO configstring after devmap as backup for cgame

Game module:
- ClientBegin: set pm_type=PM_SPECTATOR after ClientSpawn (which
  memsets ps). ClientThink_real normally sets this but is disabled
  in demo mode.
- G_WriteSessionData: skip during demo playback so forced
  TEAM_SPECTATOR doesn't persist to next normal game
- ClientThink: return early in demo mode (no server-side movement)

Removed debug prints and unused SVD_GetPlayMaxClients.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 06:32:08 +08:00
..
lz4.c Add LZ4 compression library (r131) 2026-03-24 02:42:47 +08:00
lz4.h Add LZ4 compression library (r131) 2026-03-24 02:42:47 +08:00
server.h Fix svdemo_play from in-game and devmap from demo playback 2026-03-24 06:32:08 +08:00
sv_bot.c Initial commit: Quake 3 1.32b GPL source 2026-03-18 13:32:24 +08:00
sv_ccmds.c Demo pause: freeze svs.time, hold demo data consumption 2026-03-24 03:28:32 +08:00
sv_client.c Fix follow mode switching and PVS during pause 2026-03-24 04:31:39 +08:00
sv_game.c Fix chat capture: capture any target, deduplicate in buffer 2026-03-23 05:55:19 +08:00
sv_init.c Fix svdemo_play from in-game and devmap from demo playback 2026-03-24 06:32:08 +08:00
sv_main.c Demo pause: freeze svs.time, hold demo data consumption 2026-03-24 03:28:32 +08:00
sv_net_chan.c Initial commit: Quake 3 1.32b GPL source 2026-03-18 13:32:24 +08:00
sv_netdemo.c Fix svdemo_play from in-game and devmap from demo playback 2026-03-24 06:32:08 +08:00
sv_rankings.c Initial commit: Quake 3 1.32b GPL source 2026-03-18 13:32:24 +08:00
sv_snapshot.c Initial commit: Quake 3 1.32b GPL source 2026-03-18 13:32:24 +08:00
sv_world.c Initial commit: Quake 3 1.32b GPL source 2026-03-18 13:32:24 +08:00