From ba2150ae500cb1c61211de99fed37b2e3e807d1e Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 29 Dec 2023 17:10:56 +0800 Subject: [PATCH] 1 --- server/gameserver/pbutils.cc | 44 +++++++++++++++++++++--------------- server/gameserver/room.cc | 5 ++-- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/server/gameserver/pbutils.cc b/server/gameserver/pbutils.cc index b2c77b9d..af7380fa 100644 --- a/server/gameserver/pbutils.cc +++ b/server/gameserver/pbutils.cc @@ -1613,16 +1613,17 @@ void Human::SendUIUpdate() notifymsg.set_boss_state(room->pve_data.boss_state); } if (room->IsMobaModeRoom()) { - if (room->GetMobaTeamA()) { - notifymsg.set_a_team_id(room->GetMobaTeamA()->GetTeamId()); - notifymsg.set_a_kill_count(room->GetMobaTeamA()->GetKillCount()); - } - if (room->GetMobaTeamB()) { - notifymsg.set_b_team_id(room->GetMobaTeamB()->GetTeamId()); - notifymsg.set_b_kill_count(room->GetMobaTeamB()->GetKillCount()); - } -#if 0 +#if 1 if (GetTeam()->GetTeamId() == room->GetMobaTeamA()->GetTeamId()) { + if (room->GetMobaTeamA()) { + notifymsg.set_a_team_id(room->GetMobaTeamB()->GetTeamId()); + notifymsg.set_a_kill_count(room->GetMobaTeamB()->GetKillCount()); + } + if (room->GetMobaTeamB()) { + notifymsg.set_b_team_id(room->GetMobaTeamA()->GetTeamId()); + notifymsg.set_b_kill_count(room->GetMobaTeamA()->GetKillCount()); + } + } else { if (room->GetMobaTeamA()) { notifymsg.set_a_team_id(room->GetMobaTeamA()->GetTeamId()); notifymsg.set_a_kill_count(room->GetMobaTeamA()->GetKillCount()); @@ -1631,16 +1632,23 @@ void Human::SendUIUpdate() notifymsg.set_b_team_id(room->GetMobaTeamB()->GetTeamId()); notifymsg.set_b_kill_count(room->GetMobaTeamB()->GetKillCount()); } - } else { - if (room->GetMobaTeamA()) { - notifymsg.set_b_team_id(room->GetMobaTeamA()->GetTeamId()); - notifymsg.set_b_kill_count(room->GetMobaTeamA()->GetKillCount()); - } - if (room->GetMobaTeamB()) { - notifymsg.set_a_team_id(room->GetMobaTeamB()->GetTeamId()); - notifymsg.set_a_kill_count(room->GetMobaTeamB()->GetKillCount()); - } } +#else + if (room->GetMobaTeamA()) { + notifymsg.set_a_team_id(room->GetMobaTeamA()->GetTeamId()); + notifymsg.set_a_kill_count(room->GetMobaTeamA()->GetKillCount()); + } + if (room->GetMobaTeamB()) { + notifymsg.set_b_team_id(room->GetMobaTeamB()->GetTeamId()); + notifymsg.set_b_kill_count(room->GetMobaTeamB()->GetKillCount()); + } +#endif +#ifdef MYDEBUG + a8::XPrintf("zzzzzzzzzzzzz self_team_id:%d data:%s\n", + { + GetTeam()->GetTeamId(), + f8::PbToJson(¬ifymsg) + }); #endif } SendNotifyMsg(notifymsg); diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index 2e038891..6422a678 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -351,7 +351,8 @@ void Room::AddPlayer(Player* hum, std::shared_ptr init_born_point, bo } #if 1 if (IsMobaModeRoom()) { - hum->side = a8::RandEx(1, 2); + //hum->side = a8::RandEx(1, 2); + hum->side = 1; CreateAndroid(7); std::vector humans; for (auto& pair : human_hash_) { @@ -406,7 +407,7 @@ void Room::AddPlayer(Player* hum, std::shared_ptr init_born_point, bo } }, &hum->xtimer_attacher); -#ifdef MYDEBUG1 +#ifdef MYDEBUG for (auto& pair : human_hash_) { a8::XPrintf("moba check uniid:%d team_id:%d side:%d\n", {