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
feat: FurniEditor WebSocket packets (10040-10045) — composers, parsers, events
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
+57
@@ -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;
|
||||
}
|
||||
}
|
||||
+34
@@ -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;
|
||||
}
|
||||
}
|
||||
+43
@@ -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;
|
||||
}
|
||||
}
|
||||
+54
@@ -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';
|
||||
Reference in New Issue
Block a user