From 224b0850799361847c7cb468991ead81d2bc082e Mon Sep 17 00:00:00 2001 From: Bill Date: Sun, 22 Aug 2021 19:18:11 -0400 Subject: [PATCH] Call for help packets --- src/nitro/communication/NitroMessages.ts | 6 + .../messages/incoming/IncomingHeader.ts | 3 + .../callforhelp/CallForHelpCategoryData.ts | 48 ++++++++ .../callforhelp/CallForHelpTopicData.ts | 31 +++++ .../callforhelp/CfhSanctionMessageEvent.ts | 16 +++ .../callforhelp/CfhSanctionTypeData.ts | 49 ++++++++ .../callforhelp/CfhTopicsInitEvent.ts | 16 +++ .../callforhelp/SanctionStatusEvent.ts | 16 +++ .../messages/incoming/callforhelp/index.ts | 6 + .../bots/BotAddedToInventoryEvent.ts | 2 +- .../messages/incoming/moderation/INamed.ts | 4 + .../messages/incoming/moderation/index.ts | 1 + .../callforhelp/CfhSanctionMessageParser.ts | 45 +++++++ .../callforhelp/CfhTopicsInitMessageParser.ts | 38 ++++++ .../SanctionStatusMessageParser.ts | 115 ++++++++++++++++++ .../messages/parser/callforhelp/index.ts | 3 + .../bots/BotAddedToInventoryParser.ts | 2 +- 17 files changed, 399 insertions(+), 2 deletions(-) create mode 100644 src/nitro/communication/messages/incoming/callforhelp/CallForHelpCategoryData.ts create mode 100644 src/nitro/communication/messages/incoming/callforhelp/CallForHelpTopicData.ts create mode 100644 src/nitro/communication/messages/incoming/callforhelp/CfhSanctionMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/callforhelp/CfhSanctionTypeData.ts create mode 100644 src/nitro/communication/messages/incoming/callforhelp/CfhTopicsInitEvent.ts create mode 100644 src/nitro/communication/messages/incoming/callforhelp/SanctionStatusEvent.ts create mode 100644 src/nitro/communication/messages/incoming/callforhelp/index.ts create mode 100644 src/nitro/communication/messages/incoming/moderation/INamed.ts create mode 100644 src/nitro/communication/messages/incoming/moderation/index.ts create mode 100644 src/nitro/communication/messages/parser/callforhelp/CfhSanctionMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/callforhelp/CfhTopicsInitMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/callforhelp/SanctionStatusMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/callforhelp/index.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index f1bafbdf..eaa719c7 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1,6 +1,7 @@ import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, AvailabilityTimeMessageEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, CatalogApproveNameResultEvent, ChangeUserNameResultMessageEvent, CheckUserNameResultMessageEvent, ClubGiftNotificationEvent, FigureUpdateEvent, FurnitureGuildInfoComposer, GetBonusRareInfoMessageComposer, GetJukeboxPlayListMessageComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetUserSongDisksMessageComposer, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, MaintenanceStatusMessageEvent, MysteryBoxKeysEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, RoomAdErrorEvent, RoomUnitGiveHandItemPetComposer, SellablePetPalettesEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, UnseenResetCategoryComposer, UnseenResetItemsComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, WardrobeMessageEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; +import { CfhSanctionMessageEvent, CfhTopicsInitEvent, SanctionStatusEvent } from './messages/incoming/callforhelp'; import { CameraPublishStatusMessageEvent } from './messages/incoming/camera/CameraPublishStatusMessageEvent'; import { CameraPurchaseOKMessageEvent } from './messages/incoming/camera/CameraPurchaseOKMessageEvent'; import { CameraStorageUrlMessageEvent } from './messages/incoming/camera/CameraStorageUrlMessageEvent'; @@ -493,6 +494,11 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.USER_FIGURE, FigureUpdateEvent); this._events.set(IncomingHeader.USER_OUTFITS, WardrobeMessageEvent); + // CALL FOR HELP + this._events.set(IncomingHeader.CFH_SANCTION, CfhSanctionMessageEvent); + this._events.set(IncomingHeader.CFH_TOPICS, CfhTopicsInitEvent); + this._events.set(IncomingHeader.CFH_SANCTION_STATUS, SanctionStatusEvent); + // CATALOG this._events.set(IncomingHeader.CATALOG_CLUB, CatalogClubEvent); this._events.set(IncomingHeader.CATALOG_MODE, CatalogModeEvent); diff --git a/src/nitro/communication/messages/incoming/IncomingHeader.ts b/src/nitro/communication/messages/incoming/IncomingHeader.ts index 56d16e90..6963e111 100644 --- a/src/nitro/communication/messages/incoming/IncomingHeader.ts +++ b/src/nitro/communication/messages/incoming/IncomingHeader.ts @@ -289,4 +289,7 @@ export class IncomingHeader public static TRAX_SONG_INFO = 3365; public static USER_SONG_DISKS_INVENTORY = 2602; public static CHECK_USER_NAME = 563; + public static CFH_SANCTION = 2782; + public static CFH_TOPICS = 325; + public static CFH_SANCTION_STATUS = 2221; } diff --git a/src/nitro/communication/messages/incoming/callforhelp/CallForHelpCategoryData.ts b/src/nitro/communication/messages/incoming/callforhelp/CallForHelpCategoryData.ts new file mode 100644 index 00000000..6f3bee4c --- /dev/null +++ b/src/nitro/communication/messages/incoming/callforhelp/CallForHelpCategoryData.ts @@ -0,0 +1,48 @@ +import { IDisposable, IMessageDataWrapper } from '../../../../../core'; +import { INamed } from '../moderation'; +import { CallForHelpTopicData } from './CallForHelpTopicData'; + +export class CallForHelpCategoryData implements INamed, IDisposable +{ + private _name: string; + private _topics: CallForHelpTopicData[]; + private _disposed: boolean; + + constructor(wrapper: IMessageDataWrapper) + { + this._topics = []; + this._name = wrapper.readString(); + + let count = wrapper.readInt(); + + while(count > 0) + { + this._topics.push(new CallForHelpTopicData(wrapper)); + + count++; + } + } + + public dispose(): void + { + if(this._disposed) return; + + this._disposed = true; + this._topics = null; + } + + public get disposed(): boolean + { + return this._disposed; + } + + public get name(): string + { + return this._name; + } + + public get _Str_14841(): CallForHelpTopicData[] + { + return this._topics; + } +} diff --git a/src/nitro/communication/messages/incoming/callforhelp/CallForHelpTopicData.ts b/src/nitro/communication/messages/incoming/callforhelp/CallForHelpTopicData.ts new file mode 100644 index 00000000..29bb124d --- /dev/null +++ b/src/nitro/communication/messages/incoming/callforhelp/CallForHelpTopicData.ts @@ -0,0 +1,31 @@ +import { IMessageDataWrapper } from '../../../../../core'; +import { INamed } from '../moderation'; + +export class CallForHelpTopicData implements INamed +{ + private _name: string; + private _id: number; + private _consequence: string; + + constructor(wrapper: IMessageDataWrapper) + { + this._name = wrapper.readString(); + this._id = wrapper.readInt(); + this._consequence = wrapper.readString(); + } + + public get name(): string + { + return this._name; + } + + public get id(): number + { + return this._id; + } + + public get _Str_26337(): string + { + return this._consequence; + } +} diff --git a/src/nitro/communication/messages/incoming/callforhelp/CfhSanctionMessageEvent.ts b/src/nitro/communication/messages/incoming/callforhelp/CfhSanctionMessageEvent.ts new file mode 100644 index 00000000..15762a6b --- /dev/null +++ b/src/nitro/communication/messages/incoming/callforhelp/CfhSanctionMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { CfhSanctionMessageParser } from '../../parser/callforhelp/CfhSanctionMessageParser'; + +export class CfhSanctionMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, CfhSanctionMessageParser); + } + + public getParser(): CfhSanctionMessageParser + { + return this.parser as CfhSanctionMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/callforhelp/CfhSanctionTypeData.ts b/src/nitro/communication/messages/incoming/callforhelp/CfhSanctionTypeData.ts new file mode 100644 index 00000000..6cdf23d4 --- /dev/null +++ b/src/nitro/communication/messages/incoming/callforhelp/CfhSanctionTypeData.ts @@ -0,0 +1,49 @@ +import { IMessageDataWrapper } from '../../../../../core'; +import { INamed } from '../moderation'; + +export class CfhSanctionTypeData implements INamed +{ + private _name: string; + private _sanctionLengthInHours: number; + private _probationDays: number; + private _avatarOnly: boolean; + private _tradeLockInfo: string = ''; + private _machineBanInfo: string = ''; + + constructor(wrapper: IMessageDataWrapper) + { + this._name = wrapper.readString(); + this._sanctionLengthInHours = wrapper.readInt(); + this._probationDays = wrapper.readInt(); + this._avatarOnly = wrapper.readBoolean(); + + if(wrapper.bytesAvailable) this._tradeLockInfo = wrapper.readString(); + + if(wrapper.bytesAvailable) this._machineBanInfo = wrapper.readString(); + } + + public get name(): string + { + return this._name; + } + + public get sanctionLengthInHours(): number + { + return this._sanctionLengthInHours; + } + + public get avatarOnly(): boolean + { + return this._avatarOnly; + } + + public get tradeLockInfo(): string + { + return this._tradeLockInfo; + } + + public get machineBanInfo(): string + { + return this._machineBanInfo; + } +} diff --git a/src/nitro/communication/messages/incoming/callforhelp/CfhTopicsInitEvent.ts b/src/nitro/communication/messages/incoming/callforhelp/CfhTopicsInitEvent.ts new file mode 100644 index 00000000..0b3b5022 --- /dev/null +++ b/src/nitro/communication/messages/incoming/callforhelp/CfhTopicsInitEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { CfhTopicsInitMessageParser } from '../../parser/callforhelp/CfhTopicsInitMessageParser'; + +export class CfhTopicsInitEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, CfhTopicsInitMessageParser); + } + + public getParser(): CfhTopicsInitMessageParser + { + return this.parser as CfhTopicsInitMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/callforhelp/SanctionStatusEvent.ts b/src/nitro/communication/messages/incoming/callforhelp/SanctionStatusEvent.ts new file mode 100644 index 00000000..2a9ce7aa --- /dev/null +++ b/src/nitro/communication/messages/incoming/callforhelp/SanctionStatusEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { SanctionStatusMessageParser } from '../../parser/callforhelp'; + +export class SanctionStatusEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, SanctionStatusMessageParser); + } + + public getParser(): SanctionStatusMessageParser + { + return this.parser as SanctionStatusMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/callforhelp/index.ts b/src/nitro/communication/messages/incoming/callforhelp/index.ts new file mode 100644 index 00000000..be8b70cc --- /dev/null +++ b/src/nitro/communication/messages/incoming/callforhelp/index.ts @@ -0,0 +1,6 @@ +export * from './CallForHelpCategoryData'; +export * from './CallForHelpTopicData'; +export * from './CfhSanctionMessageEvent'; +export * from './CfhSanctionTypeData'; +export * from './CfhTopicsInitEvent'; +export * from './SanctionStatusEvent'; diff --git a/src/nitro/communication/messages/incoming/inventory/bots/BotAddedToInventoryEvent.ts b/src/nitro/communication/messages/incoming/inventory/bots/BotAddedToInventoryEvent.ts index fe55b447..926163a0 100644 --- a/src/nitro/communication/messages/incoming/inventory/bots/BotAddedToInventoryEvent.ts +++ b/src/nitro/communication/messages/incoming/inventory/bots/BotAddedToInventoryEvent.ts @@ -13,4 +13,4 @@ export class BotAddedToInventoryEvent extends MessageEvent implements IMessageEv { return this.parser as BotAddedToInventoryParser; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/incoming/moderation/INamed.ts b/src/nitro/communication/messages/incoming/moderation/INamed.ts new file mode 100644 index 00000000..3a74243e --- /dev/null +++ b/src/nitro/communication/messages/incoming/moderation/INamed.ts @@ -0,0 +1,4 @@ +export interface INamed +{ + name: string; +} diff --git a/src/nitro/communication/messages/incoming/moderation/index.ts b/src/nitro/communication/messages/incoming/moderation/index.ts new file mode 100644 index 00000000..599d890b --- /dev/null +++ b/src/nitro/communication/messages/incoming/moderation/index.ts @@ -0,0 +1 @@ +export * from './INamed'; diff --git a/src/nitro/communication/messages/parser/callforhelp/CfhSanctionMessageParser.ts b/src/nitro/communication/messages/parser/callforhelp/CfhSanctionMessageParser.ts new file mode 100644 index 00000000..37b097b3 --- /dev/null +++ b/src/nitro/communication/messages/parser/callforhelp/CfhSanctionMessageParser.ts @@ -0,0 +1,45 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { CfhSanctionTypeData } from '../../incoming/callforhelp'; +import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser'; + +export class CfhSanctionMessageParser implements IMessageParser +{ + private _issueId: number; + private _accountId: number; + private _sanctionType: CfhSanctionTypeData; + + public flush(): boolean + { + this._issueId = -1; + this._accountId = 1; + this._sanctionType = null; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._issueId = wrapper.readInt(); + this._accountId = wrapper.readInt(); + this._sanctionType = new CfhSanctionTypeData(wrapper); + + return true; + } + + public get issueId(): number + { + return this._issueId; + } + + public get accountId(): number + { + return this._accountId; + } + + public get sanctionType(): CfhSanctionTypeData + { + return this._sanctionType; + } +} diff --git a/src/nitro/communication/messages/parser/callforhelp/CfhTopicsInitMessageParser.ts b/src/nitro/communication/messages/parser/callforhelp/CfhTopicsInitMessageParser.ts new file mode 100644 index 00000000..6365657f --- /dev/null +++ b/src/nitro/communication/messages/parser/callforhelp/CfhTopicsInitMessageParser.ts @@ -0,0 +1,38 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { CallForHelpCategoryData } from '../modtool'; +import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser'; + +export class CfhTopicsInitMessageParser implements IMessageParser +{ + private _callForHelpCategories: CallForHelpCategoryData[]; + + public flush(): boolean + { + this._callForHelpCategories = null; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._callForHelpCategories = []; + + let count = wrapper.readInt(); + + while(count > 0) + { + this._callForHelpCategories.push(new CallForHelpCategoryData(wrapper)); + + count--; + } + + return true; + } + + public get callForHelpCategories(): CallForHelpCategoryData[] + { + return this._callForHelpCategories; + } +} diff --git a/src/nitro/communication/messages/parser/callforhelp/SanctionStatusMessageParser.ts b/src/nitro/communication/messages/parser/callforhelp/SanctionStatusMessageParser.ts new file mode 100644 index 00000000..a3e9b60a --- /dev/null +++ b/src/nitro/communication/messages/parser/callforhelp/SanctionStatusMessageParser.ts @@ -0,0 +1,115 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser'; + +export class SanctionStatusMessageParser implements IMessageParser +{ + private _Str_21269: boolean; + private _Str_20966: boolean; + private _Str_19378: string; + private _Str_19998: number; + private _Str_21197: string; + private _Str_20631: string; + private _Str_19322: number; + private _Str_22000: string; + private _Str_19157: number; + private _Str_21458: boolean; + private _Str_22154: string; + + public flush(): boolean + { + this._Str_21269 = false; + this._Str_20966 = false; + this._Str_19378 = null; + this._Str_19998 = 0; + this._Str_21197 = null; + this._Str_20631 = null; + this._Str_19322 = 0; + this._Str_22000 = null; + this._Str_19157 = 0; + this._Str_21458 = false; + this._Str_22154 = null; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._Str_21269 = wrapper.readBoolean(); + this._Str_20966 = wrapper.readBoolean(); + this._Str_19378 = wrapper.readString(); + this._Str_19998 = wrapper.readInt(); + + wrapper.readInt(); + + this._Str_21197 = wrapper.readString(); + this._Str_20631 = wrapper.readString(); + this._Str_19322 = wrapper.readInt(); + this._Str_22000 = wrapper.readString(); + this._Str_19157 = wrapper.readInt(); + + wrapper.readInt(); + + this._Str_21458 = wrapper.readBoolean(); + + if(wrapper.bytesAvailable) this._Str_22154 = wrapper.readString(); + + return true; + } + + public get _Str_22957(): boolean + { + return this._Str_21269; + } + + public get _Str_16442(): boolean + { + return this._Str_20966; + } + + public get _Str_22691(): string + { + return this._Str_19378; + } + + public get _Str_22497(): number + { + return this._Str_19998; + } + + public get _Str_22005(): string + { + return this._Str_21197; + } + + public get _Str_25720(): string + { + return this._Str_20631; + } + + public get _Str_20904(): number + { + return this._Str_19322; + } + + public get _Str_23024(): string + { + return this._Str_22000; + } + + public get _Str_23610(): number + { + return this._Str_19157; + } + + public get _Str_23177(): boolean + { + return this._Str_21458; + } + + public get _Str_21248(): string + { + return this._Str_22154; + } +} diff --git a/src/nitro/communication/messages/parser/callforhelp/index.ts b/src/nitro/communication/messages/parser/callforhelp/index.ts new file mode 100644 index 00000000..2064142a --- /dev/null +++ b/src/nitro/communication/messages/parser/callforhelp/index.ts @@ -0,0 +1,3 @@ +export * from './CfhSanctionMessageParser'; +export * from './CfhTopicsInitMessageParser'; +export * from './SanctionStatusMessageParser'; diff --git a/src/nitro/communication/messages/parser/inventory/bots/BotAddedToInventoryParser.ts b/src/nitro/communication/messages/parser/inventory/bots/BotAddedToInventoryParser.ts index 17c62b66..3c3c4b64 100644 --- a/src/nitro/communication/messages/parser/inventory/bots/BotAddedToInventoryParser.ts +++ b/src/nitro/communication/messages/parser/inventory/bots/BotAddedToInventoryParser.ts @@ -34,4 +34,4 @@ export class BotAddedToInventoryParser implements IMessageParser { return this._openInventory; } -} \ No newline at end of file +}