mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-28 23:47:14 +00:00
feat(ugc): placed models from the UGC server without 3D services
A placed model's client (1.10.64, UGCUSE3DSERVICES=7:0) always loads its blueprint's NIF and HKX (its BlueprintComponent sets renderUserGen and physicsUserGen itself) and its LXFML, asks the world for each file's manifest first and waits for the answer with no timeout. With ugc_manifest=1 and the new ugc_manifest_models=1 (default 0) the world: - leaves the models whose mesh the UGC server made out of the LXFML it sends when a property loads, - answers their NIF with the UGC server's checksum, their LXFML with the stored LXFML's (worked out once and kept) and their HKX as not known, - sends a model that isn't made its LXFML (once for the three requests), so the client builds it itself and no model is left waiting. When the UGC server writes a model's mesh with a new checksum it sends UGC_MODELS_MADE (a new master message, appended) to the master, which passes it to every world; a world with that model placed sends its players the new NIF checksum and NotifyClientUGCModelReady (game message 909, the blueprint id), so clients switch to the served mesh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -603,6 +603,15 @@ namespace GameMessages {
|
||||
return true;
|
||||
}
|
||||
|
||||
void NotifyClientUGCModelReady::Serialize(RakNet::BitStream& bitStream) const {
|
||||
bitStream.Write(blueprintID);
|
||||
}
|
||||
|
||||
bool NotifyClientUGCModelReady::Deserialize(RakNet::BitStream& bitStream) {
|
||||
VALIDATE_READ(bitStream.Read(blueprintID));
|
||||
return true;
|
||||
}
|
||||
|
||||
void UGObjectMetadata::Serialize(RakNet::BitStream& bitStream) const {
|
||||
bitStream.Write(userModelID);
|
||||
bitStream.Write(blueprintID);
|
||||
|
||||
@@ -242,6 +242,19 @@ namespace GameMessages {
|
||||
int32_t count{};
|
||||
};
|
||||
|
||||
// Server -> client, to a placed model. Its blueprint's files were made (again) on the UGC server: the client's
|
||||
// BlueprintComponent with that blueprint flushes its cached NIF, HKX and LXFML and requests the NIF and HKX again
|
||||
// (LWOBlueprintComponent::OnNotifyClientUGCModelReady, 0x00ca6430; the payload is the blueprint id only,
|
||||
// GameMessage::NotifyClientUGCIconReady::Serialize 0x00daae30 is shared with it). The client keeps using its
|
||||
// cached manifest entry, so the new checksum is sent first (UgcManifestResponse). See docs/UgcServer.md.
|
||||
struct NotifyClientUGCModelReady : public NetGameMsg {
|
||||
NotifyClientUGCModelReady() : NetGameMsg(MessageType::Game::NOTIFY_CLIENT_UGC_MODEL_READY) {}
|
||||
void Serialize(RakNet::BitStream& bitStream) const override;
|
||||
bool Deserialize(RakNet::BitStream& bitStream) override;
|
||||
|
||||
LWOOBJID blueprintID{};
|
||||
};
|
||||
|
||||
// A model's user generated data (UGObjectMetadata::Serialize, 0x00f5f590)
|
||||
struct UGObjectMetadata {
|
||||
LWOOBJID userModelID{};
|
||||
|
||||
Reference in New Issue
Block a user