Skip to content

Add resetmatch command to soft restart the map without the need to respawn the server [restart] (fixes #2609)

z411 requested to merge z411/srestart into master

This is a draft for a new command called resetmatch that soft resets a map to restart a match. The restart server command respawns the server, forcing clients to reconnect and reload everything and the server to spawn the whole virtual machine again, which seems mostly unnecessary most of the time.

This command instead simply restarts the match (if warmup is disabled) or goes back to warmup stage (if warmup is enabled) without respawning the whole server. It has the added bonus that players don't have to reconnect and don't get forced out of their teams.

ReadyRestart(true) now basically ends warmup, while ReadyRestart(false) restarts into warmup (if warmup is enabled) or restart the match (if warmup is disabled). The new resetmatch server command calls the latter.

There didn't seem to be any bugs when playing with bots, including round based games. Please tell me if there are any and I'll work on it.

If this works, I´d also suggest this to replace restart in the voteable commands, as restart seems to be something a server admin would want to do, while players would be just fine voting for a reset if they want to restart the match for whatever reason.

Edited by z411

Merge request reports