diff --git a/server/gameserver/mobabattle.cc b/server/gameserver/mobabattle.cc index 55a73e79..aba7479d 100644 --- a/server/gameserver/mobabattle.cc +++ b/server/gameserver/mobabattle.cc @@ -5,17 +5,16 @@ int MobaTeam::GetMemberNum() { - return 0; + return member_hash_.size(); } void MobaTeam::TraverseMember(std::function)> cb) { - -} - -bool MobaBattle::CanAdd(const std::string& account_id, const std::string& session_id) -{ - return true; + for (auto& pair : member_hash_) { + if (!cb(pair.second)) { + break; + } + } } std::shared_ptr MobaBattle::GetTeamByAccountId(const std::string& account_id) @@ -36,11 +35,6 @@ std::shared_ptr MobaBattle::GetTeamByTeamUuid(const std::string& team_ return itr != uuid_hash_.end() ? itr->second : nullptr; } -bool MobaBattle::AllIsJoined() -{ - return false; -} - int MobaBattle::GetMemberNum() { return member_id_hash_.size(); diff --git a/server/gameserver/mobabattle.h b/server/gameserver/mobabattle.h index bd823336..3f919838 100644 --- a/server/gameserver/mobabattle.h +++ b/server/gameserver/mobabattle.h @@ -69,11 +69,9 @@ class MobaBattle int GetNodeId() { return zone_id_; } int GetStartTime() { return start_time_; } void ParseResult(a8::XObject& obj); - bool CanAdd(const std::string& account_id, const std::string& session_id); std::shared_ptr GetTeamByAccountId(const std::string& account_id); std::shared_ptr GetMemberByAccountId(const std::string& account_id); std::shared_ptr GetTeamByTeamUuid(const std::string& team_uuid); - bool AllIsJoined(); int GetMemberNum(); int GetTeamNum(); void TraverseMemberList(std::function func);