Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
all.qh File Reference
#include <common/command/_mod.qh>
#include <common/constants.qh>
#include <common/teams.qh>
#include <common/util.qh>
#include <common/sounds/sound.qh>
#include <common/weapons/all.qh>
#include "all.inc"
Include dependency graph for all.qh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ACVNN(name)
#define APP_NUM(num, prefix)
#define APP_TEAM_NUM(num, prefix)
#define BOLD_OPERATOR   "^BOLD"
#define DEFAULT_FILENAME   "notifications_dump.cfg"
#define EIGHT_VARS_TO_VARARGS_VARLIST
#define HASH_REPLACE(full_msg, num, attacker_name)
#define KILL_SPREE_LIST
#define MSG_ANNCE_NOTIF(name, defaultvalue, sound, channel, volume, position, queuetime)
#define MSG_ANNCE_NOTIF_(teamnum, name, cvarname, defaultvalue, sound, channel, volume, position, queuetime)
#define MSG_ANNCE_NOTIF_TEAM(teamnum, name, cvarname, defaultvalue, sound, channel, volume, position, queuetime)
#define MSG_CENTER_NOTIF(name, defaultvalue, strnum, flnum, args, cpid, durcnt, normal, gentle)
#define MSG_CENTER_NOTIF_(teamnum, name, cvarname, defaultvalue, strnum, flnum, args, cpid, durcnt, normal, gentle)
#define MSG_CENTER_NOTIF_TEAM(teamnum, name, cvarname, defaultvalue, strnum, flnum, args, cpid, durcnt, normal, gentle)
#define MSG_CHOICE_NOTIF(name, defaultvalue, challow, chtype, optiona, optionb)
#define MSG_CHOICE_NOTIF_(teamnum, name, cvarname, defaultvalue, challow, chtype, optiona, optionb)
#define MSG_CHOICE_NOTIF_TEAM(teamnum, name, cvarname, defaultvalue, challow, chtype, optiona, optionb)
#define MSG_INFO_NOTIF(name, defaultvalue, strnum, flnum, args, hudargs, icon, normal, gentle)
#define MSG_INFO_NOTIF_(teamnum, name, cvarname, defaultvalue, strnum, flnum, args, hudargs, icon, normal, gentle)
#define MSG_INFO_NOTIF_TEAM(teamnum, name, cvarname, defaultvalue, strnum, flnum, args, hudargs, icon, normal, gentle)
#define MSG_MULTI_NOTIF(name, defaultvalue, anncename, infoname, centername)
#define MULTIICON_INFO(name, defaultvalue, strnum, flnum, args, hudargs, iconargs, icon, normal, gentle)
#define MULTIICON_INFO_(name, defaultvalue, strnum, flnum, args, hudargs, iconargs, icon, normal, gentle)
#define NOTIF_ADD_AUTOCVAR(name, defaultvalue)
#define NOTIF_ARGUMENT_LIST
#define NOTIF_HIT_MAX(count, funcname)
#define NOTIF_HIT_UNKNOWN(token, funcname)
#define SPREE_ITEM(counta, countb, center, normal, gentle)
#define SPREE_ITEM(counta, countb, center, normal, gentle)

Typedefs

using Notification = entity
 always last

Functions

string BUFF_NAME (int i)
void Create_Notification_Entity (entity notif, float var_default, float var_cvar, MSG typeId, string namestring, int teamnum)
void Create_Notification_Entity_Annce (entity notif, float var_cvar, string namestring, float channel, string snd, float vol, float position, float queuetime)
void Create_Notification_Entity_Choice (entity notif, float var_cvar, string namestring, float challow_def, float challow_var, MSG chtype, Notification optiona, Notification optionb)
void Create_Notification_Entity_InfoCenter (entity notif, float var_cvar, string namestring, int strnum, int flnum, string args, string hudargs, string icon, CPID cpid, string durcnt, string normal, string gentle)
void Create_Notification_Entity_Multi (entity notif, float var_cvar, string namestring, Notification anncename, Notification infoname, Notification centername)
void Destroy_All_Notifications ()
void Dump_Notifications (int fh, bool alsoprint)
 used to output notifications.cfg file
 GENERIC_COMMAND (dumpnotifs, "Dump all notifications into " DEFAULT_FILENAME, false)
string Get_Notif_BroadcastName (NOTIF broadcast)
 send to one client and their spectators
string Get_Notif_CvarName (Notification notif)
Notification Get_Notif_Ent (MSG net_type, int net_name)
string Get_Notif_TypeName (MSG net_type)
 main types/groups of notifications
string hash_replace (string full_msg, int ent_msg_num, string ent_msg, string attacker_name)
void Kill_Notification (NOTIF broadcast, entity client, MSG net_type, CPID net_name)
void Local_Notification (MSG net_type, Notification net_name,...count)
void Local_Notification_Queue_Process ()
void Local_Notification_WOVA (MSG net_type, Notification net_name, float stringcount, float floatcount, string s1, string s2, string s3, string s4, float f1, float f2, float f3, float f4)
 glue for networking, forwards to Local_Notification
string notif_arg_frag_ping (bool newline, float fping)
string notif_arg_frag_stats (float fhealth, float farmor, float fping)
string notif_arg_item_wepammo (float f1, float f2)
string notif_arg_spree_cen (float spree)
string notif_arg_spree_inf (float type, string input, string player, float spree)
void Notification_GetCvars (entity this, entity store)
 REGISTRY_BEGIN (Notifications)
 REGISTRY_END (Notifications)
void ReplicateVars (bool would_destroy)
void Send_Notification (NOTIF broadcast, entity client, MSG net_type, Notification net_name,...count)
void Send_Notification_WOCOVA (NOTIF broadcast, entity client, MSG net_type, Notification net_name, string s1, string s2, string s3, string s4, float f1, float f2, float f3, float f4)
void Send_Notification_WOVA (NOTIF broadcast, entity client, MSG net_type, Notification net_name, float stringcount, float floatcount, string s1, string s2, string s3, string s4, float f1, float f2, float f3, float f4)
 STATIC_INIT (g_notifications)
 STATIC_INIT (Notifications)
 STATIC_INIT_LATE (Notif_Choices)

Variables

const float ARG_CS = 4
const float ARG_CS_SV = 3
const float ARG_CS_SV_DC = 2
const float ARG_CS_SV_HA = 1
const float ARG_DC = 6
string arg_slot [NOTIF_MAX_ARGS]
const float ARG_SV = 5
float autocvar_notification_errors_are_fatal = true
float autocvar_notification_lifetime_mapload = 10
float autocvar_notification_lifetime_runtime = 0.5
float autocvar_notification_server_allows_location = 1
float autocvar_notification_show_location = false
string autocvar_notification_show_location_string = ""
float autocvar_notification_show_sprees = true
float autocvar_notification_show_sprees_info = 3
float autocvar_notification_show_sprees_info_newline = true
float autocvar_notification_show_sprees_info_specialonly = true
int cvar_value
IntrusiveList g_notifications
int msg_choice_choices [NOTIF_CHOICE_MAX]
string nent_args
NOTIF nent_broadcast
float nent_challow_def
float nent_challow_var
int nent_channel
int nent_choice_count = 0
int nent_choice_idx
entity nent_client
CPID nent_cpid
int nent_default
string nent_durcnt
bool nent_enabled
int nent_floatcount
float nent_floats [4]
string nent_hudargs
string nent_icon
string nent_iconargs
entity nent_msgannce
entity nent_msgcenter
entity nent_msginfo
string nent_name
float nent_net_name
MSG nent_net_type
entity nent_optiona
entity nent_optionb
float nent_position
float nent_queuetime
string nent_snd
string nent_string
int nent_stringcount
string nent_strings [4]
int nent_teamnum
MSG nent_type
float nent_vol
const int NOTIF_CHOICE_MAX = 20
bool notif_error
bool notif_global_error
const float NOTIF_MAX_ARGS = 7
const float NOTIF_MAX_DURCNT = 2
const float NOTIF_MAX_HUDARGS = 2
entity notif_queue_entity [NOTIF_QUEUE_MAX]
int notif_queue_length
const int NOTIF_QUEUE_MAX = 10
float notif_queue_next_time
float notif_queue_time [NOTIF_QUEUE_MAX]
MSG notif_queue_type [NOTIF_QUEUE_MAX]
string prev_soundfile
float prev_soundtime

Macro Definition Documentation

◆ ACVNN

#define ACVNN ( name)
Value:
autocvar_notification_##name
string name
Definition menu.qh:30

Definition at line 722 of file all.qh.

◆ APP_NUM

#define APP_NUM ( num,
prefix )
Value:
((num) ? APP_TEAM_NUM(num, prefix) : prefix##_NEUTRAL)
#define APP_TEAM_NUM(num, prefix)
Definition all.qh:84

Definition at line 85 of file all.qh.

Referenced by ctf_CheckFlagReturn(), ctf_Handle_Capture(), ctf_Handle_Drop(), ctf_Handle_Pickup(), ctf_Handle_Retrieve(), and MUTATOR_HOOKFUNCTION().

◆ APP_TEAM_NUM

◆ BOLD_OPERATOR

#define BOLD_OPERATOR   "^BOLD"

Definition at line 12 of file all.qh.

Referenced by HUD_CenterPrint().

◆ DEFAULT_FILENAME

#define DEFAULT_FILENAME   "notifications_dump.cfg"

Definition at line 164 of file all.qh.

Referenced by GENERIC_COMMAND(), and GENERIC_COMMAND().

◆ EIGHT_VARS_TO_VARARGS_VARLIST

#define EIGHT_VARS_TO_VARARGS_VARLIST
Value:
VARITEM(1, 0, s1) \
VARITEM(2, 0, XPD(s1, s2)) \
VARITEM(3, 0, XPD(s1, s2, s3)) \
VARITEM(4, 0, XPD(s1, s2, s3, s4)) \
VARITEM(0, 1, f1) \
VARITEM(1, 1, XPD(s1, f1)) \
VARITEM(2, 1, XPD(s1, s2, f1)) \
VARITEM(3, 1, XPD(s1, s2, s3, f1)) \
VARITEM(4, 1, XPD(s1, s2, s3, s4, f1)) \
VARITEM(0, 2, XPD(f1, f2)) \
VARITEM(1, 2, XPD(s1, f1, f2)) \
VARITEM(2, 2, XPD(s1, s2, f1, f2)) \
VARITEM(3, 2, XPD(s1, s2, s3, f1, f2)) \
VARITEM(4, 2, XPD(s1, s2, s3, s4, f1, f2)) \
VARITEM(0, 3, XPD(f1, f2, f3)) \
VARITEM(1, 3, XPD(s1, f1, f2, f3)) \
VARITEM(2, 3, XPD(s1, s2, f1, f2, f3)) \
VARITEM(3, 3, XPD(s1, s2, s3, f1, f2, f3)) \
VARITEM(4, 3, XPD(s1, s2, s3, s4, f1, f2, f3)) \
VARITEM(0, 4, XPD(f1, f2, f3, f4)) \
VARITEM(1, 4, XPD(s1, f1, f2, f3, f4)) \
VARITEM(2, 4, XPD(s1, s2, f1, f2, f3, f4)) \
VARITEM(3, 4, XPD(s1, s2, s3, f1, f2, f3, f4)) \
VARITEM(4, 4, XPD(s1, s2, s3, s4, f1, f2, f3, f4))
#define XPD(...)
Definition util.qh:228
spree_inf s1 s2 s3loc s2 spree_inf s1 s2 s3loc s2 spree_inf s1 s2 s3loc s2 s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2 f1points f2
Definition all.inc:364
spree_inf s1 s2 s3loc s2 s1
Definition all.inc:281
spree_inf s1 s2 s3loc s2 spree_inf s1 s2 s3loc s2 spree_inf s1 s2 s3loc s2 s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2loc s1 s2 f1points s1 s2
Definition all.inc:469
f1
Definition all.inc:561
#define VARITEM(stringc, floatc, args)

Definition at line 87 of file all.qh.

87#define EIGHT_VARS_TO_VARARGS_VARLIST \
88 VARITEM(1, 0, s1) \
89 VARITEM(2, 0, XPD(s1, s2)) \
90 VARITEM(3, 0, XPD(s1, s2, s3)) \
91 VARITEM(4, 0, XPD(s1, s2, s3, s4)) \
92 VARITEM(0, 1, f1) \
93 VARITEM(1, 1, XPD(s1, f1)) \
94 VARITEM(2, 1, XPD(s1, s2, f1)) \
95 VARITEM(3, 1, XPD(s1, s2, s3, f1)) \
96 VARITEM(4, 1, XPD(s1, s2, s3, s4, f1)) \
97 VARITEM(0, 2, XPD(f1, f2)) \
98 VARITEM(1, 2, XPD(s1, f1, f2)) \
99 VARITEM(2, 2, XPD(s1, s2, f1, f2)) \
100 VARITEM(3, 2, XPD(s1, s2, s3, f1, f2)) \
101 VARITEM(4, 2, XPD(s1, s2, s3, s4, f1, f2)) \
102 VARITEM(0, 3, XPD(f1, f2, f3)) \
103 VARITEM(1, 3, XPD(s1, f1, f2, f3)) \
104 VARITEM(2, 3, XPD(s1, s2, f1, f2, f3)) \
105 VARITEM(3, 3, XPD(s1, s2, s3, f1, f2, f3)) \
106 VARITEM(4, 3, XPD(s1, s2, s3, s4, f1, f2, f3)) \
107 VARITEM(0, 4, XPD(f1, f2, f3, f4)) \
108 VARITEM(1, 4, XPD(s1, f1, f2, f3, f4)) \
109 VARITEM(2, 4, XPD(s1, s2, f1, f2, f3, f4)) \
110 VARITEM(3, 4, XPD(s1, s2, s3, f1, f2, f3, f4)) \
111 VARITEM(4, 4, XPD(s1, s2, s3, s4, f1, f2, f3, f4))

Referenced by Local_Notification_WOVA(), Send_Notification_WOCOVA(), and Send_Notification_WOVA().

◆ HASH_REPLACE

#define HASH_REPLACE ( full_msg,
num,
attacker_name )
Value:
hash_replace(input, num, s##num, attacker_name)
string hash_replace(string full_msg, int ent_msg_num, string ent_msg, string attacker_name)
Definition all.qh:404

Definition at line 419 of file all.qh.

◆ KILL_SPREE_LIST

#define KILL_SPREE_LIST
Value:
SPREE_ITEM(3, 03, _("TRIPLE FRAG!"), _("%s^K1 made a TRIPLE FRAG!"), _("%s^K1 made a TRIPLE SCORE!")) \
SPREE_ITEM(5, 05, _("RAGE!"), _("%s^K1 unlocked RAGE!"), _("%s^K1 made FIVE SCORES IN A ROW!")) \
SPREE_ITEM(10, 10, _("MASSACRE!"), _("%s^K1 started a MASSACRE!"), _("%s^K1 made TEN SCORES IN A ROW!")) \
SPREE_ITEM(15, 15, _("MAYHEM!"), _("%s^K1 executed MAYHEM!"), _("%s^K1 made FIFTEEN SCORES IN A ROW!")) \
SPREE_ITEM(20, 20, _("BERSERKER!"), _("%s^K1 is a BERSERKER!"), _("%s^K1 made TWENTY SCORES IN A ROW!")) \
SPREE_ITEM(25, 25, _("CARNAGE!"), _("%s^K1 inflicts CARNAGE!"), _("%s^K1 made TWENTY FIVE SCORES IN A ROW!")) \
SPREE_ITEM(30, 30, _("ARMAGEDDON!"), _("%s^K1 unleashes ARMAGEDDON!"), _("%s^K1 made THIRTY SCORES IN A ROW!"))
#define SPREE_ITEM(counta, countb, center, normal, gentle)

Definition at line 491 of file all.qh.

491#define KILL_SPREE_LIST \
492 SPREE_ITEM(3, 03, _("TRIPLE FRAG!"), _("%s^K1 made a TRIPLE FRAG!"), _("%s^K1 made a TRIPLE SCORE!")) \
493 SPREE_ITEM(5, 05, _("RAGE!"), _("%s^K1 unlocked RAGE!"), _("%s^K1 made FIVE SCORES IN A ROW!")) \
494 SPREE_ITEM(10, 10, _("MASSACRE!"), _("%s^K1 started a MASSACRE!"), _("%s^K1 made TEN SCORES IN A ROW!")) \
495 SPREE_ITEM(15, 15, _("MAYHEM!"), _("%s^K1 executed MAYHEM!"), _("%s^K1 made FIFTEEN SCORES IN A ROW!")) \
496 SPREE_ITEM(20, 20, _("BERSERKER!"), _("%s^K1 is a BERSERKER!"), _("%s^K1 made TWENTY SCORES IN A ROW!")) \
497 SPREE_ITEM(25, 25, _("CARNAGE!"), _("%s^K1 inflicts CARNAGE!"), _("%s^K1 made TWENTY FIVE SCORES IN A ROW!")) \
498 SPREE_ITEM(30, 30, _("ARMAGEDDON!"), _("%s^K1 unleashes ARMAGEDDON!"), _("%s^K1 made THIRTY SCORES IN A ROW!"))

Referenced by MUTATOR_HOOKFUNCTION(), notif_arg_spree_cen(), notif_arg_spree_inf(), and Obituary().

◆ MSG_ANNCE_NOTIF

#define MSG_ANNCE_NOTIF ( name,
defaultvalue,
sound,
channel,
volume,
position,
queuetime )
Value:
NOTIF_ADD_AUTOCVAR(ANNCE_##name, defaultvalue) \
MSG_ANNCE_NOTIF_(0, ANNCE_##name, ANNCE_##name, defaultvalue, sound, channel, volume, position, queuetime)
#define NOTIF_ADD_AUTOCVAR(name, defaultvalue)
Definition all.qh:302
#define sound(e, c, s, v, a)
Definition sound.qh:52
float volume
Definition triggers.qh:47

Definition at line 773 of file all.qh.

773#define MSG_ANNCE_NOTIF(name, defaultvalue, sound, channel, volume, position, queuetime) \
774 NOTIF_ADD_AUTOCVAR(ANNCE_##name, defaultvalue) \
775 MSG_ANNCE_NOTIF_(0, ANNCE_##name, ANNCE_##name, defaultvalue, sound, channel, volume, position, queuetime)

◆ MSG_ANNCE_NOTIF_

#define MSG_ANNCE_NOTIF_ ( teamnum,
name,
cvarname,
defaultvalue,
sound,
channel,
volume,
position,
queuetime )
Value:
REGISTER(Notifications, name, m_id, new_pure(msg_annce_notification)) { \
Create_Notification_Entity (this, defaultvalue, ACVNN(cvarname), MSG_ANNCE, strtoupper(#name), teamnum); \
Create_Notification_Entity_Annce(this, ACVNN(cvarname), strtoupper(#name), \
channel, /* channel */ \
sound, /* snd */ \
volume, /* vol */ \
position, /* position */ \
queuetime); /* queuetime */ \
}
int m_id
Definition effect.qh:19
#define ACVNN(name)
Definition all.qh:722
#define new_pure(class)
purely logical entities (not linked to the area grid)
Definition oo.qh:67
#define REGISTER(...)
Register a new entity with a registry.
Definition registry.qh:87

Definition at line 777 of file all.qh.

777#define MSG_ANNCE_NOTIF_(teamnum, name, cvarname, defaultvalue, sound, channel, volume, position, queuetime) \
778 REGISTER(Notifications, name, m_id, new_pure(msg_annce_notification)) { \
779 Create_Notification_Entity (this, defaultvalue, ACVNN(cvarname), MSG_ANNCE, strtoupper(#name), teamnum); \
780 Create_Notification_Entity_Annce(this, ACVNN(cvarname), strtoupper(#name), \
781 channel, /* channel */ \
782 sound, /* snd */ \
783 volume, /* vol */ \
784 position, /* position */ \
785 queuetime); /* queuetime */ \
786 }

◆ MSG_ANNCE_NOTIF_TEAM

#define MSG_ANNCE_NOTIF_TEAM ( teamnum,
name,
cvarname,
defaultvalue,
sound,
channel,
volume,
position,
queuetime )
Value:
MSG_ANNCE_NOTIF_(teamnum, ANNCE_##name, ANNCE_##cvarname, defaultvalue, sound, channel, volume, position, queuetime)
#define MSG_ANNCE_NOTIF_(teamnum, name, cvarname, defaultvalue, sound, channel, volume, position, queuetime)
Definition all.qh:777

Definition at line 770 of file all.qh.

770#define MSG_ANNCE_NOTIF_TEAM(teamnum, name, cvarname, defaultvalue, sound, channel, volume, position, queuetime) \
771 MSG_ANNCE_NOTIF_(teamnum, ANNCE_##name, ANNCE_##cvarname, defaultvalue, sound, channel, volume, position, queuetime)

◆ MSG_CENTER_NOTIF

#define MSG_CENTER_NOTIF ( name,
defaultvalue,
strnum,
flnum,
args,
cpid,
durcnt,
normal,
gentle )
Value:
NOTIF_ADD_AUTOCVAR(CENTER_##name, defaultvalue) \
MSG_CENTER_NOTIF_(0, CENTER_##name, CENTER_##name, defaultvalue, strnum, flnum, args, cpid, durcnt, normal, gentle)

Definition at line 829 of file all.qh.

829#define MSG_CENTER_NOTIF(name, defaultvalue, strnum, flnum, args, cpid, durcnt, normal, gentle) \
830 NOTIF_ADD_AUTOCVAR(CENTER_##name, defaultvalue) \
831 MSG_CENTER_NOTIF_(0, CENTER_##name, CENTER_##name, defaultvalue, strnum, flnum, args, cpid, durcnt, normal, gentle)

Referenced by BOLD(), BOLD(), BOLD(), BOLD(), BOLD(), BOLD(), BOLD(), BOLD(), BOLD(), BOLD(), BOLD(), BOLD(), BOLD(), BOLD(), BOLD(), BOLD(), BOLD(), BOLD(), BOLD(), BOLD(), BOLD(), BOLD(), BOLD(), BOLD(), BOLD(), BOLD(), BOLD(), BOLD(), BOLD(), BOLD(), MSG_CENTER_NOTIF(), MSG_CENTER_NOTIF(), MSG_CENTER_NOTIF(), MSG_CENTER_NOTIF(), MSG_CENTER_NOTIF(), MSG_CENTER_NOTIF(), MSG_CENTER_NOTIF(), MSG_CENTER_NOTIF(), MSG_CENTER_NOTIF(), MSG_CENTER_NOTIF(), MSG_CENTER_NOTIF(), MSG_CENTER_NOTIF(), MSG_CENTER_NOTIF(), MSG_CENTER_NOTIF(), MSG_CENTER_NOTIF(), MSG_CENTER_NOTIF(), MSG_CENTER_NOTIF(), MSG_CENTER_NOTIF(), MSG_CENTER_NOTIF(), MSG_CENTER_NOTIF(), MSG_CENTER_NOTIF(), MSG_CENTER_NOTIF(), MSG_CENTER_NOTIF(), MSG_CENTER_NOTIF(), MSG_CENTER_NOTIF(), MSG_CENTER_NOTIF(), strcat(), VERBOSE_MURDER(), VERBOSE_MURDER(), VERBOSE_MURDER(), VERBOSE_MURDER(), VERBOSE_MURDER(), and VERBOSE_MURDER().

◆ MSG_CENTER_NOTIF_

#define MSG_CENTER_NOTIF_ ( teamnum,
name,
cvarname,
defaultvalue,
strnum,
flnum,
args,
cpid,
durcnt,
normal,
gentle )
Value:
REGISTER(Notifications, name, m_id, new_pure(msg_center_notification)) { \
Create_Notification_Entity (this, defaultvalue, ACVNN(cvarname), MSG_CENTER, strtoupper(#name), teamnum); \
Create_Notification_Entity_InfoCenter(this, ACVNN(cvarname), strtoupper(#name), strnum, flnum, \
args, /* args */ \
"", /* hudargs */ \
"", /* icon */ \
cpid, /* cpid */ \
durcnt, /* durcnt */ \
normal, /* normal */ \
gentle); /* gentle */ \
}

Definition at line 833 of file all.qh.

833#define MSG_CENTER_NOTIF_(teamnum, name, cvarname, defaultvalue, strnum, flnum, args, cpid, durcnt, normal, gentle) \
834 REGISTER(Notifications, name, m_id, new_pure(msg_center_notification)) { \
835 Create_Notification_Entity (this, defaultvalue, ACVNN(cvarname), MSG_CENTER, strtoupper(#name), teamnum); \
836 Create_Notification_Entity_InfoCenter(this, ACVNN(cvarname), strtoupper(#name), strnum, flnum, \
837 args, /* args */ \
838 "", /* hudargs */ \
839 "", /* icon */ \
840 cpid, /* cpid */ \
841 durcnt, /* durcnt */ \
842 normal, /* normal */ \
843 gentle); /* gentle */ \
844 }

◆ MSG_CENTER_NOTIF_TEAM

#define MSG_CENTER_NOTIF_TEAM ( teamnum,
name,
cvarname,
defaultvalue,
strnum,
flnum,
args,
cpid,
durcnt,
normal,
gentle )
Value:
MSG_CENTER_NOTIF_(teamnum, CENTER_##name, CENTER_##cvarname, defaultvalue, strnum, flnum, args, cpid, durcnt, normal, gentle)
#define MSG_CENTER_NOTIF_(teamnum, name, cvarname, defaultvalue, strnum, flnum, args, cpid, durcnt, normal, gentle)
Definition all.qh:833

Definition at line 826 of file all.qh.

826#define MSG_CENTER_NOTIF_TEAM(teamnum, name, cvarname, defaultvalue, strnum, flnum, args, cpid, durcnt, normal, gentle) \
827 MSG_CENTER_NOTIF_(teamnum, CENTER_##name, CENTER_##cvarname, defaultvalue, strnum, flnum, args, cpid, durcnt, normal, gentle)

◆ MSG_CHOICE_NOTIF

#define MSG_CHOICE_NOTIF ( name,
defaultvalue,
challow,
chtype,
optiona,
optionb )
Value:
NOTIF_ADD_AUTOCVAR(CHOICE_##name, defaultvalue) \
NOTIF_ADD_AUTOCVAR(CHOICE_##name##_ALLOWED, challow) \
MSG_CHOICE_NOTIF_(0, CHOICE_##name, CHOICE_##name, defaultvalue, challow, chtype, optiona, optionb)

Definition at line 859 of file all.qh.

859#define MSG_CHOICE_NOTIF(name, defaultvalue, challow, chtype, optiona, optionb) \
860 NOTIF_ADD_AUTOCVAR(CHOICE_##name, defaultvalue) \
861 NOTIF_ADD_AUTOCVAR(CHOICE_##name##_ALLOWED, challow) \
862 MSG_CHOICE_NOTIF_(0, CHOICE_##name, CHOICE_##name, defaultvalue, challow, chtype, optiona, optionb)

◆ MSG_CHOICE_NOTIF_

#define MSG_CHOICE_NOTIF_ ( teamnum,
name,
cvarname,
defaultvalue,
challow,
chtype,
optiona,
optionb )
Value:
REGISTER(Notifications, name, m_id, new_pure(msg_choice_notification)) { \
if (!teamnum || teamnum == NUM_TEAM_4) \
Create_Notification_Entity (this, defaultvalue, ACVNN(cvarname), MSG_CHOICE, strtoupper(#name), teamnum); \
Create_Notification_Entity_Choice(this, ACVNN(cvarname), strtoupper(#name), \
challow, /* challow_def */ \
autocvar_notification_##cvarname##_ALLOWED, /* challow_var */ \
chtype, /* chtype */ \
optiona, /* optiona */ \
optionb); /* optionb */ \
}
int nent_choice_idx
Definition all.qh:736
int nent_choice_count
Definition all.qh:735
const int NUM_TEAM_4
Definition teams.qh:16

Definition at line 864 of file all.qh.

864#define MSG_CHOICE_NOTIF_(teamnum, name, cvarname, defaultvalue, challow, chtype, optiona, optionb) \
865 REGISTER(Notifications, name, m_id, new_pure(msg_choice_notification)) { \
866 this.nent_choice_idx = nent_choice_count; \
867 if (!teamnum || teamnum == NUM_TEAM_4) \
868 nent_choice_count++; \
869 Create_Notification_Entity (this, defaultvalue, ACVNN(cvarname), MSG_CHOICE, strtoupper(#name), teamnum); \
870 Create_Notification_Entity_Choice(this, ACVNN(cvarname), strtoupper(#name), \
871 challow, /* challow_def */ \
872 autocvar_notification_##cvarname##_ALLOWED, /* challow_var */ \
873 chtype, /* chtype */ \
874 optiona, /* optiona */ \
875 optionb); /* optionb */ \
876 }

◆ MSG_CHOICE_NOTIF_TEAM

#define MSG_CHOICE_NOTIF_TEAM ( teamnum,
name,
cvarname,
defaultvalue,
challow,
chtype,
optiona,
optionb )
Value:
MSG_CHOICE_NOTIF_(teamnum, CHOICE_##name, CHOICE_##cvarname, defaultvalue, challow, chtype, optiona, optionb)
#define MSG_CHOICE_NOTIF_(teamnum, name, cvarname, defaultvalue, challow, chtype, optiona, optionb)
Definition all.qh:864

Definition at line 856 of file all.qh.

856#define MSG_CHOICE_NOTIF_TEAM(teamnum, name, cvarname, defaultvalue, challow, chtype, optiona, optionb) \
857 MSG_CHOICE_NOTIF_(teamnum, CHOICE_##name, CHOICE_##cvarname, defaultvalue, challow, chtype, optiona, optionb)

◆ MSG_INFO_NOTIF

#define MSG_INFO_NOTIF ( name,
defaultvalue,
strnum,
flnum,
args,
hudargs,
icon,
normal,
gentle )
Value:
NOTIF_ADD_AUTOCVAR(INFO_##name, defaultvalue) \
MSG_INFO_NOTIF_(0, INFO_##name, INFO_##name, defaultvalue, strnum, flnum, args, hudargs, icon, normal, gentle)

Definition at line 791 of file all.qh.

791#define MSG_INFO_NOTIF(name, defaultvalue, strnum, flnum, args, hudargs, icon, normal, gentle) \
792 NOTIF_ADD_AUTOCVAR(INFO_##name, defaultvalue) \
793 MSG_INFO_NOTIF_(0, INFO_##name, INFO_##name, defaultvalue, strnum, flnum, args, hudargs, icon, normal, gentle)

Referenced by MSG_INFO_NOTIF(), MSG_INFO_NOTIF(), and MULTIICON_INFO().

◆ MSG_INFO_NOTIF_

#define MSG_INFO_NOTIF_ ( teamnum,
name,
cvarname,
defaultvalue,
strnum,
flnum,
args,
hudargs,
icon,
normal,
gentle )
Value:
REGISTER(Notifications, name, m_id, new_pure(msg_info_notification)) { \
Create_Notification_Entity (this, defaultvalue, ACVNN(cvarname), MSG_INFO, strtoupper(#name), teamnum); \
Create_Notification_Entity_InfoCenter(this, ACVNN(cvarname), strtoupper(#name), strnum, flnum, \
args, /* args */ \
hudargs, /* hudargs */ \
icon, /* icon */ \
CPID_Null,/* cpid */ \
"", /* durcnt */ \
normal, /* normal */ \
gentle); /* gentle */ \
}
s1 s2 s1 s2 FLAG s1 s2 FLAG spree_cen s1 CPID_Null
Definition all.inc:617

Definition at line 795 of file all.qh.

795#define MSG_INFO_NOTIF_(teamnum, name, cvarname, defaultvalue, strnum, flnum, args, hudargs, icon, normal, gentle) \
796 REGISTER(Notifications, name, m_id, new_pure(msg_info_notification)) { \
797 Create_Notification_Entity (this, defaultvalue, ACVNN(cvarname), MSG_INFO, strtoupper(#name), teamnum); \
798 Create_Notification_Entity_InfoCenter(this, ACVNN(cvarname), strtoupper(#name), strnum, flnum, \
799 args, /* args */ \
800 hudargs, /* hudargs */ \
801 icon, /* icon */ \
802 CPID_Null,/* cpid */ \
803 "", /* durcnt */ \
804 normal, /* normal */ \
805 gentle); /* gentle */ \
806 }

◆ MSG_INFO_NOTIF_TEAM

#define MSG_INFO_NOTIF_TEAM ( teamnum,
name,
cvarname,
defaultvalue,
strnum,
flnum,
args,
hudargs,
icon,
normal,
gentle )
Value:
MSG_INFO_NOTIF_(teamnum, INFO_##name, INFO_##cvarname, defaultvalue, strnum, flnum, args, hudargs, icon, normal, gentle)
#define MSG_INFO_NOTIF_(teamnum, name, cvarname, defaultvalue, strnum, flnum, args, hudargs, icon, normal, gentle)
Definition all.qh:795

Definition at line 788 of file all.qh.

788#define MSG_INFO_NOTIF_TEAM(teamnum, name, cvarname, defaultvalue, strnum, flnum, args, hudargs, icon, normal, gentle) \
789 MSG_INFO_NOTIF_(teamnum, INFO_##name, INFO_##cvarname, defaultvalue, strnum, flnum, args, hudargs, icon, normal, gentle)

◆ MSG_MULTI_NOTIF

#define MSG_MULTI_NOTIF ( name,
defaultvalue,
anncename,
infoname,
centername )
Value:
NOTIF_ADD_AUTOCVAR(name, defaultvalue) \
REGISTER(Notifications, name, m_id, new_pure(msg_multi_notification)) { \
Create_Notification_Entity (this, defaultvalue, ACVNN(name), MSG_MULTI, strtoupper(#name), 0); \
Create_Notification_Entity_Multi(this, ACVNN(name), strtoupper(#name), \
anncename, /* anncename */ \
infoname, /* infoname */ \
centername); /* centername */ \
}

Definition at line 846 of file all.qh.

846#define MSG_MULTI_NOTIF(name, defaultvalue, anncename, infoname, centername) \
847 NOTIF_ADD_AUTOCVAR(name, defaultvalue) \
848 REGISTER(Notifications, name, m_id, new_pure(msg_multi_notification)) { \
849 Create_Notification_Entity (this, defaultvalue, ACVNN(name), MSG_MULTI, strtoupper(#name), 0); \
850 Create_Notification_Entity_Multi(this, ACVNN(name), strtoupper(#name), \
851 anncename, /* anncename */ \
852 infoname, /* infoname */ \
853 centername); /* centername */ \
854 }

◆ MULTIICON_INFO

#define MULTIICON_INFO ( name,
defaultvalue,
strnum,
flnum,
args,
hudargs,
iconargs,
icon,
normal,
gentle )
Value:
MULTIICON_INFO_(INFO_##name, defaultvalue, strnum, flnum, args, hudargs, iconargs, icon, normal, gentle)
#define MULTIICON_INFO_(name, defaultvalue, strnum, flnum, args, hudargs, iconargs, icon, normal, gentle)
Definition all.qh:811

Definition at line 809 of file all.qh.

809#define MULTIICON_INFO(name, defaultvalue, strnum, flnum, args, hudargs, iconargs, icon, normal, gentle) \
810 MULTIICON_INFO_(INFO_##name, defaultvalue, strnum, flnum, args, hudargs, iconargs, icon, normal, gentle)

Referenced by MULTIICON_INFO().

◆ MULTIICON_INFO_

#define MULTIICON_INFO_ ( name,
defaultvalue,
strnum,
flnum,
args,
hudargs,
iconargs,
icon,
normal,
gentle )
Value:
NOTIF_ADD_AUTOCVAR(name, defaultvalue) \
REGISTER(Notifications, name, m_id, new_pure(msg_info_notification)) { \
Create_Notification_Entity (this, defaultvalue, ACVNN(name), MSG_INFO, strtoupper(#name), 0); \
Create_Notification_Entity_InfoCenter(this, ACVNN(name), strtoupper(#name), strnum, flnum, \
args, /* args */ \
hudargs, /* hudargs */ \
icon, /* icon */ \
CPID_Null,/* cpid */ \
"", /* durcnt */ \
normal, /* normal */ \
gentle); /* gentle */ \
this.nent_iconargs = iconargs; \
}
string nent_iconargs
Definition all.qh:808

Definition at line 811 of file all.qh.

811#define MULTIICON_INFO_(name, defaultvalue, strnum, flnum, args, hudargs, iconargs, icon, normal, gentle) \
812 NOTIF_ADD_AUTOCVAR(name, defaultvalue) \
813 REGISTER(Notifications, name, m_id, new_pure(msg_info_notification)) { \
814 Create_Notification_Entity (this, defaultvalue, ACVNN(name), MSG_INFO, strtoupper(#name), 0); \
815 Create_Notification_Entity_InfoCenter(this, ACVNN(name), strtoupper(#name), strnum, flnum, \
816 args, /* args */ \
817 hudargs, /* hudargs */ \
818 icon, /* icon */ \
819 CPID_Null,/* cpid */ \
820 "", /* durcnt */ \
821 normal, /* normal */ \
822 gentle); /* gentle */ \
823 this.nent_iconargs = iconargs; \
824 }

◆ NOTIF_ADD_AUTOCVAR

#define NOTIF_ADD_AUTOCVAR ( name,
defaultvalue )
Value:
float autocvar_notification_##name = defaultvalue;

Definition at line 302 of file all.qh.

◆ NOTIF_ARGUMENT_LIST

#define NOTIF_ARGUMENT_LIST

Definition at line 436 of file all.qh.

436#define NOTIF_ARGUMENT_LIST \
437 ARG_CASE(ARG_CS_SV_HA, "s1", s1) \
438 ARG_CASE(ARG_CS_SV_HA, "s2", s2) \
439 ARG_CASE(ARG_CS_SV_HA, "s3", s3) \
440 ARG_CASE(ARG_CS_SV_HA, "s4", s4) \
441 ARG_CASE(ARG_CS_SV, "s2loc", ((autocvar_notification_show_location && (s2 != "")) ? sprintf(( ((tmp_s = autocvar_notification_show_location_string) != "") ? tmp_s : _(" (near %s)") ), s2) : "")) \
442 ARG_CASE(ARG_CS_SV, "s3loc", ((autocvar_notification_show_location && (s3 != "")) ? sprintf(( ((tmp_s = autocvar_notification_show_location_string) != "") ? tmp_s : _(" (near %s)") ), s3) : "")) \
443 ARG_CASE(ARG_CS_SV, "s4loc", ((autocvar_notification_show_location && (s4 != "")) ? sprintf(( ((tmp_s = autocvar_notification_show_location_string) != "") ? tmp_s : _(" (near %s)") ), s4) : "")) \
444 ARG_CASE(ARG_CS_SV_DC, "f1", ftos(f1)) \
445 ARG_CASE(ARG_CS_SV_DC, "f2", ftos(f2)) \
446 ARG_CASE(ARG_CS_SV, "f3", ftos(f3)) \
447 ARG_CASE(ARG_CS_SV, "f4", ftos(f4)) \
448 ARG_CASE(ARG_CS_SV, "f1dtime", ftos_decimals(TIME_DECODE(f1), 2)) \
449 ARG_CASE(ARG_CS_SV, "f2dtime", ftos_decimals(TIME_DECODE(f2), 2)) \
450 ARG_CASE(ARG_CS, "f2primsec", (f2 ? _("secondary") : _("primary"))) \
451 ARG_CASE(ARG_CS, "f3primsec", (f3 ? _("secondary") : _("primary"))) \
452 ARG_CASE(ARG_CS, "f1secs", count_seconds(f1)) \
453 ARG_CASE(ARG_CS, "f1points", (f1 == 1 ? _("1 point") : sprintf(_("%d points"), f1))) \
454 ARG_CASE(ARG_CS_SV, "f1ord", count_ordinal(f1)) \
455 ARG_CASE(ARG_CS_SV, "f1time", process_time(2, f1)) \
456 ARG_CASE(ARG_CS_SV_HA, "f1race_time", TIME_ENCODED_TOSTRING(f1, true)) \
457 ARG_CASE(ARG_CS_SV_HA, "f2race_time", TIME_ENCODED_TOSTRING(f2, true)) \
458 ARG_CASE(ARG_CS_SV_HA, "f3race_time", TIME_ENCODED_TOSTRING(f3, true)) \
459 ARG_CASE(ARG_CS_SV, "race_col", CCR((f1 == 1) ? "^F1" : "^F2")) \
460 ARG_CASE(ARG_CS_SV, "race_diff", ((TIME_ENCODED_TOSTRING(fabs(f2 - f3), true) == "0.00") ? "^3[+0.0]" : (f2 > f3) ? sprintf("^1[+%s]", TIME_ENCODED_TOSTRING(f2 - f3, true)) : sprintf("^2[-%s]", TIME_ENCODED_TOSTRING(f3 - f2, true)))) \
461 ARG_CASE(ARG_CS, "pass_key", getcommandkey(_("drop flag"), "+use")) \
462 ARG_CASE(ARG_CS, "nade_key", getcommandkey(_("throw nade"), "dropweapon")) \
463 ARG_CASE(ARG_CS, "join_key", getcommandkey(_("jump"), "+jump")) \
464 ARG_CASE(ARG_CS, "frag_ping", notif_arg_frag_ping(true, f2)) \
465 ARG_CASE(ARG_CS, "frag_stats", notif_arg_frag_stats(f2, f3, f4)) \
466 /*ARG_CASE(ARG_CS, "frag_pos", ((Should_Print_Score_Pos(f1)) ? sprintf("\n^BG%s", Read_Score_Pos(f1)) : ""))*/ \
467 ARG_CASE(ARG_CS, "spree_cen", (autocvar_notification_show_sprees ? notif_arg_spree_cen(f1) : "")) \
468 ARG_CASE(ARG_CS_SV, "spree_inf", (autocvar_notification_show_sprees ? notif_arg_spree_inf(1, input, s2, f2) : "")) \
469 ARG_CASE(ARG_CS_SV, "spree_end", (autocvar_notification_show_sprees ? notif_arg_spree_inf(-1, "", "", f1) : "")) \
470 ARG_CASE(ARG_CS_SV, "spree_lost", (autocvar_notification_show_sprees ? notif_arg_spree_inf(-2, "", "", f1) : "")) \
471 ARG_CASE(ARG_CS_SV, "item_wepname", REGISTRY_GET(Weapons, f1).m_name) \
472 ARG_CASE(ARG_CS_SV, "item_buffname", BUFF_NAME(f1)) \
473 ARG_CASE(ARG_CS_SV, "f3buffname", BUFF_NAME(f3)) \
474 ARG_CASE(ARG_CS_SV, "item_wepammo", (f2 > 0 ? notif_arg_item_wepammo(f1, f2) : "")) \
475 ARG_CASE(ARG_DC, "item_centime", ftos(autocvar_notification_item_centerprinttime)) \
476 ARG_CASE(ARG_SV, "death_team", Team_ColoredFullName(f1)) \
477 ARG_CASE(ARG_CS, "death_team", Team_ColoredFullName(f1 - 1)) \
478 ARG_CASE(ARG_SV, "s3#s2", s3) \
479 ARG_CASE(ARG_SV, "#s2", s2) \
480 ARG_CASE(ARG_CS, "s3#s2", HASH_REPLACE(input, 3, s2)) \
481 ARG_CASE(ARG_CS, "#s2", "") \
482 ARG_CASE(ARG_CS_SV_HA, "minigame1_name",find(NULL,netname,s1).descriptor.message) \
483 ARG_CASE(ARG_CS_SV_HA, "minigame1_d", find(NULL,netname,s1).descriptor.netname)

Referenced by Local_Notification_centerprint_Add(), Local_Notification_HUD_Notify_Push(), Local_Notification_sprintf(), and Process_Notif_Args().

◆ NOTIF_HIT_MAX

#define NOTIF_HIT_MAX ( count,
funcname )
Value:
MACRO_BEGIN \
if(sel_num == count) { backtrace(sprintf("%s: Hit maximum arguments!\n", funcname)); break; } \
float count
Definition powerups.qc:22
#define backtrace(msg)
Definition log.qh:99
#define MACRO_END
Definition macro.qh:7

Definition at line 485 of file all.qh.

485#define NOTIF_HIT_MAX(count,funcname) MACRO_BEGIN \
486 if(sel_num == count) { backtrace(sprintf("%s: Hit maximum arguments!\n", funcname)); break; } \
487MACRO_END

Referenced by Local_Notification_centerprint_Add(), Local_Notification_HUD_Notify_Push(), and Local_Notification_sprintf().

◆ NOTIF_HIT_UNKNOWN

#define NOTIF_HIT_UNKNOWN ( token,
funcname )
Value:
{ backtrace(sprintf("%s: Hit unknown token in selected string! '%s'\n", funcname, selected)); break; }

Definition at line 489 of file all.qh.

Referenced by Local_Notification_centerprint_Add(), Local_Notification_HUD_Notify_Push(), and Local_Notification_sprintf().

◆ SPREE_ITEM [1/2]

#define SPREE_ITEM ( counta,
countb,
center,
normal,
gentle )
Value:
case counta: \
return strcat(normal_or_gentle(center, sprintf(_("%d score spree!"), spree)), " ");
#define normal_or_gentle(normal, gentle)
Definition util.qh:243
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))

◆ SPREE_ITEM [2/2]

#define SPREE_ITEM ( counta,
countb,
center,
normal,
gentle )
Value:
case counta: \
return sprintf(CCR(strcat(normal_or_gentle(normal, gentle), " %s^BG")), \
player, spree_newline);
string CCR(string input)
color code replace, place inside of sprintf and parse the string
Definition string.qh:216

Typedef Documentation

◆ Notification

always last

Definition at line 81 of file all.qh.

Function Documentation

◆ BUFF_NAME()

string BUFF_NAME ( int i)

Definition at line 3 of file buffs.qc.

4{
5 Buff b = REGISTRY_GET(StatusEffects, i);
7}
Definition buffs.qh:17
string m_name
Definition buffs.qh:23
vector m_color
Definition buffs.qh:22
ERASEABLE string rgb_to_hexcolor(vector rgb)
Definition color.qh:183
#define REGISTRY_GET(id, i)
Definition registry.qh:43

References Buff::m_color, Buff::m_name, REGISTRY_GET, rgb_to_hexcolor(), and strcat().

◆ Create_Notification_Entity()

void Create_Notification_Entity ( entity notif,
float var_default,
float var_cvar,
MSG typeId,
string namestring,
int teamnum )

Definition at line 396 of file all.qc.

402{
403 // =====================
404 // Global Entity Setup
405 // =====================
406 notif.nent_default = var_default;
407 notif.nent_enabled = (var_cvar >= 1);
408 notif.nent_type = typeId;
409 notif.nent_name = strzone(namestring);
410 notif.nent_teamnum = teamnum;
411
412 // Other pre-notif-setup requisites
413 notif_error = false;
414
415 switch (typeId)
416 {
417 case MSG_ANNCE:
418 case MSG_INFO:
419 case MSG_CENTER:
420 case MSG_MULTI:
421 case MSG_CHOICE:
422 break;
423 default:
424 LOG_INFOF(
425 (
426 "^1NOTIFICATION WITH IMPROPER TYPE: "
427 "^7net_type = %d, net_name = %s."
428 ),
429 typeId,
430 namestring
431 );
432 notif_error = true;
433 break;
434 }
435
436 // now check to see if any errors happened
437 if (notif_error)
438 {
439 notif.nent_enabled = false; // disable the notification so it can't cause trouble
440 notif_global_error = true; // throw the red flag that an error happened on init
441 }
442}
#define LOG_INFOF(...)
Definition log.qh:66
string strzone(string s)
bool notif_error
Definition all.qh:739
bool notif_global_error
Definition all.qh:740

References entity(), LOG_INFOF, notif_error, notif_global_error, and strzone().

◆ Create_Notification_Entity_Annce()

void Create_Notification_Entity_Annce ( entity notif,
float var_cvar,
string namestring,
float channel,
string snd,
float vol,
float position,
float queuetime )

Definition at line 446 of file all.qc.

455 {
456 // Set MSG_ANNCE information and handle precaching
457 #ifdef CSQC
458 MSG typeId = MSG_ANNCE;
459 if (!(GENTLE && (var_cvar == 1)))
460 {
461 if(snd != "")
462 {
463 if(notif.nent_enabled)
464 {
466 notif.nent_channel = channel;
467 notif.nent_snd = strzone(snd);
468 notif.nent_vol = vol;
469 notif.nent_position = position;
470 notif.nent_queuetime = queuetime;
471 }
472 }
473 else
474 {
475 string typestring = Get_Notif_TypeName(typeId);
476 LOG_INFOF(
477 (
478 "^1NOTIFICATION WITH NO SOUND: "
479 "^7net_type = %s, net_name = %s."
480 ),
481 typestring,
482 namestring
483 );
484 notif_error = true;
485 }
486 }
487 else { notif.nent_enabled = false; }
488 #else
489 notif.nent_enabled = false;
490 #endif
491
492 }
#define GENTLE
Definition util.qh:238
string precache_sound(string sample)
#define AnnouncerFilename(snd)
Definition all.qc:444
string Get_Notif_TypeName(MSG net_type)
main types/groups of notifications
Definition all.qh:30

References AnnouncerFilename, entity(), GENTLE, Get_Notif_TypeName(), LOG_INFOF, notif_error, precache_sound(), and strzone().

◆ Create_Notification_Entity_Choice()

void Create_Notification_Entity_Choice ( entity notif,
float var_cvar,
string namestring,
float challow_def,
float challow_var,
MSG chtype,
Notification optiona,
Notification optionb )

Definition at line 704 of file all.qc.

713 {
714 MSG typeId = MSG_CHOICE;
715 if (chtype == MSG_Null || !optiona || !optionb)
716 {
717 string typestring = Get_Notif_TypeName(typeId);
718 LOG_INFOF(
719 (
720 "^1NOTIFICATION IS MISSING CHOICE PARAMS: "
721 "^7net_type = %s, net_name = %s."
722 ),
723 typestring,
724 namestring
725 );
726 notif_error = true;
727 }
728 else
729 {
730 notif.nent_optiona = optiona;
731 notif.nent_optionb = optionb;
732 notif.nent_challow_def = challow_def; // 0: never allowed, 1: allowed in warmup, 2: always allowed
733 notif.nent_challow_var = challow_var; // 0: never allowed, 1: allowed in warmup, 2: always allowed
734 notif.nent_stringcount = max(notif.nent_optiona.nent_stringcount, notif.nent_optionb.nent_stringcount);
735 notif.nent_floatcount = max(notif.nent_optiona.nent_floatcount, notif.nent_optionb.nent_floatcount);
736
737 /*#ifdef NOTIFICATIONS_DEBUG
738 Debug_Notification(sprintf(
739 "Create_Notification_Entity(...): MSG_CHOICE: %s\n%s\n%s\n",
740 notif.nent_name,
741 sprintf(
742 "^ optiona: %s %s : %d %d",
743 Get_Notif_TypeName(notif.nent_optiona.nent_type),
744 notif.nent_optiona.nent_name,
745 notif.nent_optiona.nent_stringcount,
746 notif.nent_optiona.nent_floatcount
747 ),
748 sprintf(
749 "^ optionb: %s %s : %d %d",
750 Get_Notif_TypeName(notif.nent_optionb.nent_type),
751 notif.nent_optionb.nent_name,
752 notif.nent_optionb.nent_stringcount,
753 notif.nent_optionb.nent_floatcount
754 )
755 ));
756 #endif*/
757 }
758 }
float max(float f,...)

References entity(), Get_Notif_TypeName(), LOG_INFOF, max(), and notif_error.

◆ Create_Notification_Entity_InfoCenter()

void Create_Notification_Entity_InfoCenter ( entity notif,
float var_cvar,
string namestring,
int strnum,
int flnum,
string args,
string hudargs,
string icon,
CPID cpid,
string durcnt,
string normal,
string gentle )

Definition at line 494 of file all.qc.

507 {
508 MSG typeId = notif.nent_type;
509 // Set MSG_INFO and MSG_CENTER string/float counts
510 notif.nent_stringcount = strnum;
511 notif.nent_floatcount = flnum;
512
513 // Only initialize arguments if we're either a client or on a dedicated server
514 #ifdef SVQC
515 float should_process_args = autocvar_sv_dedicated;
516 #else
517 float should_process_args = true;
518 #endif
519 string typestring = Get_Notif_TypeName(typeId);
520 if(should_process_args)
521 {
522 // ========================
523 // Process Main Arguments
524 // ========================
525 if(strnum + flnum)
526 {
527 if(args != "")
528 {
529 notif.nent_args = strzone(
530 Process_Notif_Args(1, args, typestring, namestring));
531 }
532 else if((hudargs == "") && (durcnt ==""))
533 {
534 LOG_INFOF(
535 (
536 "^1NOTIFICATION HAS ARG COUNTS BUT NO ARGS OR HUDARGS OR DURCNT: "
537 "^7net_type = %s, net_name = %s, strnum = %d, flnum = %d"
538 ),
539 typestring,
540 namestring,
541 strnum,
542 flnum
543 );
544 notif_error = true;
545 }
546 }
547 else if(args != "")
548 {
549 notif.nent_args = strzone(
550 Process_Notif_Args(1, args, typestring, namestring));
551 }
552
553
554 // =======================================
555 // Process HUD and Centerprint Arguments
556 // Only processed on CSQC, as these
557 // args are only for HUD features.
558 // =======================================
559 #ifdef CSQC
560 if(hudargs != "")
561 {
562 notif.nent_hudargs = strzone(
563 Process_Notif_Args(2, hudargs, typestring, namestring));
564
565 if(icon != "") { notif.nent_icon = strzone(icon); }
566 else
567 {
568 LOG_INFOF(
569 (
570 "^1NOTIFICATION HAS HUDARGS BUT NO ICON: "
571 "^7net_type = %s, net_name = %s."
572 ),
573 typestring,
574 namestring
575 );
576 notif_error = true;
577 }
578 }
579 else if(icon != "")
580 {
581 LOG_WARNF(
582 (
583 "^1NOTIFICATION HAS ICON BUT NO HUDARGS: "
584 "^7net_type = %s, net_name = %s.\n"
585 ),
586 typestring,
587 namestring
588 );
589 notif_error = true;
590 }
591
592 if (durcnt != "")
593 {
594 notif.nent_durcnt = strzone(Process_Notif_Args(3, durcnt, typestring, namestring));
595
596 if (cpid == CPID_Null && durcnt != "0 0")
597 {
598 LOG_WARNF(
599 (
600 "Notification has durcnt but no cpid: "
601 "net_type = %s, net_name = %s."
602 ),
603 typestring,
604 namestring
605 );
606 notif_error = true;
607 }
608 }
609 notif.nent_cpid = cpid;
610 #endif
611
612
613 // ======================
614 // Process Notif String
615 // ======================
616 #define SET_NOTIF_STRING(string,stringname) MACRO_BEGIN \
617 notif.nent_string = strzone(CCR( \
618 Process_Notif_Line( \
619 typeId, \
620 (var_cvar > 1), \
621 string, \
622 typestring, \
623 namestring, \
624 stringname \
625 )) \
626 ); \
627 MACRO_END
628
629 if(GENTLE)
630 {
631 if(gentle != "") { SET_NOTIF_STRING(gentle, "GENTLE"); }
632 else if(normal != "") { SET_NOTIF_STRING(normal, "NORMAL"); }
633 }
634 else if(normal != "") { SET_NOTIF_STRING(normal, "NORMAL"); }
635 #undef SET_NOTIF_STRING
636
637 // Check to make sure a string was chosen
638 if(notif.nent_string == "")
639 {
640 LOG_INFOF(
641 (
642 "^1EMPTY NOTIFICATION: "
643 "^7net_type = %s, net_name = %s."
644 ),
645 typestring,
646 namestring
647 );
648 notif_error = true;
649 }
650 }
651 }
#define LOG_WARNF(...)
Definition log.qh:62
#define SET_NOTIF_STRING(string, stringname)
string Process_Notif_Args(float arg_type, string args, string notiftype, string notifname)
Definition all.qc:219
bool autocvar_sv_dedicated
Definition world.qh:41

References autocvar_sv_dedicated, CPID_Null, entity(), GENTLE, Get_Notif_TypeName(), LOG_INFOF, LOG_WARNF, notif_error, Process_Notif_Args(), SET_NOTIF_STRING, and strzone().

◆ Create_Notification_Entity_Multi()

void Create_Notification_Entity_Multi ( entity notif,
float var_cvar,
string namestring,
Notification anncename,
Notification infoname,
Notification centername )

Definition at line 653 of file all.qc.

660 {
661 MSG typeId = MSG_MULTI;
662 // Set MSG_MULTI string/float counts
663 if (!anncename && !infoname && !centername)
664 {
665 string typestring = Get_Notif_TypeName(typeId);
666 LOG_INFOF(
667 (
668 "^1NOTIFICATION WITH NO SUBCALLS: "
669 "^7net_type = %s, net_name = %s."
670 ),
671 typestring,
672 namestring
673 );
674 notif_error = true;
675 }
676 else
677 {
678 // announcements don't actually need any arguments, so lets not even count them.
679 if (anncename) { notif.nent_msgannce = anncename; }
680
681 float infoname_stringcount = 0, infoname_floatcount = 0;
682 float centername_stringcount = 0, centername_floatcount = 0;
683
684 if (infoname)
685 {
686 notif.nent_msginfo = infoname;
687 infoname_stringcount = notif.nent_msginfo.nent_stringcount;
688 infoname_floatcount = notif.nent_msginfo.nent_floatcount;
689 }
690
691 if (centername)
692 {
693 notif.nent_msgcenter = centername;
694 centername_stringcount = notif.nent_msgcenter.nent_stringcount;
695 centername_floatcount = notif.nent_msgcenter.nent_floatcount;
696 }
697
698 // set the requirements of THIS notification to the totals of its subcalls
699 notif.nent_stringcount = max(infoname_stringcount, centername_stringcount);
700 notif.nent_floatcount = max(infoname_floatcount, centername_floatcount);
701 }
702 }

References entity(), Get_Notif_TypeName(), LOG_INFOF, max(), and notif_error.

◆ Destroy_All_Notifications()

void Destroy_All_Notifications ( )

Definition at line 159 of file all.qc.

160{
161 // kill all networked notifications and centerprints
162 #ifdef SVQC
163 Kill_Notification(NOTIF_ALL, NULL, MSG_Null, CPID_Null);
164 #else
166 #endif
167
168 // kill all real notification entities
169 FOREACH(Notifications, true, { Destroy_Notification_Entity(it); });
170}
void centerprint_KillAll()
#define FOREACH(list, cond, body)
Definition iter.qh:19
void Kill_Notification(NOTIF broadcast, entity client, MSG net_type, CPID net_cpid)
Definition all.qc:1537
void Destroy_Notification_Entity(entity notif)
Definition all.qc:147
#define NULL
Definition post.qh:14

References centerprint_KillAll(), CPID_Null, Destroy_Notification_Entity(), FOREACH, Kill_Notification(), and NULL.

Referenced by GenericCommand_restartnotifs().

◆ Dump_Notifications()

void Dump_Notifications ( int fh,
bool alsoprint )

used to output notifications.cfg file

Definition at line 783 of file all.qc.

784{
785 #define NOTIF_WRITE(str) write_String_To_File(fh, str, alsoprint)
786
787 #define NOTIF_WRITE_ENTITY(e, description) \
788 NOTIF_WRITE(sprintf( \
789 "seta notification_%s \"%d\" \"%s\"\n", \
790 Get_Notif_CvarName(e), e.nent_default, description \
791 ))
792
793 #define NOTIF_WRITE_ENTITY_CHOICE(e, descriptiona, descriptionb) \
794 NOTIF_WRITE(sprintf( \
795 "seta notification_%s \"%d\" \"%s\"\n" \
796 "seta notification_%s_ALLOWED \"%d\" \"%s\"\n", \
797 Get_Notif_CvarName(e), e.nent_default, descriptiona, \
798 Get_Notif_CvarName(e), e.nent_challow_def, descriptionb \
799 ))
800
801 #define NOTIF_WRITE_HARDCODED(cvar, default, description) \
802 NOTIF_WRITE("seta notification_" cvar " \"" default "\" \"" description "\"\n")
803
804 // Note: This warning only applies to the notifications.cfg file that is output...
805 // You ARE supposed to manually edit this function to add i.e. hard coded
806 // notification variables for mutators or gametypes or such and then
807 // regenerate the notifications.cfg file from the new code.
808
810 "// ********************************************** //\n"
811 "// ** WARNING - DO NOT MANUALLY EDIT THIS FILE ** //\n"
812 "// ** ** //\n"
813 "// ** This file is automatically generated ** //\n"
814 "// ** by code with the command 'dumpnotifs'. ** //\n"
815 "// ** ** //\n"
816 "// ** If you add a new notification, please ** //\n"
817 "// ** regenerate this file with that command ** //\n"
818 "// ** making sure that the output matches ** //\n"
819 "// ** with the lists and defaults in code. ** //\n"
820 "// ** ** //\n"
821 "// ********************************************** //\n");
822
823 // These notifications will also append their string as a comment...
824 // This is not necessary, and does not matter if they vary between config versions,
825 // it is just a semi-helpful tool for those who want to manually change their user settings.
826
827 int NOTIF_ANNCE_COUNT = 0;
828 int NOTIF_INFO_COUNT = 0;
829 int NOTIF_CENTER_COUNT = 0;
830 int NOTIF_MULTI_COUNT = 0;
831 int NOTIF_CHOICE_COUNT = 0;
832 FOREACH(Notifications, true, {
833 switch (it.nent_type)
834 {
835 case MSG_ANNCE: ++NOTIF_ANNCE_COUNT; break;
836 case MSG_INFO: ++NOTIF_INFO_COUNT; break;
837 case MSG_CENTER: ++NOTIF_CENTER_COUNT; break;
838 case MSG_MULTI: ++NOTIF_MULTI_COUNT; break;
839 case MSG_CHOICE: ++NOTIF_CHOICE_COUNT; break;
840 }
841 });
842
843 NOTIF_WRITE(sprintf("\n// MSG_ANNCE notifications:\n"));
844 FOREACH(Notifications, it.nent_type == MSG_ANNCE && (!it.nent_teamnum || it.nent_teamnum == NUM_TEAM_1), {
845 NOTIF_WRITE_ENTITY(it,
846 "\\\"0\\\" = disabled, \\\"1\\\" = enabled if gentle mode is off, \\\"2\\\" = always enabled"
847 );
848 });
849
850 NOTIF_WRITE(sprintf("\n// MSG_INFO notifications:\n"));
851 FOREACH(Notifications, it.nent_type == MSG_INFO && (!it.nent_teamnum || it.nent_teamnum == NUM_TEAM_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)"
855 );
856 });
857
858 NOTIF_WRITE(sprintf("\n// MSG_CENTER notifications:\n"));
859 FOREACH(Notifications, it.nent_type == MSG_CENTER && (!it.nent_teamnum || it.nent_teamnum == NUM_TEAM_1), {
860 NOTIF_WRITE_ENTITY(it,
861 "\\\"0\\\" = off, \\\"1\\\" = centerprint"
862 );
863 });
864
865 NOTIF_WRITE(sprintf("\n// MSG_MULTI notifications:\n"));
866 FOREACH(Notifications, it.nent_type == MSG_MULTI && (!it.nent_teamnum || it.nent_teamnum == NUM_TEAM_1), {
867 NOTIF_WRITE_ENTITY(it,
868 "enable this multiple notification"
869 );
870 });
871
872 NOTIF_WRITE(sprintf("\n// MSG_CHOICE notifications:\n"));
873 FOREACH(Notifications, it.nent_type == MSG_CHOICE && (!it.nent_teamnum || it.nent_teamnum == NUM_TEAM_1), {
874 NOTIF_WRITE_ENTITY_CHOICE(it,
875 "choice for this notification; \\\"0\\\" = off, \\\"1\\\" = default message, \\\"2\\\" = verbose message",
876 "allow choice for this notification; \\\"0\\\" = off, \\\"1\\\" = only in warmup-stage, \\\"2\\\" = always"
877 );
878 });
879
880 // edit these to match whichever cvars are used for specific notification options
881 NOTIF_WRITE("\n// HARD CODED notification variables:\n");
882
884 "allow_chatboxprint", "1",
885 "allow INFO notifications to be printed to chat box; "
886 "\\\"0\\\" = do not allow, "
887 "\\\"1\\\" = allow only if allowed by individual notification_INFO* cvars, "
888 "\\\"2\\\" = force all INFO notifications to be printed to the chatbox"
889 );
890
892 "debug", "0",
893 "print extra debug information on all notification function calls "
894 "(REQUIRES: -DNOTIFICATIONS_DEBUG flag to be enabled on QCSRC compilation); "
895 "\\\"0\\\" = disabled, \\\"1\\\" = dprint, \\\"2\\\" = print"
896 );
897
899 "errors_are_fatal", "1",
900 "if a notification fails upon initialization, cause a Host_Error to stop the program"
901 );
902
904 "item_centerprinttime", "1.5",
905 "how long to show item information centerprint messages (like 'You got the Electro' or such)"
906 );
907
909 "lifetime_mapload", "10",
910 "amount of time that notification entities last immediately at mapload (in seconds) "
911 "to help prevent notifications from being lost on early init (like gamestart countdown)"
912 );
913
915 "lifetime_runtime", "0.5",
916 "amount of time that notification entities last on the server during runtime (in seconds)"
917 );
918
920 "server_allows_location", "1",
921 "server side cvar for allowing death messages to show location information too"
922 );
923
925 "show_location", "0",
926 "append location information to MSG_INFO death/kill messages"
927 );
928
930 "show_location_string", "",
931 "replacement string piped into sprintf, "
932 "so you can do different messages like ' at the %s' or ' (near %s)'"
933 );
934
936 "show_sprees", "1",
937 "print information about sprees in death/kill messages"
938 );
939
941 "show_sprees_center", "1",
942 "show spree information in MSG_CENTER messages; "
943 "\\\"0\\\" = off, \\\"1\\\" = target (but only for first victim) and attacker"
944 );
945
947 "show_sprees_center_specialonly", "1",
948 "do not show spree information in MSG_CENTER messages if it is not an achievement"
949 );
950
952 "show_sprees_info", "3",
953 "show spree information in MSG_INFO messages; "
954 "\\\"0\\\" = off, \\\"1\\\" = target only, \\\"2\\\" = attacker only, \\\"3\\\" = target and attacker"
955 );
956
958 "show_sprees_info_newline", "1",
959 "show attacker spree information for MSG_INFO messages on a separate line than the death notification itself"
960 );
961
963 "show_sprees_info_specialonly", "1",
964 "do not show attacker spree information in MSG_INFO messages if it is not an achievement"
965 );
966
967 LOG_INFOF("Notification counts (total = %d): "
968 "MSG_ANNCE = %d, MSG_INFO = %d, MSG_CENTER = %d, MSG_MULTI = %d, MSG_CHOICE = %d\n",
969 (
970 NOTIF_ANNCE_COUNT +
971 NOTIF_INFO_COUNT +
972 NOTIF_CENTER_COUNT +
973 NOTIF_MULTI_COUNT +
974 NOTIF_CHOICE_COUNT
975 ),
976 NOTIF_ANNCE_COUNT,
977 NOTIF_INFO_COUNT,
978 NOTIF_CENTER_COUNT,
979 NOTIF_MULTI_COUNT,
980 NOTIF_CHOICE_COUNT
981 );
982 #undef NOTIF_WRITE_HARDCODED
983 #undef NOTIF_WRITE_ENTITY
984 #undef NOTIF_WRITE
985}
#define NOTIF_WRITE(str)
#define NOTIF_WRITE_HARDCODED(cvar, default, description)

References FOREACH, LOG_INFOF, NOTIF_WRITE, NOTIF_WRITE_HARDCODED, and NUM_TEAM_1.

Referenced by GENERIC_COMMAND().

◆ GENERIC_COMMAND()

GENERIC_COMMAND ( dumpnotifs ,
"Dump all notifications into " DEFAULT_FILENAME,
false  )

Definition at line 166 of file all.qh.

167{
168 switch (request)
169 {
171 {
172 #ifdef GAMEQC
173 string filename = argv(1);
174 bool alsoprint = false;
175 if (filename == "")
176 {
177 filename = DEFAULT_FILENAME;
178 alsoprint = false;
179 }
180 else if (filename == "-")
181 {
182 filename = DEFAULT_FILENAME;
183 alsoprint = true;
184 }
185 int fh = fopen(filename, FILE_WRITE);
186 if (fh >= 0)
187 {
188 Dump_Notifications(fh, alsoprint);
189 LOG_INFOF("Dumping notifications... File located in ^2data/data/%s^7.", filename);
190 fclose(fh);
191 }
192 else
193 {
194 LOG_INFOF("^1Error: ^7Could not open file '%s'!", filename);
195 }
196 #else
197 LOG_INFO("Notification dump command only works with cl_cmd and sv_cmd.");
198 #endif
199 return;
200 }
201 default:
203 {
204 LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " dumpnotifs [<filename>]");
205 LOG_HELPF(" Where <filename> is the file to write (default is %s),", DEFAULT_FILENAME);
206 LOG_HELP(" if supplied with '-' output to console as well as default,");
207 LOG_HELP(" if left blank, it will only write to default.");
208 return;
209 }
210 }
211}
const int CMD_REQUEST_COMMAND
Definition command.qh:3
const int CMD_REQUEST_USAGE
Definition command.qh:4
const float FILE_WRITE
#define GetProgramCommandPrefix()
Definition generic.qh:25
#define LOG_HELP(...)
Definition log.qh:85
#define LOG_INFO(...)
Definition log.qh:65
#define LOG_HELPF(...)
Definition log.qh:86
void fclose(float fhandle)
float fopen(string filename, float mode)
string argv(float n)
#define DEFAULT_FILENAME
Definition all.qh:164
void Dump_Notifications(int fh, bool alsoprint)
used to output notifications.cfg file
Definition all.qc:783

References argv(), CMD_REQUEST_COMMAND, CMD_REQUEST_USAGE, DEFAULT_FILENAME, Dump_Notifications(), fclose(), FILE_WRITE, fopen(), GetProgramCommandPrefix, LOG_HELP, LOG_HELPF, LOG_INFO, and LOG_INFOF.

◆ Get_Notif_BroadcastName()

string Get_Notif_BroadcastName ( NOTIF broadcast)

send to one client and their spectators

send ONLY to one client send only to X team and their spectators send only to X team and their spectators, except for Y person and their spectators send to everyone send to everyone except X person and their spectators

Definition at line 260 of file all.qh.

261{
262 switch (broadcast)
263 {
264 case NOTIF_ONE: return "NOTIF_ONE";
265 case NOTIF_ONE_ONLY: return "NOTIF_ONE_ONLY";
266 case NOTIF_ALL_EXCEPT: return "NOTIF_ALL_EXCEPT";
267 case NOTIF_ALL: return "NOTIF_ALL";
268 case NOTIF_TEAM: return "NOTIF_TEAM";
269 case NOTIF_TEAM_EXCEPT: return "NOTIF_TEAM_EXCEPT";
270 }
271 LOG_WARNF("Get_Notif_BroadcastName(%d): Improper broadcast!", broadcast);
272 return "";
273}

References Get_Notif_BroadcastName(), LOG_WARNF, and string().

Referenced by Get_Notif_BroadcastName(), Kill_Notification(), Send_Notification(), Send_Notification_WOCOVA(), and Send_Notification_WOVA().

◆ Get_Notif_CvarName()

string Get_Notif_CvarName ( Notification notif)

Definition at line 749 of file all.qh.

750{
751 if(!notif.nent_teamnum)
752 return notif.nent_name;
753 return substring(notif.nent_name, 0, -strlen(Static_Team_ColorName(notif.nent_teamnum)) - 2);
754}
#define strlen
string substring(string s, float start, float length)
string Static_Team_ColorName(int teamid)
Definition teams.qh:103

References Static_Team_ColorName(), strlen, and substring().

Referenced by Local_Notification().

◆ Get_Notif_Ent()

Notification Get_Notif_Ent ( MSG net_type,
int net_name )

Definition at line 756 of file all.qh.

757{
758 Notification it = REGISTRY_GET(Notifications, net_name);
759 if (it.nent_type != net_type) {
760 LOG_WARNF("Get_Notif_Ent(%s (%d), %s (%d)): Improper net type '%s'!",
761 Get_Notif_TypeName(net_type), net_type,
762 it.registered_id, net_name,
763 Get_Notif_TypeName(it.nent_type)
764 );
765 return NULL;
766 }
767 return it;
768}
entity Notification
always last
Definition all.qh:81

References Get_Notif_TypeName(), LOG_WARNF, NULL, and REGISTRY_GET.

Referenced by NET_HANDLE().

◆ Get_Notif_TypeName()

string Get_Notif_TypeName ( MSG net_type)

main types/groups of notifications

"Global" AND "personal" announcer messages "Global" information messages "Personal" centerprint messages Subcall MSG_INFO and/or MSG_CENTER notifications Choose which subcall wrapper to activate Kill centerprint message

Deprecated

Definition at line 30 of file all.qh.

31{
32 switch (net_type)
33 {
34 case MSG_ANNCE: return "MSG_ANNCE";
35 case MSG_INFO: return "MSG_INFO";
36 case MSG_CENTER: return "MSG_CENTER";
37 case MSG_MULTI: return "MSG_MULTI";
38 case MSG_CHOICE: return "MSG_CHOICE";
39 case MSG_CENTER_KILL: return "MSG_CENTER_KILL";
40 }
41 LOG_WARNF("Get_Notif_TypeName(%d): Improper net type!", ORDINAL(net_type));
42 return "";
43}
#define ORDINAL(it)
Definition enumclass.qh:25

References Get_Notif_TypeName(), LOG_WARNF, ORDINAL, and string().

Referenced by Create_Notification_Entity_Annce(), Create_Notification_Entity_Choice(), Create_Notification_Entity_InfoCenter(), Create_Notification_Entity_Multi(), Get_Notif_Ent(), Get_Notif_TypeName(), Kill_Notification(), Local_Notification(), NET_HANDLE(), Net_Notification_Remove(), Send_Notification(), Send_Notification_WOCOVA(), and Send_Notification_WOVA().

◆ hash_replace()

string hash_replace ( string full_msg,
int ent_msg_num,
string ent_msg,
string attacker_name )

Definition at line 404 of file all.qh.

405{
406 int s_ofs = 0;
407 while (--ent_msg_num >= 0)
408 s_ofs += strstrofs(full_msg, "%s", s_ofs);
409 string col = find_last_color_code(substring(full_msg, 0, s_ofs));
410
411 int hash_ofs = strstrofs(ent_msg, "#", 0);
412 if (hash_ofs < 0)
413 ent_msg = strcat(ent_msg, " ", CCR("^BG"), attacker_name, col);
414 else
415 ent_msg = strreplace("#", strcat(CCR("^BG"), attacker_name, col), ent_msg);
416 return ent_msg;
417}
string find_last_color_code(string s)
Definition util.qc:960
#define strstrofs

References CCR(), find_last_color_code(), strcat(), strstrofs, and substring().

◆ Kill_Notification()

void Kill_Notification ( NOTIF broadcast,
entity client,
MSG net_type,
CPID net_name )
Parameters
net_typemessage group, MSG_Null for all
net_namecpid group, CPID_Null for all

Definition at line 1537 of file all.qc.

1543{
1544 #ifdef NOTIFICATIONS_DEBUG
1545 Debug_Notification(sprintf(
1546 "Kill_Notification(%s, '%s', %s, %d);\n",
1547 Get_Notif_BroadcastName(broadcast),
1548 client.netname,
1549 (net_type ? Get_Notif_TypeName(net_type) : "0"),
1550 net_cpid
1551 ));
1552 #endif
1553
1554 string checkargs = Notification_CheckArgs(broadcast, client);
1555 if (checkargs != "") { LOG_WARNF("Incorrect usage of Kill_Notification: %s", checkargs); return; }
1556
1557 entity net_notif = new_pure(net_kill_notification);
1558 net_notif.nent_broadcast = broadcast;
1559 net_notif.nent_client = client;
1560 net_notif.nent_net_type = MSG_CENTER_KILL;
1561 net_notif.nent_net_name = ORDINAL(net_cpid);
1563
1565 (it.owner.nent_type == net_type || net_type == MSG_Null) && (it.owner.nent_cpid == net_cpid || net_cpid == CPID_Null),
1566 {
1567 it.nent_net_name = -1;
1568 it.nextthink = time;
1569 }
1570 );
1571}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define IL_EACH(this, cond, body)
void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
Definition net.qh:123
bool Net_Write_Notification(entity this, entity client, int sf)
Definition all.qc:1526
string Notification_CheckArgs(NOTIF broadcast, entity client)
Definition all.qc:21
IntrusiveList g_notifications
Definition all.qh:240
float autocvar_notification_lifetime_runtime
Definition all.qh:312
string Get_Notif_BroadcastName(NOTIF broadcast)
send to one client and their spectators
Definition all.qh:260

References autocvar_notification_lifetime_runtime, CPID_Null, entity(), g_notifications, Get_Notif_BroadcastName(), Get_Notif_TypeName(), IL_EACH, LOG_WARNF, Net_LinkEntity(), Net_Write_Notification(), new_pure, Notification_CheckArgs(), and ORDINAL.

Referenced by ClientCommand_selectteam(), ClientCommand_spectate(), CommonCommand_timein(), Destroy_All_Notifications(), instagib_stop_countdown(), Join(), kh_EnableTrackingDevice(), kh_StartRound(), MUTATOR_HOOKFUNCTION(), NextLevel(), Remove_Countdown(), SetPlayerTeam(), timeout_handler_think(), toss_nade(), and vehicles_exit().

◆ Local_Notification()

void Local_Notification ( MSG net_type,
Notification net_name,
... )

Definition at line 1236 of file all.qc.

1237{
1238 // retreive entity of this notification
1239 entity notif = net_name;
1240 if (!notif)
1241 {
1242 #ifdef NOTIFICATIONS_DEBUG
1243 Debug_Notification(sprintf(
1244 "Local_Notification(%s, NULL, ...);\n",
1245 Get_Notif_TypeName(net_type)
1246 ));
1247 #endif
1248 LOG_WARNF("Incorrect usage of Local_Notification: %s", "Null notification");
1249 return;
1250 }
1251
1252 // check if the notification is enabled
1253 if (!notif.nent_enabled)
1254 {
1255 #ifdef NOTIFICATIONS_DEBUG
1256 Debug_Notification(sprintf(
1257 "Local_Notification(%s, %s, ...): Entity was disabled...\n",
1258 Get_Notif_TypeName(net_type),
1259 notif.nent_name
1260 ));
1261 #endif
1262 return;
1263 }
1264
1265 string s1 = (notif.nent_stringcount > 0) ? ...(0, string) : "";
1266 string s2 = (notif.nent_stringcount > 1) ? ...(1, string) : "";
1267 string s3 = (notif.nent_stringcount > 2) ? ...(2, string) : "";
1268 string s4 = (notif.nent_stringcount > 3) ? ...(3, string) : "";
1269 float f1 = ((notif.nent_floatcount > 0) ? ...((notif.nent_stringcount + 0), float) : 0);
1270 float f2 = ((notif.nent_floatcount > 1) ? ...((notif.nent_stringcount + 1), float) : 0);
1271 float f3 = ((notif.nent_floatcount > 2) ? ...((notif.nent_stringcount + 2), float) : 0);
1272 float f4 = ((notif.nent_floatcount > 3) ? ...((notif.nent_stringcount + 3), float) : 0);
1273
1274 #ifdef NOTIFICATIONS_DEBUG
1275 Debug_Notification(sprintf(
1276 "Local_Notification(%s, %s, %s, %s);\n",
1277 Get_Notif_TypeName(net_type),
1278 notif.nent_name,
1279 MakeConsoleSafe(sprintf("'%s^7', '%s^7', '%s^7', '%s^7'", s1, s2, s3, s4)),
1280 sprintf("%d, %d, %d, %d", f1, f2, f3, f4)
1281 ));
1282 #endif
1283
1284 if ((notif.nent_stringcount + notif.nent_floatcount) != count)
1285 {
1286 backtrace(sprintf(
1287 (
1288 "Arguments mismatch for Local_Notification(%s, %s, ...)! "
1289 "stringcount(%d) + floatcount(%d) != count(%d)\n"
1290 "Check the definition and function call for accuracy...?\n"
1291 ),
1292 Get_Notif_TypeName(net_type),
1293 notif.nent_name,
1294 notif.nent_stringcount,
1295 notif.nent_floatcount,
1296 count
1297 ));
1298 return;
1299 }
1300
1301 switch (net_type)
1302 {
1303 case MSG_ANNCE:
1304 {
1305 #ifdef CSQC
1306 Local_Notification_Queue_Add(net_type, notif, notif.nent_queuetime);
1307 #else
1308 backtrace("MSG_ANNCE on server?... Please notify Samual immediately!\n");
1309 #endif
1310 break;
1311 }
1312
1313 case MSG_INFO:
1314 {
1315 print(
1317 notif.nent_string,
1318 notif.nent_args,
1319 s1, s2, s3, s4,
1320 f1, f2, f3, f4)
1321 );
1322 #ifdef CSQC
1323 if (notif.nent_icon != "")
1324 {
1325 if (notif.nent_iconargs != "")
1326 {
1327 string s = Local_Notification_sprintf(
1328 notif.nent_icon,notif.nent_iconargs,
1329 s1, s2, s3, s4, f1, f2, f3, f4);
1330 // remove the trailing newline
1331 notif.nent_icon = strzone(substring(s, 0, -1));
1332 }
1334 notif.nent_icon,
1335 notif.nent_hudargs,
1336 s1, s2, s3, s4,
1337 f1, f2, f3, f4);
1338 }
1339 #endif
1340 break;
1341 }
1342
1343 #ifdef CSQC
1344 case MSG_CENTER:
1345 {
1348 notif.nent_string,
1349 notif.nent_args,
1350 s1, s2, s3, s4,
1351 f1, f2, f3, f4),
1352 notif.nent_durcnt,
1353 notif.nent_cpid,
1354 f1, f2);
1355 break;
1356 }
1357 #endif
1358
1359 case MSG_MULTI:
1360 {
1361 if (notif.nent_msginfo && notif.nent_msginfo.nent_enabled)
1362 {
1364 MSG_INFO,
1365 notif.nent_msginfo,
1366 notif.nent_msginfo.nent_stringcount,
1367 notif.nent_msginfo.nent_floatcount,
1368 s1, s2, s3, s4,
1369 f1, f2, f3, f4);
1370 }
1371 #ifdef CSQC
1372 if (notif.nent_msgannce && notif.nent_msgannce.nent_enabled)
1373 {
1375 MSG_ANNCE,
1376 notif.nent_msgannce,
1377 0, 0,
1378 "", "", "", "",
1379 0, 0, 0, 0);
1380 }
1381 if (notif.nent_msgcenter && notif.nent_msgcenter.nent_enabled)
1382 {
1384 MSG_CENTER,
1385 notif.nent_msgcenter,
1386 notif.nent_msgcenter.nent_stringcount,
1387 notif.nent_msgcenter.nent_floatcount,
1388 s1, s2, s3, s4,
1389 f1, f2, f3, f4);
1390 }
1391 #endif
1392 break;
1393 }
1394
1395 case MSG_CHOICE:
1396 {
1397 entity found_choice = notif.nent_optiona;
1398 if (notif.nent_challow_var && (warmup_stage || (notif.nent_challow_var == 2))) {
1399 switch (cvar(sprintf("notification_%s", Get_Notif_CvarName(notif))))
1400 {
1401 case 1: break;
1402 case 2: found_choice = notif.nent_optionb; break;
1403 default: return; // not enabled anyway
1404 }
1405 }
1406
1408 found_choice.nent_type,
1409 found_choice,
1410 found_choice.nent_stringcount,
1411 found_choice.nent_floatcount,
1412 s1, s2, s3, s4,
1413 f1, f2, f3, f4);
1414 break;
1415 }
1416 }
1417}
var float(entity ent) nudgeoutofsolid_OrFallback
bool warmup_stage
Definition main.qh:120
ERASEABLE string MakeConsoleSafe(string input)
escape the string to make it safe for consoles
Definition cvar.qh:24
float cvar(string name)
void print(string text,...)
void Local_Notification_centerprint_Add(string input, string durcnt, CPID cpid, float f1, float f2)
Definition all.qc:1135
void Local_Notification_Queue_Add(MSG net_type, entity notif, float queue_time)
Definition all.qc:1195
void Local_Notification_WOVA(MSG net_type, Notification net_name, float stringcount, float floatcount, string s1, string s2, string s3, string s4, float f1, float f2, float f3, float f4)
glue for networking, forwards to Local_Notification
Definition all.qc:1420
void Local_Notification_HUD_Notify_Push(string icon, string hudargs, string s1, string s2, string s3, string s4, float f1, float f2, float f3, float f4)
Definition all.qc:1091
string Local_Notification_sprintf(string input, string args, string s1, string s2, string s3, string s4, int f1, float f2, float f3, float f4)
Definition all.qc:992
string Get_Notif_CvarName(Notification notif)
Definition all.qh:749

References backtrace, count, cvar(), entity(), f1, f2, float(), Get_Notif_CvarName(), Get_Notif_TypeName(), Local_Notification_centerprint_Add(), Local_Notification_HUD_Notify_Push(), Local_Notification_Queue_Add(), Local_Notification_sprintf(), Local_Notification_WOVA(), LOG_WARNF, MakeConsoleSafe(), print(), s1, s2, strzone(), substring(), and warmup_stage.

Referenced by Announcer_Countdown(), Announcer_Gamestart(), Local_Notification_WOVA(), and NET_HANDLE().

◆ Local_Notification_Queue_Process()

void Local_Notification_Queue_Process ( )

Definition at line 1218 of file all.qc.

1219{
1221 return;
1222
1224
1225 // Shift queue to the left
1227 for (int j = 0; j < notif_queue_length; ++j) {
1231 }
1232}
float time
void Local_Notification_Queue_Run(MSG net_type, entity notif)
Definition all.qc:1183
entity notif_queue_entity[NOTIF_QUEUE_MAX]
Definition all.qh:394
MSG notif_queue_type[NOTIF_QUEUE_MAX]
Definition all.qh:395
float notif_queue_time[NOTIF_QUEUE_MAX]
Definition all.qh:396
int notif_queue_length
Definition all.qh:399

References Local_Notification_Queue_Run(), notif_queue_entity, notif_queue_length, notif_queue_time, notif_queue_type, and time.

Referenced by HUD_Draw().

◆ Local_Notification_WOVA()

void Local_Notification_WOVA ( MSG net_type,
Notification net_name,
float stringcount,
float floatcount,
string s1,
string s2,
string s3,
string s4,
float f1,
float f2,
float f3,
float f4 )

glue for networking, forwards to Local_Notification

Definition at line 1420 of file all.qc.

1425{
1426 #define VARITEM(stringc, floatc, args) \
1427 if ((stringcount == stringc) && (floatcount == floatc)) \
1428 { Local_Notification(net_type, net_name, args); return; }
1430 #undef VARITEM
1431 Local_Notification(net_type, net_name); // some notifications don't have any arguments at all
1432}
void Local_Notification(MSG net_type, Notification net_name,...count)
Definition all.qc:1236
#define EIGHT_VARS_TO_VARARGS_VARLIST
Definition all.qh:87

References EIGHT_VARS_TO_VARARGS_VARLIST, f1, f2, Local_Notification(), s1, and s2.

Referenced by Local_Notification(), NET_HANDLE(), and Send_Notification().

◆ notif_arg_frag_ping()

string notif_arg_frag_ping ( bool newline,
float fping )

Definition at line 501 of file all.qh.

502{
503 string s = newline ? "\n" : " ";
504 if (fping < 0)
505 return sprintf(CCR(_("%s(^F1Bot^BG)")), s);
506 else
507 return sprintf(CCR(_("%s(Ping ^F1%d^BG)")), s, fping);
508}

References CCR().

Referenced by notif_arg_frag_stats().

◆ notif_arg_frag_stats()

string notif_arg_frag_stats ( float fhealth,
float farmor,
float fping )

Definition at line 510 of file all.qh.

511{
512 string s = notif_arg_frag_ping(false, fping);
513 if (fhealth > 1)
514 return sprintf(CCR(_("\n(Health ^1%d^BG / Armor ^2%d^BG)%s")), fhealth, farmor, s);
515 else
516 return sprintf(CCR(_("\n(^F4Dead^BG)%s")), s);
517}
string notif_arg_frag_ping(bool newline, float fping)
Definition all.qh:501

References CCR(), and notif_arg_frag_ping().

◆ notif_arg_item_wepammo()

string notif_arg_item_wepammo ( float f1,
float f2 )

Definition at line 663 of file all.qh.

664{
666 if(wep.ammo_type == RES_NONE)
667 return ""; // doesn't use ammo
668 // example for translators: You dropped the Vortex with 5 cells
669 return sprintf(_(" with %d %s"), f2, strtolower(wep.ammo_type.m_name));
670}
string m_name
Definition resources.qh:31
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
Definition weapon.qh:44
Resource ammo_type
M: ammotype : main ammo type.
Definition weapon.qh:51
string strtolower(string s)
Weapons
Definition guide.qh:113

References Weapon::ammo_type, f1, f2, Resource::m_name, REGISTRY_GET, strtolower(), and Weapons.

◆ notif_arg_spree_cen()

string notif_arg_spree_cen ( float spree)

Definition at line 519 of file all.qh.

520{
521 // 0 = off, 1 = target (but only for first victim) and attacker
522 if(autocvar_notification_show_sprees_center)
523 {
524 if(spree > 1)
525 {
526 #define SPREE_ITEM(counta,countb,center,normal,gentle) \
527 case counta: \
528 return strcat(normal_or_gentle(center, sprintf(_("%d score spree!"), spree)), " ");
529
530 switch(spree)
531 {
533 default:
534 {
535 if (!autocvar_notification_show_sprees_center_specialonly)
536 {
537 return
538 sprintf(
540 _("%d frag spree!"),
541 _("%d score spree!")
542 ), " "),
543 spree);
544 }
545 else { return ""; } // don't show spree information if it isn't an achievement
546 }
547 }
548
549 #undef SPREE_ITEM
550 }
551 else if(spree == -1) // first blood
552 {
553 return strcat(normal_or_gentle(_("First blood!"), _("First score!")), " ");
554 }
555 else if(spree == -2) // first victim
556 {
557 return strcat(normal_or_gentle(_("First victim!"), _("First casualty!")), " ");
558 }
559 }
560 return "";
561}
#define KILL_SPREE_LIST
Definition all.qh:491

References KILL_SPREE_LIST, normal_or_gentle, and strcat().

◆ notif_arg_spree_inf()

string notif_arg_spree_inf ( float type,
string input,
string player,
float spree )

Definition at line 564 of file all.qh.

565{
566 switch(type)
567 {
568 case 1: // attacker kill spree
569 {
570 // 0 = off, 1 = target only, 2 = attacker only, 3 = target and attacker
571 // this conditional (& 2) is true for 2 and 3
573 {
574 #ifdef CSQC
575 string spree_newline =
577 ((substring(input, 0, 1) == "\{3}") ? "\n\{3}" : "\n") : "" );
578 #else
579 string spree_newline =
581 #endif
582
583 if(spree > 1)
584 {
585 #define SPREE_ITEM(counta,countb,center,normal,gentle) \
586 case counta: \
587 return sprintf(CCR(strcat(normal_or_gentle(normal, gentle), " %s^BG")), \
588 player, spree_newline);
589
590 switch(spree)
591 {
593 default:
594 {
596 {
597 return
598 sprintf(
600 _("%s^K1 has %d frags in a row!"),
601 _("%s^K1 made %d scores in a row!")
602 ), " %s^BG")),
603 player,
604 spree,
605 spree_newline
606 );
607 }
608 else { return ""; } // don't show spree information if it isn't an achievement
609 }
610 }
611
612 #undef SPREE_ITEM
613 }
614 else if(spree == -1) // firstblood
615 {
616 return
617 sprintf(
619 _("%s^K1 drew first blood!"),
620 _("%s^K1 got the first score!")
621 ), " %s^BG")),
622 player,
623 spree_newline
624 );
625 }
626 }
627 break;
628 }
629
630 case -1: // kill spree ended
631 {
632 if((spree > 1) && (autocvar_notification_show_sprees_info & 1))
633 {
634 return
635 sprintf(normal_or_gentle(
636 _(", ending their %d frag spree"),
637 _(", ending their %d score spree")
638 ),
639 spree
640 );
641 }
642 break;
643 }
644
645 case -2: // kill spree lost
646 {
647 if((spree > 1) && (autocvar_notification_show_sprees_info & 1))
648 {
649 return
650 sprintf(normal_or_gentle(
651 _(", losing their %d frag spree"),
652 _(", losing their %d score spree")
653 ),
654 spree
655 );
656 }
657 break;
658 }
659 }
660 return "";
661}
float autocvar_notification_show_sprees_info
Definition all.qh:307
float autocvar_notification_show_sprees_info_specialonly
Definition all.qh:309
float autocvar_notification_show_sprees_info_newline
Definition all.qh:308

References autocvar_notification_show_sprees_info, autocvar_notification_show_sprees_info_newline, autocvar_notification_show_sprees_info_specialonly, CCR(), KILL_SPREE_LIST, normal_or_gentle, strcat(), and substring().

◆ Notification_GetCvars()

void Notification_GetCvars ( entity this,
entity store )

Definition at line 767 of file all.qc.

768{
769 FOREACH(Notifications, it.nent_type == MSG_CHOICE && (!it.nent_teamnum || it.nent_teamnum == NUM_TEAM_1), {
770 GetCvars_handleFloat(
771 this,
772 store,
773 get_cvars_s,
774 get_cvars_f,
775 msg_choice_choices[it.nent_choice_idx],
776 sprintf("notification_%s", Get_Notif_CvarName(it))
777 );
778 });
779}

References entity(), FOREACH, and NUM_TEAM_1.

Referenced by GetCvars().

◆ REGISTRY_BEGIN()

REGISTRY_BEGIN ( Notifications )

Definition at line 878 of file all.qh.

879{
880 notif_global_error = false;
881}

References notif_global_error.

◆ REGISTRY_END()

REGISTRY_END ( Notifications )

Definition at line 883 of file all.qh.

884{
885 if (!notif_global_error) return;
886 // shit happened... stop the loading of the program now if this is unacceptable
888 LOG_FATAL("Notification initialization failed! Read above and fix the errors!");
889 else
890 LOG_SEVERE("Notification initialization failed! Read above and fix the errors!");
891}
#define LOG_SEVERE(...)
Definition log.qh:57
#define LOG_FATAL(...)
Definition log.qh:53
float autocvar_notification_errors_are_fatal
Definition all.qh:310

References autocvar_notification_errors_are_fatal, LOG_FATAL, LOG_SEVERE, and notif_global_error.

◆ ReplicateVars()

void ReplicateVars ( bool would_destroy)

Definition at line 895 of file all.qh.

896{
897 if (!would_destroy)
898 FOREACH(Notifications, it.nent_type == MSG_CHOICE && (!it.nent_teamnum || it.nent_teamnum == NUM_TEAM_1), {
899 string cvarname = strcat("notification_", Get_Notif_CvarName(it));
900 // NOTE: REPLICATE_SIMPLE can return;
901 REPLICATE_SIMPLE(it.cvar_value, cvarname);
902 });
903}

References FOREACH, and NUM_TEAM_1.

Referenced by CSQC_UpdateView(), GetCvars(), and Shutdown().

◆ Send_Notification()

void Send_Notification ( NOTIF broadcast,
entity client,
MSG net_type,
Notification net_name,
... )

Definition at line 1573 of file all.qc.

1577{
1578 if (broadcast == NOTIF_ONE_ONLY && !IS_REAL_CLIENT(client)) return;
1579 entity notif = net_name;
1580 string parms = sprintf("%s, '%s', %s, %s",
1581 Get_Notif_BroadcastName(broadcast),
1582 client.classname,
1583 Get_Notif_TypeName(net_type),
1584 net_name.registered_id
1585 );
1586 #ifdef NOTIFICATIONS_DEBUG
1587 Debug_Notification(sprintf("Send_Notification(%s, ...%d);\n", parms, count));
1588 #endif
1589
1590 if (!notif)
1591 {
1592 LOG_WARN("Send_Notification: Could not find notification entity!");
1593 return;
1594 }
1595
1596 // check supplied broadcast, target, type, and name for errors
1597 string checkargs = Notification_CheckArgs(broadcast, client);
1598 if (!net_name) { checkargs = sprintf("No notification provided! %s", checkargs); }
1599 if (checkargs != "")
1600 {
1601 LOG_WARNF("Incorrect usage of Send_Notification: %s", checkargs);
1602 return;
1603 }
1604
1605 string s1 = ((0 < notif.nent_stringcount) ? ...(0, string) : "");
1606 string s2 = ((1 < notif.nent_stringcount) ? ...(1, string) : "");
1607 string s3 = ((2 < notif.nent_stringcount) ? ...(2, string) : "");
1608 string s4 = ((3 < notif.nent_stringcount) ? ...(3, string) : "");
1609 float f1 = ((0 < notif.nent_floatcount) ? ...((notif.nent_stringcount + 0), float) : 0);
1610 float f2 = ((1 < notif.nent_floatcount) ? ...((notif.nent_stringcount + 1), float) : 0);
1611 float f3 = ((2 < notif.nent_floatcount) ? ...((notif.nent_stringcount + 2), float) : 0);
1612 float f4 = ((3 < notif.nent_floatcount) ? ...((notif.nent_stringcount + 3), float) : 0);
1613
1614 #ifdef NOTIFICATIONS_DEBUG
1615 Debug_Notification(sprintf(
1616 "Send_Notification(%s, %s, %s);\n",
1617 parms,
1618 MakeConsoleSafe(sprintf("'%s^7', '%s^7', '%s^7', '%s^7'", s1, s2, s3, s4)),
1619 sprintf("%d, %d, %d, %d", f1, f2, f3, f4)
1620 ));
1621 #endif
1622
1623 if ((notif.nent_stringcount + notif.nent_floatcount) != count)
1624 {
1625 LOG_WARNF(
1626 "Argument mismatch for Send_Notification(%s, ...)! "
1627 "stringcount(%d) + floatcount(%d) != count(%d)\n"
1628 "Check the definition and function call for accuracy...?\n",
1629 parms,
1630 notif.nent_stringcount,
1631 notif.nent_floatcount,
1632 count
1633 );
1634 return;
1635 }
1636
1638 && (broadcast == NOTIF_ALL || broadcast == NOTIF_ALL_EXCEPT)
1639 && !(net_type == MSG_ANNCE || net_type == MSG_CENTER)
1640 )
1641 {
1643 net_type, net_name,
1644 notif.nent_stringcount,
1645 notif.nent_floatcount,
1646 s1, s2, s3, s4,
1647 f1, f2, f3, f4);
1648 }
1649
1650 if (net_type == MSG_CHOICE)
1651 {
1652 // THIS GETS TRICKY... now we have to cycle through each possible player (checking broadcast)
1653 // and then do an individual NOTIF_ONE_ONLY recursive call for each one depending on their option...
1654 // It's slow, but it's better than the alternatives:
1655 // 1. Constantly networking all info and letting client decide
1656 // 2. Manually handling each separate call on per-usage basis (See old CTF usage of verbose)
1657 entity found_choice;
1658
1659 #define RECURSE_FROM_CHOICE(ent,action) MACRO_BEGIN \
1660 if (notif.nent_challow_var && (warmup_stage || (notif.nent_challow_var == 2))) { \
1661 switch (CS_CVAR(ent).msg_choice_choices[net_name.nent_choice_idx]) \
1662 { \
1663 case 1: found_choice = notif.nent_optiona; break; \
1664 case 2: found_choice = notif.nent_optionb; break; \
1665 default: action; \
1666 } \
1667 } else { \
1668 found_choice = notif.nent_optiona; \
1669 } \
1670 Send_Notification_WOVA( \
1671 NOTIF_ONE_ONLY, \
1672 ent, \
1673 found_choice.nent_type, \
1674 found_choice, \
1675 found_choice.nent_stringcount, \
1676 found_choice.nent_floatcount, \
1677 s1, s2, s3, s4, \
1678 f1, f2, f3, f4); \
1679 MACRO_END
1680
1681 switch (broadcast)
1682 {
1683 case NOTIF_ONE_ONLY: // we can potentially save processing power with this broadcast method
1684 {
1685 if (IS_REAL_CLIENT(client)) {
1686 RECURSE_FROM_CHOICE(client, return);
1687 }
1688 break;
1689 }
1690 default:
1691 {
1692 FOREACH_CLIENT(Notification_ShouldSend(broadcast, it, client), {
1693 RECURSE_FROM_CHOICE(it, continue);
1694 });
1695 break;
1696 }
1697 }
1698 }
1699 else
1700 {
1701 entity net_notif = new_pure(net_notification);
1702 IL_PUSH(g_notifications, net_notif);
1703 net_notif.owner = notif;
1704 net_notif.nent_broadcast = broadcast;
1705 net_notif.nent_client = client;
1706 net_notif.nent_net_type = net_type;
1707 net_notif.nent_net_name = notif.m_id;
1708 net_notif.nent_stringcount = notif.nent_stringcount;
1709 net_notif.nent_floatcount = notif.nent_floatcount;
1710
1711 for (int i = 0; i < net_notif.nent_stringcount; ++i) {
1712 net_notif.nent_strings[i] = strzone(...(i, string));
1713 }
1714 for (int i = 0; i < net_notif.nent_floatcount; ++i) {
1715 net_notif.nent_floats[i] = ...((net_notif.nent_stringcount + i), float);
1716 }
1717
1719 net_notif.nextthink = (time > autocvar_notification_lifetime_mapload)
1722
1723 Net_LinkEntity(net_notif, false, 0, Net_Write_Notification);
1724 }
1725}
string() ReadString_Raw
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
#define LOG_WARN(...)
Definition log.qh:61
void Net_Notification_Remove(entity this)
Definition all.qc:1511
bool Notification_ShouldSend(NOTIF broadcast, entity to_client, entity other_client)
Definition all.qc:80
#define RECURSE_FROM_CHOICE(ent, action)
float autocvar_notification_lifetime_mapload
Definition all.qh:313
#define setthink(e, f)
#define IS_REAL_CLIENT(v)
Definition utils.qh:17
#define FOREACH_CLIENT(cond, body)
Definition utils.qh:50

References autocvar_notification_lifetime_mapload, autocvar_notification_lifetime_runtime, autocvar_sv_dedicated, count, entity(), f1, f2, float(), FOREACH_CLIENT, g_notifications, Get_Notif_BroadcastName(), Get_Notif_TypeName(), IL_PUSH(), IS_REAL_CLIENT, Local_Notification_WOVA(), LOG_WARN, LOG_WARNF, MakeConsoleSafe(), Net_LinkEntity(), Net_Notification_Remove(), Net_Write_Notification(), new_pure, Notification_CheckArgs(), Notification_ShouldSend(), RECURSE_FROM_CHOICE, s1, s2, setthink, string(), strzone(), and time.

Referenced by bot_spawn(), buff_Touch(), CA_CheckWinner(), ca_LastPlayerForTeam_Notify(), CheckPlayerJump(), CheckRules_World(), ClientCommand_minigame(), ClientCommand_selectteam(), ClientCommand_spectate(), ClientConnect(), ClientDisconnect(), ClientKill_Now_TeamChange(), ClientKill_TeamChange(), CommonCommand_timeout(), counter_use(), ctf_CaptureRecord(), ctf_CaptureShield_Touch(), ctf_CaptureShield_Update(), ctf_CheckFlagReturn(), ctf_CheckStalemate(), ctf_FlagcarrierWaypoints(), ctf_Handle_Capture(), ctf_Handle_Drop(), ctf_Handle_Pickup(), ctf_Handle_Retrieve(), ctf_Handle_Return(), Domination_CheckWinner(), dompoint_captured(), door_check_keys(), fireBullet_falloff(), FireRailgunBullet(), frag_centermessage_override(), freezetag_CheckWinner(), freezetag_LastPlayerForTeam_Notify(), GameCommand_cointoss(), GameCommand_lockteams(), GameCommand_unlockteams(), InitiateOvertime(), instagib_ammocheck(), instagib_countdown(), Invasion_CheckWinner(), invite_minigame(), Item_GiveTo(), Join(), joinAllowed(), ka_DropEvent(), ka_TouchEvent(), kh_FinishRound(), kh_Key_Collect(), kh_Key_DropAll(), kh_Key_DropOne(), kh_Key_Spawn(), kh_Key_Think(), kh_LoserTeam(), kh_StartRound(), kh_WaitForPlayers(), kh_WinnerTeam(), KillIndicator_Think(), lms_AddPlayer(), lms_RemovePlayer(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), nades_GiveBonus(), nexball_setstatus(), NIX_GiveCurrentWeapon(), nJoinAllowed(), Obituary(), ObserverOrSpectatorThink(), ons_CaptureShield_Touch(), ons_ControlPoint_Icon_BuildThink(), ons_ControlPoint_Icon_Damage(), ons_ControlPoint_Touch(), ons_GeneratorDamage(), ons_GeneratorThink(), Onslaught_CheckWinner(), onslaught_generator_touch(), player_powerups(), PlayerFrame(), Portal_TeleportPlayer(), PutObserverInServer(), PutPlayerInServer(), race_AbandonRaceCheck(), race_SendTime(), race_setTime(), ReadyCount(), ReadyRestart_force(), Remove_Countdown(), ResetBall(), Say(), Send_Notification_WOCOVA(), Send_Notification_WOVA(), SetPlayerTeam(), ShowRespawnCountdown(), superspec_hello(), Surv_CheckWinner(), surv_LastPlayerForTeam_Notify(), Surv_RoundStart(), SV_ParseClientCommand(), target_init_use(), TeamBalance_RemoveExcessPlayers(), timeout_handler_think(), tka_DropEvent(), tka_TouchEvent(), trigger_keylock_touch(), vehicles_enter(), VoteAccept(), VoteCommand_abstain(), VoteCommand_call(), VoteCommand_no(), VoteCommand_yes(), VoteReject(), VoteTimeout(), W_Devastator_Explode(), W_Electro_Explode(), W_MineLayer_Attack(), W_MineLayer_Explode(), W_Mortar_Grenade_Explode(), W_Mortar_Grenade_Explode2(), W_OverkillNex_Attack(), W_Porto_Fail(), W_Porto_Touch(), W_RocketMinsta_Laser_Explode(), W_ThrowWeapon(), W_Vaporizer_Attack(), W_Vortex_Attack(), weapon_prepareattack_checkammo(), WinningCondition_Assault(), and WinningCondition_Scores().

◆ Send_Notification_WOCOVA()

void Send_Notification_WOCOVA ( NOTIF broadcast,
entity client,
MSG net_type,
Notification net_name,
string s1,
string s2,
string s3,
string s4,
float f1,
float f2,
float f3,
float f4 )

Definition at line 1762 of file all.qc.

1767{
1768 entity notif = net_name;
1769
1770 #ifdef NOTIFICATIONS_DEBUG
1771 Debug_Notification(sprintf(
1772 "Send_Notification_WOCOVA(%s, %s, %s);\n",
1773 sprintf(
1774 "%s, '%s', %s, %s",
1775 Get_Notif_BroadcastName(broadcast),
1776 client.classname,
1777 Get_Notif_TypeName(net_type),
1778 notif.nent_name
1779 ),
1780 MakeConsoleSafe(sprintf("'%s^7', '%s^7', '%s^7', '%s^7'", s1, s2, s3, s4)),
1781 sprintf("%d, %d, %d, %d", f1, f2, f3, f4)
1782 ));
1783 #endif
1784
1785 #define VARITEM(stringc, floatc, args) \
1786 if ((notif.nent_stringcount == stringc) && (notif.nent_floatcount == floatc)) \
1787 { Send_Notification(broadcast, client, net_type, net_name, args); return; }
1789 #undef VARITEM
1790 Send_Notification(broadcast, client, net_type, net_name); // some notifications don't have any arguments at all
1791}
void Send_Notification(NOTIF broadcast, entity client, MSG net_type, Notification net_name,...count)
Definition all.qc:1573

References EIGHT_VARS_TO_VARARGS_VARLIST, entity(), f1, f2, Get_Notif_BroadcastName(), Get_Notif_TypeName(), MakeConsoleSafe(), s1, s2, and Send_Notification().

Referenced by Obituary_SpecialDeath(), and Obituary_WeaponDeath().

◆ Send_Notification_WOVA()

void Send_Notification_WOVA ( NOTIF broadcast,
entity client,
MSG net_type,
Notification net_name,
float stringcount,
float floatcount,
string s1,
string s2,
string s3,
string s4,
float f1,
float f2,
float f3,
float f4 )

Definition at line 1728 of file all.qc.

1734{
1735 #ifdef NOTIFICATIONS_DEBUG
1736 entity notif = net_name;
1737 Debug_Notification(sprintf(
1738 "Send_Notification_WOVA(%s, %d, %d, %s, %s);\n",
1739 sprintf(
1740 "%s, '%s', %s, %s",
1741 Get_Notif_BroadcastName(broadcast),
1742 client.classname,
1743 Get_Notif_TypeName(net_type),
1744 notif.nent_name
1745 ),
1746 stringcount,
1747 floatcount,
1748 MakeConsoleSafe(sprintf("'%s^7', '%s^7', '%s^7', '%s^7'", s1, s2, s3, s4)),
1749 sprintf("%d, %d, %d, %d", f1, f2, f3, f4)
1750 ));
1751 #endif
1752
1753 #define VARITEM(stringc, floatc, args) \
1754 if ((stringcount == stringc) && (floatcount == floatc)) \
1755 { Send_Notification(broadcast, client, net_type, net_name, args); return; }
1757 #undef VARITEM
1758 Send_Notification(broadcast, client, net_type, net_name); // some notifications don't have any arguments at all
1759}

References EIGHT_VARS_TO_VARARGS_VARLIST, entity(), f1, f2, Get_Notif_BroadcastName(), Get_Notif_TypeName(), MakeConsoleSafe(), s1, s2, and Send_Notification().

◆ STATIC_INIT() [1/2]

STATIC_INIT ( g_notifications )

Definition at line 241 of file all.qh.

241{ g_notifications = IL_NEW(); }
#define IL_NEW()

References g_notifications, and IL_NEW.

◆ STATIC_INIT() [2/2]

STATIC_INIT ( Notifications )

Definition at line 729 of file all.qh.

729{ FOREACH(Notifications, true, it.m_id = i); }

References FOREACH, and STATIC_INIT.

◆ STATIC_INIT_LATE()

STATIC_INIT_LATE ( Notif_Choices )

Definition at line 742 of file all.qh.

743{
745 LOG_FATALF("Too many MSG_CHOICE notifications (%d), hit NOTIF_CHOICE_MAX (%d) limit",
747}
#define LOG_FATALF(...)
Definition log.qh:54
const int NOTIF_CHOICE_MAX
Definition all.qh:732

References LOG_FATALF, nent_choice_count, NOTIF_CHOICE_MAX, and STATIC_INIT_LATE.

Variable Documentation

◆ ARG_CS

const float ARG_CS = 4

Definition at line 427 of file all.qh.

◆ ARG_CS_SV

const float ARG_CS_SV = 3

Definition at line 426 of file all.qh.

◆ ARG_CS_SV_DC

const float ARG_CS_SV_DC = 2

Definition at line 425 of file all.qh.

◆ ARG_CS_SV_HA

const float ARG_CS_SV_HA = 1

Definition at line 424 of file all.qh.

◆ ARG_DC

const float ARG_DC = 6

Definition at line 429 of file all.qh.

◆ arg_slot

◆ ARG_SV

const float ARG_SV = 5

Definition at line 428 of file all.qh.

◆ autocvar_notification_errors_are_fatal

float autocvar_notification_errors_are_fatal = true

Definition at line 310 of file all.qh.

Referenced by REGISTRY_END().

◆ autocvar_notification_lifetime_mapload

float autocvar_notification_lifetime_mapload = 10

Definition at line 313 of file all.qh.

Referenced by Send_Notification().

◆ autocvar_notification_lifetime_runtime

float autocvar_notification_lifetime_runtime = 0.5

Definition at line 312 of file all.qh.

Referenced by Kill_Notification(), and Send_Notification().

◆ autocvar_notification_server_allows_location

float autocvar_notification_server_allows_location = 1

Definition at line 318 of file all.qh.

Referenced by Obituary().

◆ autocvar_notification_show_location

float autocvar_notification_show_location = false

Definition at line 304 of file all.qh.

◆ autocvar_notification_show_location_string

string autocvar_notification_show_location_string = ""

Definition at line 305 of file all.qh.

◆ autocvar_notification_show_sprees

float autocvar_notification_show_sprees = true

Definition at line 306 of file all.qh.

◆ autocvar_notification_show_sprees_info

float autocvar_notification_show_sprees_info = 3

Definition at line 307 of file all.qh.

Referenced by notif_arg_spree_inf().

◆ autocvar_notification_show_sprees_info_newline

float autocvar_notification_show_sprees_info_newline = true

Definition at line 308 of file all.qh.

Referenced by notif_arg_spree_inf().

◆ autocvar_notification_show_sprees_info_specialonly

float autocvar_notification_show_sprees_info_specialonly = true

Definition at line 309 of file all.qh.

Referenced by notif_arg_spree_inf().

◆ cvar_value

int cvar_value

Definition at line 894 of file all.qh.

◆ g_notifications

IntrusiveList g_notifications

Definition at line 240 of file all.qh.

Referenced by Kill_Notification(), Send_Notification(), and STATIC_INIT().

◆ msg_choice_choices

int msg_choice_choices[NOTIF_CHOICE_MAX]

Definition at line 737 of file all.qh.

◆ nent_args

string nent_args

Definition at line 694 of file all.qh.

◆ nent_broadcast

NOTIF nent_broadcast

Definition at line 714 of file all.qh.

Referenced by Net_Write_Notification().

◆ nent_challow_def

float nent_challow_def

Definition at line 707 of file all.qh.

◆ nent_challow_var

float nent_challow_var

Definition at line 708 of file all.qh.

◆ nent_channel

int nent_channel

Definition at line 687 of file all.qh.

◆ nent_choice_count

int nent_choice_count = 0

Definition at line 735 of file all.qh.

Referenced by STATIC_INIT_LATE().

◆ nent_choice_idx

int nent_choice_idx

Definition at line 736 of file all.qh.

◆ nent_client

entity nent_client

Definition at line 716 of file all.qh.

Referenced by Net_Write_Notification().

◆ nent_cpid

CPID nent_cpid

Definition at line 697 of file all.qh.

◆ nent_default

int nent_default

Definition at line 678 of file all.qh.

◆ nent_durcnt

string nent_durcnt

Definition at line 698 of file all.qh.

◆ nent_enabled

bool nent_enabled

Definition at line 679 of file all.qh.

◆ nent_floatcount

int nent_floatcount

Definition at line 683 of file all.qh.

Referenced by Net_Write_Notification().

◆ nent_floats

float nent_floats[4]

Definition at line 720 of file all.qh.

Referenced by Net_Write_Notification().

◆ nent_hudargs

string nent_hudargs

Definition at line 695 of file all.qh.

◆ nent_icon

string nent_icon

Definition at line 696 of file all.qh.

◆ nent_iconargs

string nent_iconargs

Definition at line 808 of file all.qh.

◆ nent_msgannce

entity nent_msgannce

Definition at line 702 of file all.qh.

◆ nent_msgcenter

entity nent_msgcenter

Definition at line 704 of file all.qh.

◆ nent_msginfo

entity nent_msginfo

Definition at line 703 of file all.qh.

◆ nent_name

string nent_name

Definition at line 681 of file all.qh.

◆ nent_net_name

float nent_net_name

Definition at line 718 of file all.qh.

Referenced by Net_Notification_Remove(), and Net_Write_Notification().

◆ nent_net_type

MSG nent_net_type

Definition at line 717 of file all.qh.

Referenced by Net_Notification_Remove(), and Net_Write_Notification().

◆ nent_optiona

entity nent_optiona

Definition at line 709 of file all.qh.

◆ nent_optionb

entity nent_optionb

Definition at line 710 of file all.qh.

◆ nent_position

float nent_position

Definition at line 690 of file all.qh.

◆ nent_queuetime

float nent_queuetime

Definition at line 691 of file all.qh.

◆ nent_snd

string nent_snd

Definition at line 688 of file all.qh.

◆ nent_string

string nent_string

Definition at line 699 of file all.qh.

◆ nent_stringcount

int nent_stringcount

Definition at line 682 of file all.qh.

Referenced by Net_Notification_Remove(), and Net_Write_Notification().

◆ nent_strings

string nent_strings[4]

Definition at line 719 of file all.qh.

Referenced by Net_Notification_Remove(), and Net_Write_Notification().

◆ nent_teamnum

int nent_teamnum

Definition at line 684 of file all.qh.

◆ nent_type

MSG nent_type

Definition at line 680 of file all.qh.

◆ nent_vol

float nent_vol

Definition at line 689 of file all.qh.

◆ NOTIF_CHOICE_MAX

const int NOTIF_CHOICE_MAX = 20

Definition at line 732 of file all.qh.

Referenced by STATIC_INIT_LATE().

◆ notif_error

◆ notif_global_error

bool notif_global_error

Definition at line 740 of file all.qh.

Referenced by Create_Notification_Entity(), REGISTRY_BEGIN(), and REGISTRY_END().

◆ NOTIF_MAX_ARGS

const float NOTIF_MAX_ARGS = 7

Definition at line 388 of file all.qh.

Referenced by Local_Notification_sprintf(), and Process_Notif_Args().

◆ NOTIF_MAX_DURCNT

const float NOTIF_MAX_DURCNT = 2

Definition at line 390 of file all.qh.

Referenced by Local_Notification_centerprint_Add(), and Process_Notif_Args().

◆ NOTIF_MAX_HUDARGS

const float NOTIF_MAX_HUDARGS = 2

Definition at line 389 of file all.qh.

Referenced by Local_Notification_HUD_Notify_Push(), and Process_Notif_Args().

◆ notif_queue_entity

entity notif_queue_entity[NOTIF_QUEUE_MAX]

Definition at line 394 of file all.qh.

Referenced by Local_Notification_Queue_Add(), and Local_Notification_Queue_Process().

◆ notif_queue_length

int notif_queue_length

Definition at line 399 of file all.qh.

Referenced by Local_Notification_Queue_Add(), and Local_Notification_Queue_Process().

◆ NOTIF_QUEUE_MAX

const int NOTIF_QUEUE_MAX = 10

Definition at line 393 of file all.qh.

Referenced by Local_Notification_Queue_Add().

◆ notif_queue_next_time

float notif_queue_next_time

Definition at line 398 of file all.qh.

Referenced by Local_Notification_Queue_Add().

◆ notif_queue_time

float notif_queue_time[NOTIF_QUEUE_MAX]

Definition at line 396 of file all.qh.

Referenced by Local_Notification_Queue_Add(), and Local_Notification_Queue_Process().

◆ notif_queue_type

MSG notif_queue_type[NOTIF_QUEUE_MAX]

Definition at line 395 of file all.qh.

Referenced by Local_Notification_Queue_Add(), and Local_Notification_Queue_Process().

◆ prev_soundfile

string prev_soundfile

Definition at line 235 of file all.qh.

Referenced by Local_Notification_sound().

◆ prev_soundtime

float prev_soundtime

Definition at line 236 of file all.qh.

Referenced by Local_Notification_sound().