1
This commit is contained in:
parent
0996109eae
commit
4ceff51f7d
@ -1036,6 +1036,26 @@ bool Room::CanJoin(const std::string& accountid,
|
||||
if (GetPlayerByAccountId(accountid)) {
|
||||
return false;
|
||||
}
|
||||
if (GetPlayerNum() < (int)GetRoomMaxPlayerNum() &&
|
||||
!msg.team_uuid().empty() &&
|
||||
human_hash_.size() >= GetRoomMaxPlayerNum()
|
||||
) {
|
||||
bool have_team = false;
|
||||
for (auto& pair : human_hash_) {
|
||||
if (pair.second->team_uuid == msg.team_uuid()) {
|
||||
if (pair.second->GetTeam() && !pair.second->GetTeam()->IsFull()) {
|
||||
have_team = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}//end for human_hash_
|
||||
if (have_team) {
|
||||
while (human_hash_.size() >= GetRoomMaxPlayerNum()) {
|
||||
RandRemoveAndroid();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return GetPlayerNum() < (int)GetRoomMaxPlayerNum();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user