SyntaxSquad/DADProject#16 fix: Cancle and Return is working and some other fixes involving game duration

This commit is contained in:
AfonsoCMSousa
2026-01-03 02:19:00 +00:00
parent 7e6766c726
commit 3dcd8df4c7
9 changed files with 227 additions and 143 deletions
+1
View File
@@ -96,6 +96,7 @@ const performGameEnd = (io, game, gameId, winnerId, loserId, reason) => {
action: "game_ended",
winnerId: parseInt(winnerId),
loserId: parseInt(loserId),
totalTime: game.startTime ? Math.floor((Date.now() - game.startTime) / 1000) : 0,
isDraw: false,
player1_points: game.players[Object.keys(game.players)[0]]?.points || 0,
player2_points: game.players[Object.keys(game.players)[1]]?.points || 0,