#28 - Game2StartingGameFailedMessageEvent added

This commit is contained in:
oobjectt 2023-01-03 21:01:41 +01:00
parent 12a8362872
commit fed3291bba
6 changed files with 51 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -35,6 +35,7 @@ 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_STARTING_GAME_FAILED = 2142;
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 { Game2StartingGameFailedMessageParser } from '../../../parser';
export class Game2StartingGameFailedMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, Game2StartingGameFailedMessageParser);
}
public getParser(): Game2StartingGameFailedMessageParser
{
return this.parser as Game2StartingGameFailedMessageParser;
}
}

View File

@ -1 +1,2 @@
export * from './Game2AccountGameStatusMessageEvent'; export * from './Game2AccountGameStatusMessageEvent';
export * from './Game2StartingGameFailedMessageEvent';

View File

@ -0,0 +1,30 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../../api';
export class Game2StartingGameFailedMessageParser implements IMessageParser
{
public static readonly NOT_ENOUGH_PLAYERS: number = 1;
public static readonly GAME_HAS_NO_OWNER: number = 2;
private _reason: number;
public flush(): boolean
{
this._reason = -1;
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._reason = wrapper.readInt();
return true;
}
public get reason(): number
{
return this._reason;
}
}

View File

@ -1 +1,2 @@
export * from './Game2AccountGameStatusMessageParser'; export * from './Game2AccountGameStatusMessageParser';
export * from './Game2StartingGameFailedMessageParser';