mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
feat(ugc): when each creation was made and how long it took, on the UGC page
The UGC server records how long each successful make took (process_ms on ugc and ugc_modular_build; migrations sqlite 73, mysql 90). The UGC page shows it with the time it was made: in the models list's Made column (sortable, slowest first), in the tiles' tooltips, in the item preview and in an assembly's References. The gallery can sort by slowest to make too. Makes from before this are shown without a duration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -432,6 +432,8 @@ public:
|
||||
void SetUgcFileChecksum(const eFileOwner owner, const LWOOBJID storageId, const std::string_view file, const std::string_view md5, const uint32_t size) override;
|
||||
std::optional<IUgc::FileChecksum> GetUgcFileChecksum(const LWOOBJID blueprintId, const std::string_view file) override;
|
||||
void SetModularBuildCombination(const LWOOBJID id, const LWOOBJID combinationId) override;
|
||||
void SetUgcModelProcessMs(const LWOOBJID id, const uint32_t milliseconds) override;
|
||||
void SetModularBuildProcessMs(const LWOOBJID id, const uint32_t milliseconds) override;
|
||||
std::vector<IUgcModularBuild::PendingBuild> GetModularBuildsWithoutCombination(const uint32_t limit) override;
|
||||
std::optional<IUgc::ProcessInfo> GetUgcProcessInfo(const LWOOBJID id) override;
|
||||
uint64_t ResetUgcModelProcessing(const std::optional<LWOOBJID> id, const bool failedOnly) override;
|
||||
|
||||
@@ -194,3 +194,7 @@ std::optional<IUgc::FileChecksum> MySQLDatabase::GetUgcFileChecksum(const LWOOBJ
|
||||
if (!result->next()) return std::nullopt;
|
||||
return IUgc::FileChecksum{ std::string(result->getString("md5").c_str()), static_cast<uint32_t>(result->getUInt("size")) };
|
||||
}
|
||||
|
||||
void MySQLDatabase::SetUgcModelProcessMs(const LWOOBJID id, const uint32_t milliseconds) {
|
||||
ExecuteUpdate("UPDATE ugc SET process_ms = ? WHERE id = ?;", milliseconds, id);
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace {
|
||||
entry.bakeAo = result->getInt("bake_ao") != 0;
|
||||
entry.bricks = static_cast<uint32_t>(result->getInt64("brick_count"));
|
||||
entry.triangles = static_cast<uint32_t>(result->getInt64("triangle_count"));
|
||||
entry.processMs = static_cast<uint32_t>(result->getInt64("process_ms"));
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,3 +119,7 @@ std::vector<IUgcModularBuild::PendingBuild> MySQLDatabase::GetModularBuildsWitho
|
||||
}
|
||||
return builds;
|
||||
}
|
||||
|
||||
void MySQLDatabase::SetModularBuildProcessMs(const LWOOBJID id, const uint32_t milliseconds) {
|
||||
ExecuteUpdate("UPDATE ugc_modular_build SET process_ms = ? WHERE ugc_id = ?;", milliseconds, id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user