|
|
@@ -70,7 +70,8 @@ public class RoomService {
|
|
|
Game game = gameRepo.findById(gameId).orElseThrow(new BusinessException("游戏无记录"));
|
|
|
GameMode mode = gameModeRepo.findById(modeId).orElseThrow(new BusinessException("模式无记录"));
|
|
|
GameMap map = gameMapRepo.findById(mapId).orElseThrow(new BusinessException("地图无记录"));
|
|
|
- BindGame bindGame = bindGameRepo.findByUserIdAndGameId(userId, gameId).orElse(null);
|
|
|
+ BindGame bindGame = bindGameRepo.findByUserIdAndGameIdAndZoneAndActive(userId, gameId, zone, true)
|
|
|
+ .orElseThrow(new BusinessException("请先绑定游戏"));
|
|
|
Room room = Room.builder()
|
|
|
.name(mode.getName() + " " + map.getName())
|
|
|
.status(RoomStatus.WAITING)
|