#28 - OfferRewardDeliveredMessageEvent added (#44)

Co-authored-by: Bill <billsonnn@users.noreply.github.com>
This commit is contained in:
object 2023-04-30 01:45:31 +02:00 committed by GitHub
parent 7ac70f4ef0
commit 276c3e1b68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 72 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -128,6 +128,7 @@ export class IncomingHeader
public static CONVERTED_ROOM_ID = 1331;
public static GUEST_ROOM_SEARCH_RESULT = 52;
public static NOTIFICATION_LIST = 1992;
public static NOTIFICATION_OFFER_REWARD_DELIVERED = 2125;
public static NOTIFICATION_SIMPLE_ALERT = 5100;
public static NOTIFICATION_ELEMENT_POINTER = 1787;
public static PET_FIGURE_UPDATE = 1924;

View File

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

View File

@ -9,6 +9,7 @@ export * from './HotelWillShutdownEvent';
export * from './InfoFeedEnableMessageEvent';
export * from './MOTDNotificationEvent';
export * from './NotificationDialogMessageEvent';
export * from './OfferRewardDeliveredMessageEvent';
export * from './PetLevelNotificationEvent';
export * from './PetPlacingErrorEvent';
export * from './SimpleAlertMessageEvent';

View File

@ -0,0 +1,51 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../api';
export class OfferRewardDeliveredMessageParser implements IMessageParser
{
private _contentType: string;
private _classId: number;
private _name: string;
private _description: string;
public flush(): boolean
{
this._contentType = null;
this._classId = 0;
this._name = null;
this._description = null;
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._contentType = wrapper.readString();
this._classId = wrapper.readInt();
this._name = wrapper.readString();
this._description = wrapper.readString();
return true;
}
public get contentType(): string
{
return this._contentType;
}
public get classId(): number
{
return this._classId;
}
public get name(): string
{
return this._name;
}
public get description(): string
{
return this._description;
}
}

View File

@ -10,6 +10,7 @@ export * from './HotelWillShutdownParser';
export * from './InfoFeedEnableMessageParser';
export * from './MOTDNotificationParser';
export * from './NotificationDialogMessageParser';
export * from './OfferRewardDeliveredMessageParser';
export * from './PetLevelNotificationParser';
export * from './PetPlacingErrorEventParser';
export * from './SimpleAlertMessageParser';