1
This commit is contained in:
parent
c4cae288f4
commit
cc2da01509
@ -35,6 +35,11 @@ int MobaBattle::GetMemberNum()
|
|||||||
return member_id_hash_.size();
|
return member_id_hash_.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int MobaBattle::GetTeamNum()
|
||||||
|
{
|
||||||
|
return uuid_hash_.size();
|
||||||
|
}
|
||||||
|
|
||||||
void MobaBattle::TraverseMemberList(std::function<bool (MobaMember*)> func)
|
void MobaBattle::TraverseMemberList(std::function<bool (MobaMember*)> func)
|
||||||
{
|
{
|
||||||
for (auto& pair : member_id_hash_) {
|
for (auto& pair : member_id_hash_) {
|
||||||
|
@ -26,6 +26,7 @@ class MobaBattle
|
|||||||
std::shared_ptr<MobaTeam> GetTeamByTeamUuid(const std::string& team_uuid);
|
std::shared_ptr<MobaTeam> GetTeamByTeamUuid(const std::string& team_uuid);
|
||||||
bool AllIsJoined();
|
bool AllIsJoined();
|
||||||
int GetMemberNum();
|
int GetMemberNum();
|
||||||
|
int GetTeamNum();
|
||||||
void TraverseMemberList(std::function<bool (MobaMember*)> func);
|
void TraverseMemberList(std::function<bool (MobaMember*)> func);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -1170,6 +1170,16 @@ void RoomMgr::_CMJoinMoba(f8::MsgHdr* hdr, const cs::CMJoin& msg)
|
|||||||
if (!member) {
|
if (!member) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (p->GetTeamNum() < 0 ||
|
||||||
|
p->GetTeamNum() > 2) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
p->TraverseMemberList
|
||||||
|
(
|
||||||
|
[] (MobaMember* m) -> bool
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
});
|
||||||
};
|
};
|
||||||
SendGetMobaBattleData(join_msg, cb);
|
SendGetMobaBattleData(join_msg, cb);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user