From 7eaf6bfa47d0e8b172c68d59f106fbb530aba9fb Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Sat, 15 Dec 2012 03:32:48 -0500 Subject: [PATCH] Remove some legacy notification systems --- qcsrc/common/notifications.qc | 32 ++++---------------------------- qcsrc/server/g_damage.qc | 8 +++----- qcsrc/server/race.qc | 12 ++++++------ 3 files changed, 13 insertions(+), 39 deletions(-) diff --git a/qcsrc/common/notifications.qc b/qcsrc/common/notifications.qc index 8df9454a4..1ddf72118 100644 --- a/qcsrc/common/notifications.qc +++ b/qcsrc/common/notifications.qc @@ -197,6 +197,10 @@ string got_commandkey; MSG_INFO_NOTIF(INFO_DEATH_MURDER_FIRE, 2, 1, XPND3(s1, s2, SPREE_END), XPND2(s1, s2), "notify_death", _("^BG%s^K1 was burnt up into a crisp by ^BG%s^K1%s\n"), _("^F1%s^K1 felt a little hot from ^BG%s^K1's fire^K1%s\n")) \ MSG_INFO_NOTIF(INFO_KEEPAWAY_DROPPED, 1, 0, s1, XPND2(s1, ""), "notify_balldropped", _("^BG%s^BG has dropped the ball!\n"), "") \ MSG_INFO_NOTIF(INFO_KEEPAWAY_PICKUP, 1, 0, s1, XPND2(s1, ""), "notify_ballpickedup", _("^BG%s^BG has picked up the ball!\n"), "") \ + MSG_INFO_NOTIF(INFO_RACE_FAIL, 2, 0, XPND2(s1, s2), XPND2(s1, ""), "race_newfail", "", "") \ + MSG_INFO_NOTIF(INFO_RACE_NEW_RECORD, 2, 0, XPND2(s1, s2), XPND2(s1, ""), "race_newrecordserver", "", "") \ + MSG_INFO_NOTIF(INFO_RACE_NEW_TIME, 2, 0, XPND2(s1, s2), XPND2(s1, ""), "race_newtime", "", "") \ + MSG_INFO_NOTIF(INFO_RACE_NEW_RANK, 2, 0, XPND2(s1, s2), XPND2(s1, ""), "race_newrankyellow", "", "") \ MULTITEAM_INFO(INFO_SCORES_, 4, 0, 0, NO_STR_ARG, XPND2("", ""), "", _("^TC^TT ^BGteam scores!\n"), "") \ MSG_INFO_NOTIF(INFO_WEAPON_THINKING_WITH_PORTALS, 1, 0, s1, XPND2(s1, ""), "notify_selfkill", _("^BG%s^K1 is now thinking with portals...\n"), "") \ MSG_INFO_NOTIF(INFO_WEAPON_CRYLINK_SUICIDE, 1, 0, s1, XPND2(s1, ""), "weaponcrylink", _("^BG%s^K1 felt the strong pull of their Crylink\n"), "") \ @@ -844,34 +848,6 @@ 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 0e67dada7..2fceee4e1 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -340,12 +340,11 @@ void Obituary_SpecialDeath(entity notif_target, float murder, float deathtype, s if not(hits) { - backtrace("Unhandled deathtype. Please notify Samual!\n"); - //return; + backtrace("Obituary_SpecialDeath(): Unhandled deathtype- Please notify Samual!\n"); } if not(handled) { - print(sprintf("Obituary_SpecialDeath(): ^1Deathtype ^7(%s-%d)^1 has no notification!\n", Deathtype_Name(deathtype), deathtype)); + dprint(sprintf("Obituary_SpecialDeath(): ^1Deathtype ^7(%s-%d)^1 has no notification!\n", Deathtype_Name(deathtype), deathtype)); return; } } @@ -362,7 +361,7 @@ void Obituary_WeaponDeath(float murder, float deathtype, string s1, string s2) w_deathtype = FALSE; if(death_message) { Send_Notification(world, MSG_ALL, MSG_WEAPON, death_message, s1, s2, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); } - else { print(sprintf("Obituary_WeaponDeath(): ^1Deathtype ^7(%s-%d)^1 has no notification for weapon %d!\n", Deathtype_Name(deathtype), deathtype, death_weapon)); } + else { dprint(sprintf("Obituary_WeaponDeath(): ^1Deathtype ^7(%s-%d)^1 has no notification for weapon %d!\n", Deathtype_Name(deathtype), deathtype, death_weapon)); } } } @@ -463,7 +462,6 @@ void Obituary(entity attacker, entity inflictor, entity targ, float deathtype) attacker.taunt_soundtime = time + 1; attacker.killcount = attacker.killcount + 1; - if(targ.killcount > 2) { Send_KillNotification(s, ftos(targ.killcount), a, KILL_END_SPREE, MSG_SPREE); } #define ADD_ACHIEVEMENT_CASE(numa,numb) \ case numa: \ diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index c7c38165d..a1dda5f10 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -156,13 +156,13 @@ void race_setTime(string map, float t, string myuid, string mynetname, entity e) recorddifference = strcat(" ^1[+", TIME_ENCODED_TOSTRING(t - oldrec), "]"); bprint(mynetname, "^7 couldn't break their ", race_placeName(player_prevpos), " place record of ", TIME_ENCODED_TOSTRING(oldrec), recorddifference, "\n"); race_SendStatus(0, e); // "fail" - Send_KillNotification(e.netname, TIME_ENCODED_TOSTRING(t), "", RACE_FAIL, MSG_RACE); + Send_Notification(world, MSG_ALL, MSG_INFO, INFO_RACE_FAIL, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); return; } else if (!newpos) { // no ranking, time worse than the worst ranked recorddifference = strcat(" ^1[+", TIME_ENCODED_TOSTRING(t - race_readTime(GetMapname(), RANKINGS_CNT)), "]"); bprint(mynetname, "^7 couldn't break the ", race_placeName(RANKINGS_CNT), " place record of ", TIME_ENCODED_TOSTRING(race_readTime(GetMapname(), RANKINGS_CNT)), recorddifference, "\n"); race_SendStatus(0, e); // "fail" - Send_KillNotification(e.netname, TIME_ENCODED_TOSTRING(t), "", RACE_FAIL, MSG_RACE); + Send_Notification(world, MSG_ALL, MSG_INFO, INFO_RACE_FAIL, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); return; } @@ -201,22 +201,22 @@ void race_setTime(string map, float t, string myuid, string mynetname, entity e) bprint(mynetname, "^1 broke ", oldrec_holder, "^1's 1st place record with ", strcat(TIME_ENCODED_TOSTRING(t), recorddifference, "\n")); } race_SendStatus(3, e); // "new server record" - Send_KillNotification(e.netname, TIME_ENCODED_TOSTRING(t), "", RACE_SERVER_RECORD, MSG_RACE); + Send_Notification(world, MSG_ALL, MSG_INFO, INFO_RACE_NEW_RECORD, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); } else { if(newpos == player_prevpos) { recorddifference = strcat(" ^2[-", TIME_ENCODED_TOSTRING(oldrec - t), "]"); bprint(mynetname, "^5 improved their ", race_placeName(newpos), " ^5place record with ", TIME_ENCODED_TOSTRING(t), recorddifference, "\n"); race_SendStatus(1, e); // "new time" - Send_KillNotification(e.netname, TIME_ENCODED_TOSTRING(t), "", RACE_NEW_TIME, MSG_RACE); + Send_Notification(world, MSG_ALL, MSG_INFO, INFO_RACE_NEW_TIME, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); } else if (oldrec == 0) { bprint(mynetname, "^2 set the ", race_placeName(newpos), " ^2place record with ", TIME_ENCODED_TOSTRING(t), "\n"); race_SendStatus(2, e); // "new rank" - Send_KillNotification(e.netname, TIME_ENCODED_TOSTRING(t), "", RACE_NEW_RANK, MSG_RACE); + Send_Notification(world, MSG_ALL, MSG_INFO, INFO_RACE_NEW_RANK, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); } else { recorddifference = strcat(" ^2[-", TIME_ENCODED_TOSTRING(oldrec - t), "]"); bprint(mynetname, "^2 broke ", oldrec_holder, "^2's ", race_placeName(newpos), " ^2place record with ", strcat(TIME_ENCODED_TOSTRING(t), recorddifference, "\n")); race_SendStatus(2, e); // "new rank" - Send_KillNotification(e.netname, TIME_ENCODED_TOSTRING(t), "", RACE_NEW_TIME, MSG_RACE); + Send_Notification(world, MSG_ALL, MSG_INFO, INFO_RACE_NEW_RANK, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); } } } -- 2.39.2