mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2024-11-22 23:50:52 +01:00
#28 - Multiple packets Weekly and Game2 added
This commit is contained in:
parent
12a8362872
commit
dd6b716b1b
File diff suppressed because one or more lines are too long
@ -446,4 +446,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;
|
||||
}
|
||||
|
@ -1,2 +1,3 @@
|
||||
export * from './directory';
|
||||
export * from './lobby';
|
||||
export * from './score';
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
export * from './Game2WeeklyFriendsLeaderboardEvent';
|
||||
export * from './Game2WeeklyLeaderboardEvent';
|
||||
export * from './WeeklyCompetitiveFriendsLeaderboardEvent';
|
||||
export * from './WeeklyCompetitiveLeaderboardEvent';
|
||||
export * from './WeeklyGameRewardEvent';
|
||||
export * from './WeeklyGameRewardWinnersEvent';
|
@ -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';
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
@ -2,42 +2,42 @@ import { IMessageDataWrapper } from '../../../../../../api';
|
||||
|
||||
export class GameRewardWinnerEntry
|
||||
{
|
||||
private _name:string;
|
||||
private _figure:string;
|
||||
private _gender:string;
|
||||
private _rank:number;
|
||||
private _score:number;
|
||||
private _name: string;
|
||||
private _figure: string;
|
||||
private _gender: string;
|
||||
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
|
||||
public get name(): string
|
||||
{
|
||||
return this._name;
|
||||
}
|
||||
|
||||
public get figure():string
|
||||
public get figure(): string
|
||||
{
|
||||
return this._figure;
|
||||
}
|
||||
|
||||
public get gender():string
|
||||
public get gender(): string
|
||||
{
|
||||
return this._gender;
|
||||
}
|
||||
|
||||
public get rank():number
|
||||
public get rank(): number
|
||||
{
|
||||
return this._rank;
|
||||
}
|
||||
|
||||
public get score():number
|
||||
public get score(): number
|
||||
{
|
||||
return this._score;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -1,2 +1,5 @@
|
||||
export * from './Game2WeeklyLeaderboardParser';
|
||||
export * from './GameRewardWinnerEntry';
|
||||
export * from './LeaderboardEntry';
|
||||
export * from './WeeklyGameRewardParser';
|
||||
export * from './WeeklyGameRewardWinnersParser';
|
||||
|
Loading…
Reference in New Issue
Block a user