feat: FurniEditor WebSocket packets (10040-10045) — composers, parsers, events

This commit is contained in:
Life
2026-03-27 19:54:21 +01:00
parent 6e552eeba5
commit 594b9c28a0
27 changed files with 530 additions and 2 deletions
File diff suppressed because one or more lines are too long
+3
View File
@@ -20,6 +20,7 @@ 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';
export * from './messages/incoming/friendlist'; export * from './messages/incoming/friendlist';
export * from './messages/incoming/furnieditor';
export * from './messages/incoming/game'; export * from './messages/incoming/game';
export * from './messages/incoming/game/directory'; export * from './messages/incoming/game/directory';
export * from './messages/incoming/game/lobby'; export * from './messages/incoming/game/lobby';
@@ -94,6 +95,7 @@ export * from './messages/outgoing/crafting';
export * from './messages/outgoing/desktop'; export * from './messages/outgoing/desktop';
export * from './messages/outgoing/friendfurni'; export * from './messages/outgoing/friendfurni';
export * from './messages/outgoing/friendlist'; export * from './messages/outgoing/friendlist';
export * from './messages/outgoing/furnieditor';
export * from './messages/outgoing/game'; export * from './messages/outgoing/game';
export * from './messages/outgoing/game/arena'; export * from './messages/outgoing/game/arena';
export * from './messages/outgoing/game/directory'; export * from './messages/outgoing/game/directory';
@@ -173,6 +175,7 @@ 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';
export * from './messages/parser/friendlist'; export * from './messages/parser/friendlist';
export * from './messages/parser/furnieditor';
export * from './messages/parser/game'; export * from './messages/parser/game';
export * from './messages/parser/game/directory'; export * from './messages/parser/game/directory';
export * from './messages/parser/game/lobby'; export * from './messages/parser/game/lobby';
@@ -477,6 +477,12 @@ export class IncomingHeader
public static RENTABLE_FURNI_RENT_OR_BUYOUT_OFFER = 35; public static RENTABLE_FURNI_RENT_OR_BUYOUT_OFFER = 35;
public static HANDSHAKE_IDENTITY_ACCOUNT = 3523; public static HANDSHAKE_IDENTITY_ACCOUNT = 3523;
// Furni Editor
public static FURNI_EDITOR_SEARCH_RESULT = 10040;
public static FURNI_EDITOR_DETAIL_RESULT = 10041;
public static FURNI_EDITOR_INTERACTIONS_RESULT = 10043;
public static FURNI_EDITOR_RESULT = 10044;
// Catalog Admin // Catalog Admin
public static CATALOG_ADMIN_RESULT = 10059; public static CATALOG_ADMIN_RESULT = 10059;
@@ -0,0 +1,16 @@
import { IMessageEvent } from '@nitrots/api';
import { MessageEvent } from '@nitrots/events';
import { FurniEditorDetailResultMessageParser } from '../../parser';
export class FurniEditorDetailResultEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, FurniEditorDetailResultMessageParser);
}
public getParser(): FurniEditorDetailResultMessageParser
{
return this.parser as FurniEditorDetailResultMessageParser;
}
}
@@ -0,0 +1,16 @@
import { IMessageEvent } from '@nitrots/api';
import { MessageEvent } from '@nitrots/events';
import { FurniEditorInteractionsResultMessageParser } from '../../parser';
export class FurniEditorInteractionsResultEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, FurniEditorInteractionsResultMessageParser);
}
public getParser(): FurniEditorInteractionsResultMessageParser
{
return this.parser as FurniEditorInteractionsResultMessageParser;
}
}
@@ -0,0 +1,16 @@
import { IMessageEvent } from '@nitrots/api';
import { MessageEvent } from '@nitrots/events';
import { FurniEditorResultMessageParser } from '../../parser';
export class FurniEditorResultEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, FurniEditorResultMessageParser);
}
public getParser(): FurniEditorResultMessageParser
{
return this.parser as FurniEditorResultMessageParser;
}
}
@@ -0,0 +1,16 @@
import { IMessageEvent } from '@nitrots/api';
import { MessageEvent } from '@nitrots/events';
import { FurniEditorSearchResultMessageParser } from '../../parser';
export class FurniEditorSearchResultEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, FurniEditorSearchResultMessageParser);
}
public getParser(): FurniEditorSearchResultMessageParser
{
return this.parser as FurniEditorSearchResultMessageParser;
}
}
@@ -0,0 +1,4 @@
export * from './FurniEditorDetailResultEvent';
export * from './FurniEditorInteractionsResultEvent';
export * from './FurniEditorResultEvent';
export * from './FurniEditorSearchResultEvent';
@@ -13,6 +13,7 @@ export * from './competition';
export * from './crafting'; export * from './crafting';
export * from './desktop'; export * from './desktop';
export * from './friendlist'; export * from './friendlist';
export * from './furnieditor';
export * from './game'; export * from './game';
export * from './game/directory'; export * from './game/directory';
export * from './game/lobby'; export * from './game/lobby';
@@ -476,6 +476,14 @@ export class OutgoingHeader
public static FURNITURE_PICKUP_ALL = 10017; public static FURNITURE_PICKUP_ALL = 10017;
// Furni Editor
public static FURNI_EDITOR_SEARCH = 10040;
public static FURNI_EDITOR_DETAIL = 10041;
public static FURNI_EDITOR_BY_SPRITE = 10042;
public static FURNI_EDITOR_INTERACTIONS = 10043;
public static FURNI_EDITOR_UPDATE = 10044;
public static FURNI_EDITOR_DELETE = 10045;
public static CATALOG_ADMIN_SAVE_PAGE = 10050; public static CATALOG_ADMIN_SAVE_PAGE = 10050;
public static CATALOG_ADMIN_CREATE_PAGE = 10051; public static CATALOG_ADMIN_CREATE_PAGE = 10051;
public static CATALOG_ADMIN_DELETE_PAGE = 10052; public static CATALOG_ADMIN_DELETE_PAGE = 10052;
@@ -0,0 +1,21 @@
import { IMessageComposer } from '@nitrots/api';
export class FurniEditorBySpriteComposer implements IMessageComposer<ConstructorParameters<typeof FurniEditorBySpriteComposer>>
{
private _data: ConstructorParameters<typeof FurniEditorBySpriteComposer>;
constructor(spriteId: number)
{
this._data = [ spriteId ];
}
dispose(): void
{
this._data = null;
}
public getMessageArray()
{
return this._data;
}
}
@@ -0,0 +1,21 @@
import { IMessageComposer } from '@nitrots/api';
export class FurniEditorDeleteComposer implements IMessageComposer<ConstructorParameters<typeof FurniEditorDeleteComposer>>
{
private _data: ConstructorParameters<typeof FurniEditorDeleteComposer>;
constructor(id: number)
{
this._data = [ id ];
}
dispose(): void
{
this._data = null;
}
public getMessageArray()
{
return this._data;
}
}
@@ -0,0 +1,21 @@
import { IMessageComposer } from '@nitrots/api';
export class FurniEditorDetailComposer implements IMessageComposer<ConstructorParameters<typeof FurniEditorDetailComposer>>
{
private _data: ConstructorParameters<typeof FurniEditorDetailComposer>;
constructor(id: number)
{
this._data = [ id ];
}
dispose(): void
{
this._data = null;
}
public getMessageArray()
{
return this._data;
}
}
@@ -0,0 +1,21 @@
import { IMessageComposer } from '@nitrots/api';
export class FurniEditorInteractionsComposer implements IMessageComposer<ConstructorParameters<typeof FurniEditorInteractionsComposer>>
{
private _data: ConstructorParameters<typeof FurniEditorInteractionsComposer>;
constructor()
{
this._data = [];
}
dispose(): void
{
this._data = null;
}
public getMessageArray()
{
return this._data;
}
}
@@ -0,0 +1,21 @@
import { IMessageComposer } from '@nitrots/api';
export class FurniEditorSearchComposer implements IMessageComposer<ConstructorParameters<typeof FurniEditorSearchComposer>>
{
private _data: ConstructorParameters<typeof FurniEditorSearchComposer>;
constructor(query: string, type: string, page: number)
{
this._data = [ query, type, page ];
}
dispose(): void
{
this._data = null;
}
public getMessageArray()
{
return this._data;
}
}
@@ -0,0 +1,21 @@
import { IMessageComposer } from '@nitrots/api';
export class FurniEditorUpdateComposer implements IMessageComposer<ConstructorParameters<typeof FurniEditorUpdateComposer>>
{
private _data: ConstructorParameters<typeof FurniEditorUpdateComposer>;
constructor(id: number, jsonFields: string)
{
this._data = [ id, jsonFields ];
}
dispose(): void
{
this._data = null;
}
public getMessageArray()
{
return this._data;
}
}
@@ -0,0 +1,6 @@
export * from './FurniEditorBySpriteComposer';
export * from './FurniEditorDeleteComposer';
export * from './FurniEditorDetailComposer';
export * from './FurniEditorInteractionsComposer';
export * from './FurniEditorSearchComposer';
export * from './FurniEditorUpdateComposer';
@@ -9,6 +9,7 @@ export * from './crafting';
export * from './desktop'; export * from './desktop';
export * from './friendfurni'; export * from './friendfurni';
export * from './friendlist'; export * from './friendlist';
export * from './furnieditor';
export * from './game'; export * from './game';
export * from './game/arena'; export * from './game/arena';
export * from './game/directory'; export * from './game/directory';
@@ -0,0 +1,23 @@
import { IMessageDataWrapper } from '@nitrots/api';
export class CatalogRefData
{
public id: number;
public catalogName: string;
public costCredits: number;
public costPoints: number;
public pointsType: number;
public pageId: number;
public pageName: string;
public parse(wrapper: IMessageDataWrapper): void
{
this.id = wrapper.readInt();
this.catalogName = wrapper.readString();
this.costCredits = wrapper.readInt();
this.costPoints = wrapper.readInt();
this.pointsType = wrapper.readInt();
this.pageId = wrapper.readInt();
this.pageName = wrapper.readString();
}
}
@@ -0,0 +1,38 @@
import { IMessageDataWrapper } from '@nitrots/api';
import { FurniItemData } from './FurniItemData';
export class FurniDetailData extends FurniItemData
{
public allowGift: boolean;
public allowTrade: boolean;
public allowRecycle: boolean;
public allowMarketplaceSell: boolean;
public allowInventoryStack: boolean;
public vendingIds: string;
public customparams: string;
public effectIdMale: number;
public effectIdFemale: number;
public clothingOnWalk: string;
public multiheight: string;
public description: string;
public usageCount: number;
public override parse(wrapper: IMessageDataWrapper): void
{
super.parse(wrapper);
this.allowGift = wrapper.readBoolean();
this.allowTrade = wrapper.readBoolean();
this.allowRecycle = wrapper.readBoolean();
this.allowMarketplaceSell = wrapper.readBoolean();
this.allowInventoryStack = wrapper.readBoolean();
this.vendingIds = wrapper.readString();
this.customparams = wrapper.readString();
this.effectIdMale = wrapper.readInt();
this.effectIdFemale = wrapper.readInt();
this.clothingOnWalk = wrapper.readString();
this.multiheight = wrapper.readString();
this.description = wrapper.readString();
this.usageCount = wrapper.readInt();
}
}
@@ -0,0 +1,57 @@
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
import { CatalogRefData } from './CatalogRefData';
import { FurniDetailData } from './FurniDetailData';
export class FurniEditorDetailResultMessageParser implements IMessageParser
{
private _item: FurniDetailData;
private _catalogItems: CatalogRefData[];
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 = new FurniDetailData();
this._item.parse(wrapper);
const catalogCount = wrapper.readInt();
this._catalogItems = [];
for(let i = 0; i < catalogCount; i++)
{
const ref = new CatalogRefData();
ref.parse(wrapper);
this._catalogItems.push(ref);
}
this._furniDataJson = wrapper.readString();
return true;
}
public get item(): FurniDetailData
{
return this._item;
}
public get catalogItems(): CatalogRefData[]
{
return this._catalogItems;
}
public get furniDataJson(): string
{
return this._furniDataJson;
}
}
@@ -0,0 +1,34 @@
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
export class FurniEditorInteractionsResultMessageParser 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,43 @@
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
export class FurniEditorResultMessageParser 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,54 @@
import { IMessageDataWrapper, IMessageParser } from '@nitrots/api';
import { FurniItemData } from './FurniItemData';
export class FurniEditorSearchResultMessageParser implements IMessageParser
{
private _items: FurniItemData[];
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++)
{
const item = new FurniItemData();
item.parse(wrapper);
this._items.push(item);
}
this._total = wrapper.readInt();
this._page = wrapper.readInt();
return true;
}
public get items(): FurniItemData[]
{
return this._items;
}
public get total(): number
{
return this._total;
}
public get page(): number
{
return this._page;
}
}
@@ -0,0 +1,37 @@
import { IMessageDataWrapper } from '@nitrots/api';
export class FurniItemData
{
public id: number;
public spriteId: number;
public itemName: string;
public publicName: string;
public type: string;
public width: number;
public length: number;
public stackHeight: number;
public allowStack: boolean;
public allowWalk: boolean;
public allowSit: boolean;
public allowLay: boolean;
public interactionType: string;
public interactionModesCount: number;
public parse(wrapper: IMessageDataWrapper): void
{
this.id = wrapper.readInt();
this.spriteId = wrapper.readInt();
this.itemName = wrapper.readString();
this.publicName = wrapper.readString();
this.type = wrapper.readString();
this.width = wrapper.readInt();
this.length = wrapper.readInt();
this.stackHeight = wrapper.readDouble();
this.allowStack = wrapper.readBoolean();
this.allowWalk = wrapper.readBoolean();
this.allowSit = wrapper.readBoolean();
this.allowLay = wrapper.readBoolean();
this.interactionType = wrapper.readString();
this.interactionModesCount = wrapper.readInt();
}
}
@@ -0,0 +1,7 @@
export * from './CatalogRefData';
export * from './FurniDetailData';
export * from './FurniEditorDetailResultMessageParser';
export * from './FurniEditorInteractionsResultMessageParser';
export * from './FurniEditorResultMessageParser';
export * from './FurniEditorSearchResultMessageParser';
export * from './FurniItemData';
@@ -12,6 +12,7 @@ export * from './competition';
export * from './crafting'; export * from './crafting';
export * from './desktop'; export * from './desktop';
export * from './friendlist'; export * from './friendlist';
export * from './furnieditor';
export * from './game'; export * from './game';
export * from './game/directory'; export * from './game/directory';
export * from './game/lobby'; export * from './game/lobby';