feat(bbb): answer FetchModelMetadataRequest for brick built models

The client asks for a model's metadata (name, owner, behaviors and its blueprint's
bricks and box) when it shows a brick built model item's tooltip, a model on a
property or an exhibit, and shows BBB_LOADING_BLUEPRINT until it gets it. The
world server never answered. It now does as live did: UG data for the model
(found among the player's items by subkey, else among placed models) and, for a
brick built model, the blueprint data from its ugc row and LXFML.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-27 14:47:29 -05:00
parent 0b89aa6669
commit abfcea36d7
11 changed files with 479 additions and 0 deletions

View File

@@ -21,6 +21,16 @@ namespace Lxfml {
[[nodiscard]] Result NormalizePosition(const std::string_view data, const NiPoint3& curPosition = NiPoint3Constant::ZERO);
[[nodiscard]] std::vector<Result> Split(const std::string_view data, const NiPoint3& curPosition = NiPoint3Constant::ZERO);
// What a model is made of: every brick's design id (one per Brick, in file order) and the box around the bricks'
// origins (their bones' positions; zero with no bricks). Brick shapes aren't known here, so the box is the
// smallest one holding every brick's origin.
struct Contents {
std::vector<uint32_t> designIds;
NiPoint3 boxMin{};
NiPoint3 boxMax{};
};
[[nodiscard]] Contents ReadContents(const std::string_view data);
// these are only for the migrations due to a bug in one of the implementations.
[[nodiscard]] Result NormalizePositionOnlyFirstPart(const std::string_view data);
[[nodiscard]] Result NormalizePositionAfterFirstPart(const std::string_view data, const NiPoint3& position);