Le multijoueur fonctionne enfin. Mise à jour des scores. Et de la partie.
This commit is contained in:
@@ -240,9 +240,9 @@ export class GameSession {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
id: this.id,
|
||||
scoreLeft: gc.scoreLeft,
|
||||
scoreRight: gc.scoreRight,
|
||||
gameServerIdOfTheMatch: this.id,
|
||||
playerOneUsernameResult: gc.scoreLeft,
|
||||
playerTwoUsernameResult: gc.scoreRight,
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ function privateMatchmaking(player: ClientPlayer)
|
||||
const maxPlayersNumber = 2;
|
||||
privateMatchmakingMap.set(player.id, player);
|
||||
const matchOptions = player.matchOptions;
|
||||
|
||||
console.log(player)
|
||||
const token = player.token;
|
||||
const compatiblePlayers: ClientPlayer[] = [];
|
||||
for (const [id, client] of privateMatchmakingMap)
|
||||
@@ -254,6 +254,8 @@ async function playerReadyConfirmationListener(this: WebSocket, data: string)
|
||||
gameOptions: gameSession.matchOptions,
|
||||
playerOneUsername: (<ClientPlayer>gameSessionPlayersIterator.next().value).username,
|
||||
playerTwoUsername: (<ClientPlayer>gameSessionPlayersIterator.next().value).username,
|
||||
playerOneUsernameResult : 0,
|
||||
playerTwoUsernameResult : 0
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
@@ -12,4 +12,8 @@ export class CreateGameDto {
|
||||
playerOneUsername : string
|
||||
@IsString()
|
||||
playerTwoUsername : string
|
||||
@IsNumber()
|
||||
playerTwoUsernameResult : number
|
||||
@IsNumber()
|
||||
playerOneUsernameResult : number
|
||||
}
|
||||
|
||||
@@ -1,15 +1,5 @@
|
||||
import { OmitType } from "@nestjs/mapped-types";
|
||||
import { IsBoolean, IsNotEmpty, IsNumber, IsString } from "class-validator";
|
||||
import { CreateGameDto } from "./createGame.dto";
|
||||
|
||||
export class UpdateGameDto {
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
gameServerIdOfTheMatch : string
|
||||
@IsNumber()
|
||||
@IsNotEmpty()
|
||||
playerOneUsernameResult : number
|
||||
@IsNumber()
|
||||
@IsNotEmpty()
|
||||
playerTwoUsernameResult : number
|
||||
@IsBoolean()
|
||||
isMatchIsFinished : boolean
|
||||
}
|
||||
export class UpdateGameDto extends OmitType(CreateGameDto, ['playerOneUsername', 'playerTwoUsername', 'gameOptions'] as const){}
|
||||
|
||||
@@ -17,7 +17,7 @@ export class Game {
|
||||
@Column({default : 0, nullable : true})
|
||||
playerTwoUsernameResult : number
|
||||
|
||||
@Column()
|
||||
@Column({unique : true})
|
||||
gameServerIdOfTheMatch: string
|
||||
|
||||
@Column({default: false, nullable : true}) //éric pourra trouver un meilleur mot : ongoing ?
|
||||
|
||||
@@ -7,6 +7,7 @@ import { User } from 'src/users/entities/user.entity';
|
||||
import { UsersService } from 'src/users/users.service';
|
||||
import { CreateGameDto } from './dto/createGame.dto';
|
||||
import { GrantTicketDto } from './dto/grantTicket.dto';
|
||||
import { UpdateGameDto } from './dto/updateGame.dto';
|
||||
import { ValidateTicketDto } from './dto/validateTicket.dto';
|
||||
import { TokenGame } from './entity/tokenGame.entity';
|
||||
import { GameService } from './game.service';
|
||||
@@ -78,9 +79,19 @@ export class GameController {
|
||||
@Post('gameserver/creategame')
|
||||
async createGame(@Body() creategameDto : CreateGameDto)
|
||||
{
|
||||
console.log("On est dans create game")
|
||||
console.log(creategameDto)
|
||||
return this.gameService.createGame(creategameDto);
|
||||
}
|
||||
|
||||
@Post('gameserver/updategame')
|
||||
async updateGame(@Body() updateGameDto : UpdateGameDto)
|
||||
{
|
||||
console.log("On est dans update game")
|
||||
console.log(updateGameDto)
|
||||
return this.gameService.updateGame(updateGameDto);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import { ValidateTicketDto } from './dto/validateTicket.dto';
|
||||
import { TokenGame } from './entity/tokenGame.entity';
|
||||
import { UsersService } from 'src/users/users.service';
|
||||
import { CreateGameDto } from './dto/createGame.dto';
|
||||
import { UpdateGameDto } from './dto/updateGame.dto';
|
||||
|
||||
@Injectable()
|
||||
export class GameService {
|
||||
@@ -68,6 +69,8 @@ export class GameService {
|
||||
}
|
||||
|
||||
async validateToken(validateTicketDto : ValidateTicketDto) {
|
||||
console.log("On valide le token pour : ")
|
||||
console.log(validateTicketDto)
|
||||
if (validateTicketDto.isGameIsWithInvitation === true)
|
||||
{
|
||||
const tokenGame : TokenGame = await this.tokenGameRepository.createQueryBuilder('tokengame')
|
||||
@@ -138,6 +141,7 @@ export class GameService {
|
||||
token : gameToken.token,
|
||||
});
|
||||
}
|
||||
console.log("Il y a des invitations !")
|
||||
return partialGame;
|
||||
}
|
||||
|
||||
@@ -145,6 +149,7 @@ export class GameService {
|
||||
{
|
||||
// if (user.status === "In Game")
|
||||
// return new HttpException("You must finish your game before decline.", HttpStatus.FORBIDDEN)
|
||||
console.log("On décline l'invitation")
|
||||
const tokenGame = await this.tokenGameRepository.createQueryBuilder('tokengame')
|
||||
.andWhere('tokengame.playerTwoUsername = :playerTwoUsername', {playerTwoUsername : user.username})
|
||||
.andWhere('tokengame.token = :token', {token : token})
|
||||
@@ -158,6 +163,7 @@ export class GameService {
|
||||
{
|
||||
// if (user.status === "In Game")
|
||||
// return new HttpException("You must finish your game before accept.", HttpStatus.FORBIDDEN)
|
||||
console.log("On accepte l'invitation")
|
||||
const tokenGame = await this.tokenGameRepository.createQueryBuilder('tokenGame')
|
||||
.andWhere('tokenGame.playerTwoUsername = :playerTwoUsername', {playerTwoUsername : user.username})
|
||||
.andWhere('tokenGame.token = :token', {token : token})
|
||||
@@ -190,11 +196,43 @@ export class GameService {
|
||||
async createGame(creategameDto : CreateGameDto)
|
||||
{
|
||||
const game = this.gameRepository.create(creategameDto)
|
||||
game.isMatchIsFinished = false;
|
||||
this.gameRepository.save(game);
|
||||
if (!game)
|
||||
return HttpStatus.INTERNAL_SERVER_ERROR
|
||||
console.log("200 retourné pour la création de partie")
|
||||
return HttpStatus.OK
|
||||
}
|
||||
|
||||
async updateGame(updateGameDto : UpdateGameDto) {
|
||||
const game = await this.gameRepository.preload(
|
||||
{gameServerIdOfTheMatch : updateGameDto.gameServerIdOfTheMatch,
|
||||
...updateGameDto}
|
||||
)
|
||||
if (!game)
|
||||
throw new HttpException(`The game could not be updated.`,HttpStatus.NOT_FOUND);
|
||||
game.isMatchIsFinished = true;
|
||||
this.userRepository.save(game);
|
||||
const playerOne = await this.userRepository.findOneBy({username : game.playerOneUsername})
|
||||
const playerTwo = await this.userRepository.findOneBy({username : game.playerTwoUsername})
|
||||
if (!playerOne || !playerTwo)
|
||||
return new HttpException("Internal Server Error. Impossible to update the database", HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
if (game.playerOneUsernameResult === game.playerTwoUsernameResult)
|
||||
{
|
||||
this.userService.incrementDraws(playerOne.id)
|
||||
this.userService.incrementDraws(playerTwo.id)
|
||||
}
|
||||
else if (game.playerOneUsernameResult < game.playerTwoUsernameResult)
|
||||
{
|
||||
this.userService.incrementDefeats(playerOne.id)
|
||||
this.userService.incrementVictories(playerTwo.id)
|
||||
}
|
||||
else
|
||||
{
|
||||
this.userService.incrementVictories(playerOne.id)
|
||||
this.userService.incrementDefeats(playerTwo.id)
|
||||
}
|
||||
return HttpStatus.OK
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// et de les mettre comme optionnelles. De plus on peut hériter
|
||||
// des décorateurs de la classe parente (par exemple @IsString()).
|
||||
|
||||
import { OmitType, PartialType } from "@nestjs/mapped-types";
|
||||
import { OmitType } from "@nestjs/mapped-types";
|
||||
import { CreateUsersDto } from "./create-users.dto";
|
||||
|
||||
export class UpdateUsersDto extends OmitType(CreateUsersDto, ['fortyTwoId', 'email', 'image_url', 'status'] as const){}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { onMount } from "svelte";
|
||||
import { onMount, onDestroy } from "svelte";
|
||||
import * as enumeration from './shared_js/enums'
|
||||
import * as constants from './client/constants'
|
||||
import { initPong, initGc, initMatchOptions, initStartFunction } from './client/global'
|
||||
@@ -14,7 +14,9 @@
|
||||
import { initAudio } from './client/audio';
|
||||
import { pong, gc} from './client/global'
|
||||
import Header from '../../pieces/Header.svelte';
|
||||
import { push } from "svelte-spa-router";
|
||||
import { fade, fly } from 'svelte/transition'
|
||||
|
||||
|
||||
|
||||
//user's stuff
|
||||
let user;
|
||||
@@ -36,10 +38,10 @@
|
||||
let showInvitations = false;
|
||||
let showGameOption = true;
|
||||
let showError = false;
|
||||
let showCanvas = false;
|
||||
|
||||
let isThereAnyInvitation = false;
|
||||
let invitations;
|
||||
let invitations = [];
|
||||
|
||||
|
||||
let waitingMessage = "Please wait..."
|
||||
let errorMessageWhenAttemptingToGetATicket = "";
|
||||
@@ -51,10 +53,13 @@
|
||||
.then( x => x.json() );
|
||||
})
|
||||
|
||||
const init = async() => {
|
||||
onDestroy( async() => {
|
||||
|
||||
})
|
||||
|
||||
const initGame = async() => {
|
||||
optionsAreNotSet = false
|
||||
showWaitPage = true
|
||||
console.log("Player two username " + playerTwoUsername)
|
||||
if (multi_balls === true)
|
||||
matchOption |= enumeration.MatchOptions.multiBalls
|
||||
if (moving_walls === true )
|
||||
@@ -71,11 +76,10 @@
|
||||
})
|
||||
})
|
||||
const responseFromServer = await responseWhenGrantToken;
|
||||
console.log("Response.ok : " + responseFromServer.ok )
|
||||
console.log("//")
|
||||
const responseInjson = await responseFromServer.json()
|
||||
const responseInjson = await responseFromServer.json();
|
||||
const token : string = responseInjson.token;
|
||||
showWaitPage = false
|
||||
if (!responseFromServer.ok || !responseInjson.token)
|
||||
if (!responseFromServer.ok)
|
||||
{
|
||||
errorMessageWhenAttemptingToGetATicket = responseInjson.message;
|
||||
showError = true;
|
||||
@@ -87,25 +91,37 @@
|
||||
matchOption = 0;
|
||||
}, 5000)
|
||||
}
|
||||
else
|
||||
else if (token)
|
||||
{
|
||||
const token = responseInjson.token
|
||||
console.log("Token === " + token)
|
||||
if (sound === "off") {
|
||||
initAudio(true);
|
||||
}
|
||||
else if (sound === "on") {
|
||||
initAudio(false);
|
||||
}
|
||||
(sound === "off") ? initAudio(true) : initAudio(false);
|
||||
initMatchOptions(matchOption)
|
||||
initPong(new GameArea())
|
||||
initGc(new GameComponentsClient(matchOption, pong.ctx))
|
||||
initStartFunction(start)
|
||||
console.log("Avant init websocket")
|
||||
isSomeoneIsIvited ?
|
||||
initWebSocket(matchOption, token, user.username, true, playerTwoUsername) :
|
||||
initWebSocket(matchOption, token, user.username)
|
||||
}
|
||||
}
|
||||
|
||||
const initGameForPrivateParty = async(invitation : any) => {
|
||||
optionsAreNotSet = false
|
||||
showWaitPage = true
|
||||
console.log("invitation : ")
|
||||
console.log(invitation)
|
||||
if (invitation.token)
|
||||
{
|
||||
initMatchOptions(matchOption)
|
||||
initPong(new GameArea())
|
||||
initGc(new GameComponentsClient(matchOption, pong.ctx))
|
||||
initStartFunction(start)
|
||||
showWaitPage = false
|
||||
initWebSocket(matchOption, invitation.token, invitation.playerOneUsername, true, user.username)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function start() : void {
|
||||
gc.text1.pos.assign(constants.w*0.5, constants.h*0.75);
|
||||
countdown(constants.matchStartDelay/1000, (count: number) => {
|
||||
@@ -138,28 +154,38 @@
|
||||
showInvitations = true;
|
||||
invitations = await fetch("http://transcendance:8080/api/v2/game/invitations")
|
||||
.then(x => x.json())
|
||||
console.log(...invitations)
|
||||
invitations.length !== 0 ? isThereAnyInvitation = true : isThereAnyInvitation = false
|
||||
}
|
||||
|
||||
const rejectInvitation = async() => {
|
||||
const rejectInvitation = async(invitation) => {
|
||||
await fetch("http://transcendance:8080/api/v2/game/decline",{
|
||||
method: "POST",
|
||||
headers: { 'Content-Type': 'application/json'},
|
||||
body: JSON.stringify({
|
||||
|
||||
token : invitation.token
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
.then(x => x.json())
|
||||
.catch(error => console.log(error))
|
||||
showInvitation()
|
||||
}
|
||||
|
||||
const acceptInvitation = async() => {
|
||||
const acceptInvitation = async(invitation : any) => {
|
||||
await fetch("http://transcendance:8080/api/v2/game/accept",{
|
||||
method: "POST",
|
||||
headers: { 'Content-Type': 'application/json'},
|
||||
body: JSON.stringify({
|
||||
token : invitation.token
|
||||
})
|
||||
})
|
||||
.then(x => x.json())
|
||||
.catch(error => {
|
||||
console.log(error)
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
showInvitation()
|
||||
initGameForPrivateParty(invitation)
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@@ -169,90 +195,100 @@
|
||||
<div id="preload_font">.</div>
|
||||
|
||||
{#if showError === true}
|
||||
<div id="div_game">
|
||||
<fieldset>
|
||||
<legend>Error</legend>
|
||||
<p>{errorMessageWhenAttemptingToGetATicket}</p>
|
||||
<button id="pong_button">Retry</button>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div id="div_game" in:fly="{{ y: 10, duration: 1000 }}">
|
||||
<fieldset>
|
||||
<legend>Error</legend>
|
||||
<p>{errorMessageWhenAttemptingToGetATicket}</p>
|
||||
<button id="pong_button">Retry</button>
|
||||
</fieldset>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if optionsAreNotSet}
|
||||
{#if showGameOption === true}
|
||||
<form on:submit|preventDefault={init}>
|
||||
<div id="div_game">
|
||||
<button id="pong_button" on:click={showInvitation}>Show invitations</button>
|
||||
<fieldset>
|
||||
<legend>game options</legend>
|
||||
<div>
|
||||
<input type="checkbox" id="multi_balls" name="multi_balls" bind:checked={multi_balls}>
|
||||
<label for="multi_balls">Multiples balls</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" id="moving_walls" name="moving_walls" bind:checked={moving_walls}>
|
||||
<label for="moving_walls">Moving walls</label>
|
||||
</div>
|
||||
<div>
|
||||
<!-- svelte-ignore a11y-label-has-associated-control -->
|
||||
<label>sound :</label>
|
||||
<input type="radio" id="sound_on" name="sound_selector" bind:group={sound} value="on">
|
||||
<label for="sound_on">on</label>
|
||||
<input type="radio" id="sound_off" name="sound_selector" bind:group={sound} value="off">
|
||||
<label for="sound_off">off</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" id="isSomeoneIsIvited" name="moving_walls" bind:checked={isSomeoneIsIvited}>
|
||||
<label for="moving_walls">Invite a friend</label>
|
||||
</div>
|
||||
{#if isSomeoneIsIvited === true}
|
||||
<select bind:value={playerTwoUsername}>
|
||||
{#each allUsers as user }
|
||||
<option value={user.username}>{user.username}</option>
|
||||
{/each}
|
||||
</select>
|
||||
{/if}
|
||||
<div>
|
||||
<button id="pong_button" >PLAY</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</form>
|
||||
{/if}
|
||||
{#if showInvitations}
|
||||
<div id="div_game">
|
||||
<button id="pong_button" on:click={showOptions}>Play a Game</button>
|
||||
<fieldset>
|
||||
<legend>Current invitation(s)</legend>
|
||||
{#if isThereAnyInvitation}
|
||||
{#each invitations as invitation }
|
||||
<div>
|
||||
{invitation.playerOneUsername} has invited you to play a pong !
|
||||
<button id="pong_button" on:click={acceptInvitation}>V</button>
|
||||
<button id="pong_button" on:click={rejectInvitation}>X</button>
|
||||
</div>
|
||||
{/each}
|
||||
{/if}
|
||||
{#if isThereAnyInvitation ===false}
|
||||
<p>Currently, no one asked to play with you.</p>
|
||||
<button id="pong_button" on:click={showInvitation}>Reload</button>
|
||||
{/if}
|
||||
</fieldset>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
<div id="canvas_container">
|
||||
{#if showWaitPage === true}
|
||||
<div id="div_game">
|
||||
{#if showWaitPage === true}
|
||||
<div id="div_game" in:fly="{{ y: 10, duration: 1000 }}">
|
||||
<fieldset>
|
||||
<legend>Connecting to the game...</legend>
|
||||
<p>{waitingMessage}</p>
|
||||
</fieldset>
|
||||
</div>
|
||||
{/if}
|
||||
<canvas id="gameArea"></canvas>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{#if optionsAreNotSet}
|
||||
{#if showGameOption === true}
|
||||
<div id="game_option">
|
||||
<form on:submit|preventDefault={() => initGame()}>
|
||||
<div id="div_game">
|
||||
<button id="pong_button" on:click={showInvitation}>Show invitations</button>
|
||||
<fieldset>
|
||||
<legend>game options</legend>
|
||||
<div>
|
||||
<input type="checkbox" id="multi_balls" name="multi_balls" bind:checked={multi_balls}>
|
||||
<label for="multi_balls">Multiples balls</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" id="moving_walls" name="moving_walls" bind:checked={moving_walls}>
|
||||
<label for="moving_walls">Moving walls</label>
|
||||
</div>
|
||||
<div>
|
||||
<p>sound :</p>
|
||||
<input type="radio" id="sound_on" name="sound_selector" bind:group={sound} value="on">
|
||||
<label for="sound_on">on</label>
|
||||
<input type="radio" id="sound_off" name="sound_selector" bind:group={sound} value="off">
|
||||
<label for="sound_off">off</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" id="isSomeoneIsIvited" bind:checked={isSomeoneIsIvited}>
|
||||
<label for="moving_walls">Invite a friend</label>
|
||||
</div>
|
||||
{#if isSomeoneIsIvited === true}
|
||||
<select bind:value={playerTwoUsername}>
|
||||
{#each allUsers as user }
|
||||
<option value={user.username}>{user.username}</option>
|
||||
{/each}
|
||||
</select>
|
||||
{/if}
|
||||
<div>
|
||||
<button id="pong_button" >PLAY</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if showInvitations}
|
||||
<div id="invitations_options" in:fly="{{ y: 10, duration: 1000 }}">
|
||||
<div id="div_game">
|
||||
<button id="pong_button" on:click={showOptions}>Play a Game</button>
|
||||
<fieldset>
|
||||
<legend>Current invitation(s)</legend>
|
||||
{#if isThereAnyInvitation}
|
||||
{#each invitations as invitation }
|
||||
<div>
|
||||
{invitation.playerOneUsername} has invited you to play a pong !
|
||||
<button id="pong_button" on:click={() => acceptInvitation(invitation)}>V</button>
|
||||
<button id="pong_button" on:click={() => rejectInvitation(invitation)}>X</button>
|
||||
</div>
|
||||
{/each}
|
||||
{/if}
|
||||
{#if isThereAnyInvitation === false}
|
||||
<p>Currently, no one asked to play with you.</p>
|
||||
<button id="pong_button" on:click={showInvitation}>Reload</button>
|
||||
{/if}
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
|
||||
|
||||
<div id="canvas_container">
|
||||
<!-- <p> =) </p> -->
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
@@ -284,6 +320,14 @@ body {
|
||||
/* max-height: 80vh; */
|
||||
/* overflow: hidden; */
|
||||
}
|
||||
|
||||
#users_name {
|
||||
text-align: center;
|
||||
font-family: "Bit5x3";
|
||||
color: rgb(245, 245, 245);
|
||||
font-size: x-large;
|
||||
}
|
||||
|
||||
#div_game {
|
||||
text-align: center;
|
||||
font-family: "Bit5x3";
|
||||
|
||||
@@ -9,10 +9,13 @@ export class GameArea {
|
||||
canvas: HTMLCanvasElement;
|
||||
ctx: CanvasRenderingContext2D;
|
||||
constructor() {
|
||||
this.canvas = document.getElementById("gameArea");
|
||||
this.canvas = document.createElement("canvas");
|
||||
this.ctx = this.canvas.getContext("2d") as CanvasRenderingContext2D;
|
||||
this.canvas.width = c.CanvasWidth;
|
||||
this.canvas.height = c.CanvasWidth / c.CanvasRatio;
|
||||
let container = document.getElementById("canvas_container");
|
||||
if (container)
|
||||
container.insertBefore(this.canvas, container.childNodes[0]);
|
||||
}
|
||||
addKey(key: string) {
|
||||
key = key.toLowerCase();
|
||||
|
||||
@@ -34,6 +34,8 @@ export const clientInfoSpectator = new ClientInfoSpectator(); // WIP, could refa
|
||||
export function initWebSocket(options: en.MatchOptions, token: string, username: string, privateMatch = false, playerTwoUsername?: string)
|
||||
{
|
||||
socket = new WebSocket(wsUrl, "json");
|
||||
console.log("Infos from ws.ts : options => " + options + " token => " + token + " username => " + username + " priavte match => " + privateMatch
|
||||
+ " player two => " + playerTwoUsername)
|
||||
socket.addEventListener("open", (event) => {
|
||||
if (privateMatch) {
|
||||
socket.send(JSON.stringify( new ev.ClientAnnouncePlayer(options, token, username, privateMatch, playerTwoUsername) ));
|
||||
|
||||
Reference in New Issue
Block a user