Call for help packets

This commit is contained in:
Bill 2021-08-22 19:18:11 -04:00
parent 1e8ccf0fd3
commit 224b085079
17 changed files with 399 additions and 2 deletions

View File

@ -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);

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -0,0 +1,6 @@
export * from './CallForHelpCategoryData';
export * from './CallForHelpTopicData';
export * from './CfhSanctionMessageEvent';
export * from './CfhSanctionTypeData';
export * from './CfhTopicsInitEvent';
export * from './SanctionStatusEvent';

View File

@ -0,0 +1,4 @@
export interface INamed
{
name: string;
}

View File

@ -0,0 +1 @@
export * from './INamed';

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -0,0 +1,3 @@
export * from './CfhSanctionMessageParser';
export * from './CfhTopicsInitMessageParser';
export * from './SanctionStatusMessageParser';