Skip to content

Commit b1d3061

Browse files
committed
billsonnn#28 - OfferRewardDeliveredMessageEvent added
1 parent 26741b7 commit b1d3061

File tree

6 files changed

+72
-1
lines changed

6 files changed

+72
-1
lines changed

src/nitro/communication/NitroMessages.ts

+2-1
Large diffs are not rendered by default.

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

+1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ export class IncomingHeader
117117
public static CONVERTED_ROOM_ID = 1331;
118118
public static GUEST_ROOM_SEARCH_RESULT = 52;
119119
public static NOTIFICATION_LIST = 1992;
120+
public static NOTIFICATION_OFFER_REWARD_DELIVERED = 2125;
120121
public static PET_FIGURE_UPDATE = 1924;
121122
public static PET_INFO = 2901;
122123
public static PET_TRAINING_PANEL = 1164;
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

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export * from './HotelWillShutdownEvent';
77
export * from './InfoFeedEnableMessageEvent';
88
export * from './MOTDNotificationEvent';
99
export * from './NotificationDialogMessageEvent';
10+
export * from './OfferRewardDeliveredMessageEvent';
1011
export * from './PetLevelNotificationEvent';
1112
export * from './PetPlacingErrorEvent';
1213
export * from './UnseenItemsEvent';
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

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export * from './HotelWillShutdownParser';
88
export * from './InfoFeedEnableMessageParser';
99
export * from './MOTDNotificationParser';
1010
export * from './NotificationDialogMessageParser';
11+
export * from './OfferRewardDeliveredMessageParser';
1112
export * from './PetLevelNotificationParser';
1213
export * from './PetPlacingErrorEventParser';
1314
export * from './UnseenItemsParser';

0 commit comments

Comments
 (0)