Skip to content

Commit 6228c6d

Browse files
committed
billsonnn#28 - Game2JoiningGameFailedMessageEvent added
1 parent 12a8362 commit 6228c6d

File tree

6 files changed

+57
-1
lines changed

6 files changed

+57
-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
@@ -35,6 +35,7 @@ export class IncomingHeader
3535
public static GAME_CENTER_ACHIEVEMENTS = 2265;
3636
public static GAME_CENTER_GAME_LIST = 222;
3737
public static GAME_CENTER_STATUS = 2893;
38+
public static GAME_CENTER_JOINING_FAILED = 1730;
3839
public static GAMESTATUSMESSAGE = 3805;
3940
public static GAMEACHIEVEMENTS = 1689;
4041
public static GAMEINVITE = 904;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { IMessageEvent } from '../../../../../../api';
2+
import { MessageEvent } from '../../../../../../events';
3+
import { Game2JoiningGameFailedMessageParser } from '../../../parser';
4+
5+
export class Game2JoiningGameFailedMessageEvent extends MessageEvent implements IMessageEvent
6+
{
7+
constructor(callBack: Function)
8+
{
9+
super(callBack, Game2JoiningGameFailedMessageParser);
10+
}
11+
12+
public getParser(): Game2JoiningGameFailedMessageParser
13+
{
14+
return this.parser as Game2JoiningGameFailedMessageParser;
15+
}
16+
}
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export * from './Game2AccountGameStatusMessageEvent';
2+
export * from './Game2JoiningGameFailedMessageEvent';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { IMessageDataWrapper, IMessageParser } from '../../../../../../api';
2+
3+
export class Game2JoiningGameFailedMessageParser implements IMessageParser
4+
{
5+
public static readonly KICKED: number = 1;
6+
public static readonly DUPLICATE_MACHINEID: number = 2;
7+
public static readonly INVITATION_REQUIRED: number = 3;
8+
public static readonly NO_SPACE_IN_TEAM: number = 4;
9+
public static readonly TEAM_NOT_FOUND: number = 5;
10+
public static readonly USER_HAS_ACTIVE_INSTANCE: number = 6;
11+
public static readonly USER_HAS_PENDING_INSTANCE_REQUEST: number = 7;
12+
public static readonly USER_HAS_NO_FREE_GAMES_LEFT: number = 8;
13+
14+
private _reason: number;
15+
16+
public flush(): boolean
17+
{
18+
this._reason = -1;
19+
20+
return true;
21+
}
22+
23+
public parse(wrapper: IMessageDataWrapper): boolean
24+
{
25+
if(!wrapper) return false;
26+
27+
this._reason = wrapper.readInt();
28+
29+
return true;
30+
}
31+
32+
public get reason(): number
33+
{
34+
return this._reason;
35+
}
36+
}
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export * from './Game2AccountGameStatusMessageParser';
2+
export * from './Game2JoiningGameFailedMessageParser';

0 commit comments

Comments
 (0)