diff --git a/packages/room/src/RoomContentLoader.ts b/packages/room/src/RoomContentLoader.ts index 0273f209..687d3c77 100644 --- a/packages/room/src/RoomContentLoader.ts +++ b/packages/room/src/RoomContentLoader.ts @@ -42,6 +42,8 @@ export class RoomContentLoader implements IRoomContentLoader this.processFurnitureData(GetSessionDataManager().getAllFurnitureData()); for(const [index, name] of GetConfiguration().getValue('pet.types').entries()) this._pets[name] = index; + + await Promise.all(RoomContentLoader.MANDATORY_LIBRARIES.map(value => this.downloadAsset(value))); } public processFurnitureData(furnitureData: IFurnitureData[]): void diff --git a/packages/room/src/RoomManager.ts b/packages/room/src/RoomManager.ts index 12435988..c4f00bc8 100644 --- a/packages/room/src/RoomManager.ts +++ b/packages/room/src/RoomManager.ts @@ -4,7 +4,6 @@ import { NitroLogger } from '@nitrots/utils'; import { GetRoomContentLoader } from './GetRoomContentLoader'; import { GetRoomObjectLogicFactory } from './GetRoomObjectLogicFactory'; import { GetRoomObjectVisualizationFactory } from './GetRoomObjectVisualizationFactory'; -import { RoomContentLoader } from './RoomContentLoader'; import { RoomInstance } from './RoomInstance'; import { RoomObjectManager } from './RoomObjectManager'; @@ -30,10 +29,6 @@ export class RoomManager implements IRoomManager, IRoomInstanceContainer GetEventDispatcher().addEventListener(RoomContentLoadedEvent.RCLE_SUCCESS, this.onRoomContentLoadedEvent); GetEventDispatcher().addEventListener(RoomContentLoadedEvent.RCLE_FAILURE, this.onRoomContentLoadedEvent); GetEventDispatcher().addEventListener(RoomContentLoadedEvent.RCLE_CANCEL, this.onRoomContentLoadedEvent); - - const promises = RoomContentLoader.MANDATORY_LIBRARIES.map(value => GetRoomContentLoader().downloadAsset(value)); - - await Promise.all(promises); } public getRoomInstance(roomId: string): IRoomInstance diff --git a/packages/session/src/SessionDataManager.ts b/packages/session/src/SessionDataManager.ts index 81bca30e..ee93e7ef 100644 --- a/packages/session/src/SessionDataManager.ts +++ b/packages/session/src/SessionDataManager.ts @@ -56,12 +56,13 @@ export class SessionDataManager implements ISessionDataManager public async init(): Promise { - await this._furnitureData.init(); - await this._productData.init(); - - this._badgeImageManager.init(); - this._ignoredUsersManager.init(); - this._groupInformationManager.init(); + await Promise.all([ + this._furnitureData.init(), + this._productData.init(), + this._badgeImageManager.init(), + this._ignoredUsersManager.init(), + this._groupInformationManager.init() + ]); GetCommunication().registerMessageEvent(new FigureUpdateEvent((event: FigureUpdateEvent) => {