major rework in Game.svelte and GameSpectator.svelte

+ WIP match draw
This commit is contained in:
LuckyLaszlo
2023-01-06 20:04:40 +01:00
parent 68ae8ac333
commit 711f971333
8 changed files with 191 additions and 188 deletions

View File

@@ -229,8 +229,7 @@ export class GameSession {
this._forfeit();
}
else {
// WIP: envoyer un truc à Nest ? Genre "match draw"
this.destroy();
this._matchEnd(en.PlayerSide.noSide, true);
}
return true;
}
@@ -269,11 +268,16 @@ export class GameSession {
gc.scoreLeft = 3;
gc.scoreRight = 0;
}
else
else if (winner === en.PlayerSide.right)
{
gc.scoreLeft = 0;
gc.scoreRight = 3;
}
else
{ // TODO: match draw, verifier la getion coté Nest
gc.scoreLeft = 0;
gc.scoreRight = 0;
}
}
await fetch(c.addressBackEnd + "/game/gameserver/updategame",
{

View File

@@ -31,6 +31,7 @@ export enum InputEnum {
}
export enum PlayerSide {
noSide = 0,
left = 1,
right
}