From 1eddbe8b6dd92aa9aa41f56b00a8bc7fd519da53 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Mon, 14 Oct 2013 00:49:15 +0200 Subject: [PATCH] Add a compatibility stop date to the update notification info. After this date, servers below the current minor version (second part of version number) will not be shown any more. --- qcsrc/menu/xonotic/util.qc | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/qcsrc/menu/xonotic/util.qc b/qcsrc/menu/xonotic/util.qc index 8f5fc938d..0bc966cfb 100644 --- a/qcsrc/menu/xonotic/util.qc +++ b/qcsrc/menu/xonotic/util.qc @@ -284,6 +284,11 @@ void URI_Get_Callback(float id, float status, string data) } } +void DisableServerBackwardsCompatibility() +{ + cvar_set("gameversion_min", ftos(100 * floor(cvar("gameversion") / 100))); +} + void UpdateNotification_URI_Get_Callback(float id, float status, string data) { float n; @@ -324,6 +329,7 @@ void UpdateNotification_URI_Get_Callback(float id, float status, string data) string un_emergency_pk3s = ""; string un_promoted = ""; string un_recommended = ""; + string un_compatexpire = ""; for(i = 0; i < n; ++i) { @@ -338,6 +344,11 @@ void UpdateNotification_URI_Get_Callback(float id, float status, string data) un_version = s; break; } + case "C": + { + un_compatexpire = s; + break; + } case "D": { un_download = s; @@ -380,6 +391,16 @@ void UpdateNotification_URI_Get_Callback(float id, float status, string data) _Nex_ExtResponseSystem_UpdateTo = strzone(un_version); if(un_download) { print(sprintf(_("Update can be downloaded at:\n%s\n"), un_download)); } if(un_url) { _Nex_ExtResponseSystem_UpdateToURL = strzone(un_url); } + DisableServerBackwardsCompatibility(); + } + else if(cvar_string("g_xonoticversion") == un_version) + { + if(un_compatexpire != "") + { + string curdate = strftime(FALSE, "%Y%m%d%H%M%S"); + if (strcmp(curdate, un_compatexpire) >= 0) + DisableServerBackwardsCompatibility(); + } } } @@ -400,7 +421,6 @@ void UpdateNotification_URI_Get_Callback(float id, float status, string data) _Nex_ExtResponseSystem_RecommendedServers = strzone(un_recommended); _Nex_ExtResponseSystem_RecommendedServersNeedsRefresh = 1; } - } // END OF URI SYSTEM //////////////////////////////////////////////////////// -- 2.39.2