Merge branch 'oobjectt-incoming-multiple-weekly'

This commit is contained in:
dank074 2023-01-04 00:38:15 -06:00
commit 0d5d02fa00
16 changed files with 296 additions and 17 deletions

File diff suppressed because one or more lines are too long

View File

@ -448,4 +448,10 @@ export class IncomingHeader
public static RENTABLE_SPACE_RENT_FAILED = 1868;
public static EMAIL_STATUS = 612;
public static CHANGE_EMAIL_RESULT = 1815;
public static WEEKLY_GAME_REWARD = 2641;
public static WEEKLY_GAME_REWARD_WINNERS = 3097;
public static WEEKLY_COMPETITIVE_LEADERBOARD = 3512;
public static WEEKLY_COMPETITIVE_FRIENDS_LEADERBOARD = 3560;
public static WEEKLY_GAME2_FRIENDS_LEADERBOARD = 2270;
public static WEEKLY_GAME2_LEADERBOARD = 2196;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,6 @@
export * from './Game2WeeklyFriendsLeaderboardEvent';
export * from './Game2WeeklyLeaderboardEvent';
export * from './WeeklyCompetitiveFriendsLeaderboardEvent';
export * from './WeeklyCompetitiveLeaderboardEvent';
export * from './WeeklyGameRewardEvent';
export * from './WeeklyGameRewardWinnersEvent';

View File

@ -14,6 +14,7 @@ export * from './friendlist';
export * from './game';
export * from './game/directory';
export * from './game/lobby';
export * from './game/score';
export * from './generic';
export * from './gifts';
export * from './group';

View File

@ -0,0 +1,59 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../../api';
export class Game2WeeklyLeaderboardParser implements IMessageParser
{
private _year: number;
private _week: number;
private _maxOffset: number;
private _currentOffset: number;
private _minutesUntilReset: number;
public flush(): boolean
{
this._year = -1;
this._week = -1;
this._maxOffset = -1;
this._currentOffset = -1;
this._minutesUntilReset = -1;
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._year = wrapper.readInt();
this._week = wrapper.readInt();
this._maxOffset = wrapper.readInt();
this._currentOffset = wrapper.readInt();
this._minutesUntilReset = wrapper.readInt();
return true;
}
public get year(): number
{
return this._year;
}
public get week(): number
{
return this._week;
}
public get maxOffset(): number
{
return this._maxOffset;
}
public get currentOffset(): number
{
return this._currentOffset;
}
public get minutesUntilReset(): number
{
return this._minutesUntilReset;
}
}

View File

@ -8,13 +8,13 @@ export class GameRewardWinnerEntry
private _rank: number;
private _score: number;
constructor(k:IMessageDataWrapper)
constructor(wrapper: IMessageDataWrapper)
{
this._name = k.readString();
this._figure = k.readString();
this._gender = k.readString();
this._rank = k.readInt();
this._score = k.readInt();
this._name = wrapper.readString();
this._figure = wrapper.readString();
this._gender = wrapper.readString();
this._rank = wrapper.readInt();
this._score = wrapper.readInt();
}
public get name(): string

View File

@ -0,0 +1,59 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../../api';
import { CatalogPageMessageProductData } from '../../catalog';
export class WeeklyGameRewardParser implements IMessageParser
{
private _gameTypeId: number;
private _products: CatalogPageMessageProductData[];
private _minutesUntilNextWeek: number;
private _rewardingOn: boolean;
public flush(): boolean
{
this._gameTypeId = -1;
this._products = [];
this._minutesUntilNextWeek = 0;
this._rewardingOn = true;
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._gameTypeId = wrapper.readInt();
let totalProducts: number = wrapper.readInt();
while(totalProducts > 0)
{
this._products.push(new CatalogPageMessageProductData(wrapper));
totalProducts--;
}
this._minutesUntilNextWeek = wrapper.readInt();
this._rewardingOn = wrapper.readBoolean();
return true;
}
public get gameTypeId(): number
{
return this._gameTypeId;
}
public get products(): CatalogPageMessageProductData[]
{
return this._products;
}
public get minutesUntilNextWeek(): number
{
return this._minutesUntilNextWeek;
}
public get rewardingOn(): boolean
{
return this._rewardingOn;
}
}

View File

@ -0,0 +1,42 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../../api';
import { GameRewardWinnerEntry } from './GameRewardWinnerEntry';
export class WeeklyGameRewardWinnersParser implements IMessageParser
{
private _gameTypeId: number;
private _winners: GameRewardWinnerEntry[];
public flush(): boolean
{
this._gameTypeId = -1;
this._winners = [];
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._gameTypeId = wrapper.readInt();
let totalWinners: number = wrapper.readInt();
while(totalWinners > 0)
{
this._winners.push(new GameRewardWinnerEntry(wrapper));
totalWinners--;
}
return true;
}
public get gameTypeId(): number
{
return this._gameTypeId;
}
public get winners(): GameRewardWinnerEntry[]
{
return this._winners;
}
}

View File

@ -1,2 +1,5 @@
export * from './Game2WeeklyLeaderboardParser';
export * from './GameRewardWinnerEntry';
export * from './LeaderboardEntry';
export * from './WeeklyGameRewardParser';
export * from './WeeklyGameRewardWinnersParser';