Gamecenter | Score packets

This commit is contained in:
object 2023-11-22 21:57:44 +01:00
parent 81cfd5c56f
commit d410ecc22a
13 changed files with 188 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -470,4 +470,6 @@ export class IncomingHeader
public static WEEKLY_GAME2_LEADERBOARD = 2196;
public static RENTABLE_FURNI_RENT_OR_BUYOUT_OFFER = 35;
public static HANDSHAKE_IDENTITY_ACCOUNT = 3523;
public static GAME2_FRIENDS_LEADERBOARD = 3099;
public static GAME2_TOTAL_LEADERBOARD = 3863;
}

View File

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

View File

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

View File

@ -1,3 +1,5 @@
export * from './Game2FriendsLeaderboardEvent';
export * from './Game2TotalLeaderboardEvent';
export * from './Game2WeeklyFriendsLeaderboardEvent';
export * from './Game2WeeklyLeaderboardEvent';
export * from './WeeklyCompetitiveFriendsLeaderboardEvent';

View File

@ -46,6 +46,10 @@ export class OutgoingHeader
public static LEAVEQUEUEMESSAGE = 2384;
public static RESETRESOLUTIONACHIEVEMENTMESSAGE = 3144;
public static GETWEEKLYGAMEREWARDWINNERS = 1054;
public static GETWEEKLYCOMPETITIVELEADERBOARD = 654;
public static GETFRIENDSWEEKLYCOMPETITIVELEADERBOARD = 1081;
public static GAME2GETFRIENDSLEADERBOARD = 1859;
public static GAME2GETTOTALLEADERBOARD = 3362;
public static GAME2GETACCOUNTGAMESTATUSMESSAGE = 11;
public static GAME2CHECKGAMEDIRECTORYSTATUSMESSAGE = 3259;
public static GAME2EXITGAMEMESSAGE = 1445;

View File

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

View File

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

View File

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

View File

@ -1,4 +1,8 @@
export * from './Game2GetFriendsLeaderboardComposer';
export * from './Game2GetTotalLeaderboardComposer';
export * from './Game2GetWeeklyFriendsLeaderboardComposer';
export * from './Game2GetWeeklyLeaderboardComposer';
export * from './GetFriendsWeeklyCompetitiveLeaderboardComposer';
export * from './GetWeeklyCompetitiveLeaderboardComposer';
export * from './GetWeeklyGameRewardComposer';
export * from './GetWeeklyGameRewardWinnersComposer';

View File

@ -0,0 +1,51 @@
import { LeaderboardEntry } from '.';
import { IMessageDataWrapper, IMessageParser } from '../../../../../../api';
export class Game2LeaderboardParser implements IMessageParser
{
private _gameTypeId: number;
private _leaderBoard: LeaderboardEntry[];
private _totalListSize: number;
public flush(): boolean
{
this._gameTypeId = -1;
this._leaderBoard = [];
this._totalListSize = -1;
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
let totalLeaderboards: number = wrapper.readInt();
while(totalLeaderboards > 0)
{
this._leaderBoard.push(new LeaderboardEntry(wrapper));
totalLeaderboards--;
}
this._totalListSize = wrapper.readInt();
this._gameTypeId = wrapper.readInt();
return true;
}
public get gameTypeId(): number
{
return this._gameTypeId;
}
public get leaderboard(): LeaderboardEntry[]
{
return this._leaderBoard;
}
public get totalListSize(): number
{
return this._totalListSize;
}
}

View File

@ -1,3 +1,4 @@
export * from './Game2LeaderboardParser';
export * from './Game2WeeklyLeaderboardParser';
export * from './GameRewardWinnerEntry';
export * from './LeaderboardEntry';