]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a compatibility stop date to the update notification info.
authorRudolf Polzer <divverent@xonotic.org>
Sun, 13 Oct 2013 22:49:15 +0000 (00:49 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Sun, 13 Oct 2013 22:50:51 +0000 (00:50 +0200)
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

index 8f5fc938da67dfb28aca81a02955720ab6408f30..0bc966cfb46dcf1901874d94065dfd0f0b9e46e7 100644 (file)
@@ -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 ////////////////////////////////////////////////////////