From: Samual Lenks Date: Fri, 22 Feb 2013 03:26:49 +0000 (-0500) Subject: Improve that check a little bit X-Git-Tag: xonotic-v0.7.0~62^2~23^2~174 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7bcbac3942f6eb97a9c394ade1363effc2d52828;p=xonotic%2Fxonotic-data.pk3dir.git Improve that check a little bit --- diff --git a/qcsrc/common/notifications.qc b/qcsrc/common/notifications.qc index 99f1a5452..ae286771a 100644 --- a/qcsrc/common/notifications.qc +++ b/qcsrc/common/notifications.qc @@ -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", ""); diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index b1e6a2adb..6ca29ae36 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -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)); } }