From ea1c12a9e9d7634e26971e332f59b44793aa7cb2 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 12 Jun 2021 15:05:04 -0500 Subject: [PATCH] cleaned RoomEngineObjectPlacedEvent --- .../inventory/furniture/FurnitureGiftOpenedParser.ts | 2 +- src/nitro/room/RoomEngine.ts | 4 ++-- src/nitro/room/RoomObjectEventHandler.ts | 10 +++++----- src/nitro/room/events/RoomEngineObjectPlacedEvent.ts | 8 ++++---- src/nitro/room/events/RoomObjectTileMouseEvent.ts | 8 ++++---- src/nitro/room/messages/ObjectRoomMaskUpdateMessage.ts | 4 ++-- .../room/messages/ObjectTileCursorUpdateMessage.ts | 4 ++-- src/nitro/room/object/logic/room/RoomLogic.ts | 2 +- src/nitro/room/object/logic/room/TileCursorLogic.ts | 6 +++--- src/nitro/session/handler/RoomPresentHandler.ts | 6 +++--- 10 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/nitro/communication/messages/parser/inventory/furniture/FurnitureGiftOpenedParser.ts b/src/nitro/communication/messages/parser/inventory/furniture/FurnitureGiftOpenedParser.ts index 2b95cea5..d20b82f0 100644 --- a/src/nitro/communication/messages/parser/inventory/furniture/FurnitureGiftOpenedParser.ts +++ b/src/nitro/communication/messages/parser/inventory/furniture/FurnitureGiftOpenedParser.ts @@ -60,7 +60,7 @@ export class FurnitureGiftOpenedParser implements IMessageParser return this._Str_3970; } - public get _Str_4057():boolean + public get placedInRoom():boolean { return this._Str_3224; } diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index 9bfcc3e2..0f2f42f9 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -2043,12 +2043,12 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato const location = roomObject.getLocation(); if(_arg_3) maskUpdate = new ObjectRoomMaskUpdateMessage(ObjectRoomMaskUpdateMessage.ADD_MASK, maskName, maskType, location); - else maskUpdate = new ObjectRoomMaskUpdateMessage(ObjectRoomMaskUpdateMessage._Str_10260, maskName); + else maskUpdate = new ObjectRoomMaskUpdateMessage(ObjectRoomMaskUpdateMessage.REMOVE_MASK, maskName); } } else { - maskUpdate = new ObjectRoomMaskUpdateMessage(ObjectRoomMaskUpdateMessage._Str_10260, maskName); + maskUpdate = new ObjectRoomMaskUpdateMessage(ObjectRoomMaskUpdateMessage.REMOVE_MASK, maskName); } const roomOwnObject = this.getRoomOwnObject(roomId); diff --git a/src/nitro/room/RoomObjectEventHandler.ts b/src/nitro/room/RoomObjectEventHandler.ts index 9fdfd1ee..a6f0ebf5 100644 --- a/src/nitro/room/RoomObjectEventHandler.ts +++ b/src/nitro/room/RoomObjectEventHandler.ts @@ -904,7 +904,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou if(!session || session.isSpectator) return; - this.sendWalkUpdate(event._Str_16836, event._Str_17676); + this.sendWalkUpdate(event.tileXAsInt, event.tileYAsInt); } private _Str_24048(event: RoomObjectMouseEvent, roomId: number): void @@ -1429,16 +1429,16 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou { if(this._whereYouClickIsWhereYouGo) { - return new ObjectTileCursorUpdateMessage(new Vector3d(k._Str_16836, k._Str_17676, k._Str_21459), 0, true, k.eventId); + return new ObjectTileCursorUpdateMessage(new Vector3d(k.tileXAsInt, k.tileYAsInt, k.tileZAsInt), 0, true, k.eventId); } const roomObject = this._roomEngine.getRoomObjectCursor(roomId); if(roomObject && roomObject.visualization) { - const _local_4 = k._Str_16836; - const _local_5 = k._Str_17676; - const _local_6 = k._Str_21459; + const _local_4 = k.tileXAsInt; + const _local_5 = k.tileYAsInt; + const _local_6 = k.tileZAsInt; const _local_7 = this._roomEngine.getRoomInstance(roomId); if(_local_7) diff --git a/src/nitro/room/events/RoomEngineObjectPlacedEvent.ts b/src/nitro/room/events/RoomEngineObjectPlacedEvent.ts index 929ff615..660dd1d5 100644 --- a/src/nitro/room/events/RoomEngineObjectPlacedEvent.ts +++ b/src/nitro/room/events/RoomEngineObjectPlacedEvent.ts @@ -27,7 +27,7 @@ export class RoomEngineObjectPlacedEvent extends RoomEngineObjectEvent this._instanceData = instanceData; } - public get _Str_7031(): string + public get wallLocation(): string { return this._wallLocation; } @@ -52,17 +52,17 @@ export class RoomEngineObjectPlacedEvent extends RoomEngineObjectEvent return this._direction; } - public get _Str_4057(): boolean + public get placedInRoom(): boolean { return this._placedInRoom; } - public get _Str_23888(): boolean + public get placedOnFloor(): boolean { return this._placedOnFloor; } - public get _Str_23432(): boolean + public get placedOnWall(): boolean { return this._placedOnWall; } diff --git a/src/nitro/room/events/RoomObjectTileMouseEvent.ts b/src/nitro/room/events/RoomObjectTileMouseEvent.ts index f9ca55d9..bdabf0a6 100644 --- a/src/nitro/room/events/RoomObjectTileMouseEvent.ts +++ b/src/nitro/room/events/RoomObjectTileMouseEvent.ts @@ -31,18 +31,18 @@ export class RoomObjectTileMouseEvent extends RoomObjectMouseEvent return this._tileZ; } - public get _Str_16836(): number + public get tileXAsInt(): number { return Math.trunc(this._tileX + 0.499); } - public get _Str_17676(): number + public get tileYAsInt(): number { return Math.trunc(this._tileY + 0.499); } - public get _Str_21459(): number + public get tileZAsInt(): number { return Math.trunc(this._tileZ + 0.499); } -} \ No newline at end of file +} diff --git a/src/nitro/room/messages/ObjectRoomMaskUpdateMessage.ts b/src/nitro/room/messages/ObjectRoomMaskUpdateMessage.ts index a26eef4d..d8dd5337 100644 --- a/src/nitro/room/messages/ObjectRoomMaskUpdateMessage.ts +++ b/src/nitro/room/messages/ObjectRoomMaskUpdateMessage.ts @@ -5,7 +5,7 @@ import { Vector3d } from '../../../room/utils/Vector3d'; export class ObjectRoomMaskUpdateMessage extends RoomObjectUpdateMessage { public static ADD_MASK: string = 'RORMUM_ADD_MASK'; - public static _Str_10260: string = 'RORMUM_ADD_MASK'; + public static REMOVE_MASK: string = 'RORMUM_ADD_MASK'; public static DOOR: string = 'door'; public static WINDOW: string = 'window'; public static HOLE: string = 'hole'; @@ -51,4 +51,4 @@ export class ObjectRoomMaskUpdateMessage extends RoomObjectUpdateMessage { return this._maskCategory; } -} \ No newline at end of file +} diff --git a/src/nitro/room/messages/ObjectTileCursorUpdateMessage.ts b/src/nitro/room/messages/ObjectTileCursorUpdateMessage.ts index b9acab81..63d9e23b 100644 --- a/src/nitro/room/messages/ObjectTileCursorUpdateMessage.ts +++ b/src/nitro/room/messages/ObjectTileCursorUpdateMessage.ts @@ -28,7 +28,7 @@ export class ObjectTileCursorUpdateMessage extends RoomObjectUpdateMessage return this._visible; } - public get _Str_20637(): string + public get sourceEventId(): string { return this._sourceEventId; } @@ -37,4 +37,4 @@ export class ObjectTileCursorUpdateMessage extends RoomObjectUpdateMessage { return this._toggleVisibility; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/logic/room/RoomLogic.ts b/src/nitro/room/object/logic/room/RoomLogic.ts index 50604fcb..c9ef0e50 100644 --- a/src/nitro/room/object/logic/room/RoomLogic.ts +++ b/src/nitro/room/object/logic/room/RoomLogic.ts @@ -259,7 +259,7 @@ export class RoomLogic extends RoomObjectLogicBase update = true; break; - case ObjectRoomMaskUpdateMessage._Str_10260: + case ObjectRoomMaskUpdateMessage.REMOVE_MASK: update = this._planeBitmapMaskParser.removeMask(message.maskId); break; diff --git a/src/nitro/room/object/logic/room/TileCursorLogic.ts b/src/nitro/room/object/logic/room/TileCursorLogic.ts index 2827265e..19ac9ab3 100644 --- a/src/nitro/room/object/logic/room/TileCursorLogic.ts +++ b/src/nitro/room/object/logic/room/TileCursorLogic.ts @@ -34,7 +34,7 @@ export class TileCursorLogic extends RoomObjectLogicBase { if(!(message instanceof ObjectTileCursorUpdateMessage)) return; - if(this._lastEventId && (this._lastEventId === message._Str_20637)) return; + if(this._lastEventId && (this._lastEventId === message.sourceEventId)) return; if(message.toggleVisibility) this._isHidden = !this._isHidden; @@ -61,6 +61,6 @@ export class TileCursorLogic extends RoomObjectLogicBase } } - this._lastEventId = message._Str_20637; + this._lastEventId = message.sourceEventId; } -} \ No newline at end of file +} diff --git a/src/nitro/session/handler/RoomPresentHandler.ts b/src/nitro/session/handler/RoomPresentHandler.ts index 2b6de335..56892ee7 100644 --- a/src/nitro/session/handler/RoomPresentHandler.ts +++ b/src/nitro/session/handler/RoomPresentHandler.ts @@ -1,8 +1,8 @@ import { IConnection } from '../../../core/communication/connections/IConnection'; -import { IRoomHandlerListener } from '../IRoomHandlerListener'; -import { BaseHandler } from './BaseHandler'; import { FurnitureGiftOpenedEvent } from '../../communication/messages/incoming/inventory/furni/gifts/FurnitureGiftOpenedEvent'; import { RoomSessionPresentEvent } from '../events/RoomSessionPresentEvent'; +import { IRoomHandlerListener } from '../IRoomHandlerListener'; +import { BaseHandler } from './BaseHandler'; export class RoomPresentHandler extends BaseHandler { @@ -29,7 +29,7 @@ export class RoomPresentHandler extends BaseHandler if(this.listener && this.listener.events) this.listener.events.dispatchEvent( new RoomSessionPresentEvent(RoomSessionPresentEvent.RSPE_PRESENT_OPENED, session, parser.classId, parser._Str_2887, - parser.productCode, parser.placedItemId, parser.placedItemType, parser._Str_4057, parser.petFigureString)); + parser.productCode, parser.placedItemId, parser.placedItemType, parser.placedInRoom, parser.petFigureString)); }