You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-20 15:36:18 +00:00
🆙 added missing AvailableCommands
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -15,6 +15,7 @@ export * from './messages/incoming/camera';
|
|||||||
export * from './messages/incoming/campaign';
|
export * from './messages/incoming/campaign';
|
||||||
export * from './messages/incoming/catalog';
|
export * from './messages/incoming/catalog';
|
||||||
export * from './messages/incoming/client';
|
export * from './messages/incoming/client';
|
||||||
|
export * from './messages/incoming/commands';
|
||||||
export * from './messages/incoming/competition';
|
export * from './messages/incoming/competition';
|
||||||
export * from './messages/incoming/crafting';
|
export * from './messages/incoming/crafting';
|
||||||
export * from './messages/incoming/desktop';
|
export * from './messages/incoming/desktop';
|
||||||
@@ -167,6 +168,7 @@ export * from './messages/parser/camera';
|
|||||||
export * from './messages/parser/campaign';
|
export * from './messages/parser/campaign';
|
||||||
export * from './messages/parser/catalog';
|
export * from './messages/parser/catalog';
|
||||||
export * from './messages/parser/client';
|
export * from './messages/parser/client';
|
||||||
|
export * from './messages/parser/commands';
|
||||||
export * from './messages/parser/competition';
|
export * from './messages/parser/competition';
|
||||||
export * from './messages/parser/crafting';
|
export * from './messages/parser/crafting';
|
||||||
export * from './messages/parser/desktop';
|
export * from './messages/parser/desktop';
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ export class IncomingHeader
|
|||||||
public static ACHIEVEMENT_LIST = 305;
|
public static ACHIEVEMENT_LIST = 305;
|
||||||
public static AUTHENTICATED = 2491;
|
public static AUTHENTICATED = 2491;
|
||||||
public static AUTHENTICATION = -1;
|
public static AUTHENTICATION = -1;
|
||||||
|
public static AVAILABLE_COMMANDS = 4050;
|
||||||
public static AVAILABILITY_STATUS = 2033;
|
public static AVAILABILITY_STATUS = 2033;
|
||||||
public static BUILDERS_CLUB_EXPIRED = 1452;
|
public static BUILDERS_CLUB_EXPIRED = 1452;
|
||||||
public static CLUB_OFFERS = 2405;
|
public static CLUB_OFFERS = 2405;
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { IMessageEvent } from '@nitrots/api';
|
||||||
|
import { MessageEvent } from '@nitrots/events';
|
||||||
|
import { AvailableCommandsParser } from '../../parser';
|
||||||
|
|
||||||
|
export class AvailableCommandsEvent extends MessageEvent implements IMessageEvent
|
||||||
|
{
|
||||||
|
constructor(callBack: Function)
|
||||||
|
{
|
||||||
|
super(callBack, AvailableCommandsParser);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getParser(): AvailableCommandsParser
|
||||||
|
{
|
||||||
|
return this.parser as AvailableCommandsParser;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export * from './AvailableCommandsEvent';
|
||||||
@@ -8,6 +8,7 @@ export * from './camera';
|
|||||||
export * from './campaign';
|
export * from './campaign';
|
||||||
export * from './catalog';
|
export * from './catalog';
|
||||||
export * from './client';
|
export * from './client';
|
||||||
|
export * from './commands';
|
||||||
export * from './competition';
|
export * from './competition';
|
||||||
export * from './crafting';
|
export * from './crafting';
|
||||||
export * from './desktop';
|
export * from './desktop';
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
|
||||||
|
|
||||||
|
export class AvailableCommandsParser implements IMessageParser
|
||||||
|
{
|
||||||
|
private _commands: { key: string; description: string }[];
|
||||||
|
|
||||||
|
public flush(): boolean
|
||||||
|
{
|
||||||
|
this._commands = [];
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public parse(wrapper: IMessageDataWrapper): boolean
|
||||||
|
{
|
||||||
|
if(!wrapper) return false;
|
||||||
|
|
||||||
|
this._commands = [];
|
||||||
|
|
||||||
|
const count = wrapper.readInt();
|
||||||
|
|
||||||
|
for(let i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
this._commands.push({
|
||||||
|
key: wrapper.readString(),
|
||||||
|
description: wrapper.readString()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get commands(): { key: string; description: string }[]
|
||||||
|
{
|
||||||
|
return this._commands;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export * from './AvailableCommandsParser';
|
||||||
@@ -7,6 +7,7 @@ export * from './camera';
|
|||||||
export * from './campaign';
|
export * from './campaign';
|
||||||
export * from './catalog';
|
export * from './catalog';
|
||||||
export * from './client';
|
export * from './client';
|
||||||
|
export * from './commands';
|
||||||
export * from './competition';
|
export * from './competition';
|
||||||
export * from './crafting';
|
export * from './crafting';
|
||||||
export * from './desktop';
|
export * from './desktop';
|
||||||
|
|||||||
Reference in New Issue
Block a user