From 10e6e8ed7cc7d2589fa57361582a0a6d1b0c6a56 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sun, 6 Jun 2021 20:10:57 -0500 Subject: [PATCH] cleaned ModeratorUserInfoData --- .../animation/AvatarAnimationLayerData.ts | 6 +- .../avatar/animation/IAnimationLayerData.ts | 4 +- src/nitro/avatar/cache/AvatarImageCache.ts | 2 +- src/nitro/avatar/enum/AvatarFigurePartType.ts | 4 +- .../parser/modtool/ModtoolUserInfoParser.ts | 10 +- .../modtool/utils/ModeratorUserInfoData.ts | 145 ++++++++++++++++++ .../parser/modtool/utils/_Str_5467.ts | 145 ------------------ .../messages/parser/modtool/utils/index.ts | 2 +- src/nitro/room/RoomEngine.ts | 4 +- .../avatar/AvatarVisualization.ts | 2 +- src/nitro/utils/FixedSizeStack.ts | 8 +- 11 files changed, 165 insertions(+), 167 deletions(-) create mode 100644 src/nitro/communication/messages/parser/modtool/utils/ModeratorUserInfoData.ts delete mode 100644 src/nitro/communication/messages/parser/modtool/utils/_Str_5467.ts diff --git a/src/nitro/avatar/animation/AvatarAnimationLayerData.ts b/src/nitro/avatar/animation/AvatarAnimationLayerData.ts index 33e70f02..7bbaf972 100644 --- a/src/nitro/avatar/animation/AvatarAnimationLayerData.ts +++ b/src/nitro/avatar/animation/AvatarAnimationLayerData.ts @@ -36,7 +36,7 @@ export class AvatarAnimationLayerData implements IAnimationLayerData let _local_5 = ''; - if(this._base !== '') _local_5 = this._Str_2108().toString(); + if(this._base !== '') _local_5 = this.baseAsInt().toString(); if(_arg_3) { @@ -50,7 +50,7 @@ export class AvatarAnimationLayerData implements IAnimationLayerData return this._items; } - private _Str_2108(): number + private baseAsInt(): number { let k = 0; let index = 0; @@ -70,7 +70,7 @@ export class AvatarAnimationLayerData implements IAnimationLayerData return this._id; } - public get _Str_891(): number + public get animationFrame(): number { return this._animationFrame; } diff --git a/src/nitro/avatar/animation/IAnimationLayerData.ts b/src/nitro/avatar/animation/IAnimationLayerData.ts index 4c5b8449..673e7ad7 100644 --- a/src/nitro/avatar/animation/IAnimationLayerData.ts +++ b/src/nitro/avatar/animation/IAnimationLayerData.ts @@ -4,9 +4,9 @@ export interface IAnimationLayerData { id: string; action: IActiveActionData; - _Str_891: number; + animationFrame: number; dx: number; dy: number; dz: number; dd: number; -} \ No newline at end of file +} diff --git a/src/nitro/avatar/cache/AvatarImageCache.ts b/src/nitro/avatar/cache/AvatarImageCache.ts index c8086b08..fc075fb5 100644 --- a/src/nitro/avatar/cache/AvatarImageCache.ts +++ b/src/nitro/avatar/cache/AvatarImageCache.ts @@ -225,7 +225,7 @@ export class AvatarImageCache _local_11.y = (_local_18.dy / 2); } - frameCount = _local_18._Str_891; + frameCount = _local_18.animationFrame; if(_local_18.action) { diff --git a/src/nitro/avatar/enum/AvatarFigurePartType.ts b/src/nitro/avatar/enum/AvatarFigurePartType.ts index 9ac466ed..23ecb286 100644 --- a/src/nitro/avatar/enum/AvatarFigurePartType.ts +++ b/src/nitro/avatar/enum/AvatarFigurePartType.ts @@ -25,5 +25,5 @@ public static RIGHT_HAND_ITEM: string = 'ri'; public static LEFT_COAT_SLEEVE: string = 'lc'; public static RIGHT_COAT_SLEEVE: string = 'rc'; - public static _Str_1286: string[] = [ AvatarFigurePartType.SHOES, AvatarFigurePartType.LEGS, AvatarFigurePartType.CHEST, AvatarFigurePartType.WAIST_ACCESSORY, AvatarFigurePartType.CHEST_ACCESSORY, AvatarFigurePartType.HEAD, AvatarFigurePartType.HAIR, AvatarFigurePartType.FACE_ACCESSORY, AvatarFigurePartType.EYE_ACCESSORY, AvatarFigurePartType.HEAD_ACCESSORY, AvatarFigurePartType.HEAD_ACCESSORY_EXTRA, AvatarFigurePartType.COAT_CHEST, AvatarFigurePartType.CHEST_PRINT ]; -} \ No newline at end of file + public static FIGURE_SETS: string[] = [ AvatarFigurePartType.SHOES, AvatarFigurePartType.LEGS, AvatarFigurePartType.CHEST, AvatarFigurePartType.WAIST_ACCESSORY, AvatarFigurePartType.CHEST_ACCESSORY, AvatarFigurePartType.HEAD, AvatarFigurePartType.HAIR, AvatarFigurePartType.FACE_ACCESSORY, AvatarFigurePartType.EYE_ACCESSORY, AvatarFigurePartType.HEAD_ACCESSORY, AvatarFigurePartType.HEAD_ACCESSORY_EXTRA, AvatarFigurePartType.COAT_CHEST, AvatarFigurePartType.CHEST_PRINT ]; +} diff --git a/src/nitro/communication/messages/parser/modtool/ModtoolUserInfoParser.ts b/src/nitro/communication/messages/parser/modtool/ModtoolUserInfoParser.ts index b0ec5ddd..265c6c30 100644 --- a/src/nitro/communication/messages/parser/modtool/ModtoolUserInfoParser.ts +++ b/src/nitro/communication/messages/parser/modtool/ModtoolUserInfoParser.ts @@ -1,12 +1,10 @@ +import { ModeratorUserInfoData } from 'nitro-renderer/src/nitro/communication/messages/parser/modtool/utils/ModeratorUserInfoData'; import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; -import { ModtoolUserChatlogParserVisit } from './utils/ModtoolUserChatlogParserVisit'; -import { ModtoolUserChatlogParserChatlog } from './utils/ModtoolUserChatlogParserChatlog'; -import { _Str_5467 } from './utils/_Str_5467'; export class ModtoolUserInfoParser implements IMessageParser { - private _data: _Str_5467; + private _data: ModeratorUserInfoData; public flush(): boolean { @@ -19,12 +17,12 @@ export class ModtoolUserInfoParser implements IMessageParser { if(!wrapper) return false; - this._data = new _Str_5467(wrapper); + this._data = new ModeratorUserInfoData(wrapper); return true; } - public get data(): _Str_5467 + public get data(): ModeratorUserInfoData { return this._data; } diff --git a/src/nitro/communication/messages/parser/modtool/utils/ModeratorUserInfoData.ts b/src/nitro/communication/messages/parser/modtool/utils/ModeratorUserInfoData.ts new file mode 100644 index 00000000..2c96f7c1 --- /dev/null +++ b/src/nitro/communication/messages/parser/modtool/utils/ModeratorUserInfoData.ts @@ -0,0 +1,145 @@ +import { IMessageDataWrapper } from 'nitro-renderer/src/core/communication/messages/IMessageDataWrapper'; + +export class ModeratorUserInfoData +{ + private _userId:number; + private _userName:string; + private _registrationAgeInMinutes:number; + private _minutesSinceLastLogin:number; + private _online:boolean; + private _cfhCount:number; + private _abusiveCfhCount:number; + private _cautionCount:number; + private _banCount:number; + private _tradingLockCount:number; + private _tradingExpiryDate:string; + private _lastPurchaseDate:string; + private _identityId:number; + private _identityRelatedBanCount:number; + private _primaryEmailAddress:string; + private _figure:string; + private _userClassification:string; + private _lastSanctionTime:string = ''; + private _sanctionAgeHours:number = 0; + + constructor(wrapper: IMessageDataWrapper) + { + this._userId = wrapper.readInt(); + this._userName = wrapper.readString(); + this._figure = wrapper.readString(); + this._registrationAgeInMinutes = wrapper.readInt(); + this._minutesSinceLastLogin = wrapper.readInt(); + this._online = wrapper.readBoolean(); + this._cfhCount = wrapper.readInt(); + this._abusiveCfhCount = wrapper.readInt(); + this._cautionCount = wrapper.readInt(); + this._banCount = wrapper.readInt(); + this._tradingLockCount = wrapper.readInt(); + this._tradingExpiryDate = wrapper.readString(); + this._lastPurchaseDate = wrapper.readString(); + this._identityId = wrapper.readInt(); + this._identityRelatedBanCount = wrapper.readInt(); + this._primaryEmailAddress = wrapper.readString(); + this._userClassification = wrapper.readString(); + if(wrapper.bytesAvailable) + { + this._lastSanctionTime = wrapper.readString(); + this._sanctionAgeHours = wrapper.readInt(); + } + } + + public get userId():number + { + return this._userId; + } + + public get userName():string + { + return this._userName; + } + + public get figure():string + { + return this._figure; + } + + public get registrationAgeInMinutes():number + { + return this._registrationAgeInMinutes; + } + + public get minutesSinceLastLogin():number + { + return this._minutesSinceLastLogin; + } + + public get online():boolean + { + return this._online; + } + + public get cfhCount():number + { + return this._cfhCount; + } + + public get abusiveCfhCount():number + { + return this._abusiveCfhCount; + } + + public get cautionCount():number + { + return this._cautionCount; + } + + public get banCount():number + { + return this._banCount; + } + + public get tradingLockCount():number + { + return this._tradingLockCount; + } + + public get tradingExpiryDate():string + { + return this._tradingExpiryDate; + } + + public get lastPurchaseDate():string + { + return this._lastPurchaseDate; + } + + public get identityId():number + { + return this._identityId; + } + + public get identityRelatedBanCount():number + { + return this._identityRelatedBanCount; + } + + public get primaryEmailAddress():string + { + return this._primaryEmailAddress; + } + + public get userClassification():string + { + return this._userClassification; + } + + public get lastSanctionTime():string + { + return this._lastSanctionTime; + } + + public get sanctionAgeHours():number + { + return this._sanctionAgeHours; + } +} diff --git a/src/nitro/communication/messages/parser/modtool/utils/_Str_5467.ts b/src/nitro/communication/messages/parser/modtool/utils/_Str_5467.ts deleted file mode 100644 index 93ef6361..00000000 --- a/src/nitro/communication/messages/parser/modtool/utils/_Str_5467.ts +++ /dev/null @@ -1,145 +0,0 @@ -import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; - -export class _Str_5467 -{ - private _userId:number; - private _userName:string; - private _Str_19258:number; - private _Str_20876:number; - private _online:boolean; - private _Str_21621:number; - private _Str_20013:number; - private _Str_20917:number; - private _Str_20349:number; - private _Str_21386:number; - private _Str_20848:string; - private _Str_21819:string; - private _Str_20982:number; - private _Str_19460:number; - private _Str_22254:string; - private _figure:string; - private _Str_20625:string; - private _Str_19116:string = ''; - private _Str_20729:number = 0; - - constructor(wrapper: IMessageDataWrapper) - { - this._userId = wrapper.readInt(); - this._userName = wrapper.readString(); - this._figure = wrapper.readString(); - this._Str_19258 = wrapper.readInt(); - this._Str_20876 = wrapper.readInt(); - this._online = wrapper.readBoolean(); - this._Str_21621 = wrapper.readInt(); - this._Str_20013 = wrapper.readInt(); - this._Str_20917 = wrapper.readInt(); - this._Str_20349 = wrapper.readInt(); - this._Str_21386 = wrapper.readInt(); - this._Str_20848 = wrapper.readString(); - this._Str_21819 = wrapper.readString(); - this._Str_20982 = wrapper.readInt(); - this._Str_19460 = wrapper.readInt(); - this._Str_22254 = wrapper.readString(); - this._Str_20625 = wrapper.readString(); - if(wrapper.bytesAvailable) - { - this._Str_19116 = wrapper.readString(); - this._Str_20729 = wrapper.readInt(); - } - } - - public get userId():number - { - return this._userId; - } - - public get userName():string - { - return this._userName; - } - - public get figure():string - { - return this._figure; - } - - public get _Str_24334():number - { - return this._Str_19258; - } - - public get _Str_23276():number - { - return this._Str_20876; - } - - public get online():boolean - { - return this._online; - } - - public get _Str_24656():number - { - return this._Str_21621; - } - - public get _Str_22987():number - { - return this._Str_20013; - } - - public get _Str_16987():number - { - return this._Str_20917; - } - - public get _Str_20373():number - { - return this._Str_20349; - } - - public get _Str_24526():number - { - return this._Str_21386; - } - - public get _Str_23969():string - { - return this._Str_20848; - } - - public get _Str_22786():string - { - return this._Str_21819; - } - - public get _Str_25657():number - { - return this._Str_20982; - } - - public get _Str_22700():number - { - return this._Str_19460; - } - - public get _Str_20219():string - { - return this._Str_22254; - } - - public get _Str_22262():string - { - return this._Str_20625; - } - - public get _Str_24447():string - { - return this._Str_19116; - } - - public get _Str_19137():number - { - return this._Str_20729; - } -} diff --git a/src/nitro/communication/messages/parser/modtool/utils/index.ts b/src/nitro/communication/messages/parser/modtool/utils/index.ts index 24b28857..27549d06 100644 --- a/src/nitro/communication/messages/parser/modtool/utils/index.ts +++ b/src/nitro/communication/messages/parser/modtool/utils/index.ts @@ -1,5 +1,6 @@ export * from './CallForHelpCategoryData'; export * from './IChatlog'; +export * from './ModeratorUserInfoData'; export * from './ModtoolRoomChatlogLine'; export * from './ModtoolRoomVisitedData'; export * from './ModtoolUserChatlogParserChatlog'; @@ -8,5 +9,4 @@ export * from './ModtoolUserVisitedRoomsRoom'; export * from './_Str_2484'; export * from './_Str_5018'; export * from './_Str_5460'; -export * from './_Str_5467'; export * from './_Str_8176'; diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index 5d4ad70f..d305d973 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -2454,7 +2454,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato sprite.y = (y - (rectangle.height / 2)); } - if(!this._Str_25871(canvas, x, y, type, altKey, ctrlKey, shiftKey)) + if(!this.handleRoomDragging(canvas, x, y, type, altKey, ctrlKey, shiftKey)) { if(!canvas.handleMouseEvent(x, y, type, altKey, ctrlKey, shiftKey, buttonDown)) { @@ -2487,7 +2487,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato this._activeRoomActiveCanvasMouseY = y; } - private _Str_25871(canvas: IRoomRenderingCanvas, x: number, y: number, type: string, altKey: boolean, ctrlKey: boolean, shiftKey: boolean): boolean + private handleRoomDragging(canvas: IRoomRenderingCanvas, x: number, y: number, type: string, altKey: boolean, ctrlKey: boolean, shiftKey: boolean): boolean { let offsetX = (x - this._activeRoomActiveCanvasMouseX); let offsetY = (y - this._activeRoomActiveCanvasMouseY); diff --git a/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts b/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts index 1e5337a1..79ae4390 100644 --- a/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts +++ b/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts @@ -408,7 +408,7 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement if(layerData) { - frameNumber = layerData._Str_891; + frameNumber = layerData.animationFrame; offsetX += layerData.dx; offsetY += layerData.dy; dd += layerData.dd; diff --git a/src/nitro/utils/FixedSizeStack.ts b/src/nitro/utils/FixedSizeStack.ts index 034a5040..a52b7d07 100644 --- a/src/nitro/utils/FixedSizeStack.ts +++ b/src/nitro/utils/FixedSizeStack.ts @@ -17,7 +17,7 @@ this._index = 0; } - public _Str_22775(k: number): void + public addValue(k: number): void { if(this._data.length < this._maxSize) { @@ -31,7 +31,7 @@ this._index = ((this._index + 1) % this._maxSize); } - public _Str_25797(): number + public getMax(): number { let k = Number.MIN_VALUE; @@ -47,7 +47,7 @@ return k; } - public _Str_26219(): number + public getMin(): number { let k = Number.MAX_VALUE; @@ -62,4 +62,4 @@ return k; } -} \ No newline at end of file +}