From: terencehill Date: Wed, 2 Apr 2025 00:29:43 +0000 (+0200) Subject: Show a warning on map start when the server has been updated without a full restart X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=refs%2Fheads%2Fterencehill%2Fwarning_on_server_update;p=xonotic%2Fxonotic-data.pk3dir.git Show a warning on map start when the server has been updated without a full restart --- diff --git a/qcsrc/server/world.qc b/qcsrc/server/world.qc index 609df4248..5e4bc9c69 100644 --- a/qcsrc/server/world.qc +++ b/qcsrc/server/world.qc @@ -757,6 +757,19 @@ void InitGameplayMode() bool world_already_spawned; spawnfunc(worldspawn) { +#ifdef WATERMARK + string watermark_start = cvar_string("sv_watermark_start"); + if (watermark_start == "") // always true on Xonotic (re)start + cvar_set("sv_watermark_start", WATERMARK); + else if (watermark_start != WATERMARK) // true when qc code has been recompiled on a different git commit + { + LOG_INFOF( + "\n^1 Warning: ^3the server QC program was updated without a full restart." + "\n^3 Please restart the Xonotic executable otherwise you may get random bugs." + "\n\n"); + } +#endif + CheckEngineExtensions(); cvar_set("_endmatch", "0"); diff --git a/xonotic-server.cfg b/xonotic-server.cfg index f277e4de9..b921ced42 100644 --- a/xonotic-server.cfg +++ b/xonotic-server.cfg @@ -14,6 +14,8 @@ set sv_mapchange_delay 5 "delay by this many seconds after the match ends before set minplayers 0 "fill server with bots to reach this number of players in teamless games (if bot_number is not enough)" set minplayers_per_team 0 "fill server with bots to reach this number of players per team (if bot_number is not enough)" +set sv_watermark_start "" + // executed when the first player joins or the last player leaves alias sv_hook_firstjoin alias sv_hook_lastleave