mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2024-11-29 18:50:51 +01:00
Merge branch 'oobjectt-talent-track-level-up'
This commit is contained in:
commit
697b03b4d8
File diff suppressed because one or more lines are too long
@ -367,6 +367,7 @@ export class IncomingHeader
|
||||
public static BADGE_REQUEST_FULFILLED = 2998;
|
||||
public static HELPER_TALENT_TRACK = 3406;
|
||||
public static TALENT_TRACK_LEVEL = 1203;
|
||||
public static TALENT_TRACK_LEVEL_UP = 638;
|
||||
public static USER_BANNED = 1683;
|
||||
public static BOT_RECEIVED = 3684;
|
||||
public static PET_LEVEL_NOTIFICATION = 859;
|
||||
|
@ -0,0 +1,16 @@
|
||||
import { IMessageEvent } from '../../../../../api';
|
||||
import { MessageEvent } from '../../../../../events';
|
||||
import { TalentLevelUpMessageParser } from '../../parser';
|
||||
|
||||
export class TalentLevelUpEvent extends MessageEvent implements IMessageEvent
|
||||
{
|
||||
constructor(callBack: Function)
|
||||
{
|
||||
super(callBack, TalentLevelUpMessageParser);
|
||||
}
|
||||
|
||||
public getParser(): TalentLevelUpMessageParser
|
||||
{
|
||||
return this.parser as TalentLevelUpMessageParser;
|
||||
}
|
||||
}
|
@ -1,2 +1,3 @@
|
||||
export * from './TalentLevelUpEvent';
|
||||
export * from './TalentTrackLevelMessageEvent';
|
||||
export * from './TalentTrackMessageEvent';
|
||||
|
@ -0,0 +1,74 @@
|
||||
import { TalentTrackRewardPerk, TalentTrackRewardProduct } from '.';
|
||||
import { IMessageDataWrapper, IMessageParser } from '../../../../../api';
|
||||
|
||||
export class TalentLevelUpMessageParser implements IMessageParser
|
||||
{
|
||||
private _talentTrackName: string;
|
||||
private _level: number;
|
||||
private _rewardPerks: TalentTrackRewardPerk[];
|
||||
private _rewardProducts: TalentTrackRewardProduct[];
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._talentTrackName = null;
|
||||
this._level = -1;
|
||||
this._rewardPerks = [];
|
||||
this._rewardProducts = [];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
let totalRewards = 0;
|
||||
|
||||
this._talentTrackName = wrapper.readString();
|
||||
this._level = wrapper.readInt();
|
||||
|
||||
const totalRewardsPerks = wrapper.readInt();
|
||||
|
||||
while(totalRewards < totalRewardsPerks)
|
||||
{
|
||||
this._rewardPerks.push(new TalentTrackRewardPerk(wrapper));
|
||||
totalRewards++;
|
||||
}
|
||||
|
||||
const totalRewardsProducts = wrapper.readInt();
|
||||
|
||||
if(totalRewards < totalRewardsProducts)
|
||||
{
|
||||
for(let i = 0; i < totalRewardsProducts; i++)
|
||||
{
|
||||
const name = wrapper.readString();
|
||||
const vipDays = wrapper.readInt();
|
||||
|
||||
this._rewardProducts.push(new TalentTrackRewardProduct(name, vipDays));
|
||||
totalRewards++;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get talentTrackName(): string
|
||||
{
|
||||
return this._talentTrackName;
|
||||
}
|
||||
|
||||
public get level(): number
|
||||
{
|
||||
return this._level;
|
||||
}
|
||||
|
||||
public get rewardPerks(): TalentTrackRewardPerk[]
|
||||
{
|
||||
return this._rewardPerks;
|
||||
}
|
||||
|
||||
public get rewardProducts(): TalentTrackRewardProduct[]
|
||||
{
|
||||
return this._rewardProducts;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
import { IMessageDataWrapper } from '../../../../../api';
|
||||
|
||||
export class TalentTrackRewardPerk
|
||||
{
|
||||
private _perkId: number;
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
this._perkId = wrapper.readInt();
|
||||
}
|
||||
|
||||
public get perkId(): number
|
||||
{
|
||||
return this._perkId;
|
||||
}
|
||||
}
|
@ -3,10 +3,10 @@ export class TalentTrackRewardProduct
|
||||
private _productCode: string;
|
||||
private _vipDays: number;
|
||||
|
||||
constructor(name: string, unknownInt: number)
|
||||
constructor(name: string, vipDays: number)
|
||||
{
|
||||
this._productCode = name;
|
||||
this._vipDays = unknownInt;
|
||||
this._vipDays = vipDays;
|
||||
}
|
||||
|
||||
public get productCode(): string
|
||||
|
@ -1,5 +1,7 @@
|
||||
export * from './TalentLevelUpMessageParser';
|
||||
export * from './TalentTrackLevel';
|
||||
export * from './TalentTrackLevelMessageParser';
|
||||
export * from './TalentTrackParser';
|
||||
export * from './TalentTrackRewardPerk';
|
||||
export * from './TalentTrackRewardProduct';
|
||||
export * from './TalentTrackTask';
|
||||
|
Loading…
Reference in New Issue
Block a user