Skip to content

Commit

Permalink
#28 - OfferRewardDeliveredMessageEvent added (#44)
Browse files Browse the repository at this point in the history
Co-authored-by: Bill <[email protected]>
  • Loading branch information
oobjectt and billsonnn authored Apr 29, 2023
1 parent 7ac70f4 commit 276c3e1
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/nitro/communication/NitroMessages.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 276c3e1

Please sign in to comment.