#28 - RoomMessageNotificationMessageEvent added

This commit is contained in:
oobjectt 2022-12-24 17:15:51 +01:00
parent 26741b78a7
commit ea0bf8ad70
6 changed files with 64 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -168,6 +168,7 @@ export class IncomingHeader
public static ROOM_SPECTATOR = 1033; public static ROOM_SPECTATOR = 1033;
public static ROOM_THICKNESS = 3547; public static ROOM_THICKNESS = 3547;
public static ROOM_GET_FILTER_WORDS = 2937; public static ROOM_GET_FILTER_WORDS = 2937;
public static ROOM_MESSAGE_NOTIFICATION = 1634;
public static INFO_FEED_ENABLE = 3284; public static INFO_FEED_ENABLE = 3284;
public static SECURITY_MACHINE = 1488; public static SECURITY_MACHINE = 1488;
public static MYSTERY_BOX_KEYS = 2833; public static MYSTERY_BOX_KEYS = 2833;

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../../api';
import { MessageEvent } from '../../../../../../events';
import { RoomMessageNotificationMessageParser } from '../../../parser';
export class RoomMessageNotificationMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, RoomMessageNotificationMessageParser);
}
public getParser(): RoomMessageNotificationMessageParser
{
return this.parser as RoomMessageNotificationMessageParser;
}
}

View File

@ -12,5 +12,6 @@ export * from './LoveLockFurniStartEvent';
export * from './OneWayDoorStatusMessageEvent'; export * from './OneWayDoorStatusMessageEvent';
export * from './RequestSpamWallPostItMessageEvent'; export * from './RequestSpamWallPostItMessageEvent';
export * from './RoomDimmerPresetsMessageEvent'; export * from './RoomDimmerPresetsMessageEvent';
export * from './RoomMessageNotificationMessageEvent';
export * from './wall'; export * from './wall';
export * from './youtube'; export * from './youtube';

View File

@ -0,0 +1,43 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../../api';
export class RoomMessageNotificationMessageParser implements IMessageParser
{
private _roomId: number;
private _roomName: string;
private _messageCount: number;
public flush(): boolean
{
this._roomId = -1;
this._roomName = null;
this._messageCount = -1;
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._roomId = wrapper.readInt();
this._roomName = wrapper.readString();
this._messageCount = wrapper.readInt();
return true;
}
public get roomId(): number
{
return this._roomId;
}
public get roomName(): string
{
return this._roomName;
}
public get messageCount(): number
{
return this._messageCount;
}
}

View File

@ -13,5 +13,6 @@ export * from './OneWayDoorStatusMessageParser';
export * from './RequestSpamWallPostItMessageParser'; export * from './RequestSpamWallPostItMessageParser';
export * from './RoomDimmerPresetsMessageData'; export * from './RoomDimmerPresetsMessageData';
export * from './RoomDimmerPresetsMessageParser'; export * from './RoomDimmerPresetsMessageParser';
export * from './RoomMessageNotificationMessageParser';
export * from './wall'; export * from './wall';
export * from './youtube'; export * from './youtube';