Skip to content

Commit

Permalink
billsonnn#9 - TalentTrackLevelMessageEvent added
Browse files Browse the repository at this point in the history
  • Loading branch information
oobjectt committed Dec 24, 2022
1 parent 26741b7 commit 8a0c402
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/nitro/communication/NitroMessages.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ export class IncomingHeader
public static BADGE_POINT_LIMITS = 2501;
public static BADGE_REQUEST_FULFILLED = 2998;
public static HELPER_TALENT_TRACK = 3406;
public static TALENT_TRACK_LEVEL = 1203;
public static USER_BANNED = 1683;
public static BOT_RECEIVED = 3684;
public static PET_LEVEL_NOTIFICATION = 859;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../api';
import { MessageEvent } from '../../../../../events';
import { TalentTrackLevelMessageParser } from '../../parser';

export class TalentTrackLevelMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, TalentTrackLevelMessageParser);
}

public getParser(): TalentTrackLevelMessageParser
{
return this.parser as TalentTrackLevelMessageParser;
}
}
1 change: 1 addition & 0 deletions src/nitro/communication/messages/incoming/talent/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './TalentTrackLevelMessageEvent';
export * from './TalentTrackMessageEvent';
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../api';

export class TalentTrackLevelMessageParser implements IMessageParser
{
private _talentTrackName: string;
private _level: number;
private _maxLevel: number;

public flush(): boolean
{
this._talentTrackName = null;
this._level = -1;
this._maxLevel = -1;

return true;
}

public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;

this._talentTrackName = wrapper.readString();
this._level = wrapper.readInt();
this._maxLevel = wrapper.readInt();

return true;
}

public get talentTrackName(): string
{
return this._talentTrackName;
}

public get level(): number
{
return this._level;
}

public get maxLevel(): number
{
return this._maxLevel;
}
}
1 change: 1 addition & 0 deletions src/nitro/communication/messages/parser/talent/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from './TalentTrackLevel';
export * from './TalentTrackLevelMessageParser';
export * from './TalentTrackParser';
export * from './TalentTrackRewardProduct';
export * from './TalentTrackTask';

0 comments on commit 8a0c402

Please sign in to comment.