#ifndef IUGCMODULARBUILD_H #define IUGCMODULARBUILD_H #include #include #include #include #include "IUgc.h" class IUgcModularBuild { public: virtual void InsertUgcBuild(const std::string& modules, const LWOOBJID bigId, const std::optional characterId) = 0; virtual void DeleteUgcBuild(const LWOOBJID bigId) = 0; // ---- Icons made by the UGC server; the same columns and meanings as IUgc's processing ---- // A modular build waiting for its icon: its id, modules (ldf_config) and the attempts so far struct PendingBuild { LWOOBJID id{}; std::string modules; uint32_t attempts{}; }; virtual std::vector GetModularBuildsToProcess(const uint32_t limit) = 0; virtual void SetModularBuildProcessed(const LWOOBJID id, const IUgc::eProcessState state, const uint32_t attempts, const std::string_view error) = 0; virtual std::optional GetModularBuildProcessInfo(const LWOOBJID id) = 0; virtual uint64_t ResetModularBuildProcessing(const std::optional id, const bool failedOnly) = 0; virtual std::vector GetModularBuildProcessList(const std::optional state, const std::string_view search, const uint32_t offset, const uint32_t limit) = 0; virtual std::vector> GetModularBuildProcessCounts() = 0; // The combination of modules a build was made as (UgcModularKey::StorageId of its modules), whose files it shares virtual void SetModularBuildCombination(const LWOOBJID id, const LWOOBJID combinationId) = 0; // How long the last successful make of a build's icon took (process_ms), for the dashboard virtual void SetModularBuildProcessMs(const LWOOBJID id, const uint32_t milliseconds) = 0; // Up to `limit` builds whose combination isn't recorded yet (combination_id 0): their ids and modules virtual std::vector GetModularBuildsWithoutCombination(const uint32_t limit) = 0; // How many builds there are of each ldf_config as stored (the same modules may be written differently) virtual std::vector> GetModularBuildConfigCounts() = 0; // Icon settings (UgcIconParams JSON) set on the dashboard for a target: "kind:" (a preset for player models or // a car or rocket build type), "model:" or "combo:" (one item's or combination's own) virtual std::optional GetUgcIconSettings(const std::string_view target) = 0; virtual void SetUgcIconSettings(const std::string_view target, const std::string_view params) = 0; virtual void DeleteUgcIconSettings(const std::string_view target) = 0; }; #endif //!IUGCMODULARBUILD_H