mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-18 09:45:28 +00:00
fix(inventory): inventory group names are cut to 64 characters, as the client
LWOInventoryComponent_Common::msgUpdateInventoryGroup (0x00c955b0) resizes the group name to 64 characters on ADD and MODIFY. The server kept names of any length in the charxml. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2399,7 +2399,8 @@ void InventoryComponent::OnUpdateInventoryGroup(const GameMessages::UpdateInvent
|
||||
GroupUpdate groupUpdate;
|
||||
groupUpdate.groupId = msg.groupID;
|
||||
groupUpdate.inventory = msg.inventoryType;
|
||||
groupUpdate.groupName = GeneralUtils::UTF16ToWTF8(msg.groupName);
|
||||
// msgUpdateInventoryGroup (0x00c955b0) cuts names to 64 characters
|
||||
groupUpdate.groupName = GeneralUtils::UTF16ToWTF8(msg.groupName.substr(0, MaximumGroupNameLength));
|
||||
|
||||
if (msg.action == "ADD") groupUpdate.command = GroupUpdateCommand::ADD;
|
||||
else if (msg.action == "MODIFY") groupUpdate.command = GroupUpdateCommand::MODIFY;
|
||||
|
||||
@@ -99,6 +99,7 @@ public:
|
||||
};
|
||||
|
||||
static constexpr uint32_t MaximumGroupCount = 50;
|
||||
static constexpr size_t MaximumGroupNameLength = 64; // UTF-16 characters
|
||||
|
||||
static constexpr eReplicaComponentType ComponentType = eReplicaComponentType::INVENTORY;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user