]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote-tracking branch 'origin/terencehill/centerprint_stuff'
authorRudolf Polzer <divverent@xonotic.org>
Sat, 27 Aug 2011 14:19:29 +0000 (16:19 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Sat, 27 Aug 2011 14:19:29 +0000 (16:19 +0200)
qcsrc/client/Main.qc
qcsrc/client/hud.qc
qcsrc/common/constants.qh
qcsrc/server/g_damage.qc
qcsrc/server/miscfunctions.qc

index f5dfec4e4a12f09649e3ff800e48c8cd732ff901..606123ad1c1d2c2ba4696b3f792bc8eb05a65e89 100644 (file)
@@ -1313,31 +1313,6 @@ void Net_ReadPingPLReport()
        playerslots[e].ping_movementloss = ml / 255.0;
 }
 
-void Net_Notify() {
-       float type;
-       type = ReadByte();
-
-       if(type == CSQC_KILLNOTIFY)
-       {
-               HUD_KillNotify(ReadString(), ReadString(), ReadString(), ReadShort(), ReadByte());
-       }
-       else if(type == CSQC_CENTERPRINT)
-       {
-               HUD_Centerprint(ReadString(), ReadString(), ReadShort(), ReadByte());
-       }
-       else if(type == CSQC_CENTERPRINT_GENERIC)
-       {
-               float id;
-               string s;
-               id = ReadByte();
-               s = ReadString();
-               if (id != 0 && s != "")
-                       centerprint_generic(id, s, ReadByte(), ReadByte());
-               else
-                       centerprint_generic(id, s, 0, 0);
-       }
-}
-
 void Net_WeaponComplain() {
        complain_weapon = ReadByte();
 
@@ -1405,8 +1380,23 @@ float CSQC_Parse_TempEntity()
                        announce_snd = strzone(ReadString());
                        bHandled = true;
                        break;
-               case TE_CSQC_NOTIFY:
-                       Net_Notify();
+               case TE_CSQC_KILLNOTIFY:
+                       HUD_KillNotify(ReadString(), ReadString(), ReadString(), ReadShort(), ReadByte());
+                       bHandled = true;
+                       break;
+               case TE_CSQC_KILLCENTERPRINT:
+                       HUD_KillCenterprint(ReadString(), ReadString(), ReadShort(), ReadByte());
+                       bHandled = true;
+                       break;
+               case TE_CSQC_CENTERPRINT_GENERIC:
+                       float id;
+                       string s;
+                       id = ReadByte();
+                       s = ReadString();
+                       if (id != 0 && s != "")
+                               centerprint_generic(id, s, ReadByte(), ReadByte());
+                       else
+                               centerprint_generic(id, s, 0, 0);
                        bHandled = true;
                        break;
                case TE_CSQC_WEAPONCOMPLAIN:
index f8d8a3296e9713dcc99d34b83fc52928558aa557..fc6164e6a0eec108a6e99927ce5556dea05dd66a 100644 (file)
@@ -1840,7 +1840,7 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) // s
        }
 }
 
-void HUD_Centerprint(string s1, string s2, float type, float msg)
+void HUD_KillCenterprint(string s1, string s2, float type, float msg)
 {
        float gentle;
        gentle = (autocvar_cl_gentle || autocvar_cl_gentle_messages);
index 9180b668321a2e202eb80f702ef7059c267966a4..67cf32a86ad0344d9ab683381034aa0ea1200abc 100644 (file)
@@ -57,8 +57,10 @@ const float TE_CSQC_TEAMNAGGER = 106;
 const float TE_CSQC_PINGPLREPORT = 107;
 const float TE_CSQC_ANNOUNCE = 110;
 const float TE_CSQC_TARGET_MUSIC = 111;
-const float TE_CSQC_NOTIFY = 112;
-const float TE_CSQC_WEAPONCOMPLAIN = 113;
+const float TE_CSQC_KILLNOTIFY = 112;
+const float TE_CSQC_KILLCENTERPRINT = 113;
+const float TE_CSQC_CENTERPRINT_GENERIC = 114;
+const float TE_CSQC_WEAPONCOMPLAIN = 115;
 const float TE_CSQC_NEX_SCOPE = 116;
 const float TE_CSQC_MINELAYER_MAXMINES = 117;
 const float TE_CSQC_HAGAR_MAXROCKETS = 118;
@@ -79,10 +81,6 @@ const float RACE_NET_SERVER_RANKINGS = 11;
 const float RACE_NET_SERVER_STATUS = 12;
 const float RANKINGS_CNT = 15;
 
-const float CSQC_KILLNOTIFY = 0;
-const float CSQC_CENTERPRINT = 1;
-const float CSQC_CENTERPRINT_GENERIC = 2;
-
 const float ENT_CLIENT = 0;
 const float ENT_CLIENT_DEAD = 1;
 const float ENT_CLIENT_ENTCS = 2;
index d6020bd349a8b7bf6955b838d5f094da1b80d7db..40887ad933c5d61329e18301a41083b253eeae07 100644 (file)
@@ -267,8 +267,7 @@ void LogDeath(string mode, float deathtype, entity killer, entity killed)
 void Send_KillNotification (string s1, string s2, string s3, float msg, float type)
 {
        WriteByte(MSG_ALL, SVC_TEMPENTITY);
-       WriteByte(MSG_ALL, TE_CSQC_NOTIFY);
-       WriteByte(MSG_ALL, CSQC_KILLNOTIFY);
+       WriteByte(MSG_ALL, TE_CSQC_KILLNOTIFY);
        WriteString(MSG_ALL, s1);
        WriteString(MSG_ALL, s2);
        WriteString(MSG_ALL, s3);
@@ -277,15 +276,14 @@ void Send_KillNotification (string s1, string s2, string s3, float msg, float ty
 }
 
 // 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_Centerprint(entity e, string s1, string s2, float msg, float type)
+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_NOTIFY);
-                       WriteByte(MSG_ONE, CSQC_CENTERPRINT);
+                       WriteByte(MSG_ONE, TE_CSQC_KILLCENTERPRINT);
                        WriteString(MSG_ONE, s1);
                        WriteString(MSG_ONE, s2);
                        WriteShort(MSG_ONE, msg);
@@ -309,7 +307,7 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                        if (deathtype == DEATH_TEAMCHANGE || deathtype == DEATH_AUTOTEAMCHANGE)
                                msg = ColoredTeamName(targ.team); // TODO: check if needed?
             if(!g_cts) // no "killed your own dumb self" message in CTS
-                Send_CSQC_Centerprint(targ, msg, "", deathtype, MSG_SUICIDE);
+                Send_CSQC_KillCenterprint(targ, msg, "", deathtype, MSG_SUICIDE);
 
                        if(deathtype != DEATH_TEAMCHANGE && deathtype != DEATH_QUIET)
                        {
@@ -340,7 +338,7 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
 
                                GiveFrags(attacker, targ, -1, deathtype);
 
-                               Send_CSQC_Centerprint(attacker, s, "", type, MSG_KILL);
+                               Send_CSQC_KillCenterprint(attacker, s, "", type, MSG_KILL);
 
                                if (targ.killcount > 2) {
                                        msg = ftos(targ.killcount);
@@ -363,18 +361,18 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                                        checkrules_firstblood = TRUE;
                                        Send_KillNotification(a, "", "", KILL_FIRST_BLOOD, MSG_KILL);
                                        // TODO: make these print a newline if they dont
-                                       Send_CSQC_Centerprint(attacker, "", "", KILL_FIRST_BLOOD, MSG_KILL);
-                                       Send_CSQC_Centerprint(targ, "", "", KILL_FIRST_VICTIM, MSG_KILL);
+                                       Send_CSQC_KillCenterprint(attacker, "", "", KILL_FIRST_BLOOD, MSG_KILL);
+                                       Send_CSQC_KillCenterprint(targ, "", "", KILL_FIRST_VICTIM, MSG_KILL);
                                        PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD, 1);
                                        PlayerStats_Event(targ, PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM, 1);
                                }
 
                                if((autocvar_sv_fragmessage_information_typefrag) && (targ.BUTTON_CHAT)) {
-                                       Send_CSQC_Centerprint(attacker, s, GetAdvancedDeathReports(targ), KILL_TYPEFRAG, MSG_KILL);
-                                       Send_CSQC_Centerprint(targ, a, GetAdvancedDeathReports(attacker), KILL_TYPEFRAGGED, MSG_KILL);
+                                       Send_CSQC_KillCenterprint(attacker, s, GetAdvancedDeathReports(targ), KILL_TYPEFRAG, MSG_KILL);
+                                       Send_CSQC_KillCenterprint(targ, a, GetAdvancedDeathReports(attacker), KILL_TYPEFRAGGED, MSG_KILL);
                                } else {
-                                       Send_CSQC_Centerprint(attacker, s, GetAdvancedDeathReports(targ), KILL_FRAG, MSG_KILL);
-                                       Send_CSQC_Centerprint(targ, a, GetAdvancedDeathReports(attacker), KILL_FRAGGED, MSG_KILL);
+                                       Send_CSQC_KillCenterprint(attacker, s, GetAdvancedDeathReports(targ), KILL_FRAG, MSG_KILL);
+                                       Send_CSQC_KillCenterprint(targ, a, GetAdvancedDeathReports(attacker), KILL_FRAGGED, MSG_KILL);
                                }
 
                                attacker.taunt_soundtime = time + 1;
@@ -455,7 +453,7 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                }
                else
                {
-                       Send_CSQC_Centerprint(targ, "", "", deathtype, MSG_KILL_ACTION);
+                       Send_CSQC_KillCenterprint(targ, "", "", deathtype, MSG_KILL_ACTION);
                        if (deathtype == DEATH_HURTTRIGGER && inflictor.message != "")
                                msg = inflictor.message;
                        else if (deathtype == DEATH_CUSTOM)
index fcf6283db1c00fef41e8a8e493e7f4f6e4219336..4192e4973118730e96099f20143a4a96d8b66aaa 100644 (file)
@@ -1673,8 +1673,7 @@ void Send_CSQC_Centerprint_Generic(entity e, float id, string s, float duration,
                msg_entity = e;
                WRITESPECTATABLE_MSG_ONE({
                        WriteByte(MSG_ONE, SVC_TEMPENTITY);
-                       WriteByte(MSG_ONE, TE_CSQC_NOTIFY);
-                       WriteByte(MSG_ONE, CSQC_CENTERPRINT_GENERIC);
+                       WriteByte(MSG_ONE, TE_CSQC_CENTERPRINT_GENERIC);
                        WriteByte(MSG_ONE, id);
                        WriteString(MSG_ONE, s);
                        if (id != 0 && s != "")