mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 02:43:44 +00:00
fix(ugc): served models keep the served mesh; physics from the LXFML sent for the HKX
Sending every model's LXFML at property load and then switching to the served mesh (served checksum, NotifyClientUGCModelReady, the model constructed again) left the client drawing its own build. Now made models' LXFML is left out of the property load again: the client downloads and draws the served mesh, and when it asks for the HKX it gets the LXFML, builds the model and loads its own HKX, so the model has collision while the mesh drawn stays the served one. The load-time switch is removed; the switch for a model made again while players are there stays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1033,8 +1033,8 @@ void LoadPlayer(const SystemAddress& sysAddr) {
|
||||
}
|
||||
|
||||
// The models' LXFML, for the client to build each model's NIF and HKX itself. With ugc_manifest_models
|
||||
// the models whose mesh the UGC server made are then switched to the served mesh, keeping the client's
|
||||
// own physics (UgcManifest, docs/UgcServer.md).
|
||||
// the models whose mesh the UGC server made are left out: the client downloads their mesh, and gets the
|
||||
// LXFML (for its physics) when it asks for the HKX (UgcManifest, docs/UgcServer.md).
|
||||
|
||||
auto bbbModels = Database::Get()->GetUgcModels(propertyId);
|
||||
if (bbbModels.empty()) {
|
||||
@@ -1047,7 +1047,11 @@ void LoadPlayer(const SystemAddress& sysAddr) {
|
||||
response.reasonCode = eBlueprintSaveResponseType::EverythingWorked;
|
||||
size_t served = 0;
|
||||
for (auto& bbbModel : bbbModels) {
|
||||
if (UgcManifest::ScheduleServedMesh(sysAddr, bbbModel.id)) served++;
|
||||
// Its served mesh is downloaded; its LXFML is sent when the client asks for the HKX (UgcManifest)
|
||||
if (UgcManifest::ServesMesh(bbbModel.id)) {
|
||||
served++;
|
||||
continue;
|
||||
}
|
||||
LOG("Getting lxfml ugcID: %llu", bbbModel.id);
|
||||
|
||||
bbbModel.lxfmlData.seekg(0, std::ios::end);
|
||||
@@ -1059,7 +1063,7 @@ void LoadPlayer(const SystemAddress& sysAddr) {
|
||||
model.blueprintId = bbbModel.id;
|
||||
model.data = bbbModel.lxfmlData.str().substr(0, lxfmlSize);
|
||||
}
|
||||
if (served > 0) LOG("%zu of the property's %zu models get their mesh from the UGC server once built", served, bbbModels.size());
|
||||
if (served > 0) LOG("%zu of the property's %zu models come from the UGC server", served, bbbModels.size());
|
||||
if (!response.models.empty()) response.Send(sysAddr);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user