Fixing merge

This commit is contained in:
David Négrier 2021-07-16 11:37:44 +02:00
parent 5c7ea7b258
commit 3d76f76d3e
3 changed files with 5 additions and 21 deletions

View file

@ -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<HasPlayerMovedEvent>();
let playerName: string | undefined;

View file

@ -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<void> {
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();
}

View file

@ -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;