From 3d76f76d3e1db5195ce7cb014b4daf3a4e2db547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Fri, 16 Jul 2021 11:37:44 +0200 Subject: [PATCH] Fixing merge --- front/src/Api/iframe/player.ts | 7 ------- pusher/src/Model/PusherRoom.ts | 17 ++++------------- pusher/src/Services/SocketManager.ts | 2 +- 3 files changed, 5 insertions(+), 21 deletions(-) diff --git a/front/src/Api/iframe/player.ts b/front/src/Api/iframe/player.ts index b2c8d58d..078a1926 100644 --- a/front/src/Api/iframe/player.ts +++ b/front/src/Api/iframe/player.ts @@ -2,15 +2,8 @@ import { IframeApiContribution, sendToWorkadventure } from "./IframeApiContribut import type { HasPlayerMovedEvent, HasPlayerMovedEventCallback } from "../Events/HasPlayerMovedEvent"; import { Subject } from "rxjs"; import { apiCallback } from "./registeredCallbacks"; -import { getGameState } from "./room"; import { isHasPlayerMovedEvent } from "../Events/HasPlayerMovedEvent"; -interface User { - id: string | undefined; - nickName: string | null; - tags: string[]; -} - const moveStream = new Subject(); let playerName: string | undefined; diff --git a/pusher/src/Model/PusherRoom.ts b/pusher/src/Model/PusherRoom.ts index f2d656c6..713e9d25 100644 --- a/pusher/src/Model/PusherRoom.ts +++ b/pusher/src/Model/PusherRoom.ts @@ -44,15 +44,6 @@ export class PusherRoom { this.tags = []; this.policyType = GameRoomPolicyTypes.ANONYMOUS_POLICY; - if (this.public) { - this.roomSlug = extractRoomSlugPublicRoomId(this.roomId); - } else { - const { organizationSlug, worldSlug, roomSlug } = extractDataFromPrivateRoomId(this.roomId); - this.roomSlug = roomSlug; - this.organizationSlug = organizationSlug; - this.worldSlug = worldSlug; - } - // A zone is 10 sprites wide. this.positionNotifier = new PositionDispatcher(this.roomUrl, 320, 320, this.socketListener); } @@ -91,10 +82,10 @@ export class PusherRoom { * Creates a connection to the back server to track global messages relative to this room (like variable changes). */ public async init(): Promise { - debug("Opening connection to room %s on back server", this.roomId); - const apiClient = await apiClientRepository.getClient(this.roomId); + debug("Opening connection to room %s on back server", this.roomUrl); + const apiClient = await apiClientRepository.getClient(this.roomUrl); const roomMessage = new RoomMessage(); - roomMessage.setRoomid(this.roomId); + roomMessage.setRoomid(this.roomUrl); this.backConnection = apiClient.listenRoom(roomMessage); this.backConnection.on("data", (batch: BatchToPusherRoomMessage) => { for (const message of batch.getPayloadList()) { @@ -141,7 +132,7 @@ export class PusherRoom { } public close(): void { - debug("Closing connection to room %s on back server", this.roomId); + debug("Closing connection to room %s on back server", this.roomUrl); this.isClosing = true; this.backConnection.cancel(); } diff --git a/pusher/src/Services/SocketManager.ts b/pusher/src/Services/SocketManager.ts index 12597b26..5a544966 100644 --- a/pusher/src/Services/SocketManager.ts +++ b/pusher/src/Services/SocketManager.ts @@ -380,7 +380,7 @@ export class SocketManager implements ZoneEventListener { if (ADMIN_API_URL) { await this.updateRoomWithAdminData(room); } - await world.init(); + await room.init(); this.rooms.set(roomUrl, room); } return room;