mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2025-03-28 14:56:24 +01:00

* edits by Kola124 + other changes in the settings parser * random ugc mod handle at object creation * file size using std::filesystem + fix warnings + some print + arg validation
33 lines
1,009 B
C++
33 lines
1,009 B
C++
#include "dll/ugc_remote_storage_bridge.h"
|
|
|
|
|
|
void Ugc_Remote_Storage_Bridge::add_ugc_query_result(UGCHandle_t file_handle, PublishedFileId_t fileid, bool handle_of_primary_file)
|
|
{
|
|
std::lock_guard lock(global_mutex);
|
|
|
|
steam_ugc_queries[file_handle].mod_id = fileid;
|
|
steam_ugc_queries[file_handle].is_primary_file = handle_of_primary_file;
|
|
}
|
|
|
|
bool Ugc_Remote_Storage_Bridge::remove_ugc_query_result(UGCHandle_t file_handle)
|
|
{
|
|
std::lock_guard lock(global_mutex);
|
|
|
|
return !!steam_ugc_queries.erase(file_handle);
|
|
}
|
|
|
|
std::optional<Ugc_Remote_Storage_Bridge::QueryInfo> Ugc_Remote_Storage_Bridge::get_ugc_query_result(UGCHandle_t file_handle)
|
|
{
|
|
std::lock_guard lock(global_mutex);
|
|
|
|
auto it = steam_ugc_queries.find(file_handle);
|
|
if (steam_ugc_queries.end() == it) return std::nullopt;
|
|
return it->second;
|
|
}
|
|
|
|
Ugc_Remote_Storage_Bridge::~Ugc_Remote_Storage_Bridge()
|
|
{
|
|
std::lock_guard lock(global_mutex);
|
|
|
|
steam_ugc_queries.clear();
|
|
}
|