mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-26 22:52:47 +00:00
feat(ugc): processing options per make, recorded per model with their times
Staff can make models again with other processing options than the UGC
settings' (ray backend, hidden-face method, denoising) and every make records
what made it, for comparing the options.
- migration mysql 99 / sqlite 82 (ugc_process_options): ugc.process_options
(picked for the next make, cleared once made), ugc.made_options (what made
the current files) and ugc_process_runs (every successful make: options,
wall and CPU time, hidden faces', occlusion's and icon's time, bricks,
triangles before and after)
- IUgc: ResetUgcModelProcessing and ResetPropertyUgcModelProcessing take the
options; PendingModel carries them; RecordUgcModelRun, GetUgcRunSummaries;
list entries have madeOptions and processOptions
- the UGC server applies a job's options over its settings and records the run
- /api/ugc/reprocess takes options ("embree fast oidn"); /api/ugc/options
lists the choices, the settings' defaults and averages per combination
- /reprocessproperty [builtin|embree|hiprt] [toolbox|fast] [off|oidn], any
order, all optional
Check: run the migration on MySQL and SQLite; /reprocessproperty embree fast
on a property, then the models' made_options and ugc_process_runs rows;
/api/ugc/options.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -497,7 +497,7 @@ void SlashCommandHandler::Startup() {
|
||||
|
||||
Command ReprocessPropertyCommand{
|
||||
.help = "Make this property's models again and reload it",
|
||||
.info = "The UGC server makes every model placed on the property you are on again (with the current UGC settings). Once they are made, everyone on the property is sent back into it, so their game loads the new meshes",
|
||||
.info = "The UGC server makes every model placed on the property you are on again, with the current UGC settings or the processing options given (in any order: builtin, embree or hiprt; toolbox or fast; off or oidn). Once they are made, everyone on the property is sent back into it, so their game loads the new meshes",
|
||||
.aliases = { "reprocessproperty", "reloadpropertymodels" },
|
||||
.handle = DEVGMCommands::ReprocessProperty,
|
||||
.requiredLevel = eGameMasterLevel::DEVELOPER
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "DEVGMCommands.h"
|
||||
|
||||
#include "UgcKeys.h"
|
||||
#include "UgcManifest.h"
|
||||
#include "PropertyManagementComponent.h"
|
||||
#include "MasterPackets.h"
|
||||
@@ -1989,12 +1990,19 @@ namespace DEVGMCommands {
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"You aren't on a property.");
|
||||
return;
|
||||
}
|
||||
const auto queued = UgcManifest::ReprocessProperty(property->GetId());
|
||||
// Optional processing options for this make: ray backend, hidden-face method, denoising, in any order
|
||||
UgcProcessOptions::Choice choice;
|
||||
if (!UgcProcessOptions::Parse(args, choice)) {
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Usage: /reprocessproperty [builtin|embree|hiprt] [toolbox|fast] [off|oidn] (left out: the UGC settings')");
|
||||
return;
|
||||
}
|
||||
const auto options = UgcProcessOptions::ToString(choice);
|
||||
const auto queued = UgcManifest::ReprocessProperty(property->GetId(), options);
|
||||
if (queued == 0) {
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"This property has no brick built models.");
|
||||
return;
|
||||
}
|
||||
ChatPackets::SendSystemMessage(sysAddr, GeneralUtils::UTF8ToUTF16("Making " + std::to_string(queued) +
|
||||
" model(s) again. Everyone on the property is reloaded when they're made."));
|
||||
ChatPackets::SendSystemMessage(sysAddr, GeneralUtils::UTF8ToUTF16("Making " + std::to_string(queued) + " model(s) again" +
|
||||
(options.empty() ? "" : " with " + options) + ". Everyone on the property is reloaded when they're made."));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -346,16 +346,17 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
size_t UgcManifest::ReprocessProperty(const LWOOBJID propertyId) {
|
||||
size_t UgcManifest::ReprocessProperty(const LWOOBJID propertyId, const std::string& options) {
|
||||
std::set<LWOOBJID> blueprintIds;
|
||||
for (const auto& model : Database::Get()->GetPropertyModels(propertyId)) {
|
||||
if (model.ugcId != 0) blueprintIds.insert(model.ugcId);
|
||||
}
|
||||
if (blueprintIds.empty()) return 0;
|
||||
Database::Get()->ResetPropertyUgcModelProcessing(propertyId);
|
||||
Database::Get()->ResetPropertyUgcModelProcessing(propertyId, options);
|
||||
const auto now = std::chrono::steady_clock::now();
|
||||
g_PropertyReload = PropertyReload{ std::move(blueprintIds), now, now + RETRY_INTERVAL };
|
||||
LOG("Making the %zu models of property %llu again; players are reloaded when they're made", g_PropertyReload->blueprintIds.size(), static_cast<unsigned long long>(propertyId));
|
||||
LOG("Making the %zu models of property %llu again%s; players are reloaded when they're made", g_PropertyReload->blueprintIds.size(), static_cast<unsigned long long>(propertyId),
|
||||
options.empty() ? "" : (" with " + options).c_str());
|
||||
return g_PropertyReload->blueprintIds.size();
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,8 @@ namespace UgcManifest {
|
||||
// /reprocessproperty: every model placed on the property is made again by the UGC server; once none is waiting
|
||||
// (or after 15 minutes), every player in this world is sent the new mesh checksums and transferred back into it,
|
||||
// so their client loads the property again with the new meshes. Returns how many models were queued.
|
||||
size_t ReprocessProperty(LWOOBJID propertyId);
|
||||
// `options`: the processing options for this make (UgcProcessOptions, e.g. "embree fast"), empty: the UGC settings'
|
||||
size_t ReprocessProperty(LWOOBJID propertyId, const std::string& options = "");
|
||||
|
||||
// A client left (or went back to character select): its waiting requests and pending switches are dropped
|
||||
void OnDisconnect(const SystemAddress& sysAddr);
|
||||
|
||||
Reference in New Issue
Block a user