You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-19 23:16:20 +00:00
🆙 added missing AvailableCommands
This commit is contained in:
@@ -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 './catalog';
|
||||
export * from './client';
|
||||
export * from './commands';
|
||||
export * from './competition';
|
||||
export * from './crafting';
|
||||
export * from './desktop';
|
||||
|
||||
Reference in New Issue
Block a user