NOTIF_WRITE_HARDCODED("ctf_capture_verbose", "0", "Show extra information when someone captures a flag");
NOTIF_WRITE_HARDCODED("ctf_pickup_enemy_verbose", "0", "Show extra information if an enemy picks up a flag");
NOTIF_WRITE_HARDCODED("ctf_pickup_team_verbose", "0", "Show extra information if a team mate picks up a flag");
+ NOTIF_WRITE_HARDCODED("debug", "0", "Print extra debug information on all notification function calls (Requires -DNOTIFICATIONS_DEBUG flag to be enabled on QCSRC compilation)... 0 = disabled, 1 = dprint, 2 = print");
NOTIF_WRITE_HARDCODED("errors_are_fatal", "1", "If a notification fails upon initialization, cause a Host_Error to stop the program");
NOTIF_WRITE_HARDCODED("frag_verbose", "1", "Show extra information when you frag someone (or when you are fragged");
NOTIF_WRITE_HARDCODED("item_centerprinttime", "1.5", "How long to show item information centerprint messages (like 'You got the Electro' or such)");
// Frontend Notification Pushing
// ===============================
+#ifdef NOTIFICATIONS_DEBUG
+void Debug_Notification(string input)
+{
+ switch(autocvar_notification_debug)
+ {
+ case 1: { dprint(input); break; }
+ case 2: { print(input); break; }
+ }
+}
+#endif
+
string Local_Notification_sprintf(
string input, string args,
string s1, string s2, string s3, string s4,
float f1, float f2, float f3, float f4)
{
#ifdef NOTIFICATIONS_DEBUG
- dprint(sprintf(
+ Debug_Notification(sprintf(
"Local_Notification_sprintf('%s^7', '%s', %s, %s);\n",
MakeConsoleSafe(input),
args,
if((soundfile != prev_soundfile) || (time >= (prev_soundtime + autocvar_cl_announcer_antispam)))
{
#ifdef NOTIFICATIONS_DEBUG
- dprint(sprintf(
+ Debug_Notification(sprintf(
"Local_Notification_sound(world, %f, '%s', %f, %f);\n",
soundchannel,
sprintf(
else
{
#ifdef NOTIFICATIONS_DEBUG
- dprint(sprintf(
+ Debug_Notification(sprintf(
"Local_Notification_sound(world, %f, '%s', %f, %f) ^1BLOCKED BY ANTISPAM:^7 prevsnd: '%s', time/prevtime: %f, limit: %f\n",
soundchannel,
sprintf(
}
}
#ifdef NOTIFICATIONS_DEBUG
- dprint(sprintf(
+ Debug_Notification(sprintf(
"Local_Notification_HUD_Notify_Push('%s^7', '%s', %s, %s);\n",
icon,
hudargs,
}
}
#ifdef NOTIFICATIONS_DEBUG
- dprint(sprintf(
+ Debug_Notification(sprintf(
"Local_Notification_centerprint_generic('%s^7', '%s', %d, %d, %d, %d);\n",
MakeConsoleSafe(input),
durcnt,
if not(notif.nent_enabled)
{
#ifdef NOTIFICATIONS_DEBUG
- dprint(sprintf(
+ Debug_Notification(sprintf(
"Local_Notification(%s, %s): Entity was disabled...\n",
Get_Notif_TypeName(net_type),
notif.nent_name
float f4 = ((3 < notif.nent_floatcount) ? ...((notif.nent_stringcount + 3), float) : 0);
#ifdef NOTIFICATIONS_DEBUG
- dprint(sprintf(
+ Debug_Notification(sprintf(
"Local_Notification(%s, %s, %s, %s);\n",
Get_Notif_TypeName(net_type),
notif.nent_name,
if(net_type == MSG_CENTER_CPID)
{
#ifdef NOTIFICATIONS_DEBUG
- dprint(sprintf(
+ Debug_Notification(sprintf(
"Read_Notification(%d) at %f: net_type = %s, net_name = %d\n",
is_new,
time,
if not(notif) { backtrace("Read_Notification: Could not find notification entity!\n"); return; }
#ifdef NOTIFICATIONS_DEBUG
- dprint(sprintf(
+ Debug_Notification(sprintf(
"Read_Notification(%d) at %f: net_type = %s, net_name = %s\n",
is_new,
time,
if not(self) { backtrace(sprintf("Net_Notification_Remove() at %f: Missing self!?\n", time)); return; }
#ifdef NOTIFICATIONS_DEBUG
- dprint(sprintf(
+ Debug_Notification(sprintf(
"Net_Notification_Remove() at %f: %s '%s - %s' notification\n",
time,
((self.nent_net_name == -1) ? "Killed" : "Removed"),
if(checkargs != "") { backtrace(sprintf("Incorrect usage of Kill_Notification: %s\n", checkargs)); return; }
#ifdef NOTIFICATIONS_DEBUG
- dprint(sprintf(
+ Debug_Notification(sprintf(
"Kill_Notification(%d, '%s', %s, %d);\n",
broadcast,
client.netname,
float f2 = ((1 < notif.nent_floatcount) ? ...((notif.nent_stringcount + 1), float) : 0);
float f3 = ((2 < notif.nent_floatcount) ? ...((notif.nent_stringcount + 2), float) : 0);
float f4 = ((3 < notif.nent_floatcount) ? ...((notif.nent_stringcount + 3), float) : 0);
- dprint(sprintf(
+ Debug_Notification(sprintf(
"Send_Notification(%d, %s, %s, %s, %s);\n",
broadcast,
Get_Notif_TypeName(net_type),
entity notif = Get_Notif_Ent(net_type, net_name);
#ifdef NOTIFICATIONS_DEBUG
- dprint(sprintf(
+ Debug_Notification(sprintf(
"Send_Notification_WOVA(%d, %s, %s, %s, %s);\n",
broadcast,
Get_Notif_TypeName(net_type),