From: Samual Lenks Date: Tue, 26 Feb 2013 18:00:06 +0000 (-0500) Subject: THERE CAN ONLY BE ONE! X-Git-Tag: xonotic-v0.7.0~62^2~23^2~106 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=97486958efa65ad2295e08228de9349e13b4bdea;p=xonotic%2Fxonotic-data.pk3dir.git THERE CAN ONLY BE ONE! --- diff --git a/qcsrc/common/notifications.qc b/qcsrc/common/notifications.qc index ffd82cfa8..8f60424d3 100644 --- a/qcsrc/common/notifications.qc +++ b/qcsrc/common/notifications.qc @@ -639,7 +639,7 @@ void Send_Notification(float broadcast, entity client, Net_LinkEntity(net_notif, FALSE, 0, Net_Write_Notification); - if((!server_is_local) && (broadcast == NOTIF_ANY || broadcast == NOTIF_ANY_EXCEPT) && (net_type != MSG_CENTER)) + if(server_is_dedicated && (broadcast == NOTIF_ANY || broadcast == NOTIF_ANY_EXCEPT) && (net_type != MSG_CENTER)) { Local_Notification_WOVA( net_type, net_name, diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index 390321c4e..10b76ba95 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -2707,3 +2707,10 @@ string process_time(string fields, float seconds) }*/ return ""; } + +#ifdef SVQC +void dedicated_print(string input) // print(), but only print if the server is not local +{ + if(server_is_dedicated) { print(input); } +} +#endif diff --git a/qcsrc/common/util.qh b/qcsrc/common/util.qh index 11b2506d5..d2b63f7ba 100644 --- a/qcsrc/common/util.qh +++ b/qcsrc/common/util.qh @@ -445,3 +445,7 @@ string count_ordinal(float interval); string count_fill(float interval, string zeroth, string first, string second, string third, string multi); string process_time(string fields, float seconds); + +#ifdef SVQC +void dedicated_print(string input); +#endif diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index 25f00a739..84be80de4 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -57,9 +57,8 @@ float team1_score, team2_score, team3_score, team4_score; float maxclients; -// flags set on worldspawn so that the code knows if it is dedicated or not +// flag set on worldspawn so that the code knows if it is dedicated or not float server_is_dedicated; -float server_is_local; // Fields diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 8ff2ac8a5..5b91f905c 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -597,16 +597,7 @@ void spawnfunc_worldspawn (void) head = nextent(head); } - if(cvar_defstring("is_dedicated")) - { - server_is_dedicated = TRUE; - server_is_local = FALSE; - } - else - { - server_is_dedicated = FALSE; - server_is_local = TRUE; - } + server_is_dedicated = (cvar_defstring("is_dedicated") ? TRUE : FALSE); // needs to be done so early because of the constants they create CALL_ACCUMULATED_FUNCTION(RegisterWeapons); diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 1fd1aa1d1..fd7020f44 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -2631,8 +2631,3 @@ float isPushable(entity e) return TRUE; return FALSE; } - -void dedicated_print(string input) // print(), but only print if the server is not local -{ - if not(server_is_local) { print(input); } -} diff --git a/qcsrc/server/mutators/gamemode_ctf.qc b/qcsrc/server/mutators/gamemode_ctf.qc index 4ede871ca..fae2284fa 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qc +++ b/qcsrc/server/mutators/gamemode_ctf.qc @@ -39,8 +39,8 @@ void ctf_CaptureRecord(entity flag, entity player) else { Send_Notification(NOTIF_ONE_ONLY, tmp_entity, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_CAPTURE_), player.netname); } } - // notify server log too - if not(server_is_local) + // the previous notification broadcast is only sent to real clients, this will notify server log too + if(server_is_dedicated) { if(autocvar_notification_ctf_capture_verbose) {