修复房间匹配问题

This commit is contained in:
aozhiwei 2020-07-08 21:05:04 +08:00
parent 23a948dff5
commit e6b81c45a8

View File

@ -44,7 +44,11 @@ static RoomType_e GetHumanRoomType(const cs::CMJoin& msg, int& game_times)
#endif
if (msg.force_entry_newbie_room()) {
if (msg.team_uuid().empty()) {
return RT_NewBrid;
} else {
return RT_MidBrid;
}
}
if (game_times <= 0) {
@ -83,7 +87,7 @@ static RoomType_e GetHumanRoomType(const cs::CMJoin& msg, int& game_times)
}
}
if (rank >= 5 && rank <= 10) {
if (rank >= 0 && rank <= 10) {
return RT_OldBrid1;
} else if (rank >= 11 && rank <= 17) {
return RT_OldBrid2;
@ -188,9 +192,11 @@ Room* RoomMgr::GetJoinableRoom(const cs::CMJoin& msg, const RoomType_e self_room
}
for (int i = 0; i < RT_Max; ++i) {
for (Room* room : group_rooms[i]) {
if (room->GetRoomType() == self_room_type) {
return room;
}
}
}
return CreateRoom(self_room_type, game_times);
}