}
-// =========================================
-// Cvar Handling With 'dumpnotifs' Command
-// =========================================
+// ===============
+// Cvar Handling
+// ===============
+// used by MSG_CHOICE to build list of choices
+#ifdef SVQC
+void Notification_GetCvars(void)
+{
+ float i;
+ for(i = 0; i <= NOTIF_CHOICE_COUNT; ++i)
+ {
+ GetCvars_handleFloat(
+ get_cvars_s,
+ get_cvars_f,
+ msg_choice_choices[i],
+ sprintf("notification_%s", msg_choice_notifs[i].nent_name)
+ );
+ }
+
+ GetCvars_handleFloat(get_cvars_s, get_cvars_f, FRAG_VERBOSE, "notification_frag_verbose");
+}
+#endif
+
+// used to output notifications.cfg file
void Dump_Notifications(float fh, float alsoprint)
{
#define NOTIF_WRITE(a) { \
#undef NOTIF_WRITE
}
-#ifdef SVQC
-void Notification_GetCvars()
-{
- GetCvars_handleFloat(get_cvars_s, get_cvars_f, FRAG_VERBOSE, "notification_frag_verbose");
-}
-#endif
-
// ===============================
// Frontend Notification Pushing
if(net_type == MSG_CHOICE)
{
+ // float verbose_allowed = (autocvar_notification_server_allows_frag_verbose && ((autocvar_notification_server_allows_frag_verbose == 2) || inWarmupStage));
// THIS GETS TRICKY... now we have to cycle through each possible player (checking broadcast)
// and then do an individual NOTIF_ONE_ONLY recursive call for each one depending on their option...
// It's slow, but it's better than the alternatives:
MSG_CHOICE_NOTIF(1, CHOICE_FRAG, MSG_CENTER, CENTER_DEATH_MURDER_FRAG, CENTER_DEATH_MURDER_FRAG_VERBOSE) \
MSG_CHOICE_NOTIF(1, CHOICE_FRAGGED, MSG_CENTER, CENTER_DEATH_MURDER_FRAGGED, CENTER_DEATH_MURDER_FRAGGED_VERBOSE) \
MSG_CHOICE_NOTIF(1, CHOICE_TYPEFRAG, MSG_CENTER, CENTER_DEATH_MURDER_TYPEFRAG, CENTER_DEATH_MURDER_TYPEFRAG_VERBOSE) \
- MSG_CHOICE_NOTIF(1, CHOICE_TYPERFRAGGED, MSG_CENTER, CENTER_DEATH_MURDER_TYPEFRAGGED, CENTER_DEATH_MURDER_TYPEFRAGGED_VERBOSE)
+ MSG_CHOICE_NOTIF(1, CHOICE_TYPEFRAGGED, MSG_CENTER, CENTER_DEATH_MURDER_TYPEFRAGGED, CENTER_DEATH_MURDER_TYPEFRAGGED_VERBOSE)
//MSG_CHOICE_NOTIF(2, CHOICE_)
kill_count_to_target = 0;
}
- float verbose_allowed = (autocvar_notification_server_allows_frag_verbose && ((autocvar_notification_server_allows_frag_verbose == 2) || inWarmupStage));
if(targ.istypefrag)
{
- if(attacker.FRAG_VERBOSE && verbose_allowed)
- Send_Notification(NOTIF_ONE, attacker, MSG_CENTER, CENTER_DEATH_MURDER_TYPEFRAG_VERBOSE, targ.netname, kill_count_to_attacker, (IS_BOT_CLIENT(targ) ? NO_MSG : targ.ping));
- else
- Send_Notification(NOTIF_ONE, attacker, MSG_CENTER, CENTER_DEATH_MURDER_TYPEFRAG, targ.netname, kill_count_to_attacker);
-
- if(targ.FRAG_VERBOSE && verbose_allowed)
- Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_DEATH_MURDER_TYPEFRAGGED_VERBOSE, attacker.netname, kill_count_to_target, attacker.health, attacker.armorvalue, (IS_BOT_CLIENT(attacker) ? NO_MSG : attacker.ping));
- else
- Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_DEATH_MURDER_TYPEFRAGGED, attacker.netname, kill_count_to_target);
+ Send_Notification(
+ NOTIF_ONE,
+ attacker,
+ MSG_CHOICE,
+ CHOICE_TYPEFRAG,
+ targ.netname,
+ kill_count_to_attacker,
+ (IS_BOT_CLIENT(targ) ? NO_MSG : targ.ping)
+ );
+ Send_Notification(
+ NOTIF_ONE,
+ targ,
+ MSG_CHOICE,
+ CHOICE_TYPEFRAGGED,
+ attacker.netname,
+ kill_count_to_target,
+ attacker.health,
+ attacker.armorvalue,
+ (IS_BOT_CLIENT(attacker) ? NO_MSG : attacker.ping)
+ );
}
else
{
- if(attacker.FRAG_VERBOSE && verbose_allowed)
- Send_Notification(NOTIF_ONE, attacker, MSG_CENTER, CENTER_DEATH_MURDER_FRAG_VERBOSE, targ.netname, kill_count_to_attacker, (IS_BOT_CLIENT(targ) ? NO_MSG : targ.ping));
- else
- Send_Notification(NOTIF_ONE, attacker, MSG_CENTER, CENTER_DEATH_MURDER_FRAG, targ.netname, kill_count_to_attacker);
-
- if(targ.FRAG_VERBOSE && verbose_allowed)
- Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_DEATH_MURDER_FRAGGED_VERBOSE, attacker.netname, kill_count_to_target, attacker.health, attacker.armorvalue, (IS_BOT_CLIENT(attacker) ? NO_MSG : attacker.ping));
- else
- Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_DEATH_MURDER_FRAGGED, attacker.netname, kill_count_to_target);
+ Send_Notification(
+ NOTIF_ONE,
+ attacker,
+ MSG_CHOICE,
+ CHOICE_FRAG,
+ targ.netname,
+ kill_count_to_attacker,
+ (IS_BOT_CLIENT(targ) ? NO_MSG : targ.ping)
+ );
+ Send_Notification(
+ NOTIF_ONE,
+ targ,
+ MSG_CHOICE,
+ CHOICE_FRAGGED,
+ attacker.netname,
+ kill_count_to_target,
+ attacker.health,
+ attacker.armorvalue,
+ (IS_BOT_CLIENT(attacker) ? NO_MSG : attacker.ping)
+ );
}
if not(Obituary_WeaponDeath(targ, TRUE, deathtype, targ.netname, attacker.netname, deathlocation, targ.killcount, kill_count_to_attacker))