From 929441e7caa0be98392ce8bdd33742c484c9d837 Mon Sep 17 00:00:00 2001 From: terencehill Date: Wed, 2 Apr 2025 02:29:43 +0200 Subject: [PATCH] Show a warning on map start when the server has been updated without a full restart --- qcsrc/server/world.qc | 13 +++++++++++++ xonotic-server.cfg | 2 ++ 2 files changed, 15 insertions(+) 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 -- 2.39.5