string durcnt,
string normal,
string gentle,
- float challow,
+ float challow_def,
+ float challow_var,
float chtype,
float optiona,
float optionb)
break;
}
}
- notif.nent_challow = challow; // 0: never allowed, 1: allowed in warmup, 2: always allowed
+ notif.nent_challow_def = challow_def; // 0: never allowed, 1: allowed in warmup, 2: always allowed
+ notif.nent_challow_var = challow_var; // 0: never allowed, 1: allowed in warmup, 2: always allowed
notif.nent_stringcount = max(notif.nent_optiona.nent_stringcount, notif.nent_optionb.nent_stringcount);
notif.nent_floatcount = max(notif.nent_optiona.nent_floatcount, notif.nent_optionb.nent_floatcount);
- print(sprintf("INIT NOTIF DEBUG: %d %d\n", notif.nent_stringcount, notif.nent_floatcount));
- print(sprintf("^ optiona: %s %s : %d %d\n",
+
+ #ifdef NOTIFICATIONS_DEBUG
+ Debug_Notification(sprintf(
+ "Create_Notification_Entity(...): MSG_CHOICE: %s\n"
+ "^ optiona: %s %s : %d %d\n"
+ "^ optionb: %s %s : %d %d\n",
+ notif.nent_name,
+ Get_Notif_TypeName(notif.nent_optiona.nent_type),
+ notif.nent_optiona.nent_name,
+ notif.nent_optiona.nent_stringcount,
+ notif.nent_optiona.nent_floatcount,
Get_Notif_TypeName(notif.nent_optiona.nent_type),
notif.nent_optiona.nent_name,
notif.nent_optiona.nent_stringcount,
- notif.nent_optiona.nent_floatcount));
+ notif.nent_optiona.nent_floatcount
+ ));
+ #endif
}
break;
}
e.nent_name, e.nent_default, description \
); \
NOTIF_WRITE(notif_msg) }
+ #define NOTIF_WRITE_ENTITY_CHOICE(descriptiona,descriptionb) { \
+ notif_msg = \
+ sprintf( \
+ "seta notification_%s \"%d\" \"%s\"\n" \
+ "seta notification_%s_ALLOWED \"%d\" \"%s\"\n", \
+ e.nent_name, e.nent_default, descriptiona, \
+ e.nent_name, e.nent_challow_def, descriptionb \
+ ); \
+ NOTIF_WRITE(notif_msg) }
#define NOTIF_WRITE_HARDCODED(cvar,default,description) { \
notif_msg = \
sprintf( \
e = Get_Notif_Ent(MSG_CHOICE, i);
if not(e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; }
- NOTIF_WRITE_ENTITY(
- "Notification control cvar: 0 = off, 1 = trigger option A subcall, 2 = trigger option B subcall"
+ NOTIF_WRITE_ENTITY_CHOICE(
+ "Notification control cvar: 0 = off, 1 = trigger option A subcall, 2 = trigger option B subcall",
+ "Notification control cvar: 0 = off, 1 = allowed in warmup mode, 2 = always allowed"
);
}
{
entity found_choice;
- if(notif.nent_challow && (warmup_stage || (notif.nent_challow == 2)))
+ if(notif.nent_challow_var && (warmup_stage || (notif.nent_challow_var == 2)))
{
switch(cvar_string(sprintf("notification_%s", notif.nent_name)))
{
if(net_type == MSG_CHOICE)
{
- // float verbose_allowed = (autocvar_notification_server_allows_frag_verbose && ((autocvar_notification_server_allows_frag_verbose == 2) || warmup_stage));
- // THIS GETS TRICKY... now we have to cycle through each possible player (checking broadcast)nent_challow
+ // THIS GETS TRICKY... now we have to cycle through each possible player (checking broadcast)
// and then do an individual NOTIF_ONE_ONLY recursive call for each one depending on their option...
// It's slow, but it's better than the alternatives:
// 1. Constantly networking all info and letting client decide
entity found_choice;
#define RECURSE_FROM_CHOICE(ent,action) \
- if(notif.nent_challow && (warmup_stage || (notif.nent_challow == 2))) \
+ if(notif.nent_challow_var && (warmup_stage || (notif.nent_challow_var == 2))) \
{ \
switch(ent.msg_choice_choices[net_name]) \
{ \
string durcnt,
string normal,
string gentle,
- float challow,
+ float challow_def,
+ float challow_var,
float chtype,
float optiona,
float optionb);
#define NOTIF_FIRST 1
-// notification limits
-#define NOTIF_ANNCE_MAX 64
-#define NOTIF_INFO_MAX 512
-#define NOTIF_CENTER_MAX 512
-#define NOTIF_MULTI_MAX 256
-#define NOTIF_CHOICE_MAX 64
-#define NOTIF_CPID_MAX 128
+// notification limits -- INCREASE AS NECESSARY
+#define NOTIF_ANNCE_MAX 64
+#define NOTIF_INFO_MAX 256
+#define NOTIF_CENTER_MAX 256
+#define NOTIF_MULTI_MAX 128
+#define NOTIF_CHOICE_MAX 8
+#define NOTIF_CPID_MAX 256 // should match NOTIF_CENTER_MAX
// error detection
float notif_error;
.float nent_cpid;
.string nent_durcnt;
.string nent_string;
-.float nent_challow;
+.float nent_challow_def;
+.float nent_challow_var;
.entity nent_optiona;
.entity nent_optionb;
"", /* durcnt */ \
"", /* normal */ \
"", /* gentle */ \
- NO_MSG, /* challow */ \
+ NO_MSG, /* challow_def */ \
+ NO_MSG, /* challow_var */ \
NO_MSG, /* chtype */ \
NO_MSG, /* optiona */ \
NO_MSG); /* optionb */ \
"", /* durcnt */ \
normal, /* normal */ \
gentle, /* gentle */ \
- NO_MSG, /* challow */ \
+ NO_MSG, /* challow_def */ \
+ NO_MSG, /* challow_var */ \
NO_MSG, /* chtype */ \
NO_MSG, /* optiona */ \
NO_MSG); /* optionb */ \
durcnt, /* durcnt */ \
normal, /* normal */ \
gentle, /* gentle */ \
- NO_MSG, /* challow */ \
+ NO_MSG, /* challow_def */ \
+ NO_MSG, /* challow_var */ \
NO_MSG, /* chtype */ \
NO_MSG, /* optiona */ \
NO_MSG); /* optionb */ \
"", /* durcnt */ \
"", /* normal */ \
"", /* gentle */ \
- NO_MSG, /* challow */ \
+ NO_MSG, /* challow_def */ \
+ NO_MSG, /* challow_var */ \
NO_MSG, /* chtype */ \
NO_MSG, /* optiona */ \
NO_MSG); /* optionb */ \
"", /* durcnt */ \
"", /* normal */ \
"", /* gentle */ \
- autocvar_notification_##name##_ALLOWED, /* challow */ \
+ challow, /* challow_def */ \
+ autocvar_notification_##name##_ALLOWED, /* challow_var */ \
chtype, /* chtype */ \
optiona, /* optiona */ \
optionb); /* optionb */ \