3 #include <client/announcer.qh>
6 #include <common/constants.qh>
7 #include <common/net_linked.qh>
8 #include <common/teams.qh>
9 #include <server/autocvars.qh>
10 #include <server/constants.qh>
11 #include <server/defs.qh>
12 #include <server/mutators/_mod.qh>
15 // ================================================
16 // Unified notification system, written by Samual
17 // Last updated: August, 2013
18 // ================================================
21 string Notification_CheckArgs(
22 NOTIF broadcast, entity client)
24 // check supplied broadcast and target for errors
30 if (IS_NOT_A_CLIENT(client)) {
31 return "No client provided!";
36 case NOTIF_ALL_EXCEPT:
38 if (IS_NOT_A_CLIENT(client)) {
39 return "Exception can't be a non-client!";
47 return "Entity provided when NULL was required!";
55 return "Teamplay not active!";
56 } else if (!client.team) {
57 // checkargs = sprintf("%sNo team provided!", checkargs);
62 case NOTIF_TEAM_EXCEPT:
65 return "Teamplay not active!";
66 } else if (IS_NOT_A_CLIENT(client)) {
67 return "Exception can't be a non-client!";
74 return sprintf("Improper broadcast: %d!", broadcast);
80 bool Notification_ShouldSend(NOTIF broadcast, entity to_client, entity other_client)
86 (to_client == other_client)
91 (to_client.enemy == other_client)
95 return (to_client == other_client);
98 (to_client.team == other_client.team)
103 (to_client.enemy.team == other_client.team)
106 case NOTIF_TEAM_EXCEPT:
108 (to_client != other_client)
111 (to_client.team == other_client.team)
117 (to_client.enemy != other_client)
119 (to_client.enemy.team == other_client.team)
126 case NOTIF_ALL_EXCEPT:
128 (to_client != other_client)
133 (to_client.enemy == other_client)
143 // ===============================
144 // Initialization Core Functions
145 // ===============================
147 // used by restartnotifs command to initialize notifications
148 void Destroy_Notification_Entity(entity notif)
150 if (notif.nent_name != "") strunzone(notif.nent_name);
151 if (notif.nent_cvarname != "") strunzone(notif.nent_cvarname);
152 if (notif.nent_snd != "") strunzone(notif.nent_snd);
153 if (notif.nent_args != "") strunzone(notif.nent_args);
154 if (notif.nent_hudargs != "") strunzone(notif.nent_hudargs);
155 if (notif.nent_icon != "") strunzone(notif.nent_icon);
156 if (notif.nent_durcnt != "") strunzone(notif.nent_durcnt);
157 if (notif.nent_string != "") strunzone(notif.nent_string);
161 void Destroy_All_Notifications()
163 // kill all networked notifications and centerprints
165 Kill_Notification(NOTIF_ALL, NULL, MSG_Null, CPID_Null);
167 reset_centerprint_messages();
170 // kill all real notification entities
171 FOREACH(Notifications, true, { Destroy_Notification_Entity(it); });
174 string Process_Notif_Line(
183 if(typeId == MSG_INFO)
185 if((chat && autocvar_notification_allow_chatboxprint)
186 || (autocvar_notification_allow_chatboxprint == 2))
188 // pass 1: add ETX char at beginning of line
189 input = strcat("\{3}", input);
191 // pass 2: add ETX char at end of each new line (so that
192 // messages with multiple lines are put through chatbox too)
193 input = strreplace("\n", "\n\{3}", input);
195 // pass 3: strip trailing ETX char
196 if(substring(input, (strlen(input) - 1), 1) == "\{3}")
197 { input = substring(input, 0, (strlen(input) - 1)); }
202 // done to both MSG_INFO and MSG_CENTER
203 if(substring(input, (strlen(input) - 1), 1) == "\n")
207 "^1TRAILING NEW LINE AT END OF NOTIFICATION: "
208 "^7net_type = %s, net_name = %s, string = %s.\n"
215 input = substring(input, 1, (strlen(input) - 1));
221 string Process_Notif_Args(
227 string selected, remaining = args;
230 for (;(remaining != "");)
232 selected = car(remaining); remaining = cdr(remaining);
236 case 1: // normal args
238 if(sel_num == NOTIF_MAX_ARGS)
242 "^1NOTIFICATION HAS TOO MANY ARGUMENTS: "
243 "^7net_type = %s, net_name = %s, max args = %d.\n"
253 switch(strtolower(selected))
255 #define ARG_CASE_ARG_CS_SV_HA(selected,result) case selected: { ++sel_num; break; }
256 #define ARG_CASE_ARG_CS_SV_DC(selected,result) case selected: { ++sel_num; break; }
257 #define ARG_CASE_ARG_CS_SV(selected,result) case selected: { ++sel_num; break; }
258 #define ARG_CASE_ARG_CS(selected,result) case selected: { ++sel_num; break; }
259 #define ARG_CASE_ARG_SV(selected,result) case selected: { ++sel_num; break; }
260 #define ARG_CASE_ARG_DC(selected,result)
261 #define ARG_CASE(prog,selected,result) ARG_CASE_##prog(selected,result)
264 #undef ARG_CASE_ARG_DC
265 #undef ARG_CASE_ARG_SV
266 #undef ARG_CASE_ARG_CS
267 #undef ARG_CASE_ARG_CS_SV
268 #undef ARG_CASE_ARG_CS_SV_DC
269 #undef ARG_CASE_ARG_CS_SV_HA
274 "^1NOTIFICATION WITH UNKNOWN TOKEN IN ARGUMENT STRING: "
275 "^7net_type = %s, net_name = %s, args arg = '%s'.\n"
289 if(sel_num == NOTIF_MAX_HUDARGS)
293 "^1NOTIFICATION HAS TOO MANY ARGUMENTS: "
294 "^7net_type = %s, net_name = %s, max hudargs = %d.\n"
304 switch(strtolower(selected))
306 #define ARG_CASE_ARG_CS_SV_HA(selected,result) case selected: { ++sel_num; break; }
307 #define ARG_CASE_ARG_CS_SV_DC(selected,result)
308 #define ARG_CASE_ARG_CS_SV(selected,result)
309 #define ARG_CASE_ARG_CS(selected,result)
310 #define ARG_CASE_ARG_SV(selected,result)
311 #define ARG_CASE_ARG_DC(selected,result)
312 #define ARG_CASE(prog,selected,result) ARG_CASE_##prog(selected,result)
315 #undef ARG_CASE_ARG_DC
316 #undef ARG_CASE_ARG_SV
317 #undef ARG_CASE_ARG_CS
318 #undef ARG_CASE_ARG_CS_SV
319 #undef ARG_CASE_ARG_CS_SV_DC
320 #undef ARG_CASE_ARG_CS_SV_HA
325 "^1NOTIFICATION WITH UNKNOWN TOKEN IN ARGUMENT STRING: "
326 "^7net_type = %s, net_name = %s, hudargs arg = '%s'.\n"
340 if(sel_num == NOTIF_MAX_DURCNT)
344 "^1NOTIFICATION HAS TOO MANY ARGUMENTS: "
345 "^7net_type = %s, net_name = %s, max durcnt = %d.\n"
355 switch(strtolower(selected))
357 #define ARG_CASE_ARG_CS_SV_HA(selected,result)
358 #define ARG_CASE_ARG_CS_SV_DC(selected,result) case selected: { ++sel_num; break; }
359 #define ARG_CASE_ARG_CS_SV(selected,result)
360 #define ARG_CASE_ARG_CS(selected,result)
361 #define ARG_CASE_ARG_SV(selected,result)
362 #define ARG_CASE_ARG_DC(selected,result) case selected: { ++sel_num; break; }
363 #define ARG_CASE(prog,selected,result) ARG_CASE_##prog(selected,result)
366 #undef ARG_CASE_ARG_DC
367 #undef ARG_CASE_ARG_SV
368 #undef ARG_CASE_ARG_CS
369 #undef ARG_CASE_ARG_CS_SV
370 #undef ARG_CASE_ARG_CS_SV_DC
371 #undef ARG_CASE_ARG_CS_SV_HA
374 if(ftos(stof(selected)) != "") { ++sel_num; }
379 "^1NOTIFICATION WITH UNKNOWN TOKEN IN ARGUMENT STRING: "
380 "^7net_type = %s, net_name = %s, durcnt arg = '%s'.\n"
398 void Create_Notification_Entity(entity notif,
403 string cvarnamestring,
406 // =====================
407 // Global Entity Setup
408 // =====================
409 notif.nent_default = var_default;
410 notif.nent_enabled = (var_cvar >= 1);
411 notif.nent_type = typeId;
412 notif.nent_name = strzone(namestring);
413 if(namestring != cvarnamestring)
414 notif.nent_cvarname = strzone(cvarnamestring);
415 notif.nent_teamnum = teamnum;
417 // Other pre-notif-setup requisites
431 "^1NOTIFICATION WITH IMPROPER TYPE: "
432 "^7net_type = %d, net_name = %s.\n"
441 // now check to see if any errors happened
444 notif.nent_enabled = false; // disable the notification so it can't cause trouble
445 notif_global_error = true; // throw the red flag that an error happened on init
449 void Create_Notification_Entity_Annce(entity notif,
458 // Set MSG_ANNCE information and handle precaching
460 MSG typeId = MSG_ANNCE;
461 if (!(GENTLE && (var_cvar == 1)))
465 if(notif.nent_enabled)
467 precache_sound(sprintf("announcer/%s/%s.wav", AnnouncerOption(), snd));
468 notif.nent_channel = channel;
469 notif.nent_snd = strzone(snd);
470 notif.nent_vol = vol;
471 notif.nent_position = position;
476 string typestring = Get_Notif_TypeName(typeId);
479 "^1NOTIFICATION WITH NO SOUND: "
480 "^7net_type = %s, net_name = %s.\n"
488 else { notif.nent_enabled = false; }
490 notif.nent_enabled = false;
495 void Create_Notification_Entity_InfoCenter(entity notif,
500 /* MSG_INFO & MSG_CENTER */
509 MSG typeId = notif.nent_type;
510 // Set MSG_INFO and MSG_CENTER string/float counts
511 notif.nent_stringcount = strnum;
512 notif.nent_floatcount = flnum;
514 // Only initialize arguments if we're either a client or on a dedicated server
516 float should_process_args = server_is_dedicated;
518 float should_process_args = true;
520 string typestring = Get_Notif_TypeName(typeId);
521 if(should_process_args)
523 // ========================
524 // Process Main Arguments
525 // ========================
530 notif.nent_args = strzone(
531 Process_Notif_Args(1, args, typestring, namestring));
533 else if((hudargs == "") && (durcnt ==""))
537 "^1NOTIFICATION HAS ARG COUNTS BUT NO ARGS OR HUDARGS OR DURCNT: "
538 "^7net_type = %s, net_name = %s, strnum = %d, flnum = %d\n"
550 notif.nent_args = strzone(
551 Process_Notif_Args(1, args, typestring, namestring));
555 // =======================================
556 // Process HUD and Centerprint Arguments
557 // Only processed on CSQC, as these
558 // args are only for HUD features.
559 // =======================================
563 notif.nent_hudargs = strzone(
564 Process_Notif_Args(2, hudargs, typestring, namestring));
566 if(icon != "") { notif.nent_icon = strzone(icon); }
571 "^1NOTIFICATION HAS HUDARGS BUT NO ICON: "
572 "^7net_type = %s, net_name = %s.\n"
584 "^1NOTIFICATION HAS ICON BUT NO HUDARGS: "
585 "^7net_type = %s, net_name = %s.\n"
595 notif.nent_durcnt = strzone(Process_Notif_Args(3, durcnt, typestring, namestring));
597 if (cpid == CPID_Null && durcnt != "0 0")
601 "Notification has durcnt but no cpid: "
602 "net_type = %s, net_name = %s."
610 notif.nent_cpid = cpid;
614 // ======================
615 // Process Notif String
616 // ======================
617 #define SET_NOTIF_STRING(string,stringname) MACRO_BEGIN { \
618 notif.nent_string = strzone(CCR( \
619 Process_Notif_Line( \
632 if(gentle != "") { SET_NOTIF_STRING(gentle, "GENTLE"); }
633 else if(normal != "") { SET_NOTIF_STRING(normal, "NORMAL"); }
635 else if(normal != "") { SET_NOTIF_STRING(normal, "NORMAL"); }
636 #undef SET_NOTIF_STRING
638 // Check to make sure a string was chosen
639 if(notif.nent_string == "")
643 "^1EMPTY NOTIFICATION: "
644 "^7net_type = %s, net_name = %s.\n"
654 void Create_Notification_Entity_Multi(entity notif,
658 Notification anncename,
659 Notification infoname,
660 Notification centername)
662 MSG typeId = MSG_MULTI;
663 // Set MSG_MULTI string/float counts
664 if (!anncename && !infoname && !centername)
666 string typestring = Get_Notif_TypeName(typeId);
669 "^1NOTIFICATION WITH NO SUBCALLS: "
670 "^7net_type = %s, net_name = %s.\n"
679 // announcements don't actually need any arguments, so lets not even count them.
680 if (anncename) { notif.nent_msgannce = anncename; }
682 float infoname_stringcount = 0, infoname_floatcount = 0;
683 float centername_stringcount = 0, centername_floatcount = 0;
687 notif.nent_msginfo = infoname;
688 infoname_stringcount = notif.nent_msginfo.nent_stringcount;
689 infoname_floatcount = notif.nent_msginfo.nent_floatcount;
694 notif.nent_msgcenter = centername;
695 centername_stringcount = notif.nent_msgcenter.nent_stringcount;
696 centername_floatcount = notif.nent_msgcenter.nent_floatcount;
699 // set the requirements of THIS notification to the totals of its subcalls
700 notif.nent_stringcount = max(infoname_stringcount, centername_stringcount);
701 notif.nent_floatcount = max(infoname_floatcount, centername_floatcount);
705 void Create_Notification_Entity_Choice(entity notif,
712 Notification optiona,
713 Notification optionb)
715 MSG typeId = MSG_CHOICE;
716 if (chtype == MSG_Null || !optiona || !optionb)
718 string typestring = Get_Notif_TypeName(typeId);
721 "^1NOTIFICATION IS MISSING CHOICE PARAMS: "
722 "^7net_type = %s, net_name = %s.\n"
731 notif.nent_optiona = optiona;
732 notif.nent_optionb = optionb;
733 notif.nent_challow_def = challow_def; // 0: never allowed, 1: allowed in warmup, 2: always allowed
734 notif.nent_challow_var = challow_var; // 0: never allowed, 1: allowed in warmup, 2: always allowed
735 notif.nent_stringcount = max(notif.nent_optiona.nent_stringcount, notif.nent_optionb.nent_stringcount);
736 notif.nent_floatcount = max(notif.nent_optiona.nent_floatcount, notif.nent_optionb.nent_floatcount);
738 /*#ifdef NOTIFICATIONS_DEBUG
739 Debug_Notification(sprintf(
740 "Create_Notification_Entity(...): MSG_CHOICE: %s\n%s\n%s\n",
743 "^ optiona: %s %s : %d %d",
744 Get_Notif_TypeName(notif.nent_optiona.nent_type),
745 notif.nent_optiona.nent_name,
746 notif.nent_optiona.nent_stringcount,
747 notif.nent_optiona.nent_floatcount
750 "^ optionb: %s %s : %d %d",
751 Get_Notif_TypeName(notif.nent_optionb.nent_type),
752 notif.nent_optionb.nent_name,
753 notif.nent_optionb.nent_stringcount,
754 notif.nent_optionb.nent_floatcount
766 // used by MSG_CHOICE to build list of choices
768 void Notification_GetCvars(entity this)
770 FOREACH(Notifications, it.nent_type == MSG_CHOICE && (!it.nent_teamnum || it.nent_teamnum == 1), {
771 string cvarname = (it.nent_cvarname ? it.nent_cvarname : it.nent_name);
772 GetCvars_handleFloat(
776 msg_choice_choices[it.nent_choice_idx],
777 sprintf("notification_%s", cvarname)
783 /** used to output notifications.cfg file */
784 void Dump_Notifications(int fh, bool alsoprint)
786 #define NOTIF_WRITE(a) MACRO_BEGIN { \
788 if (alsoprint) LOG_INFO(a); \
791 #define NOTIF_WRITE_ENTITY(e, description) MACRO_BEGIN { \
792 string cvarname = (e.nent_cvarname ? e.nent_cvarname : e.nent_name); \
793 string notif_msg = sprintf( \
794 "seta notification_%s \"%d\" \"%s\"\n", \
795 cvarname, e.nent_default, description \
797 NOTIF_WRITE(notif_msg); \
800 #define NOTIF_WRITE_ENTITY_CHOICE(e, descriptiona, descriptionb) MACRO_BEGIN { \
801 string cvarname = (e.nent_cvarname ? e.nent_cvarname : e.nent_name); \
802 string notif_msg = sprintf( \
803 "seta notification_%s \"%d\" \"%s\"\n" \
804 "seta notification_%s_ALLOWED \"%d\" \"%s\"\n", \
805 cvarname, e.nent_default, descriptiona, \
806 cvarname, e.nent_challow_def, descriptionb \
808 NOTIF_WRITE(notif_msg); \
811 #define NOTIF_WRITE_HARDCODED(cvar, default, description) MACRO_BEGIN { \
812 string notif_msg = sprintf( \
813 "seta notification_%s \"%s\" \"%s\"\n", \
814 cvar, default, description \
816 NOTIF_WRITE(notif_msg); \
819 // Note: This warning only applies to the notifications.cfg file that is output...
820 // You ARE supposed to manually edit this function to add i.e. hard coded
821 // notification variables for mutators or game modes or such and then
822 // regenerate the notifications.cfg file from the new code.
824 NOTIF_WRITE("// ********************************************** //\n");
825 NOTIF_WRITE("// ** WARNING - DO NOT MANUALLY EDIT THIS FILE ** //\n");
826 NOTIF_WRITE("// ** ** //\n");
827 NOTIF_WRITE("// ** This file is automatically generated ** //\n");
828 NOTIF_WRITE("// ** by code with the command 'dumpnotifs'. ** //\n");
829 NOTIF_WRITE("// ** ** //\n");
830 NOTIF_WRITE("// ** If you add a new notification, please ** //\n");
831 NOTIF_WRITE("// ** regenerate this file with that command ** //\n");
832 NOTIF_WRITE("// ** making sure that the output matches ** //\n");
833 NOTIF_WRITE("// ** with the lists and defaults in code. ** //\n");
834 NOTIF_WRITE("// ** ** //\n");
835 NOTIF_WRITE("// ********************************************** //\n");
837 // These notifications will also append their string as a comment...
838 // This is not necessary, and does not matter if they vary between config versions,
839 // it is just a semi-helpful tool for those who want to manually change their user settings.
841 int NOTIF_ANNCE_COUNT = 0; FOREACH(Notifications, it.nent_type == MSG_ANNCE, { ++NOTIF_ANNCE_COUNT; });
842 NOTIF_WRITE(sprintf("\n// MSG_ANNCE notifications (count = %d):\n", NOTIF_ANNCE_COUNT));
843 FOREACH(Notifications, it.nent_type == MSG_ANNCE && (!it.nent_teamnum || it.nent_teamnum == 1), {
844 NOTIF_WRITE_ENTITY(it,
845 "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
849 int NOTIF_INFO_COUNT = 0; FOREACH(Notifications, it.nent_type == MSG_INFO, { ++NOTIF_INFO_COUNT; });
850 NOTIF_WRITE(sprintf("\n// MSG_INFO notifications (count = %d):\n", NOTIF_INFO_COUNT));
851 FOREACH(Notifications, it.nent_type == MSG_INFO && (!it.nent_teamnum || it.nent_teamnum == 1), {
852 NOTIF_WRITE_ENTITY(it,
853 "0 = off, 1 = print to console, "
854 "2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
858 int NOTIF_CENTER_COUNT = 0; FOREACH(Notifications, it.nent_type == MSG_CENTER, { ++NOTIF_CENTER_COUNT; });
859 NOTIF_WRITE(sprintf("\n// MSG_CENTER notifications (count = %d):\n", NOTIF_CENTER_COUNT));
860 FOREACH(Notifications, it.nent_type == MSG_CENTER && (!it.nent_teamnum || it.nent_teamnum == 1), {
861 NOTIF_WRITE_ENTITY(it,
862 "0 = off, 1 = centerprint"
866 int NOTIF_MULTI_COUNT = 0; FOREACH(Notifications, it.nent_type == MSG_MULTI, { ++NOTIF_MULTI_COUNT; });
867 NOTIF_WRITE(sprintf("\n// MSG_MULTI notifications (count = %d):\n", NOTIF_MULTI_COUNT));
868 FOREACH(Notifications, it.nent_type == MSG_MULTI && (!it.nent_teamnum || it.nent_teamnum == 1), {
869 NOTIF_WRITE_ENTITY(it,
870 "Enable this multiple notification"
874 int NOTIF_CHOICE_COUNT = 0; FOREACH(Notifications, it.nent_type == MSG_CHOICE, { ++NOTIF_CHOICE_COUNT; });
875 NOTIF_WRITE(sprintf("\n// MSG_CHOICE notifications (count = %d):\n", NOTIF_CHOICE_COUNT));
876 FOREACH(Notifications, it.nent_type == MSG_CHOICE && (!it.nent_teamnum || it.nent_teamnum == 1), {
877 NOTIF_WRITE_ENTITY_CHOICE(it,
878 "Choice for this notification 0 = off, 1 = default message, 2 = verbose message",
879 "Allow choice for this notification 0 = off, 1 = only in warmup mode, 2 = always"
883 // edit these to match whichever cvars are used for specific notification options
884 NOTIF_WRITE("\n// HARD CODED notification variables:\n");
886 NOTIF_WRITE_HARDCODED(
887 "allow_chatboxprint", "1",
888 "Allow INFO notifications to be printed to chat box "
890 "1 = allow only if allowed by individual notification_INFO* cvars, "
891 "2 = force all INFO notifications to be printed to the chatbox"
894 NOTIF_WRITE_HARDCODED(
896 "Print extra debug information on all notification function calls "
897 "(Requires -DNOTIFICATIONS_DEBUG flag to be enabled on QCSRC compilation)... "
898 "0 = disabled, 1 = dprint, 2 = print"
901 NOTIF_WRITE_HARDCODED(
902 "errors_are_fatal", "1",
903 "If a notification fails upon initialization, cause a Host_Error to stop the program"
906 NOTIF_WRITE_HARDCODED(
907 "item_centerprinttime", "1.5",
908 "How long to show item information centerprint messages (like 'You got the Electro' or such)"
911 NOTIF_WRITE_HARDCODED(
912 "lifetime_mapload", "10",
913 "Amount of time that notification entities last immediately at mapload (in seconds) "
914 "to help prevent notifications from being lost on early init (like gamestart countdown)"
917 NOTIF_WRITE_HARDCODED(
918 "lifetime_runtime", "0.5",
919 "Amount of time that notification entities last on the server during runtime (In seconds)"
922 NOTIF_WRITE_HARDCODED(
923 "server_allows_location", "1",
924 "Server side cvar for allowing death messages to show location information too"
927 NOTIF_WRITE_HARDCODED(
928 "show_location", "0",
929 "Append location information to MSG_INFO death/kill messages"
932 NOTIF_WRITE_HARDCODED(
933 "show_location_string", "",
934 "Replacement string piped into sprintf, "
935 "so you can do different messages like this: ' at the %s' or ' (near %s)'"
938 NOTIF_WRITE_HARDCODED(
940 "Print information about sprees in death/kill messages"
943 NOTIF_WRITE_HARDCODED(
944 "show_sprees_center", "1",
945 "Show spree information in MSG_CENTER messages... "
946 "0 = off, 1 = target (but only for first victim) and attacker"
949 NOTIF_WRITE_HARDCODED(
950 "show_sprees_center_specialonly", "1",
951 "Don't show spree information in MSG_CENTER messages if it isn't an achievement"
954 NOTIF_WRITE_HARDCODED(
955 "show_sprees_info", "3",
956 "Show spree information in MSG_INFO messages... "
957 "0 = off, 1 = target only, 2 = attacker only, 3 = target and attacker"
960 NOTIF_WRITE_HARDCODED(
961 "show_sprees_info_newline", "1",
962 "Show attacker spree information for MSG_INFO messages on a separate line than the death notification itself"
965 NOTIF_WRITE_HARDCODED(
966 "show_sprees_info_specialonly", "1",
967 "Don't show attacker spree information in MSG_INFO messages if it isn't an achievement"
972 "\n// Notification counts (total = %d): "
973 "MSG_ANNCE = %d, MSG_INFO = %d, MSG_CENTER = %d, MSG_MULTI = %d, MSG_CHOICE = %d\n"
988 #undef NOTIF_WRITE_HARDCODED
989 #undef NOTIF_WRITE_ENTITY
994 // ===============================
995 // Frontend Notification Pushing
996 // ===============================
998 string Local_Notification_sprintf(
999 string input, string args,
1000 string s1, string s2, string s3, string s4,
1001 int f1, float f2, float f3, float f4)
1003 #ifdef NOTIFICATIONS_DEBUG
1004 Debug_Notification(sprintf(
1005 "Local_Notification_sprintf('%s^7', '%s', %s, %s);\n",
1006 MakeConsoleSafe(input),
1008 MakeConsoleSafe(sprintf("'%s^7', '%s^7', '%s^7', '%s^7'", s1, s2, s3, s4)),
1009 sprintf("%d, %d, %d, %d", f1, f2, f3, f4)
1013 for (int sel_num = 0; sel_num < NOTIF_MAX_ARGS; ++sel_num) { arg_slot[sel_num] = ""; }
1015 for (int sel_num = 0; (args != ""); )
1017 string selected = car(args); args = cdr(args);
1018 NOTIF_HIT_MAX(NOTIF_MAX_ARGS, "Local_Notification_sprintf");
1019 string tmp_s; // used by NOTIF_ARGUMENT_LIST
1020 switch (strtolower(selected))
1022 #define ARG_CASE_ARG_CS_SV_HA(selected, result) case selected: { arg_slot[sel_num++] = result; break; }
1023 #define ARG_CASE_ARG_CS_SV_DC(selected, result) case selected: { arg_slot[sel_num++] = result; break; }
1024 #define ARG_CASE_ARG_CS_SV(selected, result) case selected: { arg_slot[sel_num++] = result; break; }
1026 #define ARG_CASE_ARG_CS(selected, result) case selected: { arg_slot[sel_num++] = result; break; }
1027 #define ARG_CASE_ARG_SV(selected, result)
1029 #define ARG_CASE_ARG_CS(selected, result)
1030 #define ARG_CASE_ARG_SV(selected, result) case selected: { arg_slot[sel_num++] = result; break; }
1032 #define ARG_CASE_ARG_DC(selected, result)
1033 #define ARG_CASE(prog, selected, result) ARG_CASE_##prog(selected, result)
1036 #undef ARG_CASE_ARG_DC
1037 #undef ARG_CASE_ARG_SV
1038 #undef ARG_CASE_ARG_CS
1039 #undef ARG_CASE_ARG_CS_SV
1040 #undef ARG_CASE_ARG_CS_SV_DC
1041 #undef ARG_CASE_ARG_CS_SV_HA
1042 default: NOTIF_HIT_UNKNOWN(NOTIF_MAX_ARGS, "Local_Notification_sprintf")
1046 strcat(input, "\n"),
1058 void Local_Notification_sound(
1059 int soundchannel, string soundfile,
1060 float soundvolume, float soundposition)
1062 if ((soundfile != prev_soundfile) || (time >= (prev_soundtime + autocvar_cl_announcer_antispam)))
1064 #ifdef NOTIFICATIONS_DEBUG
1065 Debug_Notification(sprintf(
1066 "Local_Notification_sound(%f, '%s', %f, %f);\n",
1069 "announcer/%s/%s.wav",
1082 "announcer/%s/%s.wav",
1090 if (prev_soundfile) strunzone(prev_soundfile);
1091 prev_soundfile = strzone(soundfile);
1092 prev_soundtime = time;
1096 #ifdef NOTIFICATIONS_DEBUG
1097 Debug_Notification(sprintf(
1099 "Local_Notification_sound(NULL, %f, '%s', %f, %f) "
1100 "^1BLOCKED BY ANTISPAM:^7 prevsnd: '%s', timediff: %f, limit: %f\n"
1104 "announcer/%s/%s.wav",
1111 (time - prev_soundtime),
1112 autocvar_cl_announcer_antispam
1118 void Local_Notification_HUD_Notify_Push(
1119 string icon, string hudargs,
1120 string s1, string s2, string s3, string s4,
1121 float f1, float f2, float f3, float f4)
1123 arg_slot[0] = ""; arg_slot[1] = "";
1125 for (int sel_num = 0; (hudargs != ""); )
1127 string selected = car(hudargs); hudargs = cdr(hudargs);
1128 NOTIF_HIT_MAX(NOTIF_MAX_HUDARGS, "Local_Notification_HUD_Notify_Push");
1129 switch (strtolower(selected))
1131 #define ARG_CASE_ARG_CS_SV_HA(selected, result) case selected: { arg_slot[sel_num++] = result; break; }
1132 #define ARG_CASE_ARG_CS_SV_DC(selected, result)
1133 #define ARG_CASE_ARG_CS_SV(selected, result)
1134 #define ARG_CASE_ARG_CS(selected, result)
1135 #define ARG_CASE_ARG_SV(selected, result)
1136 #define ARG_CASE_ARG_DC(selected, result)
1137 #define ARG_CASE(prog, selected, result) ARG_CASE_##prog(selected, result)
1140 #undef ARG_CASE_ARG_DC
1141 #undef ARG_CASE_ARG_SV
1142 #undef ARG_CASE_ARG_CS
1143 #undef ARG_CASE_ARG_CS_SV
1144 #undef ARG_CASE_ARG_CS_SV_DC
1145 #undef ARG_CASE_ARG_CS_SV_HA
1146 default: NOTIF_HIT_UNKNOWN(NOTIF_MAX_HUDARGS, "Local_Notification_HUD_Notify_Push")
1149 #ifdef NOTIFICATIONS_DEBUG
1150 Debug_Notification(sprintf(
1151 "Local_Notification_HUD_Notify_Push('%s^7', '%s', %s, %s, %s);\n",
1154 MakeConsoleSafe(sprintf("'%s^7', '%s^7', '%s^7', '%s^7'", s1, s2, s3, s4)),
1155 sprintf("%d, %d, %d, %d", f1, f2, f3, f4),
1156 MakeConsoleSafe(sprintf("'%s^7', '%s^7'", stof(arg_slot[0]), stof(arg_slot[1])))
1159 HUD_Notify_Push(icon, arg_slot[0], arg_slot[1]);
1162 void Local_Notification_centerprint_generic(
1163 string input, string durcnt,
1164 CPID cpid, float f1, float f2)
1166 arg_slot[0] = ""; arg_slot[1] = "";
1168 for (int sel_num = 0; (durcnt != ""); )
1170 string selected = car(durcnt); durcnt = cdr(durcnt);
1171 NOTIF_HIT_MAX(NOTIF_MAX_DURCNT, "Local_Notification_centerprint_generic");
1172 switch (strtolower(selected))
1174 #define ARG_CASE_ARG_CS_SV_HA(selected, result)
1175 #define ARG_CASE_ARG_CS_SV_DC(selected, result) case selected: { arg_slot[sel_num++] = result; break; }
1176 #define ARG_CASE_ARG_CS_SV(selected, result)
1177 #define ARG_CASE_ARG_CS(selected, result)
1178 #define ARG_CASE_ARG_SV(selected, result)
1179 #define ARG_CASE_ARG_DC(selected, result) case selected: { arg_slot[sel_num++] = result; break; }
1180 #define ARG_CASE(prog, selected, result) ARG_CASE_##prog(selected,result)
1183 #undef ARG_CASE_ARG_DC
1184 #undef ARG_CASE_ARG_SV
1185 #undef ARG_CASE_ARG_CS
1186 #undef ARG_CASE_ARG_CS_SV
1187 #undef ARG_CASE_ARG_CS_SV_DC
1188 #undef ARG_CASE_ARG_CS_SV_HA
1191 if (/* wtf */ ftos(stof(selected)) != "") { arg_slot[sel_num++] = selected; }
1192 else { NOTIF_HIT_UNKNOWN(NOTIF_MAX_DURCNT, "Local_Notification_centerprint_generic") }
1197 #ifdef NOTIFICATIONS_DEBUG
1198 Debug_Notification(sprintf(
1199 "Local_Notification_centerprint_generic('%s^7', '%s', %d, %d, %d, %d);\n",
1200 MakeConsoleSafe(input),
1207 centerprint_generic(ORDINAL(cpid), input, stof(arg_slot[0]), stof(arg_slot[1]));
1211 void Local_Notification(MSG net_type, Notification net_name, ...count)
1213 // retreive entity of this notification
1214 entity notif = net_name;
1217 #ifdef NOTIFICATIONS_DEBUG
1218 Debug_Notification(sprintf(
1219 "Local_Notification(%s, NULL, ...);\n",
1220 Get_Notif_TypeName(net_type)
1223 LOG_WARNF("Incorrect usage of Local_Notification: %s", "Null notification");
1227 // check if the notification is enabled
1228 if (!notif.nent_enabled)
1230 #ifdef NOTIFICATIONS_DEBUG
1231 Debug_Notification(sprintf(
1232 "Local_Notification(%s, %s, ...): Entity was disabled...\n",
1233 Get_Notif_TypeName(net_type),
1240 string s1 = ((notif.nent_stringcount > 0) ? ...(0, string) : "");
1241 string s2 = ((notif.nent_stringcount > 1) ? ...(1, string) : "");
1242 string s3 = ((notif.nent_stringcount > 2) ? ...(2, string) : "");
1243 string s4 = ((notif.nent_stringcount > 3) ? ...(3, string) : "");
1244 float f1 = ((notif.nent_floatcount > 0) ? ...((notif.nent_stringcount + 0), float) : 0);
1245 float f2 = ((notif.nent_floatcount > 1) ? ...((notif.nent_stringcount + 1), float) : 0);
1246 float f3 = ((notif.nent_floatcount > 2) ? ...((notif.nent_stringcount + 2), float) : 0);
1247 float f4 = ((notif.nent_floatcount > 3) ? ...((notif.nent_stringcount + 3), float) : 0);
1249 #ifdef NOTIFICATIONS_DEBUG
1250 Debug_Notification(sprintf(
1251 "Local_Notification(%s, %s, %s, %s);\n",
1252 Get_Notif_TypeName(net_type),
1254 MakeConsoleSafe(sprintf("'%s^7', '%s^7', '%s^7', '%s^7'", s1, s2, s3, s4)),
1255 sprintf("%d, %d, %d, %d", f1, f2, f3, f4)
1259 if ((notif.nent_stringcount + notif.nent_floatcount) != count)
1263 "Arguments mismatch for Local_Notification(%s, %s, ...)! "
1264 "stringcount(%d) + floatcount(%d) != count(%d)\n"
1265 "Check the definition and function call for accuracy...?\n"
1267 Get_Notif_TypeName(net_type),
1269 notif.nent_stringcount,
1270 notif.nent_floatcount,
1281 Local_Notification_sound(
1288 backtrace("MSG_ANNCE on server?... Please notify Samual immediately!\n");
1296 Local_Notification_sprintf(
1303 if (notif.nent_icon != "")
1305 if (notif.nent_iconargs != "")
1307 string s = Local_Notification_sprintf(
1308 notif.nent_icon,notif.nent_iconargs,
1309 s1, s2, s3, s4, f1, f2, f3, f4);
1310 // remove the trailing newline
1311 notif.nent_icon = strzone(substring(s, 0, -1));
1313 Local_Notification_HUD_Notify_Push(
1326 Local_Notification_centerprint_generic(
1327 Local_Notification_sprintf(
1341 if (notif.nent_msginfo && notif.nent_msginfo.nent_enabled)
1343 Local_Notification_WOVA(
1346 notif.nent_msginfo.nent_stringcount,
1347 notif.nent_msginfo.nent_floatcount,
1352 if (notif.nent_msgannce && notif.nent_msgannce.nent_enabled)
1354 Local_Notification_WOVA(
1356 notif.nent_msgannce,
1361 if (notif.nent_msgcenter && notif.nent_msgcenter.nent_enabled)
1363 Local_Notification_WOVA(
1365 notif.nent_msgcenter,
1366 notif.nent_msgcenter.nent_stringcount,
1367 notif.nent_msgcenter.nent_floatcount,
1377 entity found_choice = notif.nent_optiona;
1378 if (notif.nent_challow_var && (warmup_stage || (notif.nent_challow_var == 2))) {
1379 string cvarname = (notif.nent_cvarname ? notif.nent_cvarname : notif.nent_name);
1380 switch (cvar(sprintf("notification_%s", cvarname)))
1383 case 2: found_choice = notif.nent_optionb; break;
1384 default: return; // not enabled anyway
1388 Local_Notification_WOVA(
1389 found_choice.nent_type,
1391 found_choice.nent_stringcount,
1392 found_choice.nent_floatcount,
1399 // WOVA = Without Variable Arguments
1400 void Local_Notification_WOVA(
1401 MSG net_type, Notification net_name,
1402 float stringcount, float floatcount,
1403 string s1, string s2, string s3, string s4,
1404 float f1, float f2, float f3, float f4)
1406 #define VARITEM(stringc, floatc, args) \
1407 if ((stringcount == stringc) && (floatcount == floatc)) \
1408 { Local_Notification(net_type, net_name, args); return; }
1409 EIGHT_VARS_TO_VARARGS_VARLIST
1411 Local_Notification(net_type, net_name); // some notifications don't have any arguments at all
1415 // =========================
1416 // Notification Networking
1417 // =========================
1419 /** networked as a linked entity to give newly connecting clients some notification context */
1420 REGISTER_NET_LINKED(ENT_CLIENT_NOTIFICATION)
1423 NET_HANDLE(ENT_CLIENT_NOTIFICATION, bool is_new)
1426 MSG net_type = ENUMCAST(MSG, ReadByte());
1427 int net_name = ReadShort();
1430 if (net_type == MSG_CENTER_KILL)
1432 if (!is_new) return;
1434 #ifdef NOTIFICATIONS_DEBUG
1435 Debug_Notification(sprintf(
1436 "Read_Notification(%d) at %f: net_type = %s, cpid = %d\n",
1439 Get_Notif_TypeName(net_type),
1443 int _net_name = net_name;
1444 CPID net_name = ENUMCAST(CPID, _net_name);
1445 if (net_name == CPID_Null) {
1447 reset_centerprint_messages();
1450 centerprint_generic(ORDINAL(net_name), "", 0, 0);
1455 Notification notif = Get_Notif_Ent(net_type, net_name);
1457 #ifdef NOTIFICATIONS_DEBUG
1458 Debug_Notification(sprintf(
1459 "Read_Notification(%d) at %f: net_type = %s, net_name = %s (%d)\n",
1462 Get_Notif_TypeName(net_type),
1463 notif.registered_id,
1469 backtrace("Read_Notification: Could not find notification entity!\n");
1473 string s1 = ((notif.nent_stringcount > 0) ? ReadString() : "");
1474 string s2 = ((notif.nent_stringcount > 1) ? ReadString() : "");
1475 string s3 = ((notif.nent_stringcount > 2) ? ReadString() : "");
1476 string s4 = ((notif.nent_stringcount > 3) ? ReadString() : "");
1477 float f1 = ((notif.nent_floatcount > 0) ? ReadLong() : 0);
1478 float f2 = ((notif.nent_floatcount > 1) ? ReadLong() : 0);
1479 float f3 = ((notif.nent_floatcount > 2) ? ReadLong() : 0);
1480 float f4 = ((notif.nent_floatcount > 3) ? ReadLong() : 0);
1482 if (!is_new) return;
1483 Local_Notification_WOVA(
1485 notif.nent_stringcount,
1486 notif.nent_floatcount,
1493 void Net_Notification_Remove(entity this)
1495 #ifdef NOTIFICATIONS_DEBUG
1496 Debug_Notification(sprintf(
1497 "Net_Notification_Remove() at %f: %s '%s - %s' notification\n",
1499 ((this.nent_net_name == -1) ? "Killed" : "Removed"),
1500 Get_Notif_TypeName(this.nent_net_type),
1501 this.owner.nent_name
1504 for (int i = 0; i < this.nent_stringcount; ++i) { if (this.nent_strings[i]) strunzone(this.nent_strings[i]); }
1508 bool Net_Write_Notification(entity this, entity client, int sf)
1510 if (!Notification_ShouldSend(this.nent_broadcast, client, this.nent_client)) return false;
1511 WriteHeader(MSG_ENTITY, ENT_CLIENT_NOTIFICATION);
1512 WriteByte(MSG_ENTITY, ORDINAL(this.nent_net_type));
1513 WriteShort(MSG_ENTITY, this.nent_net_name);
1514 for (int i = 0; i < this.nent_stringcount; ++i) { WriteString(MSG_ENTITY, this.nent_strings[i]); }
1515 for (int i = 0; i < this.nent_floatcount; ++i) { WriteLong(MSG_ENTITY, this.nent_floats[i]); }
1519 void Kill_Notification(
1520 NOTIF broadcast, entity client,
1521 /** message group, MSG_Null for all */
1523 /** cpid group, CPID_Null for all */
1526 #ifdef NOTIFICATIONS_DEBUG
1527 Debug_Notification(sprintf(
1528 "Kill_Notification(%s, '%s', %s, %d);\n",
1529 Get_Notif_BroadcastName(broadcast),
1531 (net_type ? Get_Notif_TypeName(net_type) : "0"),
1536 string checkargs = Notification_CheckArgs(broadcast, client);
1537 if (checkargs != "") { LOG_WARNF("Incorrect usage of Kill_Notification: %s", checkargs); return; }
1539 entity net_notif = new_pure(net_kill_notification);
1540 net_notif.nent_broadcast = broadcast;
1541 net_notif.nent_client = client;
1542 net_notif.nent_net_type = MSG_CENTER_KILL;
1543 net_notif.nent_net_name = ORDINAL(net_cpid);
1544 Net_LinkEntity(net_notif, false, autocvar_notification_lifetime_runtime, Net_Write_Notification);
1548 (it.owner.nent_type == net_type || net_type == MSG_Null) && (it.owner.nent_cpid == net_cpid || net_cpid == CPID_Null),
1550 it.nent_net_name = -1;
1551 it.nextthink = time;
1556 void Send_Notification(
1557 NOTIF broadcast, entity client,
1558 MSG net_type, Notification net_name,
1561 if (broadcast != NOTIF_ALL && broadcast != NOTIF_ALL_EXCEPT && !IS_REAL_CLIENT(client)) return;
1562 entity notif = net_name;
1563 string parms = sprintf("%s, '%s', %s, %s",
1564 Get_Notif_BroadcastName(broadcast),
1566 Get_Notif_TypeName(net_type),
1567 net_name.registered_id
1569 #ifdef NOTIFICATIONS_DEBUG
1570 Debug_Notification(sprintf("Send_Notification(%s, ...%d);\n", parms, count));
1575 LOG_WARN("Send_Notification: Could not find notification entity!");
1579 // check supplied broadcast, target, type, and name for errors
1580 string checkargs = Notification_CheckArgs(broadcast, client);
1581 if (!net_name) { checkargs = sprintf("No notification provided! %s", checkargs); }
1582 if (checkargs != "")
1584 LOG_WARNF("Incorrect usage of Send_Notification: %s", checkargs);
1588 string s1 = ((0 < notif.nent_stringcount) ? ...(0, string) : "");
1589 string s2 = ((1 < notif.nent_stringcount) ? ...(1, string) : "");
1590 string s3 = ((2 < notif.nent_stringcount) ? ...(2, string) : "");
1591 string s4 = ((3 < notif.nent_stringcount) ? ...(3, string) : "");
1592 float f1 = ((0 < notif.nent_floatcount) ? ...((notif.nent_stringcount + 0), float) : 0);
1593 float f2 = ((1 < notif.nent_floatcount) ? ...((notif.nent_stringcount + 1), float) : 0);
1594 float f3 = ((2 < notif.nent_floatcount) ? ...((notif.nent_stringcount + 2), float) : 0);
1595 float f4 = ((3 < notif.nent_floatcount) ? ...((notif.nent_stringcount + 3), float) : 0);
1597 #ifdef NOTIFICATIONS_DEBUG
1598 Debug_Notification(sprintf(
1599 "Send_Notification(%s, %s, %s);\n",
1601 MakeConsoleSafe(sprintf("'%s^7', '%s^7', '%s^7', '%s^7'", s1, s2, s3, s4)),
1602 sprintf("%d, %d, %d, %d", f1, f2, f3, f4)
1606 if ((notif.nent_stringcount + notif.nent_floatcount) != count)
1609 "Argument mismatch for Send_Notification(%s, ...)! "
1610 "stringcount(%d) + floatcount(%d) != count(%d)\n"
1611 "Check the definition and function call for accuracy...?\n",
1613 notif.nent_stringcount,
1614 notif.nent_floatcount,
1624 broadcast == NOTIF_ALL
1626 broadcast == NOTIF_ALL_EXCEPT
1630 net_type == MSG_ANNCE
1632 net_type == MSG_CENTER
1636 Local_Notification_WOVA(
1638 notif.nent_stringcount,
1639 notif.nent_floatcount,
1644 if (net_type == MSG_CHOICE)
1646 // THIS GETS TRICKY... now we have to cycle through each possible player (checking broadcast)
1647 // and then do an individual NOTIF_ONE_ONLY recursive call for each one depending on their option...
1648 // It's slow, but it's better than the alternatives:
1649 // 1. Constantly networking all info and letting client decide
1650 // 2. Manually handling each separate call on per-usage basis (See old CTF usage of verbose)
1651 entity found_choice;
1653 #define RECURSE_FROM_CHOICE(ent,action) MACRO_BEGIN { \
1654 if (notif.nent_challow_var && (warmup_stage || (notif.nent_challow_var == 2))) { \
1655 switch (ent.msg_choice_choices[net_name.nent_choice_idx]) \
1657 case 1: found_choice = notif.nent_optiona; break; \
1658 case 2: found_choice = notif.nent_optionb; break; \
1662 found_choice = notif.nent_optiona; \
1664 Send_Notification_WOVA( \
1667 found_choice.nent_type, \
1669 found_choice.nent_stringcount, \
1670 found_choice.nent_floatcount, \
1677 case NOTIF_ONE_ONLY: // we can potentially save processing power with this broadcast method
1679 if (IS_REAL_CLIENT(client)) {
1680 RECURSE_FROM_CHOICE(client, return);
1686 FOREACH_CLIENT(IS_REAL_CLIENT(it) && Notification_ShouldSend(broadcast, it, client), {
1687 RECURSE_FROM_CHOICE(it, continue);
1695 entity net_notif = new_pure(net_notification);
1696 IL_PUSH(g_notifications, net_notif);
1697 net_notif.owner = notif;
1698 net_notif.nent_broadcast = broadcast;
1699 net_notif.nent_client = client;
1700 net_notif.nent_net_type = net_type;
1701 net_notif.nent_net_name = notif.m_id;
1702 net_notif.nent_stringcount = notif.nent_stringcount;
1703 net_notif.nent_floatcount = notif.nent_floatcount;
1705 for (int i = 0; i < net_notif.nent_stringcount; ++i) {
1706 net_notif.nent_strings[i] = strzone(...(i, string));
1708 for (int i = 0; i < net_notif.nent_floatcount; ++i) {
1709 net_notif.nent_floats[i] = ...((net_notif.nent_stringcount + i), float);
1712 setthink(net_notif, Net_Notification_Remove);
1713 net_notif.nextthink = (time > autocvar_notification_lifetime_mapload)
1714 ? (time + autocvar_notification_lifetime_runtime)
1715 : autocvar_notification_lifetime_mapload;
1717 Net_LinkEntity(net_notif, false, 0, Net_Write_Notification);
1721 // WOVA = Without Variable Arguments
1722 void Send_Notification_WOVA(
1723 NOTIF broadcast, entity client,
1724 MSG net_type, Notification net_name,
1725 float stringcount, float floatcount,
1726 string s1, string s2, string s3, string s4,
1727 float f1, float f2, float f3, float f4)
1729 #ifdef NOTIFICATIONS_DEBUG
1730 entity notif = net_name;
1731 Debug_Notification(sprintf(
1732 "Send_Notification_WOVA(%s, %d, %d, %s, %s);\n",
1735 Get_Notif_BroadcastName(broadcast),
1737 Get_Notif_TypeName(net_type),
1742 MakeConsoleSafe(sprintf("'%s^7', '%s^7', '%s^7', '%s^7'", s1, s2, s3, s4)),
1743 sprintf("%d, %d, %d, %d", f1, f2, f3, f4)
1747 #define VARITEM(stringc, floatc, args) \
1748 if ((stringcount == stringc) && (floatcount == floatc)) \
1749 { Send_Notification(broadcast, client, net_type, net_name, args); return; }
1750 EIGHT_VARS_TO_VARARGS_VARLIST
1752 Send_Notification(broadcast, client, net_type, net_name); // some notifications don't have any arguments at all
1755 // WOCOVA = Without Counts Or Variable Arguments
1756 void Send_Notification_WOCOVA(
1757 NOTIF broadcast, entity client,
1758 MSG net_type, Notification net_name,
1759 string s1, string s2, string s3, string s4,
1760 float f1, float f2, float f3, float f4)
1762 entity notif = net_name;
1764 #ifdef NOTIFICATIONS_DEBUG
1765 Debug_Notification(sprintf(
1766 "Send_Notification_WOCOVA(%s, %s, %s);\n",
1769 Get_Notif_BroadcastName(broadcast),
1771 Get_Notif_TypeName(net_type),
1774 MakeConsoleSafe(sprintf("'%s^7', '%s^7', '%s^7', '%s^7'", s1, s2, s3, s4)),
1775 sprintf("%d, %d, %d, %d", f1, f2, f3, f4)
1779 #define VARITEM(stringc, floatc, args) \
1780 if ((notif.nent_stringcount == stringc) && (notif.nent_floatcount == floatc)) \
1781 { Send_Notification(broadcast, client, net_type, net_name, args); return; }
1782 EIGHT_VARS_TO_VARARGS_VARLIST
1784 Send_Notification(broadcast, client, net_type, net_name); // some notifications don't have any arguments at all
1786 #endif // ifdef SVQC