mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-11-23 11:15:34 +08:00
add different versions for Steam_UGC::GetQueryUGCResult()
Steam_UGC::RequestUGCDetails()
to support old and new mod details struct after sdk 1.60
This commit is contained in:
parent
5b02ecb1cf
commit
a69a3639c5
@ -54,6 +54,13 @@ public ISteamUGC017,
|
||||
public ISteamUGC018,
|
||||
public ISteamUGC
|
||||
{
|
||||
public:
|
||||
enum class IUgcItfVersion : unsigned {
|
||||
v018, // sdk 1.59
|
||||
v020, // sdk 1.60
|
||||
};
|
||||
|
||||
private:
|
||||
constexpr static const char ugc_favorits_file[] = "favorites.txt";
|
||||
|
||||
class Settings *settings{};
|
||||
@ -76,12 +83,15 @@ public ISteamUGC
|
||||
|
||||
std::optional<std::vector<std::string>> get_query_ugc_tags(UGCQueryHandle_t handle, uint32 index);
|
||||
|
||||
void set_details(PublishedFileId_t id, SteamUGCDetails_t *pDetails);
|
||||
void set_details(PublishedFileId_t id, SteamUGCDetails_t *pDetails, IUgcItfVersion ver);
|
||||
|
||||
void read_ugc_favorites();
|
||||
|
||||
bool write_ugc_favorites();
|
||||
|
||||
bool internal_GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails, IUgcItfVersion ver );
|
||||
SteamAPICall_t internal_RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds, IUgcItfVersion ver );
|
||||
|
||||
public:
|
||||
Steam_UGC(class Settings *settings, class Ugc_Remote_Storage_Bridge *ugc_bridge, class Local_Storage *local_storage, class SteamCallResults *callback_results, class SteamCallBacks *callbacks);
|
||||
|
||||
@ -107,6 +117,8 @@ public:
|
||||
|
||||
// Retrieve an individual result after receiving the callback for querying UGC
|
||||
bool GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails );
|
||||
// before SDK v1.60
|
||||
bool GetQueryUGCResult_old( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails );
|
||||
|
||||
uint32 GetQueryUGCNumTags( UGCQueryHandle_t handle, uint32 index );
|
||||
|
||||
@ -200,6 +212,8 @@ public:
|
||||
|
||||
// DEPRECATED - Use CreateQueryUGCDetailsRequest call above instead!
|
||||
SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds );
|
||||
// before SDK v1.60
|
||||
SteamAPICall_t RequestUGCDetails_old( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds );
|
||||
|
||||
SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID );
|
||||
|
||||
|
18
dll/flat.cpp
18
dll/flat.cpp
@ -3675,14 +3675,7 @@ STEAMAPI_API SteamAPICall_t SteamAPI_ISteamUGC_SendQueryUGCRequest( ISteamUGC* s
|
||||
|
||||
STEAMAPI_API steam_bool SteamAPI_ISteamUGC_GetQueryUGCResult( ISteamUGC* self, UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t * pDetails )
|
||||
{
|
||||
long long client_vftable_distance = ((char *)self - (char*)get_steam_client()->steam_ugc);
|
||||
long long server_vftable_distance = ((char *)self - (char*)get_steam_client()->steam_gameserver_ugc);
|
||||
auto ptr = get_steam_client()->steam_gameserver_ugc;
|
||||
if (client_vftable_distance >= 0 && (server_vftable_distance < 0 || client_vftable_distance < server_vftable_distance)) {
|
||||
ptr = get_steam_client()->steam_ugc;
|
||||
}
|
||||
|
||||
return (ptr)->GetQueryUGCResult(handle, index, pDetails);
|
||||
return self->GetQueryUGCResult(handle, index, pDetails);
|
||||
}
|
||||
|
||||
STEAMAPI_API uint32 SteamAPI_ISteamUGC_GetQueryUGCNumTags( ISteamUGC* self, UGCQueryHandle_t handle, uint32 index )
|
||||
@ -4143,14 +4136,7 @@ STEAMAPI_API steam_bool SteamAPI_ISteamUGC_AddRequiredKeyValueTag( ISteamUGC* se
|
||||
|
||||
STEAMAPI_API SteamAPICall_t SteamAPI_ISteamUGC_RequestUGCDetails( ISteamUGC* self, PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds )
|
||||
{
|
||||
long long client_vftable_distance = ((char *)self - (char*)get_steam_client()->steam_ugc);
|
||||
long long server_vftable_distance = ((char *)self - (char*)get_steam_client()->steam_gameserver_ugc);
|
||||
auto ptr = get_steam_client()->steam_gameserver_ugc;
|
||||
if (client_vftable_distance >= 0 && (server_vftable_distance < 0 || client_vftable_distance < server_vftable_distance)) {
|
||||
ptr = get_steam_client()->steam_ugc;
|
||||
}
|
||||
|
||||
return (ptr)->RequestUGCDetails(nPublishedFileID, unMaxAgeSeconds);
|
||||
return self->RequestUGCDetails(nPublishedFileID, unMaxAgeSeconds);
|
||||
}
|
||||
|
||||
STEAMAPI_API SteamAPICall_t SteamAPI_ISteamUGC_CreateItem( ISteamUGC* self, AppId_t nConsumerAppId, EWorkshopFileType eFileType )
|
||||
|
@ -219,6 +219,7 @@ void Settings::addModDetails(PublishedFileId_t id, const Mod_entry &details)
|
||||
f->score = details.score;
|
||||
f->numChildren = details.numChildren;
|
||||
f->previewURL = details.previewURL;
|
||||
f->total_files_sizes = details.total_files_sizes;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ std::optional<std::vector<std::string>> Steam_UGC::get_query_ugc_tags(UGCQueryHa
|
||||
|
||||
}
|
||||
|
||||
void Steam_UGC::set_details(PublishedFileId_t id, SteamUGCDetails_t *pDetails)
|
||||
void Steam_UGC::set_details(PublishedFileId_t id, SteamUGCDetails_t *pDetails, IUgcItfVersion ver)
|
||||
{
|
||||
if (pDetails) {
|
||||
memset(pDetails, 0, sizeof(SteamUGCDetails_t));
|
||||
@ -106,8 +106,10 @@ void Steam_UGC::set_details(PublishedFileId_t id, SteamUGCDetails_t *pDetails)
|
||||
// TODO should we enable this?
|
||||
// pDetails->m_unNumChildren = mod.numChildren;
|
||||
|
||||
// TODO make sure the filesize is good
|
||||
pDetails->m_ulTotalFilesSize = mod.total_files_sizes;
|
||||
if (ver >= IUgcItfVersion::v020) {
|
||||
// TODO make sure the filesize is good
|
||||
pDetails->m_ulTotalFilesSize = mod.total_files_sizes;
|
||||
}
|
||||
} else {
|
||||
PRINT_DEBUG(" mod isn't installed, returning failure");
|
||||
pDetails->m_eResult = k_EResultFail;
|
||||
@ -151,6 +153,63 @@ bool Steam_UGC::write_ugc_favorites()
|
||||
return (size_t)stored == file_data.size();
|
||||
}
|
||||
|
||||
bool Steam_UGC::internal_GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails, IUgcItfVersion ver )
|
||||
{
|
||||
PRINT_DEBUG("%llu [%u] %p <%u>", handle, index, pDetails, (unsigned)ver);
|
||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||
|
||||
// some apps (like appid 588650) ignore the return of this function, especially for builtin mods
|
||||
if (pDetails) {
|
||||
pDetails->m_nPublishedFileId = k_PublishedFileIdInvalid;
|
||||
pDetails->m_eResult = k_EResultFail;
|
||||
pDetails->m_bAcceptedForUse = false;
|
||||
pDetails->m_hFile = k_UGCHandleInvalid;
|
||||
pDetails->m_hPreviewFile = k_UGCHandleInvalid;
|
||||
pDetails->m_unNumChildren = 0;
|
||||
}
|
||||
|
||||
if (handle == k_UGCQueryHandleInvalid) return false;
|
||||
|
||||
auto request = std::find_if(ugc_queries.begin(), ugc_queries.end(), [&handle](struct UGC_query const& item) { return item.handle == handle; });
|
||||
if (ugc_queries.end() == request) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (index >= request->results.size()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto it = request->results.begin();
|
||||
std::advance(it, index);
|
||||
PublishedFileId_t file_id = *it;
|
||||
set_details(file_id, pDetails, ver);
|
||||
return true;
|
||||
}
|
||||
|
||||
SteamAPICall_t Steam_UGC::internal_RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds, IUgcItfVersion ver )
|
||||
{
|
||||
PRINT_DEBUG("%llu %u <%u>", nPublishedFileID, unMaxAgeSeconds, (unsigned)ver);
|
||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||
|
||||
if (ver <= IUgcItfVersion::v018) { // <= SDK 1.59
|
||||
SteamUGCRequestUGCDetailsResult018_t data{};
|
||||
data.m_bCachedData = false;
|
||||
set_details(nPublishedFileID, reinterpret_cast<SteamUGCDetails_t *>(&data.m_details), ver);
|
||||
|
||||
auto ret = callback_results->addCallResult(data.k_iCallback, &data, sizeof(data));
|
||||
callbacks->addCBResult(data.k_iCallback, &data, sizeof(data));
|
||||
return ret;
|
||||
} else { // >= SDK 1.60
|
||||
SteamUGCRequestUGCDetailsResult_t data{};
|
||||
data.m_bCachedData = false;
|
||||
set_details(nPublishedFileID, &data.m_details, ver);
|
||||
|
||||
auto ret = callback_results->addCallResult(data.k_iCallback, &data, sizeof(data));
|
||||
callbacks->addCBResult(data.k_iCallback, &data, sizeof(data));
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Steam_UGC::Steam_UGC(class Settings *settings, class Ugc_Remote_Storage_Bridge *ugc_bridge, class Local_Storage *local_storage, class SteamCallResults *callback_results, class SteamCallBacks *callbacks)
|
||||
{
|
||||
@ -278,23 +337,13 @@ SteamAPICall_t Steam_UGC::SendQueryUGCRequest( UGCQueryHandle_t handle )
|
||||
bool Steam_UGC::GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails )
|
||||
{
|
||||
PRINT_DEBUG("%llu %u %p", handle, index, pDetails);
|
||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||
if (handle == k_UGCQueryHandleInvalid) return false;
|
||||
return internal_GetQueryUGCResult(handle, index, pDetails, IUgcItfVersion::v020);
|
||||
}
|
||||
|
||||
auto request = std::find_if(ugc_queries.begin(), ugc_queries.end(), [&handle](struct UGC_query const& item) { return item.handle == handle; });
|
||||
if (ugc_queries.end() == request) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (index >= request->results.size()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto it = request->results.begin();
|
||||
std::advance(it, index);
|
||||
PublishedFileId_t file_id = *it;
|
||||
set_details(file_id, pDetails);
|
||||
return true;
|
||||
bool Steam_UGC::GetQueryUGCResult_old( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails )
|
||||
{
|
||||
PRINT_DEBUG("%llu %u %p", handle, index, pDetails);
|
||||
return internal_GetQueryUGCResult(handle, index, pDetails, IUgcItfVersion::v018);
|
||||
}
|
||||
|
||||
std::optional<std::string> Steam_UGC::get_query_ugc_tag(UGCQueryHandle_t handle, uint32 index, uint32 indexTag)
|
||||
@ -841,20 +890,19 @@ bool Steam_UGC::SetTimeUpdatedDateRange( UGCQueryHandle_t handle, RTime32 rtStar
|
||||
SteamAPICall_t Steam_UGC::RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds )
|
||||
{
|
||||
PRINT_DEBUG("%llu", nPublishedFileID);
|
||||
std::lock_guard<std::recursive_mutex> lock(global_mutex);
|
||||
|
||||
SteamUGCRequestUGCDetailsResult_t data{};
|
||||
data.m_bCachedData = false;
|
||||
set_details(nPublishedFileID, &(data.m_details));
|
||||
auto ret = callback_results->addCallResult(data.k_iCallback, &data, sizeof(data));
|
||||
callbacks->addCBResult(data.k_iCallback, &data, sizeof(data));
|
||||
return ret;
|
||||
return internal_RequestUGCDetails(nPublishedFileID, unMaxAgeSeconds, IUgcItfVersion::v020);
|
||||
}
|
||||
|
||||
SteamAPICall_t Steam_UGC::RequestUGCDetails_old( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds )
|
||||
{
|
||||
PRINT_DEBUG("%llu", nPublishedFileID);
|
||||
return internal_RequestUGCDetails(nPublishedFileID, unMaxAgeSeconds, IUgcItfVersion::v018);
|
||||
}
|
||||
|
||||
SteamAPICall_t Steam_UGC::RequestUGCDetails( PublishedFileId_t nPublishedFileID )
|
||||
{
|
||||
PRINT_DEBUG("old");
|
||||
return RequestUGCDetails(nPublishedFileID, 0);
|
||||
return RequestUGCDetails_old(nPublishedFileID, 0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -15,7 +15,7 @@ public:
|
||||
|
||||
virtual SteamAPICall_t SendQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
|
||||
|
||||
virtual bool GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
virtual bool GetQueryUGCResult_old( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
|
||||
// Release the request to free up memory, after retrieving results
|
||||
virtual bool ReleaseQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
|
||||
|
@ -16,7 +16,7 @@ public:
|
||||
|
||||
virtual SteamAPICall_t SendQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
|
||||
|
||||
virtual bool GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
virtual bool GetQueryUGCResult_old( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
|
||||
// Release the request to free up memory, after retrieving results
|
||||
virtual bool ReleaseQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
|
||||
@ -34,7 +34,7 @@ public:
|
||||
virtual bool SetSearchText( UGCQueryHandle_t handle, const char *pSearchText ) = 0;
|
||||
virtual bool SetRankedByTrendDays( UGCQueryHandle_t handle, uint32 unDays ) = 0;
|
||||
|
||||
virtual SteamAPICall_t RequestUGCDetails(PublishedFileId_t nPublishedFileID, uint32 uUnk) = 0;
|
||||
virtual SteamAPICall_t RequestUGCDetails_old(PublishedFileId_t nPublishedFileID, uint32 uUnk) = 0;
|
||||
|
||||
|
||||
// Steam Workshop Creator API
|
||||
|
@ -20,7 +20,7 @@ public:
|
||||
virtual SteamAPICall_t SendQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
|
||||
|
||||
// Retrieve an individual result after receiving the callback for querying UGC
|
||||
virtual bool GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
virtual bool GetQueryUGCResult_old( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
|
||||
// Release the request to free up memory, after retrieving results
|
||||
virtual bool ReleaseQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
|
||||
@ -41,7 +41,7 @@ public:
|
||||
virtual bool SetRankedByTrendDays( UGCQueryHandle_t handle, uint32 unDays ) = 0;
|
||||
|
||||
// Request full details for one piece of UGC
|
||||
virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
virtual SteamAPICall_t RequestUGCDetails_old( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
|
||||
// Steam Workshop Creator API
|
||||
virtual SteamAPICall_t CreateItem( AppId_t nConsumerAppId, EWorkshopFileType eFileType ) = 0; // create new item for this app with no content attached yet
|
||||
|
@ -19,7 +19,7 @@ public:
|
||||
virtual SteamAPICall_t SendQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
|
||||
|
||||
// Retrieve an individual result after receiving the callback for querying UGC
|
||||
virtual bool GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
virtual bool GetQueryUGCResult_old( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
|
||||
// Release the request to free up memory, after retrieving results
|
||||
virtual bool ReleaseQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
|
||||
@ -40,7 +40,7 @@ public:
|
||||
virtual bool SetRankedByTrendDays( UGCQueryHandle_t handle, uint32 unDays ) = 0;
|
||||
|
||||
// Request full details for one piece of UGC
|
||||
virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
virtual SteamAPICall_t RequestUGCDetails_old( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
|
||||
// Steam Workshop Creator API
|
||||
virtual SteamAPICall_t CreateItem( AppId_t nConsumerAppId, EWorkshopFileType eFileType ) = 0; // create new item for this app with no content attached yet
|
||||
|
@ -20,7 +20,7 @@ public:
|
||||
virtual SteamAPICall_t SendQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
|
||||
|
||||
// Retrieve an individual result after receiving the callback for querying UGC
|
||||
virtual bool GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
virtual bool GetQueryUGCResult_old( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
|
||||
virtual bool GetQueryUGCPreviewURL( UGCQueryHandle_t handle, uint32 index, char *pchURL, uint32 cchURLSize ) = 0;
|
||||
virtual bool GetQueryUGCMetadata( UGCQueryHandle_t handle, uint32 index, char *pchMetadata, uint32 cchMetadatasize ) = 0;
|
||||
@ -52,7 +52,7 @@ public:
|
||||
virtual bool SetRankedByTrendDays( UGCQueryHandle_t handle, uint32 unDays ) = 0;
|
||||
|
||||
// Request full details for one piece of UGC
|
||||
virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
virtual SteamAPICall_t RequestUGCDetails_old( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
|
||||
// Steam Workshop Creator API
|
||||
virtual SteamAPICall_t CreateItem( AppId_t nConsumerAppId, EWorkshopFileType eFileType ) = 0; // create new item for this app with no content attached yet
|
||||
|
@ -21,7 +21,7 @@ public:
|
||||
virtual SteamAPICall_t SendQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
|
||||
|
||||
// Retrieve an individual result after receiving the callback for querying UGC
|
||||
virtual bool GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
virtual bool GetQueryUGCResult_old( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
|
||||
virtual bool GetQueryUGCPreviewURL( UGCQueryHandle_t handle, uint32 index, char *pchURL, uint32 cchURLSize ) = 0;
|
||||
virtual bool GetQueryUGCMetadata( UGCQueryHandle_t handle, uint32 index, char *pchMetadata, uint32 cchMetadatasize ) = 0;
|
||||
@ -54,7 +54,7 @@ public:
|
||||
virtual bool SetRankedByTrendDays( UGCQueryHandle_t handle, uint32 unDays ) = 0;
|
||||
|
||||
// Request full details for one piece of UGC
|
||||
virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
virtual SteamAPICall_t RequestUGCDetails_old( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
|
||||
// Steam Workshop Creator API
|
||||
virtual SteamAPICall_t CreateItem( AppId_t nConsumerAppId, EWorkshopFileType eFileType ) = 0; // create new item for this app with no content attached yet
|
||||
|
@ -20,7 +20,7 @@ public:
|
||||
virtual SteamAPICall_t SendQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
|
||||
|
||||
// Retrieve an individual result after receiving the callback for querying UGC
|
||||
virtual bool GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
virtual bool GetQueryUGCResult_old( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
|
||||
virtual bool GetQueryUGCPreviewURL( UGCQueryHandle_t handle, uint32 index, char *pchURL, uint32 cchURLSize ) = 0;
|
||||
virtual bool GetQueryUGCMetadata( UGCQueryHandle_t handle, uint32 index, char *pchMetadata, uint32 cchMetadatasize ) = 0;
|
||||
@ -59,7 +59,7 @@ public:
|
||||
virtual bool AddRequiredKeyValueTag( UGCQueryHandle_t handle, const char *pKey, const char *pValue ) = 0;
|
||||
|
||||
// Request full details for one piece of UGC
|
||||
virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
virtual SteamAPICall_t RequestUGCDetails_old( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
|
||||
// Steam Workshop Creator API
|
||||
virtual SteamAPICall_t CreateItem( AppId_t nConsumerAppId, EWorkshopFileType eFileType ) = 0; // create new item for this app with no content attached yet
|
||||
|
@ -21,7 +21,7 @@ public:
|
||||
virtual SteamAPICall_t SendQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
|
||||
|
||||
// Retrieve an individual result after receiving the callback for querying UGC
|
||||
virtual bool GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
virtual bool GetQueryUGCResult_old( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
|
||||
virtual bool GetQueryUGCPreviewURL( UGCQueryHandle_t handle, uint32 index, char *pchURL, uint32 cchURLSize ) = 0;
|
||||
virtual bool GetQueryUGCMetadata( UGCQueryHandle_t handle, uint32 index, char *pchMetadata, uint32 cchMetadatasize ) = 0;
|
||||
@ -59,7 +59,7 @@ public:
|
||||
virtual bool AddRequiredKeyValueTag( UGCQueryHandle_t handle, const char *pKey, const char *pValue ) = 0;
|
||||
|
||||
// Request full details for one piece of UGC
|
||||
virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
virtual SteamAPICall_t RequestUGCDetails_old( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
|
||||
// Steam Workshop Creator API
|
||||
virtual SteamAPICall_t CreateItem( AppId_t nConsumerAppId, EWorkshopFileType eFileType ) = 0; // create new item for this app with no content attached yet
|
||||
|
@ -20,7 +20,7 @@ public:
|
||||
virtual SteamAPICall_t SendQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
|
||||
|
||||
// Retrieve an individual result after receiving the callback for querying UGC
|
||||
virtual bool GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
virtual bool GetQueryUGCResult_old( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
|
||||
virtual bool GetQueryUGCPreviewURL( UGCQueryHandle_t handle, uint32 index, char *pchURL, uint32 cchURLSize ) = 0;
|
||||
virtual bool GetQueryUGCMetadata( UGCQueryHandle_t handle, uint32 index, char *pchMetadata, uint32 cchMetadatasize ) = 0;
|
||||
@ -59,7 +59,7 @@ public:
|
||||
virtual bool AddRequiredKeyValueTag( UGCQueryHandle_t handle, const char *pKey, const char *pValue ) = 0;
|
||||
|
||||
// Request full details for one piece of UGC
|
||||
virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
virtual SteamAPICall_t RequestUGCDetails_old( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
|
||||
// Steam Workshop Creator API
|
||||
virtual SteamAPICall_t CreateItem( AppId_t nConsumerAppId, EWorkshopFileType eFileType ) = 0; // create new item for this app with no content attached yet
|
||||
|
@ -23,7 +23,7 @@ public:
|
||||
virtual SteamAPICall_t SendQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
|
||||
|
||||
// Retrieve an individual result after receiving the callback for querying UGC
|
||||
virtual bool GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
virtual bool GetQueryUGCResult_old( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
virtual bool GetQueryUGCPreviewURL( UGCQueryHandle_t handle, uint32 index, STEAM_OUT_STRING_COUNT(cchURLSize) char *pchURL, uint32 cchURLSize ) = 0;
|
||||
virtual bool GetQueryUGCMetadata( UGCQueryHandle_t handle, uint32 index, STEAM_OUT_STRING_COUNT(cchMetadatasize) char *pchMetadata, uint32 cchMetadatasize ) = 0;
|
||||
virtual bool GetQueryUGCChildren( UGCQueryHandle_t handle, uint32 index, PublishedFileId_t* pvecPublishedFileID, uint32 cMaxEntries ) = 0;
|
||||
@ -60,7 +60,7 @@ public:
|
||||
virtual bool AddRequiredKeyValueTag( UGCQueryHandle_t handle, const char *pKey, const char *pValue ) = 0;
|
||||
|
||||
// DEPRECATED - Use CreateQueryUGCDetailsRequest call above instead!
|
||||
virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
virtual SteamAPICall_t RequestUGCDetails_old( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
|
||||
// Steam Workshop Creator API
|
||||
STEAM_CALL_RESULT( CreateItemResult_t )
|
||||
|
@ -25,7 +25,7 @@ public:
|
||||
virtual SteamAPICall_t SendQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
|
||||
|
||||
// Retrieve an individual result after receiving the callback for querying UGC
|
||||
virtual bool GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
virtual bool GetQueryUGCResult_old( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
virtual bool GetQueryUGCPreviewURL( UGCQueryHandle_t handle, uint32 index, STEAM_OUT_STRING_COUNT(cchURLSize) char *pchURL, uint32 cchURLSize ) = 0;
|
||||
virtual bool GetQueryUGCMetadata( UGCQueryHandle_t handle, uint32 index, STEAM_OUT_STRING_COUNT(cchMetadatasize) char *pchMetadata, uint32 cchMetadatasize ) = 0;
|
||||
virtual bool GetQueryUGCChildren( UGCQueryHandle_t handle, uint32 index, PublishedFileId_t* pvecPublishedFileID, uint32 cMaxEntries ) = 0;
|
||||
@ -62,7 +62,7 @@ public:
|
||||
virtual bool AddRequiredKeyValueTag( UGCQueryHandle_t handle, const char *pKey, const char *pValue ) = 0;
|
||||
|
||||
// DEPRECATED - Use CreateQueryUGCDetailsRequest call above instead!
|
||||
virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
virtual SteamAPICall_t RequestUGCDetails_old( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
|
||||
// Steam Workshop Creator API
|
||||
STEAM_CALL_RESULT( CreateItemResult_t )
|
||||
|
@ -26,7 +26,7 @@ public:
|
||||
virtual SteamAPICall_t SendQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
|
||||
|
||||
// Retrieve an individual result after receiving the callback for querying UGC
|
||||
virtual bool GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
virtual bool GetQueryUGCResult_old( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
virtual bool GetQueryUGCPreviewURL( UGCQueryHandle_t handle, uint32 index, STEAM_OUT_STRING_COUNT(cchURLSize) char *pchURL, uint32 cchURLSize ) = 0;
|
||||
virtual bool GetQueryUGCMetadata( UGCQueryHandle_t handle, uint32 index, STEAM_OUT_STRING_COUNT(cchMetadatasize) char *pchMetadata, uint32 cchMetadatasize ) = 0;
|
||||
virtual bool GetQueryUGCChildren( UGCQueryHandle_t handle, uint32 index, PublishedFileId_t* pvecPublishedFileID, uint32 cMaxEntries ) = 0;
|
||||
@ -63,7 +63,7 @@ public:
|
||||
virtual bool AddRequiredKeyValueTag( UGCQueryHandle_t handle, const char *pKey, const char *pValue ) = 0;
|
||||
|
||||
// DEPRECATED - Use CreateQueryUGCDetailsRequest call above instead!
|
||||
virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
virtual SteamAPICall_t RequestUGCDetails_old( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
|
||||
// Steam Workshop Creator API
|
||||
STEAM_CALL_RESULT( CreateItemResult_t )
|
||||
|
@ -25,7 +25,7 @@ public:
|
||||
virtual SteamAPICall_t SendQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
|
||||
|
||||
// Retrieve an individual result after receiving the callback for querying UGC
|
||||
virtual bool GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
virtual bool GetQueryUGCResult_old( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
virtual bool GetQueryUGCPreviewURL( UGCQueryHandle_t handle, uint32 index, STEAM_OUT_STRING_COUNT(cchURLSize) char *pchURL, uint32 cchURLSize ) = 0;
|
||||
virtual bool GetQueryUGCMetadata( UGCQueryHandle_t handle, uint32 index, STEAM_OUT_STRING_COUNT(cchMetadatasize) char *pchMetadata, uint32 cchMetadatasize ) = 0;
|
||||
virtual bool GetQueryUGCChildren( UGCQueryHandle_t handle, uint32 index, PublishedFileId_t* pvecPublishedFileID, uint32 cMaxEntries ) = 0;
|
||||
@ -64,7 +64,7 @@ public:
|
||||
virtual bool AddRequiredKeyValueTag( UGCQueryHandle_t handle, const char *pKey, const char *pValue ) = 0;
|
||||
|
||||
// DEPRECATED - Use CreateQueryUGCDetailsRequest call above instead!
|
||||
virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
virtual SteamAPICall_t RequestUGCDetails_old( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
|
||||
// Steam Workshop Creator API
|
||||
STEAM_CALL_RESULT( CreateItemResult_t )
|
||||
|
@ -28,7 +28,7 @@ public:
|
||||
virtual SteamAPICall_t SendQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
|
||||
|
||||
// Retrieve an individual result after receiving the callback for querying UGC
|
||||
virtual bool GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
virtual bool GetQueryUGCResult_old( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
virtual bool GetQueryUGCPreviewURL( UGCQueryHandle_t handle, uint32 index, STEAM_OUT_STRING_COUNT(cchURLSize) char *pchURL, uint32 cchURLSize ) = 0;
|
||||
virtual bool GetQueryUGCMetadata( UGCQueryHandle_t handle, uint32 index, STEAM_OUT_STRING_COUNT(cchMetadatasize) char *pchMetadata, uint32 cchMetadatasize ) = 0;
|
||||
virtual bool GetQueryUGCChildren( UGCQueryHandle_t handle, uint32 index, PublishedFileId_t* pvecPublishedFileID, uint32 cMaxEntries ) = 0;
|
||||
@ -72,7 +72,7 @@ public:
|
||||
|
||||
// DEPRECATED - Use CreateQueryUGCDetailsRequest call above instead!
|
||||
STEAM_CALL_RESULT( SteamUGCRequestUGCDetailsResult_t )
|
||||
virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
virtual SteamAPICall_t RequestUGCDetails_old( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
|
||||
// Steam Workshop Creator API
|
||||
STEAM_CALL_RESULT( CreateItemResult_t )
|
||||
|
@ -28,7 +28,7 @@ public:
|
||||
virtual SteamAPICall_t SendQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
|
||||
|
||||
// Retrieve an individual result after receiving the callback for querying UGC
|
||||
virtual bool GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
virtual bool GetQueryUGCResult_old( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
virtual uint32 GetQueryUGCNumTags( UGCQueryHandle_t handle, uint32 index ) = 0;
|
||||
virtual bool GetQueryUGCTag( UGCQueryHandle_t handle, uint32 index, uint32 indexTag, STEAM_OUT_STRING_COUNT( cchValueSize ) char* pchValue, uint32 cchValueSize ) = 0;
|
||||
virtual bool GetQueryUGCTagDisplayName( UGCQueryHandle_t handle, uint32 index, uint32 indexTag, STEAM_OUT_STRING_COUNT( cchValueSize ) char* pchValue, uint32 cchValueSize ) = 0;
|
||||
@ -74,7 +74,7 @@ public:
|
||||
|
||||
// DEPRECATED - Use CreateQueryUGCDetailsRequest call above instead!
|
||||
STEAM_CALL_RESULT( SteamUGCRequestUGCDetailsResult_t )
|
||||
virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
virtual SteamAPICall_t RequestUGCDetails_old( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
|
||||
// Steam Workshop Creator API
|
||||
STEAM_CALL_RESULT( CreateItemResult_t )
|
||||
|
@ -27,7 +27,7 @@ public:
|
||||
virtual SteamAPICall_t SendQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
|
||||
|
||||
// Retrieve an individual result after receiving the callback for querying UGC
|
||||
virtual bool GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
virtual bool GetQueryUGCResult_old( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
virtual uint32 GetQueryUGCNumTags( UGCQueryHandle_t handle, uint32 index ) = 0;
|
||||
virtual bool GetQueryUGCTag( UGCQueryHandle_t handle, uint32 index, uint32 indexTag, STEAM_OUT_STRING_COUNT( cchValueSize ) char* pchValue, uint32 cchValueSize ) = 0;
|
||||
virtual bool GetQueryUGCTagDisplayName( UGCQueryHandle_t handle, uint32 index, uint32 indexTag, STEAM_OUT_STRING_COUNT( cchValueSize ) char* pchValue, uint32 cchValueSize ) = 0;
|
||||
@ -75,7 +75,7 @@ public:
|
||||
|
||||
// DEPRECATED - Use CreateQueryUGCDetailsRequest call above instead!
|
||||
STEAM_CALL_RESULT( SteamUGCRequestUGCDetailsResult_t )
|
||||
virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
virtual SteamAPICall_t RequestUGCDetails_old( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
|
||||
// Steam Workshop Creator API
|
||||
STEAM_CALL_RESULT( CreateItemResult_t )
|
||||
|
@ -28,7 +28,7 @@ public:
|
||||
virtual SteamAPICall_t SendQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
|
||||
|
||||
// Retrieve an individual result after receiving the callback for querying UGC
|
||||
virtual bool GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
virtual bool GetQueryUGCResult_old( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
virtual uint32 GetQueryUGCNumTags( UGCQueryHandle_t handle, uint32 index ) = 0;
|
||||
virtual bool GetQueryUGCTag( UGCQueryHandle_t handle, uint32 index, uint32 indexTag, STEAM_OUT_STRING_COUNT( cchValueSize ) char* pchValue, uint32 cchValueSize ) = 0;
|
||||
virtual bool GetQueryUGCTagDisplayName( UGCQueryHandle_t handle, uint32 index, uint32 indexTag, STEAM_OUT_STRING_COUNT( cchValueSize ) char* pchValue, uint32 cchValueSize ) = 0;
|
||||
@ -78,7 +78,7 @@ public:
|
||||
|
||||
// DEPRECATED - Use CreateQueryUGCDetailsRequest call above instead!
|
||||
STEAM_CALL_RESULT( SteamUGCRequestUGCDetailsResult_t )
|
||||
virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
virtual SteamAPICall_t RequestUGCDetails_old( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
|
||||
// Steam Workshop Creator API
|
||||
STEAM_CALL_RESULT( CreateItemResult_t )
|
||||
|
@ -5,6 +5,48 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
// Details for a single published file/UGC, up until interface v018
|
||||
struct SteamUGCDetails018_t
|
||||
{
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
EResult m_eResult; // The result of the operation.
|
||||
EWorkshopFileType m_eFileType; // Type of the file
|
||||
AppId_t m_nCreatorAppID; // ID of the app that created this file.
|
||||
AppId_t m_nConsumerAppID; // ID of the app that will consume this file.
|
||||
char m_rgchTitle[k_cchPublishedDocumentTitleMax]; // title of document
|
||||
char m_rgchDescription[k_cchPublishedDocumentDescriptionMax]; // description of document
|
||||
uint64 m_ulSteamIDOwner; // Steam ID of the user who created this content.
|
||||
uint32 m_rtimeCreated; // time when the published file was created
|
||||
uint32 m_rtimeUpdated; // time when the published file was last updated
|
||||
uint32 m_rtimeAddedToUserList; // time when the user added the published file to their list (not always applicable)
|
||||
ERemoteStoragePublishedFileVisibility m_eVisibility; // visibility
|
||||
bool m_bBanned; // whether the file was banned
|
||||
bool m_bAcceptedForUse; // developer has specifically flagged this item as accepted in the Workshop
|
||||
bool m_bTagsTruncated; // whether the list of tags was too long to be returned in the provided buffer
|
||||
char m_rgchTags[k_cchTagListMax]; // comma separated list of all tags associated with this file
|
||||
// file/url information
|
||||
UGCHandle_t m_hFile; // The handle of the primary file
|
||||
UGCHandle_t m_hPreviewFile; // The handle of the preview file
|
||||
char m_pchFileName[k_cchFilenameMax]; // The cloud filename of the primary file
|
||||
int32 m_nFileSize; // Size of the primary file
|
||||
int32 m_nPreviewFileSize; // Size of the preview file
|
||||
char m_rgchURL[k_cchPublishedFileURLMax]; // URL (for a video or a website)
|
||||
// voting information
|
||||
uint32 m_unVotesUp; // number of votes up
|
||||
uint32 m_unVotesDown; // number of votes down
|
||||
float m_flScore; // calculated score
|
||||
// collection details
|
||||
uint32 m_unNumChildren;
|
||||
};
|
||||
|
||||
struct SteamUGCRequestUGCDetailsResult018_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 2 };
|
||||
SteamUGCDetails018_t m_details;
|
||||
bool m_bCachedData; // indicates whether this data was retrieved from the local on-disk cache
|
||||
};
|
||||
|
||||
|
||||
class ISteamUGC018
|
||||
{
|
||||
public:
|
||||
@ -28,7 +70,7 @@ public:
|
||||
virtual SteamAPICall_t SendQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
|
||||
|
||||
// Retrieve an individual result after receiving the callback for querying UGC
|
||||
virtual bool GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
virtual bool GetQueryUGCResult_old( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
|
||||
virtual uint32 GetQueryUGCNumTags( UGCQueryHandle_t handle, uint32 index ) = 0;
|
||||
virtual bool GetQueryUGCTag( UGCQueryHandle_t handle, uint32 index, uint32 indexTag, STEAM_OUT_STRING_COUNT( cchValueSize ) char* pchValue, uint32 cchValueSize ) = 0;
|
||||
virtual bool GetQueryUGCTagDisplayName( UGCQueryHandle_t handle, uint32 index, uint32 indexTag, STEAM_OUT_STRING_COUNT( cchValueSize ) char* pchValue, uint32 cchValueSize ) = 0;
|
||||
@ -78,7 +120,7 @@ public:
|
||||
|
||||
// DEPRECATED - Use CreateQueryUGCDetailsRequest call above instead!
|
||||
STEAM_CALL_RESULT( SteamUGCRequestUGCDetailsResult_t )
|
||||
virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
virtual SteamAPICall_t RequestUGCDetails_old( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
|
||||
// Steam Workshop Creator API
|
||||
STEAM_CALL_RESULT( CreateItemResult_t )
|
||||
|
Loading…
Reference in New Issue
Block a user