feat(multi): display player paths in round results screen

This commit is contained in:
jessy-david-dev
2026-04-11 22:08:56 +02:00
parent d4bb21da5d
commit c3152058ce
3 changed files with 30 additions and 6 deletions
+4
View File
@@ -146,6 +146,7 @@ export async function PATCH(
name: playerName.trim().slice(0, 20),
score: 0,
currentArticle: "",
path: [],
hasWon: false,
hasSurrendered: false,
isHost: false,
@@ -203,6 +204,7 @@ export async function PATCH(
// Reset etat joueurs pour cette manche
for (const p of room.players) {
p.currentArticle = startArticle;
p.path = [startArticle];
p.hasWon = false;
p.hasSurrendered = false;
}
@@ -239,6 +241,8 @@ export async function PATCH(
return Response.json({ error: "Article invalide" }, { status: 400 });
}
player.currentArticle = article;
if (!player.path) player.path = [];
player.path.push(article);
player.lastSeen = Date.now();
const normalize = (s: string) =>