feat(furni-editor): add WebSocket packets for furniture editor

Add composers, parsers, and events for the Furni Editor feature
communicating via WebSocket with the Arcturus emulator.

Packet handlers:
- Search (10040/10041): search furniture by name, ID, or type
- Detail (10042/10043): get/receive full furniture details by sprite ID
- Update (10044): save furniture property changes
- Create (10045): create new furniture items
- Delete (10046): delete furniture items
- Interactions (10047/10048): list available interaction types
- Result (10049): confirmation response for save/delete/create

New files:
- 7 outgoing composers (Search, Detail, BySprite, Interactions, Update, Create, Delete)
- 4 incoming events (Search, Detail, Interactions, Result)
- 4 parsers (Search, Detail, Interactions, Result)
- Updated IncomingHeader, OutgoingHeader, NitroMessages, and barrel exports
This commit is contained in:
Life
2026-03-22 18:04:27 +01:00
parent 427f7c66e9
commit 35f55d5add
24 changed files with 469 additions and 1 deletions
@@ -0,0 +1,76 @@
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
export class FurniEditorDetailParser implements IMessageParser
{
private _item: any;
private _catalogItems: any[];
private _furniDataJson: string;
public flush(): boolean
{
this._item = null;
this._catalogItems = [];
this._furniDataJson = '';
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._item = {
id: wrapper.readInt(),
spriteId: wrapper.readInt(),
itemName: wrapper.readString(),
publicName: wrapper.readString(),
type: wrapper.readString(),
width: wrapper.readInt(),
length: wrapper.readInt(),
stackHeight: wrapper.readDouble(),
allowStack: wrapper.readBoolean(),
allowWalk: wrapper.readBoolean(),
allowSit: wrapper.readBoolean(),
allowLay: wrapper.readBoolean(),
interactionType: wrapper.readString(),
interactionModesCount: wrapper.readInt(),
// Extended fields
allowGift: wrapper.readBoolean(),
allowTrade: wrapper.readBoolean(),
allowRecycle: wrapper.readBoolean(),
allowMarketplaceSell: wrapper.readBoolean(),
allowInventoryStack: wrapper.readBoolean(),
vendingIds: wrapper.readString(),
customparams: wrapper.readString(),
effectIdMale: wrapper.readInt(),
effectIdFemale: wrapper.readInt(),
clothingOnWalk: wrapper.readString(),
multiheight: wrapper.readString(),
description: wrapper.readString(),
usageCount: wrapper.readInt()
};
const catalogCount = wrapper.readInt();
this._catalogItems = [];
for(let i = 0; i < catalogCount; i++)
{
this._catalogItems.push({
id: wrapper.readInt(),
catalogName: wrapper.readString(),
costCredits: wrapper.readInt(),
costPoints: wrapper.readInt(),
pointsType: wrapper.readInt(),
pageId: wrapper.readInt(),
pageName: wrapper.readString()
});
}
this._furniDataJson = wrapper.readString();
return true;
}
public get item(): any { return this._item; }
public get catalogItems(): any[] { return this._catalogItems; }
public get furniDataJson(): string { return this._furniDataJson; }
}
@@ -0,0 +1,29 @@
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
export class FurniEditorInteractionsParser implements IMessageParser
{
private _interactions: string[];
public flush(): boolean
{
this._interactions = [];
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
const count = wrapper.readInt();
this._interactions = [];
for(let i = 0; i < count; i++)
{
this._interactions.push(wrapper.readString());
}
return true;
}
public get interactions(): string[] { return this._interactions; }
}
@@ -0,0 +1,31 @@
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
export class FurniEditorResultParser implements IMessageParser
{
private _success: boolean;
private _message: string;
private _id: number;
public flush(): boolean
{
this._success = false;
this._message = '';
this._id = -1;
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._success = wrapper.readBoolean();
this._message = wrapper.readString();
this._id = wrapper.readInt();
return true;
}
public get success(): boolean { return this._success; }
public get message(): string { return this._message; }
public get id(): number { return this._id; }
}
@@ -0,0 +1,53 @@
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
export class FurniEditorSearchParser implements IMessageParser
{
private _items: any[];
private _total: number;
private _page: number;
public flush(): boolean
{
this._items = [];
this._total = 0;
this._page = 1;
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
const count = wrapper.readInt();
this._items = [];
for(let i = 0; i < count; i++)
{
this._items.push({
id: wrapper.readInt(),
spriteId: wrapper.readInt(),
itemName: wrapper.readString(),
publicName: wrapper.readString(),
type: wrapper.readString(),
width: wrapper.readInt(),
length: wrapper.readInt(),
stackHeight: wrapper.readDouble(),
allowStack: wrapper.readBoolean(),
allowWalk: wrapper.readBoolean(),
allowSit: wrapper.readBoolean(),
allowLay: wrapper.readBoolean(),
interactionType: wrapper.readString(),
interactionModesCount: wrapper.readInt()
});
}
this._total = wrapper.readInt();
this._page = wrapper.readInt();
return true;
}
public get items(): any[] { return this._items; }
public get total(): number { return this._total; }
public get page(): number { return this._page; }
}
@@ -0,0 +1,4 @@
export * from './FurniEditorSearchParser';
export * from './FurniEditorDetailParser';
export * from './FurniEditorInteractionsParser';
export * from './FurniEditorResultParser';
@@ -12,6 +12,7 @@ export * from './competition';
export * from './crafting';
export * from './desktop';
export * from './friendlist';
export * from './furnieditor';
export * from './game';
export * from './game/directory';
export * from './game/lobby';