feat(game): add configurable rounds per room

This commit is contained in:
jessy-david-dev
2026-04-11 13:47:05 +02:00
parent d245232497
commit e9f39c572d
8 changed files with 175 additions and 114 deletions
+2 -2
View File
@@ -65,8 +65,8 @@ export async function PATCH(
if (!playerName || typeof playerName !== "string" || playerName.trim() === "") {
return Response.json({ error: "Pseudo invalide" }, { status: 400 });
}
if (room.players.length >= 8) {
return Response.json({ error: "Salle pleine (8 joueurs max)" }, { status: 409 });
if (room.players.length >= room.maxPlayers) {
return Response.json({ error: `Salle pleine (${room.maxPlayers} joueurs max)` }, { status: 409 });
}
if (room.phase !== "waiting" && room.phase !== "results") {
return Response.json({ error: "Partie en cours, attends la prochaine manche" }, { status: 409 });