From 93d19816de5fc6e06492d6a5f22f95b36de2afc7 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 20 Mar 2024 19:27:08 +0800 Subject: [PATCH] 1 --- server/gameserver/pbutils.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/server/gameserver/pbutils.cc b/server/gameserver/pbutils.cc index f5c4bf39..839fe636 100644 --- a/server/gameserver/pbutils.cc +++ b/server/gameserver/pbutils.cc @@ -2641,6 +2641,9 @@ void Room::SendSMTeamFull(Human* hum) void Room::OnTeamPartChg(Human* hum) { + if (!IsMobaModeRoom()) { + return; + } if (hpchg_human_hash_.empty()) { hpchg_human_hash_[hum->GetUniId()] = hum; xtimer.SetTimeoutWpEx @@ -2648,6 +2651,17 @@ void Room::OnTeamPartChg(Human* hum) [this] (int event, const a8::Args* args) { if (a8::TIMER_EXEC_EVENT == event) { + cs::SMTeamPartNotify notify_msg; + for (auto& pair : hpchg_human_hash_) { + pair.second->FillMFTeamPart(notify_msg.add_members()); + } + TraversePlayerList + ( + [¬ify_msg] (Player* hum) -> bool + { + hum->SendNotifyMsg(notify_msg); + return true; + }); hpchg_human_hash_.clear(); } },