diff --git a/src/nitro/INitro.ts b/src/nitro/INitro.ts index 5f1009c1..6f61b6fe 100644 --- a/src/nitro/INitro.ts +++ b/src/nitro/INitro.ts @@ -27,6 +27,7 @@ export interface INitro extends Application addLinkEventTracker(tracker: ILinkEventTracker): void; removeLinkEventTracker(tracker: ILinkEventTracker): void; createLinkEvent(link: string): void; + setWorker(val: Worker): void; nitroTimer: NitroTimer; core: INitroCore; events: IEventDispatcher; diff --git a/src/nitro/Nitro.ts b/src/nitro/Nitro.ts index 84611413..4f8fa875 100644 --- a/src/nitro/Nitro.ts +++ b/src/nitro/Nitro.ts @@ -335,6 +335,12 @@ export class Nitro extends Application implements INitro HabboWebTools.sendHeartBeat(); } + public setWorker(val: Worker): void + { + this._worker = val; + this._worker.onmessage = this.createWorkerEvent.bind(this); + } + public get nitroTimer(): NitroTimer { return this._nitroTimer;