From 87412c3400321a53b06cda7a3df742ed76a54819 Mon Sep 17 00:00:00 2001 From: Alexis Faizeau Date: Wed, 23 Mar 2022 10:47:46 +0100 Subject: [PATCH] Add more checking on woka details --- front/src/Connexion/RoomConnection.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/front/src/Connexion/RoomConnection.ts b/front/src/Connexion/RoomConnection.ts index b2ac2e22..ed982536 100644 --- a/front/src/Connexion/RoomConnection.ts +++ b/front/src/Connexion/RoomConnection.ts @@ -220,6 +220,7 @@ export class RoomConnection implements RoomConnection { this.socket.onmessage = (messageEvent) => { const arrayBuffer: ArrayBuffer = messageEvent.data; + const initCharacterLayers = characterLayers; const serverToClientMessage = ServerToClientMessageTsProto.decode(new Uint8Array(arrayBuffer)); //const message = ServerToClientMessage.deserializeBinary(new Uint8Array(arrayBuffer)); @@ -342,12 +343,12 @@ export class RoomConnection implements RoomConnection { this._userRoomToken = roomJoinedMessage.userRoomToken; // If one of the URLs sent to us does not exist, let's go to the Woka selection screen. - for (const characterLayer of roomJoinedMessage.characterLayer) { - if (!characterLayer.url) { - this.goToSelectYourWokaScene(); - this.closed = true; - break; - } + if ( + roomJoinedMessage.characterLayer.length !== initCharacterLayers.length || + roomJoinedMessage.characterLayer.find((layer) => !layer.url) + ) { + this.goToSelectYourWokaScene(); + this.closed = true; } if (this.closed) {