break;
}
}
-
return "";
}
{
input = strreplace("^F1", "^3", input);
input = strreplace("^F2", "^2", input);
+ input = strreplace("^K1", "^1", input);
+ input = strreplace("^K2", "^5", input);
input = strreplace("^BG", "^7", input);
input = strreplace("^N", "^7", input); // "none"-- reset to white
MSG_INFO_NOTIFICATIONS
break;
}
-
case MSG_NOTIFY:
{
+ #define MSG_NOTIFY_NOTIF(name,args,icon,normal,gentle) \
+ { NOTIF_MATCH(name,net_name) { print("unhandled\n"); } }
+
+ MSG_NOTIFY_NOTIFICATIONS
break;
}
-
case MSG_CENTER:
{
#define MSG_CENTER_NOTIF(name,args,cpid,durcnt,normal,gentle) \
MSG_CENTER_NOTIFICATIONS
break;
}
-
case MSG_WEAPON:
{
+ #define MSG_WEAPON_NOTIF(name,args,normal,gentle) \
+ { NOTIF_MATCH(name,net_name) { print("unhandled\n"); } }
+
+ MSG_WEAPON_NOTIFICATIONS
break;
}
}
#ifdef SVQC
void Send_Notification(float net_type, entity client, float net_name, string s1, string s2, string s3)
{
- print("notification: ", Get_Notif_Name(net_type, net_name), ": ", ftos(net_name), ".\n");
if(net_type && net_name)
{
+ print("notification: ", Get_Notif_Name(net_type, net_name), ": ", ftos(net_name), ".\n");
+
if(client && (clienttype(client) == CLIENTTYPE_REAL) && (client.flags & FL_CLIENT))
{
+ // personal/direct notification sent to ONE person and their spectators
msg_entity = client;
WRITESPECTATABLE_MSG_ONE({
WriteByte(MSG_ONE, SVC_TEMPENTITY);
WriteCoord(MSG_ONE, net_name);
WriteString(MSG_ONE, s1);
WriteString(MSG_ONE, s2);
- WriteString(MSG_ONE, s3);
+ WriteString(MSG_ALL, s3);
});
}
+ else
+ {
+ // global notification sent to EVERYONE
+ WriteByte(MSG_ALL, SVC_TEMPENTITY);
+ WriteByte(MSG_ALL, TE_CSQC_NOTIFICATION);
+ WriteShort(MSG_ALL, net_type);
+ WriteCoord(MSG_ALL, net_name);
+ WriteString(MSG_ALL, s1);
+ WriteString(MSG_ALL, s2);
+ WriteString(MSG_ALL, s3);
+ }
if(!server_is_local && ((net_type == MSG_INFO || net_type == MSG_NOTIFY) || client == world))
{
case MSG_NOTIFY:
{
+ #define MSG_NOTIFY_NOTIF(name,args,icon,normal,gentle) \
+ { NOTIF_MATCH(name,net_name) { print("unhandled\n"); } }
+
+ MSG_NOTIFY_NOTIFICATIONS
break;
}
}
}
}
+// use this ONLY if you need exceptions or want to exclude spectators, otherwise use Send_Notification(..., world, ...)
void Send_Notification_ToAll(entity except, float spectators, float net_type, float net_name, string s1, string s2, string s3)
{
entity tmp_entity;