From 04d1f27dbb33bc3ea4ee6c0fd48639dca58ecdc6 Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Wed, 26 Sep 2012 00:29:53 -0400 Subject: [PATCH] Going to sleep for now... just committing progress in the meanwhile --- qcsrc/client/Main.qc | 2 +- qcsrc/common/notifications.qc | 30 ++++++++++++++++++++++++++++- qcsrc/server/g_damage.qc | 36 +++++++++++++---------------------- 3 files changed, 43 insertions(+), 25 deletions(-) diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index 4d6be4c59..14b31947c 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -1188,7 +1188,7 @@ float CSQC_Parse_TempEntity() bHandled = true; break; case TE_CSQC_NOTIFICATION: - Local_Notification(ReadByte(), ReadCoord(), ReadString(), ReadString(), ReadString()); + Local_Notification(ReadShort(), ReadCoord(), ReadString(), ReadString(), ReadString()); bHandled = true; break; default: diff --git a/qcsrc/common/notifications.qc b/qcsrc/common/notifications.qc index cd0bf5fff..1d22144b1 100644 --- a/qcsrc/common/notifications.qc +++ b/qcsrc/common/notifications.qc @@ -222,7 +222,7 @@ void Send_Notification(float net_type, entity client, float net_name, string s1, WRITESPECTATABLE_MSG_ONE({ WriteByte(MSG_ONE, SVC_TEMPENTITY); WriteByte(MSG_ONE, TE_CSQC_NOTIFICATION); - WriteByte(MSG_ONE, net_type); + WriteShort(MSG_ONE, net_type); WriteCoord(MSG_ONE, net_name); WriteString(MSG_ONE, s1); WriteString(MSG_ONE, s2); @@ -281,6 +281,34 @@ void Send_Notification_ToAll(entity except, float spectators, float net_type, fl } // LEGACY NOTIFICATION SYSTEMS +void Send_KillNotification (string s1, string s2, string s3, float msg, float type) +{ + WriteByte(MSG_ALL, SVC_TEMPENTITY); + WriteByte(MSG_ALL, TE_CSQC_KILLNOTIFY); + WriteString(MSG_ALL, s1); + WriteString(MSG_ALL, s2); + WriteString(MSG_ALL, s3); + WriteShort(MSG_ALL, msg); + WriteByte(MSG_ALL, type); +} + +// Function is used to send a generic centerprint whose content CSQC gets to decide (gentle version or not in the below cases) +void Send_CSQC_KillCenterprint(entity e, string s1, string s2, float msg, float type) +{ + if (clienttype(e) == CLIENTTYPE_REAL) + { + msg_entity = e; + WRITESPECTATABLE_MSG_ONE({ + WriteByte(MSG_ONE, SVC_TEMPENTITY); + WriteByte(MSG_ONE, TE_CSQC_KILLCENTERPRINT); + WriteString(MSG_ONE, s1); + WriteString(MSG_ONE, s2); + WriteShort(MSG_ONE, msg); + WriteByte(MSG_ONE, type); + }); + } +} + void Send_CSQC_Centerprint_Generic(entity e, float id, string s, float duration, float countdown_num) { if ((clienttype(e) == CLIENTTYPE_REAL) && (e.flags & FL_CLIENT)) diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index d2cc61db3..592bf4653 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -308,31 +308,21 @@ void LogDeath(string mode, float deathtype, entity killer, entity killed) GameLogEcho(s); } -void Send_KillNotification (string s1, string s2, string s3, float msg, float type) +void Obituary_Notification(string s1, string s2, float deathtype) { - WriteByte(MSG_ALL, SVC_TEMPENTITY); - WriteByte(MSG_ALL, TE_CSQC_KILLNOTIFY); - WriteString(MSG_ALL, s1); - WriteString(MSG_ALL, s2); - WriteString(MSG_ALL, s3); - WriteShort(MSG_ALL, msg); - WriteByte(MSG_ALL, type); -} - -// Function is used to send a generic centerprint whose content CSQC gets to decide (gentle version or not in the below cases) -void Send_CSQC_KillCenterprint(entity e, string s1, string s2, float msg, float type) -{ - if (clienttype(e) == CLIENTTYPE_REAL) + switch(deathtype) { - msg_entity = e; - WRITESPECTATABLE_MSG_ONE({ - WriteByte(MSG_ONE, SVC_TEMPENTITY); - WriteByte(MSG_ONE, TE_CSQC_KILLCENTERPRINT); - WriteString(MSG_ONE, s1); - WriteString(MSG_ONE, s2); - WriteShort(MSG_ONE, msg); - WriteByte(MSG_ONE, type); - }); + case DEATH_AUTOTEAMCHANGE: + case DEATH_CAMP: + case DEATH_NOAMMO: + case DEATH_ROT: + case DEATH_TEAMCHANGE: + + case KILL_TEAM_RED + + case DEATH_QUIET: + default: + break; } } -- 2.39.2