You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-20 07:26:18 +00:00
Merge branch 'main' into chat-prefix
This commit is contained in:
@@ -93,6 +93,9 @@ export class NitroMessages implements IMessageConfiguration
|
||||
this._events.set(IncomingHeader.TARGET_OFFER_NOT_FOUND, TargetedOfferNotFoundEvent);
|
||||
this._events.set(IncomingHeader.REDEEM_VOUCHER_ERROR, VoucherRedeemErrorMessageEvent);
|
||||
this._events.set(IncomingHeader.REDEEM_VOUCHER_OK, VoucherRedeemOkMessageEvent);
|
||||
|
||||
// COMMANDS
|
||||
this._events.set(IncomingHeader.AVAILABLE_COMMANDS, AvailableCommandsEvent);
|
||||
|
||||
// CLIENT
|
||||
this._events.set(IncomingHeader.CLIENT_PING, ClientPingEvent);
|
||||
@@ -587,6 +590,7 @@ export class NitroMessages implements IMessageConfiguration
|
||||
{
|
||||
// CUSTOM PACKETS
|
||||
this._composers.set(OutgoingHeader.CLICK_FURNI, ClickFurniMessageComposer);
|
||||
this._composers.set(OutgoingHeader.CLICK_USER, ClickUserMessageComposer);
|
||||
|
||||
// AUTHENTICATION
|
||||
this._composers.set(OutgoingHeader.AUTHENTICATION, AuthenticationMessageComposer);
|
||||
|
||||
@@ -15,6 +15,7 @@ export * from './messages/incoming/camera';
|
||||
export * from './messages/incoming/campaign';
|
||||
export * from './messages/incoming/catalog';
|
||||
export * from './messages/incoming/client';
|
||||
export * from './messages/incoming/commands';
|
||||
export * from './messages/incoming/competition';
|
||||
export * from './messages/incoming/crafting';
|
||||
export * from './messages/incoming/desktop';
|
||||
@@ -167,6 +168,7 @@ export * from './messages/parser/camera';
|
||||
export * from './messages/parser/campaign';
|
||||
export * from './messages/parser/catalog';
|
||||
export * from './messages/parser/client';
|
||||
export * from './messages/parser/commands';
|
||||
export * from './messages/parser/competition';
|
||||
export * from './messages/parser/crafting';
|
||||
export * from './messages/parser/desktop';
|
||||
|
||||
@@ -7,6 +7,7 @@ export class IncomingHeader
|
||||
public static ACHIEVEMENT_LIST = 305;
|
||||
public static AUTHENTICATED = 2491;
|
||||
public static AUTHENTICATION = -1;
|
||||
public static AVAILABLE_COMMANDS = 4050;
|
||||
public static AVAILABILITY_STATUS = 2033;
|
||||
public static BUILDERS_CLUB_EXPIRED = 1452;
|
||||
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 './catalog';
|
||||
export * from './client';
|
||||
export * from './commands';
|
||||
export * from './competition';
|
||||
export * from './crafting';
|
||||
export * from './desktop';
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
export class OutgoingHeader
|
||||
{
|
||||
public static CLICK_FURNI = 6002;
|
||||
public static CLICK_USER = 10020;
|
||||
|
||||
public static ACHIEVEMENT_LIST = 219;
|
||||
public static AUTHENTICATION = -1;
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import { IMessageComposer } from '@nitrots/api';
|
||||
|
||||
export class ClickUserMessageComposer implements IMessageComposer<ConstructorParameters<typeof ClickUserMessageComposer>>
|
||||
{
|
||||
private _data: ConstructorParameters<typeof ClickUserMessageComposer>;
|
||||
|
||||
constructor(roomUnitId: number)
|
||||
{
|
||||
this._data = [ roomUnitId ];
|
||||
}
|
||||
|
||||
public getMessageArray()
|
||||
{
|
||||
return this._data;
|
||||
}
|
||||
|
||||
public dispose(): void
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ export * from './BotPlaceComposer';
|
||||
export * from './BotRemoveComposer';
|
||||
export * from './BotSkillSaveComposer';
|
||||
export * from './ClickFurniMessageComposer';
|
||||
export * from './ClickUserMessageComposer';
|
||||
export * from './CompostPlantMessageComposer';
|
||||
export * from './GetItemDataComposer';
|
||||
export * from './HarvestPetMessageComposer';
|
||||
|
||||
@@ -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