Add CustomUserNotificationMessageEvent

This commit is contained in:
Bill 2022-08-02 01:32:27 -04:00
parent dcdbaf98cf
commit 4aad057e02
6 changed files with 48 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -386,4 +386,5 @@ export class IncomingHeader
public static NO_SUCH_FLAT = 84;
public static ROOM_SETTINGS_ERROR = 2897;
public static SHOW_ENFORCE_ROOM_CATEGORY = 3896;
public static CUSTOM_USER_NOTIFICATION = 909;
}

View File

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

View File

@ -1,3 +1,4 @@
export * from './CustomUserNotificationMessageEvent';
export * from './DiceValueMessageEvent';
export * from './floor';
export * from './FurnitureAliasesEvent';

View File

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

View File

@ -1,3 +1,4 @@
export * from './CustomUserNotificationMessageParser';
export * from './DiceValueMessageParser';
export * from './floor';
export * from './FurnitureAliasesParser';