Suite intégration jeu
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import { IsBoolean, IsNotEmpty, IsNumber, IsString } from "class-validator";
|
||||
|
||||
export class UpdateGameDto {
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
gameServerIdOfTheMatch : string
|
||||
@IsNumber()
|
||||
@IsNotEmpty()
|
||||
playerOneUsernameResult : number
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
console.log("Response.ok : " + responseFromServer.ok )
|
||||
console.log("//")
|
||||
const responseInjson = await responseFromServer.json()
|
||||
showWaitPage = false
|
||||
if (!responseFromServer.ok || !responseInjson.token)
|
||||
{
|
||||
errorMessageWhenAttemptingToGetATicket = responseInjson.message;
|
||||
@@ -88,8 +89,6 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
showError = false
|
||||
showWaitPage = false
|
||||
const token = responseInjson.token
|
||||
console.log("Token === " + token)
|
||||
if (sound === "off") {
|
||||
@@ -179,15 +178,6 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if showWaitPage === true}
|
||||
<div id="div_game">
|
||||
<fieldset>
|
||||
<legend>Connecting to the game...</legend>
|
||||
<p>{waitingMessage}</p>
|
||||
</fieldset>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if optionsAreNotSet}
|
||||
{#if showGameOption === true}
|
||||
<form on:submit|preventDefault={init}>
|
||||
@@ -251,9 +241,19 @@
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
<div id="canvas_container">
|
||||
{#if showWaitPage === true}
|
||||
<div id="div_game">
|
||||
<fieldset>
|
||||
<legend>Connecting to the game...</legend>
|
||||
<p>{waitingMessage}</p>
|
||||
</fieldset>
|
||||
</div>
|
||||
{/if}
|
||||
<canvas id="gameArea"></canvas>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
|
||||
@@ -10,10 +10,6 @@ export class GameArea {
|
||||
ctx: CanvasRenderingContext2D;
|
||||
constructor() {
|
||||
this.canvas = document.getElementById("gameArea");
|
||||
if (this.canvas)
|
||||
console.log("Le canvas a été trouvé !")
|
||||
else
|
||||
console.log("Le canvas a été mangé par un être mystérieux...")
|
||||
this.ctx = this.canvas.getContext("2d") as CanvasRenderingContext2D;
|
||||
this.canvas.width = c.CanvasWidth;
|
||||
this.canvas.height = c.CanvasWidth / c.CanvasRatio;
|
||||
|
||||
Reference in New Issue
Block a user