Skip to content

Commit

Permalink
billsonnn#28 - Game2InArenaQueueMessageEvent and Game2StopCounterMess…
Browse files Browse the repository at this point in the history
…ageEvent added
  • Loading branch information
oobjectt committed Jan 3, 2023
1 parent 12a8362 commit 072dd04
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/nitro/communication/NitroMessages.ts

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/nitro/communication/messages/incoming/IncomingHeader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export class IncomingHeader
public static GAME_CENTER_ACHIEVEMENTS = 2265;
public static GAME_CENTER_GAME_LIST = 222;
public static GAME_CENTER_STATUS = 2893;
public static GAME_CENTER_IN_ARENA_QUEUE = 872;
public static GAME_CENTER_STOP_COUNTER = 3191;
public static GAMESTATUSMESSAGE = 3805;
public static GAMEACHIEVEMENTS = 1689;
public static GAMEINVITE = 904;
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 { Game2InArenaQueueMessageParser } from '../../../parser';

export class Game2InArenaQueueMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, Game2InArenaQueueMessageParser);
}

public getParser(): Game2InArenaQueueMessageParser
{
return this.parser as Game2InArenaQueueMessageParser;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../../api';
import { MessageEvent } from '../../../../../../events';
import { Game2InArenaQueueMessageParser, Game2StopCounterMessageParser } from '../../../parser';

export class Game2StopCounterMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, Game2StopCounterMessageParser);
}

public getParser(): Game2InArenaQueueMessageParser
{
return this.parser as Game2InArenaQueueMessageParser;
}
}
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export * from './Game2AccountGameStatusMessageEvent';
export * from './Game2InArenaQueueMessageEvent';
export * from './Game2StopCounterMessageEvent';
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../../api';

export class Game2InArenaQueueMessageParser implements IMessageParser
{
private _position: number;

public flush(): boolean
{
this._position = -1;

return true;
}

public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;

this._position = wrapper.readInt();

return true;
}

public get position(): number
{
return this._position;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../../api';

export class Game2StopCounterMessageParser implements IMessageParser
{
public flush(): boolean
{
return true;
}

public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;

return true;
}
}
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export * from './Game2AccountGameStatusMessageParser';
export * from './Game2InArenaQueueMessageParser';
export * from './Game2StopCounterMessageParser';

0 comments on commit 072dd04

Please sign in to comment.