|
@@ -50,12 +50,18 @@ func GetRoomsByType(roomType msg.RoomType) []*msg.RoomInfo {
|
|
|
func GetRoomsByLevel(matchInfo *msg.MatchLudo, roomStatus msg.RoomStatus) []*msg.RoomInfo {
|
|
|
gameConfig.mu.Lock()
|
|
|
defer gameConfig.mu.Unlock()
|
|
|
- roomLevel := matchInfo.RoomLevel
|
|
|
- color := matchInfo.SelectColor
|
|
|
- roomType := matchInfo.SelectRoomType
|
|
|
- var result []*msg.RoomInfo = make([]*msg.RoomInfo, 0)
|
|
|
+
|
|
|
+ fmt.Printf("RoomMap: %+v\n", gameConfig.RoomMap) // 打印 RoomMap 内容
|
|
|
+ fmt.Printf("Query: roomType=%v, roomLevel=%v, roomStatus=%v, color=%v\n",
|
|
|
+ matchInfo.SelectRoomType, matchInfo.RoomLevel, roomStatus, matchInfo.SelectColor)
|
|
|
+
|
|
|
+ var result []*msg.RoomInfo
|
|
|
for _, room := range gameConfig.RoomMap {
|
|
|
- if roomType == room.RoomType && room.RoomLevel == roomLevel && room.RoomStatus == roomStatus && IsMatchColor(room, color) {
|
|
|
+ fmt.Printf("Checking room: %+v\n", room) // 打印每个 room 的信息
|
|
|
+ if room.RoomType == matchInfo.SelectRoomType &&
|
|
|
+ room.RoomLevel == matchInfo.RoomLevel &&
|
|
|
+ room.RoomStatus == roomStatus &&
|
|
|
+ IsMatchColor(room, matchInfo.SelectColor) {
|
|
|
result = append(result, room)
|
|
|
}
|
|
|
}
|