Skip to content

Commit 276c3e1

Browse files
oobjecttbillsonnn
andauthored
#28 - OfferRewardDeliveredMessageEvent added (#44)
Co-authored-by: Bill <[email protected]>
1 parent 7ac70f4 commit 276c3e1

File tree

6 files changed

+72
-1
lines changed

6 files changed

+72
-1
lines changed

src/nitro/communication/NitroMessages.ts

Lines changed: 2 additions & 1 deletion
Large diffs are not rendered by default.

src/nitro/communication/messages/incoming/IncomingHeader.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ export class IncomingHeader
128128
public static CONVERTED_ROOM_ID = 1331;
129129
public static GUEST_ROOM_SEARCH_RESULT = 52;
130130
public static NOTIFICATION_LIST = 1992;
131+
public static NOTIFICATION_OFFER_REWARD_DELIVERED = 2125;
131132
public static NOTIFICATION_SIMPLE_ALERT = 5100;
132133
public static NOTIFICATION_ELEMENT_POINTER = 1787;
133134
public static PET_FIGURE_UPDATE = 1924;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { IMessageEvent } from '../../../../../api';
2+
import { MessageEvent } from '../../../../../events';
3+
import { OfferRewardDeliveredMessageParser } from '../../parser';
4+
5+
export class OfferRewardDeliveredMessageEvent extends MessageEvent implements IMessageEvent
6+
{
7+
constructor(callBack: Function)
8+
{
9+
super(callBack, OfferRewardDeliveredMessageParser);
10+
}
11+
12+
public getParser(): OfferRewardDeliveredMessageParser
13+
{
14+
return this.parser as OfferRewardDeliveredMessageParser;
15+
}
16+
}

src/nitro/communication/messages/incoming/notifications/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export * from './HotelWillShutdownEvent';
99
export * from './InfoFeedEnableMessageEvent';
1010
export * from './MOTDNotificationEvent';
1111
export * from './NotificationDialogMessageEvent';
12+
export * from './OfferRewardDeliveredMessageEvent';
1213
export * from './PetLevelNotificationEvent';
1314
export * from './PetPlacingErrorEvent';
1415
export * from './SimpleAlertMessageEvent';
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import { IMessageDataWrapper, IMessageParser } from '../../../../../api';
2+
3+
export class OfferRewardDeliveredMessageParser implements IMessageParser
4+
{
5+
private _contentType: string;
6+
private _classId: number;
7+
private _name: string;
8+
private _description: string;
9+
10+
public flush(): boolean
11+
{
12+
this._contentType = null;
13+
this._classId = 0;
14+
this._name = null;
15+
this._description = null;
16+
17+
return true;
18+
}
19+
20+
public parse(wrapper: IMessageDataWrapper): boolean
21+
{
22+
if(!wrapper) return false;
23+
24+
this._contentType = wrapper.readString();
25+
this._classId = wrapper.readInt();
26+
this._name = wrapper.readString();
27+
this._description = wrapper.readString();
28+
29+
return true;
30+
}
31+
32+
public get contentType(): string
33+
{
34+
return this._contentType;
35+
}
36+
37+
public get classId(): number
38+
{
39+
return this._classId;
40+
}
41+
42+
public get name(): string
43+
{
44+
return this._name;
45+
}
46+
47+
public get description(): string
48+
{
49+
return this._description;
50+
}
51+
}

src/nitro/communication/messages/parser/notifications/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export * from './HotelWillShutdownParser';
1010
export * from './InfoFeedEnableMessageParser';
1111
export * from './MOTDNotificationParser';
1212
export * from './NotificationDialogMessageParser';
13+
export * from './OfferRewardDeliveredMessageParser';
1314
export * from './PetLevelNotificationParser';
1415
export * from './PetPlacingErrorEventParser';
1516
export * from './SimpleAlertMessageParser';

0 commit comments

Comments
 (0)