This commit is contained in:
aozhiwei 2019-07-25 21:51:15 +08:00
parent abfe1e71d8
commit 8c0bc41e93

View File

@ -102,12 +102,16 @@ int RoomMgr::OverRoomNum()
Room* RoomMgr::GetJoinableRoom(const cs::CMJoin& msg) Room* RoomMgr::GetJoinableRoom(const cs::CMJoin& msg)
{ {
for (auto& pair : inactive_room_hash_) { auto itr = room_unionid_hash_.find(msg.team_uuid());
if (pair.second->CanJoin(msg)) { if (itr != room_unionid_hash_.end()) {
return pair.second; if (itr->second->CanJoin(msg)) {
} return itr->second;
} } else {
return nullptr; return nullptr;
}
} else {
return nullptr;
}
} }
Room* RoomMgr::GetRoomByUuid(long long room_uuid) Room* RoomMgr::GetRoomByUuid(long long room_uuid)