mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2024-11-22 23:50:52 +01:00
#28 - BotSkillListUpdateEvent added
This commit is contained in:
parent
26741b78a7
commit
1ae87a5606
File diff suppressed because one or more lines are too long
@ -277,6 +277,7 @@ export class IncomingHeader
|
|||||||
public static REDEEM_VOUCHER_OK = 3336;
|
public static REDEEM_VOUCHER_OK = 3336;
|
||||||
public static IN_CLIENT_LINK = 2023;
|
public static IN_CLIENT_LINK = 2023;
|
||||||
public static BOT_COMMAND_CONFIGURATION = 1618;
|
public static BOT_COMMAND_CONFIGURATION = 1618;
|
||||||
|
public static BOT_SKILL_LIST_UPDATE = 69;
|
||||||
public static HAND_ITEM_RECEIVED = 354;
|
public static HAND_ITEM_RECEIVED = 354;
|
||||||
public static PET_PLACING_ERROR = 2913;
|
public static PET_PLACING_ERROR = 2913;
|
||||||
public static BOT_ERROR = 639;
|
public static BOT_ERROR = 639;
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
import { IMessageEvent } from '../../../../../../api';
|
||||||
|
import { MessageEvent } from '../../../../../../events';
|
||||||
|
import { BotSkillListUpdateParser } from '../../../parser';
|
||||||
|
|
||||||
|
export class BotSkillListUpdateEvent extends MessageEvent implements IMessageEvent
|
||||||
|
{
|
||||||
|
constructor(callBack: Function)
|
||||||
|
{
|
||||||
|
super(callBack, BotSkillListUpdateParser);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getParser(): BotSkillListUpdateParser
|
||||||
|
{
|
||||||
|
return this.parser as BotSkillListUpdateParser;
|
||||||
|
}
|
||||||
|
}
|
@ -1 +1,2 @@
|
|||||||
export * from './BotCommandConfigurationEvent';
|
export * from './BotCommandConfigurationEvent';
|
||||||
|
export * from './BotSkillListUpdateEvent';
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
import { IMessageDataWrapper } from '../../../../../../api';
|
||||||
|
|
||||||
|
export class BotSkillData
|
||||||
|
{
|
||||||
|
private _id: number;
|
||||||
|
private _data: string;
|
||||||
|
|
||||||
|
constructor(wrapper: IMessageDataWrapper)
|
||||||
|
{
|
||||||
|
this._id = wrapper.readInt();
|
||||||
|
this._data = wrapper.readString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public get id(): number
|
||||||
|
{
|
||||||
|
return this._id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get data(): string
|
||||||
|
{
|
||||||
|
return this._data;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
import { IMessageDataWrapper, IMessageParser } from '../../../../../../api';
|
||||||
|
import { BotSkillData } from './BotSkillData';
|
||||||
|
|
||||||
|
export class BotSkillListUpdateParser implements IMessageParser
|
||||||
|
{
|
||||||
|
private _botId: number;
|
||||||
|
private _skillList: BotSkillData[];
|
||||||
|
|
||||||
|
public flush(): boolean
|
||||||
|
{
|
||||||
|
this._botId = -1;
|
||||||
|
this._skillList = [];
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public parse(wrapper: IMessageDataWrapper): boolean
|
||||||
|
{
|
||||||
|
if(!wrapper) return false;
|
||||||
|
|
||||||
|
this._botId = wrapper.readInt();
|
||||||
|
|
||||||
|
let totalSkills = wrapper.readInt();
|
||||||
|
|
||||||
|
while(totalSkills > 0)
|
||||||
|
{
|
||||||
|
this._skillList.push(new BotSkillData(wrapper));
|
||||||
|
|
||||||
|
totalSkills--;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get botId(): number
|
||||||
|
{
|
||||||
|
return this._botId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get skillList(): BotSkillData[]
|
||||||
|
{
|
||||||
|
return this._skillList;
|
||||||
|
}
|
||||||
|
}
|
@ -1 +1,3 @@
|
|||||||
export * from './BotCommandConfigurationParser';
|
export * from './BotCommandConfigurationParser';
|
||||||
|
export * from './BotSkillData';
|
||||||
|
export * from './BotSkillListUpdateParser';
|
||||||
|
Loading…
Reference in New Issue
Block a user