Add NoobnessLevelEvent

This commit is contained in:
Bill 2022-03-18 18:50:52 -04:00
parent d1eeb4177e
commit 5a8b7f933f
8 changed files with 52 additions and 0 deletions

View File

@ -50,6 +50,7 @@ import { GroupMembersEvent } from './messages/incoming/group/GroupMembersEvent';
import { GroupPurchasedEvent } from './messages/incoming/group/GroupPurchasedEvent';
import { GroupSettingsEvent } from './messages/incoming/group/GroupSettingsEvent';
import { HabboGroupDeactivatedMessageEvent } from './messages/incoming/group/HabboGroupDeactivatedMessageEvent';
import { NoobnessLevelMessageEvent } from './messages/incoming/handshake/NoobnessLevelMessageEvent';
import { CallForHelpDisabledNotifyMessageEvent } from './messages/incoming/help/CallForHelpDisabledNotifyMessageEvent';
import { CallForHelpResultMessageEvent } from './messages/incoming/help/CallForHelpResultMessageEvent';
import { GuideReportingStatusMessageEvent } from './messages/incoming/help/GuideReportingStatusMessageEvent';
@ -887,6 +888,9 @@ export class NitroMessages implements IMessageConfiguration
this._events.set(IncomingHeader.GENERIC_ERROR, GenericErrorEvent);
this._events.set(IncomingHeader.GROUP_LIST, GuildMembershipsMessageEvent);
this._events.set(IncomingHeader.CATALOG_APPROVE_NAME_RESULT, ApproveNameMessageEvent);
// HANDSHAKE
this._events.set(IncomingHeader.NOOBNESS_LEVEL, NoobnessLevelMessageEvent);
}
private registerComposers(): void

View File

@ -367,4 +367,5 @@ export class IncomingHeader
public static GROUP_DEACTIVATE = 3129;
public static PET_RESPECTED = 2788;
public static PET_SUPPLEMENT = 3441;
public static NOOBNESS_LEVEL = 3738;
}

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
import { CallForHelpDisabledNotifyMessageParser } from '../../parser/help/CallForHelpDisabledNotifyMessageParser';
export class NoobnessLevelMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, CallForHelpDisabledNotifyMessageParser);
}
public getParser(): CallForHelpDisabledNotifyMessageParser
{
return this.parser as CallForHelpDisabledNotifyMessageParser;
}
}

View File

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

View File

@ -13,6 +13,7 @@ export * from './friendlist';
export * from './game';
export * from './generic';
export * from './group';
export * from './handshake';
export * from './help';
export * from './IncomingHeader';
export * from './inventory';

View File

@ -0,0 +1,27 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
export class NoobnessLevelMessageParser implements IMessageParser
{
private _noobnessLevel: number;
public flush(): boolean
{
this._noobnessLevel = 0;
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._noobnessLevel = wrapper.readInt();
return true;
}
public get noobnessLevel(): number
{
return this._noobnessLevel;
}
}

View File

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

View File

@ -14,6 +14,7 @@ export * from './friendlist';
export * from './game';
export * from './generic';
export * from './group';
export * from './handshake';
export * from './help';
export * from './inventory';
export * from './landingview';