#28 - Game2InArenaQueueMessageEvent and Game2StopCounterMessageEvent added

This commit is contained in:
oobjectt 2023-01-03 21:42:27 +01:00
parent 12a8362872
commit 072dd04816
8 changed files with 84 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -35,6 +35,8 @@ export class IncomingHeader
public static GAME_CENTER_ACHIEVEMENTS = 2265; public static GAME_CENTER_ACHIEVEMENTS = 2265;
public static GAME_CENTER_GAME_LIST = 222; public static GAME_CENTER_GAME_LIST = 222;
public static GAME_CENTER_STATUS = 2893; 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 GAMESTATUSMESSAGE = 3805;
public static GAMEACHIEVEMENTS = 1689; public static GAMEACHIEVEMENTS = 1689;
public static GAMEINVITE = 904; public static GAMEINVITE = 904;

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -1 +1,3 @@
export * from './Game2AccountGameStatusMessageEvent'; export * from './Game2AccountGameStatusMessageEvent';
export * from './Game2InArenaQueueMessageEvent';
export * from './Game2StopCounterMessageEvent';

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -1 +1,3 @@
export * from './Game2AccountGameStatusMessageParser'; export * from './Game2AccountGameStatusMessageParser';
export * from './Game2InArenaQueueMessageParser';
export * from './Game2StopCounterMessageParser';