major rework in Game.svelte and GameSpectator.svelte
+ WIP match draw
This commit is contained in:
@@ -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",
|
||||
{
|
||||
|
||||
@@ -31,6 +31,7 @@ export enum InputEnum {
|
||||
}
|
||||
|
||||
export enum PlayerSide {
|
||||
noSide = 0,
|
||||
left = 1,
|
||||
right
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user