From 08bf0782d52cbf0887a2a8de5c0bdde67e01098e Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 27 Dec 2023 19:07:37 +0800 Subject: [PATCH] 1 --- server/gameserver/mobabattle.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/server/gameserver/mobabattle.cc b/server/gameserver/mobabattle.cc index 14518fc8..cc44a7a8 100644 --- a/server/gameserver/mobabattle.cc +++ b/server/gameserver/mobabattle.cc @@ -4,32 +4,35 @@ bool MobaBattle::CanAdd(const std::string& account_id, const std::string& session_id) { - + return true; } std::shared_ptr MobaBattle::GetTeamByAccountId(const std::string& account_id) { - + auto itr = account_hash_.find(account_id); + return itr != account_hash_.end() ? itr->second : nullptr; } std::shared_ptr MobaBattle::GetMemberByAccountId(const std::string& account_id) { - + auto itr = member_id_hash_.find(account_id); + return itr != member_id_hash_.end() ? itr->second : nullptr; } std::shared_ptr MobaBattle::GetTeamByTeamUuid(const std::string& team_uuid) { - + auto itr = uuid_hash_.find(team_uuid); + return itr != uuid_hash_.end() ? itr->second : nullptr; } bool MobaBattle::AllIsJoined() { - + return false; } int MobaBattle::GetMemberNum() { - + return member_id_hash_.size(); } void MobaBattle::TraverseMemberList(std::function func)