fix: 暂存
This commit is contained in:
@@ -239,10 +239,9 @@ public class GameServiceImpl implements GameService {
|
||||
List<RoomPlayerEntity> remaining = roomPlayerRepository.findByRoomId(roomId);
|
||||
|
||||
if (remaining.isEmpty()) {
|
||||
// 无人了,房间标记为结束
|
||||
room.setStatus("finished");
|
||||
gameRoomRepository.save(room);
|
||||
log.info("[游戏服务] 房间无人,标记为结束, roomId={}", roomId);
|
||||
// 无人了,物理删除房间(对局记录和走棋记录保留用于历史查询)
|
||||
gameRoomRepository.delete(room);
|
||||
log.info("[游戏服务] 房间无人,已删除, roomId={}", roomId);
|
||||
} else if (userId.equals(room.getCreatorId())) {
|
||||
// 房主离开,顺位转让给下一个玩家
|
||||
RoomPlayerEntity nextOwner = remaining.get(0);
|
||||
|
||||
Reference in New Issue
Block a user