From 075b0f722d876cd536723737e193683c1408b75f Mon Sep 17 00:00:00 2001 From: Lorenzune Date: Thu, 26 Mar 2026 05:24:53 +0100 Subject: [PATCH] Support NFT avatar editor category data --- .../avatar/enum/AvatarEditorFigureCategory.ts | 3 ++- .../clothing/FigureSetIdsMessageParser.ts | 27 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/packages/api/src/nitro/avatar/enum/AvatarEditorFigureCategory.ts b/packages/api/src/nitro/avatar/enum/AvatarEditorFigureCategory.ts index b5043c0..c66a37d 100644 --- a/packages/api/src/nitro/avatar/enum/AvatarEditorFigureCategory.ts +++ b/packages/api/src/nitro/avatar/enum/AvatarEditorFigureCategory.ts @@ -8,4 +8,5 @@ public static WARDROBE: string = 'wardrobe'; public static EFFECTS: string = 'effects'; public static PETS: string = 'pets'; -} \ No newline at end of file + public static NFT: string = 'nft'; +} diff --git a/packages/communication/src/messages/parser/inventory/clothing/FigureSetIdsMessageParser.ts b/packages/communication/src/messages/parser/inventory/clothing/FigureSetIdsMessageParser.ts index 28a2db4..baa6df2 100644 --- a/packages/communication/src/messages/parser/inventory/clothing/FigureSetIdsMessageParser.ts +++ b/packages/communication/src/messages/parser/inventory/clothing/FigureSetIdsMessageParser.ts @@ -4,11 +4,13 @@ export class FigureSetIdsMessageParser implements IMessageParser { private _figureSetIds: number[]; private _boundFurnitureNames: string[]; + private _figureSetNameMap: { [index: number]: string }; public flush(): boolean { this._figureSetIds = []; this._boundFurnitureNames = []; + this._figureSetNameMap = {}; return true; } @@ -35,6 +37,26 @@ export class FigureSetIdsMessageParser implements IMessageParser totalFurnitureNames--; } + if(wrapper.bytesAvailable) + { + let totalMappings = wrapper.readInt(); + + while(totalMappings > 0) + { + const furnitureName = wrapper.readString(); + let totalMappedSetIds = wrapper.readInt(); + + while(totalMappedSetIds > 0) + { + this._figureSetNameMap[wrapper.readInt()] = furnitureName; + + totalMappedSetIds--; + } + + totalMappings--; + } + } + return true; } @@ -47,4 +69,9 @@ export class FigureSetIdsMessageParser implements IMessageParser { return this._boundFurnitureNames; } + + public get figureSetNameMap(): { [index: number]: string } + { + return this._figureSetNameMap; + } }