]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Improve that check a little bit
authorSamual Lenks <samual@xonotic.org>
Fri, 22 Feb 2013 03:26:49 +0000 (22:26 -0500)
committerSamual Lenks <samual@xonotic.org>
Fri, 22 Feb 2013 03:26:49 +0000 (22:26 -0500)
qcsrc/common/notifications.qc
qcsrc/common/notifications.qh

index 99f1a545263adf0594d327eb1650664e3fd31876..ae286771aca25dfac0e39fda6592e076dd22be14 100644 (file)
@@ -99,6 +99,8 @@ void Dump_Notifications(float fh, float alsoprint)
 
        // edit these to match whichever cvars are used for specific notification options
        NOTIF_WRITE("\n// HARD CODED notification variables:\n", "");
+       NOTIF_WRITE("seta notification_version_mismatch_client_error 0 \"Cause a notif error on client if the version in notifications.cfg mismatches the code\"\n", "");
+       NOTIF_WRITE("seta notification_version_mismatch_server_error 1 \"Cause a notif error on server if the version in notifications.cfg mismatches the code\"\n", "");
        NOTIF_WRITE("seta notification_errors_are_fatal 1 \"If a notification fails upon initialization, cause a Host_Error to stop the program\"\n", "");
        NOTIF_WRITE("seta notification_ctf_pickup_team_verbose 1 \"Show extra information if a team mate picks up a flag\"\n", "");
        NOTIF_WRITE("seta notification_ctf_pickup_enemy_verbose 1 \"Show extra information if an enemy picks up a flag\"\n", "");
index b1e6a2adb891922a46fe30cb5d224b85d030fa16..6ca29ae3670c0aa2ac2d69fd4416c53548bc7c56 100644 (file)
@@ -13,7 +13,7 @@
 // This is used to check matches between the config file and the code,
 // and should be incremented any time you add a new/remove or edit an notification
 // or any time you change default values or add/edit/remove a special cvar.
-#define NOTIF_VERSION 1
+#define NOTIF_VERSION 2
 
 #define NO_MSG -12345 
 
@@ -619,6 +619,8 @@ string arg_slot[NOTIF_MAX_ARGS];
 #define NOTIF_ADD_AUTOCVAR(name,default) var float autocvar_notification_##name = default;
 
 NOTIF_ADD_AUTOCVAR(version, NOTIF_VERSION)
+NOTIF_ADD_AUTOCVAR(version_mismatch_client_error, FALSE)
+NOTIF_ADD_AUTOCVAR(version_mismatch_server_error, TRUE)
 NOTIF_ADD_AUTOCVAR(errors_are_fatal, TRUE)
 
 #ifdef SVQC
@@ -893,8 +895,15 @@ void RegisterNotifications_First()
        notif_global_error = FALSE;
        if(autocvar_notification_version != NOTIF_VERSION)
        {
-               notif_global_error = TRUE;
-               print(sprintf("^1NOTIFICATION VERSION MISMATCH: ^7cvar = %d, code = %d.\n", autocvar_notification_version, NOTIF_VERSION));
+               #ifdef CSQC
+               if(autocvar_notification_version_mismatch_client_error)
+               #else
+               if(autocvar_notification_version_mismatch_server_error)
+               #endif
+                       notif_global_error = TRUE;
+
+               print(sprintf("^1NOTIFICATION VERSION MISMATCH: ^7program = %s, config = %d, code = %d.\n",
+                       "foobar", autocvar_notification_version, NOTIF_VERSION));
        }
 }