From 7aedde8bde85eb39644d2828877a59ed6c8543d9 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 13 Aug 2021 10:53:27 +0000 Subject: [PATCH] 1 --- server/gameserver/human.cc | 52 -------------------------------------- server/gameserver/human.h | 1 - 2 files changed, 53 deletions(-) diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index daf068d..14c972a 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -1495,58 +1495,6 @@ void Human::SendDebugMsg(const std::string& debug_msg) SendNotifyMsg(notify_msg); } -void Human::SendRollMsg(const std::string& msg, int killer_id, bool killer_team_id, int weapon_id) -{ - KillInfo* info = new KillInfo; - info->killer_id = killer_id; - info->killer_team_id = killer_team_id; - info->weapon_id = weapon_id; - info->msg = msg; - room->xtimer.AddDeadLineTimerAndAttach - ( - 0, - a8::XParams() - .SetSender(this) - .SetParam1(info), - [] (const a8::XParams& param) - { - Human* target = (Human*)param.sender.GetUserData(); - KillInfo* info = (KillInfo*)param.param1.GetUserData(); - target->room->TraversePlayerList - (a8::XParams(), - [target, info] (Human* hum, a8::XParams& param) -> bool - { - cs::SMRollMsg msg; - auto element = msg.add_elements(); - element->set_element_type(1); - element->mutable_union_obj_1()->set_text(info->msg); - if (info->killer_id == hum->GetUniId()){ - element->mutable_union_obj_1()->set_color(MetaMgr::Instance()->self_kill_color); - } else if (info->killer_team_id == hum->team_id) { - element->mutable_union_obj_1()->set_color(MetaMgr::Instance()->teammate_kill_color); - } else if (target == hum) { - element->mutable_union_obj_1()->set_color(MetaMgr::Instance()->self_bekill_color); - } else if (target->team_id == hum->team_id) { - element->mutable_union_obj_1()->set_color(MetaMgr::Instance()->teammate_bekill_color); - } - if (info->weapon_id != 0) { - auto img_element = msg.add_elements(); - img_element->set_element_type(2); - img_element->mutable_union_obj_2()->set_id(info->weapon_id); - } - hum->SendNotifyMsg(msg); - return true; - }); - }, - &xtimer_attacher.timer_list_, - [] (const a8::XParams& param) - { - KillInfo* info = (KillInfo*)param.param1.GetUserData(); - delete info; - } - ); -} - void Human::UpdateAction() { int passed_time = (room->GetFrameNo() - action_frameno) * FRAME_RATE_MS; diff --git a/server/gameserver/human.h b/server/gameserver/human.h index d43e74c..2d0449d 100644 --- a/server/gameserver/human.h +++ b/server/gameserver/human.h @@ -192,7 +192,6 @@ class Human : public Creature void SendGameOver(); void FollowTarget(Human* target); virtual void SendDebugMsg(const std::string& debug_msg) override; - void SendRollMsg(const std::string& msg, int killer_id, bool killer_team_id, int weapon_id = 0); void SendRollMsgEx(KillInfo& info, const char* fmt, std::initializer_list args