Merge branch 'feature/gamecenter-packets' into 'main'

Feature/gamecenter packets

See merge request nitro/nitro-renderer!22
This commit is contained in:
skeletor 2022-11-03 01:14:11 +00:00
commit bbcc363ab8
61 changed files with 1338 additions and 13 deletions

File diff suppressed because one or more lines are too long

View File

@ -35,6 +35,18 @@ export class IncomingHeader
public static GAME_CENTER_ACHIEVEMENTS = 2265;
public static GAME_CENTER_GAME_LIST = 222;
public static GAME_CENTER_STATUS = 2893;
public static GAMESTATUSMESSAGE = 3805;
public static GAMEACHIEVEMENTS = 1689;
public static GAMEINVITE = 904;
public static JOININGQUEUEFAILED = 3035;
public static JOINEDQUEUEMESSAGE = 2260;
public static LEFTQUEUE = 1477;
public static LOAD_GAME_URL = 2624;
public static LOADGAME = 3654;
public static UNLOADGAME = 1715;
public static ACHIEVEMENTRESOLUTIONCOMPLETED = 740;
public static ACHIEVEMENTRESOLUTIONPROGRESS = 3370;
public static ACHIEVEMENTRESOLUTIONS = 66;
public static GENERIC_ALERT = 3801;
public static MODERATOR_MESSAGE = 2030;
public static GENERIC_ERROR = 1600;
@ -65,7 +77,6 @@ export class IncomingHeader
public static ITEM_WALL_ADD = 2187;
public static ITEM_WALL_REMOVE = 3208;
public static ITEM_WALL_UPDATE = 2009;
public static LOAD_GAME_URL = 2624;
public static MARKETPLACE_CONFIG = 1823;
public static MESSENGER_ACCEPT_FRIENDS = 896;
public static MESSENGER_CHAT = 1587;

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../../api';
import { MessageEvent } from '../../../../../../core';
import { Game2AccountGameStatusMessageParser } from '../../../parser/game/directory';
export class Game2AccountGameStatusMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, Game2AccountGameStatusMessageParser);
}
public getParser(): Game2AccountGameStatusMessageParser
{
return this.parser as Game2AccountGameStatusMessageParser;
}
}

View File

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

View File

@ -1 +1,2 @@
export * from './LoadGameUrlEvent';
export * from './directory';
export * from './lobby';

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../../api';
import { MessageEvent } from '../../../../../../core';
import { AchievementResolutionCompletedMessageParser } from '../../../parser';
export class AchievementResolutionCompletedMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, AchievementResolutionCompletedMessageParser);
}
public getParser(): AchievementResolutionCompletedMessageParser
{
return this.parser as AchievementResolutionCompletedMessageParser;
}
}

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../../api';
import { MessageEvent } from '../../../../../../core';
import { AchievementResolutionProgressMessageParser } from '../../../parser';
export class AchievementResolutionProgressMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, AchievementResolutionProgressMessageParser);
}
public getParser(): AchievementResolutionProgressMessageParser
{
return this.parser as AchievementResolutionProgressMessageParser;
}
}

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../../api';
import { MessageEvent } from '../../../../../../core';
import { AchievementResolutionsMessageParser } from '../../../parser';
export class AchievementResolutionsMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, AchievementResolutionsMessageParser);
}
public getParser(): AchievementResolutionsMessageParser
{
return this.parser as AchievementResolutionsMessageParser;
}
}

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../../api';
import { MessageEvent } from '../../../../../../core';
import { GameAchievementsMessageParser } from '../../../parser';
export class GameAchievementsMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, GameAchievementsMessageParser);
}
public getParser(): GameAchievementsMessageParser
{
return this.parser as GameAchievementsMessageParser;
}
}

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../../api';
import { MessageEvent } from '../../../../../../core';
import { GameInviteMessageParser } from '../../../parser';
export class GameInviteMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, GameInviteMessageParser);
}
public getParser(): GameInviteMessageParser
{
return this.parser as GameInviteMessageParser;
}
}

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../../api';
import { MessageEvent } from '../../../../../../core';
import { GameListMessageParser } from '../../../parser/game/lobby';
export class GameListMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, GameListMessageParser);
}
public getParser(): GameListMessageParser
{
return this.parser as GameListMessageParser;
}
}

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../../api';
import { MessageEvent } from '../../../../../../core';
import { GameStatusMessageParser } from '../../../parser/game/lobby';
export class GameStatusMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, GameStatusMessageParser);
}
public getParser(): GameStatusMessageParser
{
return this.parser as GameStatusMessageParser;
}
}

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../../api';
import { MessageEvent } from '../../../../../../core';
import { JoinedQueueMessageParser } from '../../../parser/game/lobby';
export class JoinedQueueMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, JoinedQueueMessageParser);
}
public getParser(): JoinedQueueMessageParser
{
return this.parser as JoinedQueueMessageParser;
}
}

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../../api';
import { MessageEvent } from '../../../../../../core';
import { JoiningQueueFailedMessageParser } from '../../../parser';
export class JoiningQueueFailedMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, JoiningQueueFailedMessageParser);
}
public getParser(): JoiningQueueFailedMessageParser
{
return this.parser as JoiningQueueFailedMessageParser;
}
}

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../../api';
import { MessageEvent } from '../../../../../../core';
import { LeftQueueMessageParser } from '../../../parser';
export class LeftQueueMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, LeftQueueMessageParser);
}
public getParser(): LeftQueueMessageParser
{
return this.parser as LeftQueueMessageParser;
}
}

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../../api';
import { MessageEvent } from '../../../../../../core';
import { LoadGameMessageParser } from '../../../parser';
export class LoadGameMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, LoadGameMessageParser);
}
public getParser(): LoadGameMessageParser
{
return this.parser as LoadGameMessageParser;
}
}

View File

@ -1,6 +1,6 @@
import { IMessageEvent } from '../../../../../api';
import { MessageEvent } from '../../../../../core';
import { LoadGameUrlParser } from '../../parser';
import { IMessageEvent } from '../../../../../../api';
import { MessageEvent } from '../../../../../../core';
import { LoadGameUrlParser } from '../../../parser';
export class LoadGameUrlEvent extends MessageEvent implements IMessageEvent
{

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../../api';
import { MessageEvent } from '../../../../../../core';
import { UnloadGameMessageParser } from '../../../parser';
export class UnloadGameMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, UnloadGameMessageParser);
}
public getParser(): UnloadGameMessageParser
{
return this.parser as UnloadGameMessageParser;
}
}

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../../api';
import { MessageEvent } from '../../../../../../core';
import { UserGameAchievementsMessageParser } from '../../../parser/game/lobby';
export class UserGameAchievementsMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, UserGameAchievementsMessageParser);
}
public getParser(): UserGameAchievementsMessageParser
{
return this.parser as UserGameAchievementsMessageParser;
}
}

View File

@ -0,0 +1,14 @@
export * from './AchievementResolutionCompletedMessageEvent';
export * from './AchievementResolutionProgressMessageEvent';
export * from './AchievementResolutionsMessageEvent';
export * from './GameAchievementsMessageEvent';
export * from './GameInviteMessageEvent';
export * from './GameListMessageEvent';
export * from './GameStatusMessageEvent';
export * from './JoinedQueueMessageEvent';
export * from './JoiningQueueFailedMessageEvent';
export * from './LeftQueueMessageEvent';
export * from './LoadGameMessageEvent';
export * from './LoadGameUrlEvent';
export * from './UnloadGameMessageEvent';
export * from './UserGameAchievementsMessageEvent';

View File

@ -37,6 +37,16 @@ export class OutgoingHeader
public static FURNITURE_WALL_UPDATE = 168;
public static GAMES_INIT = 2914;
public static GAMES_LIST = 741;
public static ACCEPTGAMEINVITE = 3802;
public static GAMEUNLOADEDMESSAGE = 3207;
public static GETGAMEACHIEVEMENTSMESSAGE = 2399;
public static GETGAMESTATUSMESSAGE = 3171;
public static GETUSERGAMEACHIEVEMENTSMESSAGE = 389;
public static JOINQUEUEMESSAGE = 1458;
public static LEAVEQUEUEMESSAGE = 2384;
public static RESETRESOLUTIONACHIEVEMENTMESSAGE = 3144;
public static GETWEEKLYGAMEREWARDWINNERS = 1054;
public static GAME2GETACCOUNTGAMESTATUSMESSAGE = 11;
public static GET_GIFT_WRAPPING_CONFIG = 418;
public static GROUP_ADMIN_ADD = 2894;
public static GROUP_ADMIN_REMOVE = 722;

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../../../api';
export class Game2GetAccountGameStatusMessageComposer implements IMessageComposer<ConstructorParameters<typeof Game2GetAccountGameStatusMessageComposer>>
{
private _data: ConstructorParameters<typeof Game2GetAccountGameStatusMessageComposer>;
constructor(k: number)
{
this._data = [ k ];
}
dispose(): void
{
this._data = null;
}
public getMessageArray()
{
return this._data;
}
}

View File

@ -0,0 +1 @@
export * from './Game2GetAccountGameStatusMessageComposer';

View File

@ -1 +1,3 @@
export * from './GetResolutionAchievementsMessageComposer';
export * from './directory';
export * from './lobby';
export * from './score';

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../../../api';
export class AcceptGameInviteMessageComposer implements IMessageComposer<ConstructorParameters<typeof AcceptGameInviteMessageComposer>>
{
private _data: ConstructorParameters<typeof AcceptGameInviteMessageComposer>;
constructor(k:number, _arg_2:number)
{
this._data = [ k, _arg_2 ];
}
dispose(): void
{
this._data = null;
}
public getMessageArray()
{
return this._data;
}
}

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../../../api';
export class GameUnloadedMessageComposer implements IMessageComposer<ConstructorParameters<typeof GameUnloadedMessageComposer>>
{
private _data: ConstructorParameters<typeof GameUnloadedMessageComposer>;
constructor(k: number)
{
this._data = [ k ];
}
dispose(): void
{
this._data = null;
}
public getMessageArray()
{
return this._data;
}
}

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../../../api';
export class GetGameAchievementsMessageComposer implements IMessageComposer<ConstructorParameters<typeof GetGameAchievementsMessageComposer>>
{
private _data: ConstructorParameters<typeof GetGameAchievementsMessageComposer>;
constructor()
{
this._data = [ ];
}
dispose(): void
{
this._data = null;
}
public getMessageArray()
{
return this._data;
}
}

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../../../api';
export class GetGameListMessageComposer implements IMessageComposer<ConstructorParameters<typeof GetGameListMessageComposer>>
{
private _data: ConstructorParameters<typeof GetGameListMessageComposer>;
constructor()
{
this._data = [ ];
}
dispose(): void
{
this._data = null;
}
public getMessageArray()
{
return this._data;
}
}

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../../../api';
export class GetGameStatusMessageComposer implements IMessageComposer<ConstructorParameters<typeof GetGameStatusMessageComposer>>
{
private _data: ConstructorParameters<typeof GetGameStatusMessageComposer>;
constructor(k: number)
{
this._data = [ k ];
}
dispose(): void
{
this._data = null;
}
public getMessageArray()
{
return this._data;
}
}

View File

@ -1,4 +1,4 @@
import { IMessageComposer } from '../../../../../api';
import { IMessageComposer } from '../../../../../../api';
export class GetResolutionAchievementsMessageComposer implements IMessageComposer<ConstructorParameters<typeof GetResolutionAchievementsMessageComposer>>
{

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../../../api';
export class GetUserGameAchievementsMessageComposer implements IMessageComposer<ConstructorParameters<typeof GetUserGameAchievementsMessageComposer>>
{
private _data: ConstructorParameters<typeof GetUserGameAchievementsMessageComposer>;
constructor(k: number)
{
this._data = [ k ];
}
dispose(): void
{
this._data = null;
}
public getMessageArray()
{
return this._data;
}
}

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../../../api';
export class JoinQueueMessageComposer implements IMessageComposer<ConstructorParameters<typeof JoinQueueMessageComposer>>
{
private _data: ConstructorParameters<typeof JoinQueueMessageComposer>;
constructor(k: number)
{
this._data = [ k ];
}
dispose(): void
{
this._data = null;
}
public getMessageArray()
{
return this._data;
}
}

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../../../api';
export class LeaveQueueMessageComposer implements IMessageComposer<ConstructorParameters<typeof LeaveQueueMessageComposer>>
{
private _data: ConstructorParameters<typeof LeaveQueueMessageComposer>;
constructor(k: number)
{
this._data = [ k ];
}
dispose(): void
{
this._data = null;
}
public getMessageArray()
{
return this._data;
}
}

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../../../api';
export class ResetResolutionAchievementMessageComposer implements IMessageComposer<ConstructorParameters<typeof ResetResolutionAchievementMessageComposer>>
{
private _data: ConstructorParameters<typeof ResetResolutionAchievementMessageComposer>;
constructor(k: number)
{
this._data = [ k ];
}
dispose(): void
{
this._data = null;
}
public getMessageArray()
{
return this._data;
}
}

View File

@ -0,0 +1,10 @@
export * from './AcceptGameInviteMessageComposer';
export * from './GameUnloadedMessageComposer';
export * from './GetGameAchievementsMessageComposer';
export * from './GetGameListMessageComposer';
export * from './GetGameStatusMessageComposer';
export * from './GetResolutionAchievementsMessageComposer';
export * from './GetUserGameAchievementsMessageComposer';
export * from './JoinQueueMessageComposer';
export * from './LeaveQueueMessageComposer';
export * from './ResetResolutionAchievementMessageComposer';

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../../../api';
export class GetWeeklyGameRewardComposer implements IMessageComposer<ConstructorParameters<typeof GetWeeklyGameRewardComposer>>
{
private _data: ConstructorParameters<typeof GetWeeklyGameRewardComposer>;
constructor(k: number)
{
this._data = [ k ];
}
dispose(): void
{
this._data = null;
}
public getMessageArray()
{
return this._data;
}
}

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../../../api';
export class GetWeeklyGameRewardWinnersComposer implements IMessageComposer<ConstructorParameters<typeof GetWeeklyGameRewardWinnersComposer>>
{
private _data: ConstructorParameters<typeof GetWeeklyGameRewardWinnersComposer>;
constructor(k: number)
{
this._data = [ k ];
}
dispose(): void
{
this._data = null;
}
public getMessageArray()
{
return this._data;
}
}

View File

@ -0,0 +1,2 @@
export * from './GetWeeklyGameRewardComposer';
export * from './GetWeeklyGameRewardWinnersComposer';

View File

@ -0,0 +1,45 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../../api';
export class Game2AccountGameStatusMessageParser implements IMessageParser
{
private _gameTypeId:number;
private _freeGamesLeft:number;
private _gamesPlayedTotal:number;
public flush(): boolean
{
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._gameTypeId = wrapper.readInt();
this._freeGamesLeft = wrapper.readInt();
this._gamesPlayedTotal = wrapper.readInt();
return true;
}
public get gameTypeId():number
{
return this._gameTypeId;
}
public get freeGamesLeft():number
{
return this._freeGamesLeft;
}
public get gamesPlayedTotal():number
{
return this._gamesPlayedTotal;
}
public get hasUnlimitedGames():boolean
{
return this._freeGamesLeft == -1;
}
}

View File

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

View File

@ -1 +1,3 @@
export * from './LoadGameUrlParser';
export * from './directory';
export * from './lobby';
export * from './score';

View File

@ -0,0 +1,32 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../../api';
export class AchievementResolutionCompletedMessageParser implements IMessageParser
{
private _stuffCode:string;
private _badgeCode:string;
public flush(): boolean
{
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._stuffCode = wrapper.readString();
this._badgeCode = wrapper.readString();
return true;
}
public get stuffCode():string
{
return this._stuffCode;
}
public get badgeCode():string
{
return this._badgeCode;
}
}

View File

@ -0,0 +1,66 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../../api';
export class AchievementResolutionProgressMessageParser implements IMessageParser
{
private _stuffId:number;
private _achievementId:number;
private _requiredLevelBadgeCode:string;
private _userProgress:number;
private _totalProgress:number;
private _endTime:number;
public flush(): boolean
{
this._stuffId = -1;
this._achievementId = 0;
this._requiredLevelBadgeCode = '';
this._userProgress = 0;
this._totalProgress = 0;
this._endTime = 0;
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._stuffId = wrapper.readInt();
this._achievementId = wrapper.readInt();
this._requiredLevelBadgeCode = wrapper.readString();
this._userProgress = wrapper.readInt();
this._totalProgress = wrapper.readInt();
this._endTime = wrapper.readInt();
return true;
}
public get stuffId():number
{
return this._stuffId;
}
public get achievementId():number
{
return this._achievementId;
}
public get requiredLevelBadgeCode():string
{
return this._requiredLevelBadgeCode;
}
public get userProgress():number
{
return this._userProgress;
}
public get totalProgress():number
{
return this._totalProgress;
}
public get endTime():number
{
return this._endTime;
}
}

View File

@ -0,0 +1,46 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../../api';
import { AchievementResolutionData } from '../../inventory';
export class AchievementResolutionsMessageParser implements IMessageParser
{
private _stuffId:number;
private _achievements:AchievementResolutionData[];
private _endTime:number;
public flush(): boolean
{
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._stuffId = wrapper.readInt();
const count = wrapper.readInt();
let _local_3 = 0;
while(_local_3 < count)
{
this._achievements.push(new AchievementResolutionData(wrapper));
_local_3++;
}
this._endTime = wrapper.readInt();
return true;
}
public get stuffId():number
{
return this._stuffId;
}
public get achievements():AchievementResolutionData[]
{
return this._achievements;
}
public get endTime():number
{
return this._endTime;
}
}

View File

@ -0,0 +1,35 @@
export class GameAchievementData
{
private _gameTypeId:number;
private _achievementId:number;
private _achievementName:string;
private _levels:number;
constructor(gameTypeId:number, achievementId:number, achievementName:string, levels:number)
{
this._gameTypeId = gameTypeId;
this._achievementId = achievementId;
this._achievementName = achievementName;
this._levels = levels;
}
public get gameTypeId():number
{
return this._gameTypeId;
}
public get achievementId():number
{
return this._achievementId;
}
public get achievementName():string
{
return this._achievementName;
}
public get levels():number
{
return this._levels;
}
}

View File

@ -0,0 +1,43 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../../api';
import { GameAchievementData } from './GameAchievementData';
export class GameAchievementsMessageParser implements IMessageParser
{
private _achievements:GameAchievementData[];
public flush(): boolean
{
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._achievements = [];
const count = wrapper.readInt();
let _local_3 = 0;
while(_local_3 < count)
{
const gameTypeId = wrapper.readInt();
const achievementCount = wrapper.readInt();
let _local_6 = 0;
while(_local_6 < achievementCount)
{
const achievementId = wrapper.readInt();
const achievementName = wrapper.readString();
const levels = wrapper.readInt();
this._achievements.push(new GameAchievementData(gameTypeId, achievementId, achievementName, levels));
_local_6++;
}
_local_3++;
}
return true;
}
public get achievements():GameAchievementData[]
{
return this._achievements;
}
}

View File

@ -0,0 +1,49 @@
export class GameConfigurationData
{
private _gameId:number;
private _gameNameId:string;
private _bgColor:number;
private _textColor:number;
private _assetUrl:string;
private _supportUrl:string;
constructor(gameId:number, gameNameId:string, bgColor:number, textColor:number, assetUrl:string, supportUrl:string)
{
this._gameId = gameId;
this._gameNameId = gameNameId;
this._bgColor = bgColor;
this._textColor = textColor;
this._assetUrl = assetUrl;
this._supportUrl = supportUrl;
}
public get gameId():number
{
return this._gameId;
}
public get gameNameId():string
{
return this._gameNameId;
}
public get bgColor():number
{
return this._bgColor;
}
public get textColor():number
{
return this._textColor;
}
public get assetUrl():string
{
return this._assetUrl;
}
public get supportUrl():string
{
return this._supportUrl;
}
}

View File

@ -0,0 +1,32 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../../api';
export class GameInviteMessageParser implements IMessageParser
{
private _gameTypeId:number;
private _inviterId:number;
public flush(): boolean
{
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._gameTypeId = wrapper.readInt();
this._inviterId = wrapper.readInt();
return true;
}
public get gameTypeId():number
{
return this._gameTypeId;
}
public get inviterId():number
{
return this._inviterId;
}
}

View File

@ -0,0 +1,43 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../../api';
import { GameConfigurationData } from './GameConfigurationData';
export class GameListMessageParser implements IMessageParser
{
private _games:GameConfigurationData[];
public flush(): boolean
{
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._games = [];
const count = wrapper.readInt();
for(let i = 0; i < count; i++)
{
const gameId = wrapper.readInt();
const gameNameId = wrapper.readString();
const _local_6 = wrapper.readString();
let bgColor = parseInt(_local_6, 16);
bgColor = (bgColor | 0xFF000000);
const _local_8 = wrapper.readString();
let textColor = parseInt(_local_8, 16);
textColor = (textColor | 0xFF000000);
const assetUrl = wrapper.readString();
const supportUrl = wrapper.readString();
this._games.push(new GameConfigurationData(gameId, gameNameId, bgColor, textColor, assetUrl, supportUrl));
}
return true;
}
public get games(): GameConfigurationData[]
{
return this._games;
}
}

View File

@ -0,0 +1,40 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../../api';
export class GameStatusMessageParser implements IMessageParser
{
private static readonly OK = 0;
private static readonly MAINTENANCE = 1;
private _gameTypeId:number;
private _status:number;
public flush(): boolean
{
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._gameTypeId = wrapper.readInt();
this._status = wrapper.readInt();
return true;
}
public get gameTypeId():number
{
return this._gameTypeId;
}
public get isOk():boolean
{
return this._status == GameStatusMessageParser.OK;
}
public get isInMaintenance():boolean
{
return this._status == GameStatusMessageParser.MAINTENANCE;
}
}

View File

@ -0,0 +1,25 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../../api';
export class JoinedQueueMessageParser implements IMessageParser
{
private _gameTypeId:number;
public flush(): boolean
{
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._gameTypeId = wrapper.readInt();
return true;
}
public get gameTypeId():number
{
return this._gameTypeId;
}
}

View File

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

View File

@ -0,0 +1,25 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../../api';
export class LeftQueueMessageParser implements IMessageParser
{
private _gameTypeId:number;
public flush(): boolean
{
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._gameTypeId = wrapper.readInt();
return true;
}
public get gameTypeId():number
{
return this._gameTypeId;
}
}

View File

@ -0,0 +1,88 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../../api';
export class LoadGameMessageParser implements IMessageParser
{
private _gameTypeId:number;
private _url:string;
private _quality:string;
private _scaleMode:string;
private _frameRate:number;
private _minMajorVersion:number;
private _minMinorVersion:number;
private _params:Map<string, string>;
private _gameClientId:string;
public flush(): boolean
{
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._gameTypeId = wrapper.readInt();
this._gameClientId = wrapper.readString();
this._url = wrapper.readString();
this._quality = wrapper.readString();
this._scaleMode = wrapper.readString();
this._frameRate = wrapper.readInt();
this._minMajorVersion = wrapper.readInt();
this._minMinorVersion = wrapper.readInt();
this._params = new Map<string,string>();
const count = wrapper.readInt();
let _local_3 = 0;
while(_local_3 < count)
{
this._params.set(wrapper.readString(), wrapper.readString());
_local_3++;
}
return true;
}
public get gameTypeId():number
{
return this._gameTypeId;
}
public get url():string
{
return this._url;
}
public get quality():string
{
return this._quality;
}
public get scaleMode():string
{
return this._scaleMode;
}
public get frameRate():number
{
return this._frameRate;
}
public get minMajorVersion():number
{
return this._minMajorVersion;
}
public get minMinorVersion():number
{
return this._minMinorVersion;
}
public get params():Map<string,string>
{
return this._params;
}
public get gameClientId():string
{
return this._gameClientId;
}
}

View File

@ -1,4 +1,4 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../api';
import { IMessageDataWrapper, IMessageParser } from '../../../../../../api';
export class LoadGameUrlParser implements IMessageParser
{

View File

@ -0,0 +1,32 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../../api';
export class UnloadGameMessageParser implements IMessageParser
{
private _gameTypeId:number;
private _gameClientId:string;
public flush(): boolean
{
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._gameTypeId = wrapper.readInt();
this._gameClientId = wrapper.readString();
return true;
}
public get gameTypeId():number
{
return this._gameTypeId;
}
public get gameClientId():string
{
return this._gameClientId;
}
}

View File

@ -0,0 +1,21 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../../api';
export class UserGameAchievementsMessageParser implements IMessageParser
{
public flush(): boolean
{
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
return true;
}
}

View File

@ -0,0 +1,16 @@
export * from './AchievementResolutionCompletedMessageParser';
export * from './AchievementResolutionProgressMessageParser';
export * from './AchievementResolutionsMessageParser';
export * from './GameAchievementData';
export * from './GameAchievementsMessageParser';
export * from './GameConfigurationData';
export * from './GameInviteMessageParser';
export * from './GameListMessageParser';
export * from './GameStatusMessageParser';
export * from './JoinedQueueMessageParser';
export * from './JoiningQueueFailedMessageParser';
export * from './LeftQueueMessageParser';
export * from './LoadGameMessageParser';
export * from './LoadGameUrlParser';
export * from './UnloadGameMessageParser';
export * from './UserGameAchievementsMessageParser';

View File

@ -0,0 +1,44 @@
import { IMessageDataWrapper } from '../../../../../../api';
export class GameRewardWinnerEntry
{
private _name:string;
private _figure:string;
private _gender:string;
private _rank:number;
private _score:number;
constructor(k:IMessageDataWrapper)
{
this._name = k.readString();
this._figure = k.readString();
this._gender = k.readString();
this._rank = k.readInt();
this._score = k.readInt();
}
public get name():string
{
return this._name;
}
public get figure():string
{
return this._figure;
}
public get gender():string
{
return this._gender;
}
public get rank():number
{
return this._rank;
}
public get score():number
{
return this._score;
}
}

View File

@ -0,0 +1,51 @@
import { IMessageDataWrapper } from '../../../../../../api';
export class LeaderboardEntry
{
private _userId:number;
private _score:number;
private _rank:number;
private _name:string;
private _figure:string;
private _gender:string;
constructor(k:IMessageDataWrapper)
{
this._userId = k.readInt();
this._score = k.readInt();
this._rank = k.readInt();
this._name = k.readString();
this._figure = k.readString();
this._gender = k.readString();
}
public get userId():number
{
return this._userId;
}
public get score():number
{
return this._score;
}
public get rank():number
{
return this._rank;
}
public get figure():string
{
return this._figure;
}
public get gender():string
{
return this._gender;
}
public get name():string
{
return this._name;
}
}

View File

@ -0,0 +1,2 @@
export * from './GameRewardWinnerEntry';
export * from './LeaderboardEntry';