diff --git a/Source/SteamBridge/Private/Core/SteamApps.cpp b/Source/SteamBridge/Private/Core/SteamApps.cpp index 870b13d..5914d3a 100644 --- a/Source/SteamBridge/Private/Core/SteamApps.cpp +++ b/Source/SteamBridge/Private/Core/SteamApps.cpp @@ -26,10 +26,8 @@ bool USteamApps::BGetDLCDataByIndex(int32 DLC, int32& AppID, bool& bAvailable, F return false; } - uint32 Temp = 0; TArray TempStr; - bool bResult = SteamApps()->BGetDLCDataByIndex(DLC, &Temp, &bAvailable, TempStr.GetData(), MAX_int32); - AppID = Temp; + bool bResult = SteamApps()->BGetDLCDataByIndex(DLC, (uint32*)&AppID, &bAvailable, TempStr.GetData(), MAX_int32); Name = UTF8_TO_TCHAR(TempStr.GetData()); return bResult; } @@ -57,15 +55,6 @@ bool USteamApps::GetCurrentBetaName(FString& Name) return bResult; } -bool USteamApps::GetDlcDownloadProgress(int32 AppID, int64& BytesDownloaded, int64& BytesTotal) -{ - uint64 TempDownloaded = 0, TempTotal = 0; - bool bResult = SteamApps()->GetDlcDownloadProgress(AppID, &TempDownloaded, &TempTotal); - BytesDownloaded = TempDownloaded; - BytesTotal = TempTotal; - return bResult; -} - int32 USteamApps::GetLaunchCommandLine(FString& CommandLine) { TArray TempStr; diff --git a/Source/SteamBridge/Private/Core/SteamHTTP.cpp b/Source/SteamBridge/Private/Core/SteamHTTP.cpp index 6b633c4..1fa7250 100644 --- a/Source/SteamBridge/Private/Core/SteamHTTP.cpp +++ b/Source/SteamBridge/Private/Core/SteamHTTP.cpp @@ -20,34 +20,6 @@ USteamHTTP::~USteamHTTP() OnHTTPRequestHeadersReceivedCallback.Unregister(); } -bool USteamHTTP::GetHTTPResponseBodySize(FHTTPRequestHandle RequestHandle, int32& BodySize) -{ - uint32 Tmp = 0; - BodySize = Tmp; - return SteamHTTP()->GetHTTPResponseBodySize(RequestHandle, &Tmp); -} - -bool USteamHTTP::GetHTTPResponseHeaderSize(FHTTPRequestHandle RequestHandle, const FString& HeaderName, int32& ResponseHeaderSize) -{ - uint32 Tmp = 0; - ResponseHeaderSize = Tmp; - return SteamHTTP()->GetHTTPResponseHeaderSize(RequestHandle, TCHAR_TO_UTF8(*HeaderName), &Tmp); -} - -bool USteamHTTP::SendHTTPRequest(FHTTPRequestHandle RequestHandle, FSteamAPICall& CallHandle) -{ - SteamAPICall_t Tmp = 0; - CallHandle = Tmp; - return SteamHTTP()->SendHTTPRequest(RequestHandle, &Tmp); -} - -bool USteamHTTP::SendHTTPRequestAndStreamResponse(FHTTPRequestHandle RequestHandle, FSteamAPICall& CallHandle) -{ - SteamAPICall_t Tmp = 0; - CallHandle = Tmp; - return SteamHTTP()->SendHTTPRequestAndStreamResponse(RequestHandle, &Tmp); -} - void USteamHTTP::OnHTTPRequestCompleted(HTTPRequestCompleted_t* pParam) { m_OnHTTPRequestCompleted.Broadcast(pParam->m_hRequest, pParam->m_ulContextValue, pParam->m_bRequestSuccessful, (ESteamHTTPStatus::Type)pParam->m_eStatusCode, pParam->m_unBodySize); diff --git a/Source/SteamBridge/Private/Core/SteamInventory.cpp b/Source/SteamBridge/Private/Core/SteamInventory.cpp index b5bbe3e..ca407a0 100644 --- a/Source/SteamBridge/Private/Core/SteamInventory.cpp +++ b/Source/SteamBridge/Private/Core/SteamInventory.cpp @@ -112,14 +112,6 @@ bool USteamInventory::GetItemDefinitionIDs(TArray& Items) const return false; } -bool USteamInventory::GetItemPrice(FSteamItemDef ItemDef, int64& CurrentPrice, int64& BasePrice) const -{ - uint64 TmpCurrent = 0, TmpBase = 0; - CurrentPrice = TmpCurrent; - BasePrice = TmpBase; - return SteamInventory()->GetItemPrice(ItemDef, &TmpCurrent, &TmpBase); -} - bool USteamInventory::GetResultItemProperty(FSteamInventoryResult ResultHandle, int32 ItemIndex, const FString& PropertyName, FString& Value) const { TArray TmpStr; diff --git a/Source/SteamBridge/Private/Core/SteamMatchmaking.cpp b/Source/SteamBridge/Private/Core/SteamMatchmaking.cpp index e1b429c..42bc857 100644 --- a/Source/SteamBridge/Private/Core/SteamMatchmaking.cpp +++ b/Source/SteamBridge/Private/Core/SteamMatchmaking.cpp @@ -50,16 +50,10 @@ int32 USteamMatchmaking::AddFavoriteGame(int32 AppID, const FString& IP, int32 C bool USteamMatchmaking::GetFavoriteGame(int32 GameIndex, int32& AppID, FString& IP, int32& ConnPort, int32& QueryPort, TArray& Flags, int32& TimeLastPlayedOnServer) const { - uint32 TmpAppID = 0, TmpIP = 0, TmpFlags = 0, TmpTime = 0; - uint16 TmpConnPort = 0, TmpQueryPort = 0; + uint32 TmpIP = 0, TmpFlags = 0; - bool bResult = SteamMatchmaking()->GetFavoriteGame(GameIndex, &TmpAppID, &TmpIP, &TmpConnPort, &TmpQueryPort, &TmpFlags, &TmpTime); - - AppID = TmpAppID; + bool bResult = SteamMatchmaking()->GetFavoriteGame(GameIndex, (uint32*)&AppID, &TmpIP, (uint16*)&ConnPort, (uint16*)&QueryPort, &TmpFlags, (uint32*)&TimeLastPlayedOnServer); IP = USteamBridgeUtils::ConvertIPToString(TmpIP); - ConnPort = TmpConnPort; - QueryPort = TmpQueryPort; - TimeLastPlayedOnServer = TmpTime; for (int32 i = 0; i < 32; i++) { @@ -108,15 +102,8 @@ bool USteamMatchmaking::GetLobbyDataByIndex(FSteamID SteamIDLobby, int32 LobbyDa bool USteamMatchmaking::GetLobbyGameServer(FSteamID SteamIDLobby, FString& GameServerIP, int32& GameServerPort, FSteamID& SteamIDGameServer) const { uint32 TmpIP = 0; - uint16 TmpPort = 0; - CSteamID TmpSteamID; - - bool bResult = SteamMatchmaking()->GetLobbyGameServer(SteamIDLobby, &TmpIP, &TmpPort, &TmpSteamID); - + bool bResult = SteamMatchmaking()->GetLobbyGameServer(SteamIDLobby, &TmpIP, (uint16*)&GameServerPort, (CSteamID*)&SteamIDGameServer); GameServerIP = USteamBridgeUtils::ConvertIPToString(TmpIP); - GameServerPort = TmpPort; - SteamIDGameServer = TmpSteamID.ConvertToUint64(); - return bResult; } diff --git a/Source/SteamBridge/Private/Core/SteamParties.cpp b/Source/SteamBridge/Private/Core/SteamParties.cpp index 5cd4811..c36b9b3 100644 --- a/Source/SteamBridge/Private/Core/SteamParties.cpp +++ b/Source/SteamBridge/Private/Core/SteamParties.cpp @@ -24,14 +24,6 @@ USteamParties::~USteamParties() OnActiveBeaconsUpdatedCallback.Unregister(); } -bool USteamParties::GetNumAvailableBeaconLocations(int32& NumLocations) const -{ - uint32 TmpNum = 0; - bool bResult = SteamParties()->GetNumAvailableBeaconLocations(&TmpNum); - NumLocations = TmpNum; - return bResult; -} - bool USteamParties::GetAvailableBeaconLocations(TArray& LocationList) const { TArray TmpArray; diff --git a/Source/SteamBridge/Private/Core/SteamUser.cpp b/Source/SteamBridge/Private/Core/SteamUser.cpp index bc68a61..802b4d9 100644 --- a/Source/SteamBridge/Private/Core/SteamUser.cpp +++ b/Source/SteamBridge/Private/Core/SteamUser.cpp @@ -86,13 +86,13 @@ bool USteamUser::GetEncryptedAppTicket(TArray& Ticket) ESteamVoiceResult USteamUser::GetVoice(TArray& VoiceData) { - int32 tmpData = 0; - ESteamVoiceResult result = GetAvailableVoice(tmpData); + int32 TmpData = 0; + ESteamVoiceResult result = GetAvailableVoice(TmpData); if (result == ESteamVoiceResult::OK) { - VoiceData.SetNum(tmpData); - result = (ESteamVoiceResult)SteamUser()->GetVoice(true, VoiceData.GetData(), VoiceData.Num(), (uint32*)&tmpData); - VoiceData.SetNum(tmpData); + VoiceData.SetNum(TmpData); + result = (ESteamVoiceResult)SteamUser()->GetVoice(true, VoiceData.GetData(), VoiceData.Num(), (uint32*)&TmpData); + VoiceData.SetNum(TmpData); } return result; } diff --git a/Source/SteamBridge/Private/Core/SteamUserStats.cpp b/Source/SteamBridge/Private/Core/SteamUserStats.cpp index d3d12ae..3c54c53 100644 --- a/Source/SteamBridge/Private/Core/SteamUserStats.cpp +++ b/Source/SteamBridge/Private/Core/SteamUserStats.cpp @@ -46,30 +46,6 @@ FSteamAPICall USteamUserStats::FindOrCreateLeaderboard(const FString& Leaderboar return SteamUserStats()->FindOrCreateLeaderboard(TCHAR_TO_UTF8(*LeaderboardName), (ELeaderboardSortMethod)LeaderboardSortMethod, (ELeaderboardDisplayType)LeaderboardDisplayType); } -bool USteamUserStats::GetAchievementAndUnlockTime(const FString& Name, bool& bAchieved, int32& UnlockTime) const -{ - uint32 TmpTime = 0; - bool bResult = SteamUserStats()->GetAchievementAndUnlockTime(TCHAR_TO_UTF8(*Name), &bAchieved, &TmpTime); - UnlockTime = TmpTime; - return bResult; -} - -bool USteamUserStats::GetGlobalStatFloat(const FString& StatName, float& Data) const -{ - double TmpData = 0; - bool bResult = SteamUserStats()->GetGlobalStat(TCHAR_TO_UTF8(*StatName), &TmpData); - Data = TmpData; - return bResult; -} - -int32 USteamUserStats::GetGlobalStatHistoryInt64(const FString& StatName, TArray& Data, int32 Size) const -{ - TArray TmpData; - int32 result = SteamUserStats()->GetGlobalStatHistory(TCHAR_TO_UTF8(*StatName), TmpData.GetData(), Size); - Data = TmpData; - return result; -} - int32 USteamUserStats::GetGlobalStatHistoryFloat(const FString& StatName, TArray& Data, int32 Size) const { TArray TmpData; @@ -81,14 +57,6 @@ int32 USteamUserStats::GetGlobalStatHistoryFloat(const FString& StatName, TArray return result; } -bool USteamUserStats::GetUserAchievementAndUnlockTime(FSteamID SteamIDUser, const FString& Name, bool& bAchieved, int32& UnlockTime) const -{ - uint32 TmpUnlockTime; - bool bResult = SteamUserStats()->GetUserAchievementAndUnlockTime(SteamIDUser, TCHAR_TO_UTF8(*Name), &bAchieved, &TmpUnlockTime); - UnlockTime = TmpUnlockTime; - return bResult; -} - FSteamAPICall USteamUserStats::UploadLeaderboardScore(FSteamLeaderboard SteamLeaderboard, ESteamLeaderboardUploadScoreMethod LeaderboardUploadScoreMethod, int32 Score, const TArray& ScoreDetails) const { return SteamUserStats()->UploadLeaderboardScore(SteamLeaderboard, (ELeaderboardUploadScoreMethod)LeaderboardUploadScoreMethod, Score, ScoreDetails.GetData(), ScoreDetails.Num()); diff --git a/Source/SteamBridge/Public/Core/SteamApps.h b/Source/SteamBridge/Public/Core/SteamApps.h index 1082da4..f38f264 100644 --- a/Source/SteamBridge/Public/Core/SteamApps.h +++ b/Source/SteamBridge/Public/Core/SteamApps.h @@ -188,7 +188,7 @@ class STEAMBRIDGE_API USteamApps final : public UObject * @return bool - true if the specified DLC exists and is currently downloading; otherwise, false. */ UFUNCTION(BlueprintPure, Category = "SteamBridgeCore|Apps") - bool GetDlcDownloadProgress(int32 AppID, int64& BytesDownloaded, int64& BytesTotal); + bool GetDlcDownloadProgress(int32 AppID, int64& BytesDownloaded, int64& BytesTotal) const { return SteamApps()->GetDlcDownloadProgress(AppID, (uint64*)&BytesDownloaded, (uint64*)&BytesTotal); } /** * Gets the time of purchase of the specified app in Unix epoch format (time since Jan 1st, 1970). diff --git a/Source/SteamBridge/Public/Core/SteamHTTP.h b/Source/SteamBridge/Public/Core/SteamHTTP.h index f08934d..329bb17 100644 --- a/Source/SteamBridge/Public/Core/SteamHTTP.h +++ b/Source/SteamBridge/Public/Core/SteamHTTP.h @@ -41,8 +41,8 @@ class STEAMBRIDGE_API USteamHTTP final : public UObject * @param bool bAllowResponsesToModify - Set whether the server can set cookies in this container. * @return FHTTPCookieContainerHandle - Returns a new cookie container handle to be used with future calls to SteamHTTP functions. */ - UFUNCTION(BlueprintCallable, Category = "SteamBridgeCore|HTTP") - FHTTPCookieContainerHandle CreateCookieContainer(bool bAllowResponsesToModify) { return SteamHTTP()->CreateCookieContainer(bAllowResponsesToModify); } + UFUNCTION(BlueprintCallable, BlueprintPure = false, Category = "SteamBridgeCore|HTTP") + FHTTPCookieContainerHandle CreateCookieContainer(bool bAllowResponsesToModify) const { return SteamHTTP()->CreateCookieContainer(bAllowResponsesToModify); } /** * Initializes a new HTTP request. @@ -54,8 +54,8 @@ class STEAMBRIDGE_API USteamHTTP final : public UObject * @param const FString & AbsoluteURL - The url to request. Must start with "http://" or "https://". * @return FHTTPRequestHandle - Returns a new request handle to be used with future calls to SteamHTTP functions. Returns INVALID_HTTPREQUEST_HANDLE if pchAbsoluteURL is NULL or empty (""). */ - UFUNCTION(BlueprintCallable, Category = "SteamBridgeCore|HTTP") - FHTTPRequestHandle CreateHTTPRequest(ESteamHTTPMethod HTTPRequestMethod, const FString& AbsoluteURL) { return SteamHTTP()->CreateHTTPRequest((EHTTPMethod)HTTPRequestMethod, TCHAR_TO_UTF8(*AbsoluteURL)); } + UFUNCTION(BlueprintCallable, BlueprintPure = false, Category = "SteamBridgeCore|HTTP") + FHTTPRequestHandle CreateHTTPRequest(ESteamHTTPMethod HTTPRequestMethod, const FString& AbsoluteURL) const { return SteamHTTP()->CreateHTTPRequest((EHTTPMethod)HTTPRequestMethod, TCHAR_TO_UTF8(*AbsoluteURL)); } /** * Defers a request which has already been sent by moving it at the back of the queue. @@ -63,8 +63,8 @@ class STEAMBRIDGE_API USteamHTTP final : public UObject * @param FHTTPRequestHandle RequestHandle - The request handle to defer. * @return bool - Returns true if the request has been successfully defered. Otherwise false if hRequest is an invalid handle, or if the request has not been sent yet. */ - UFUNCTION(BlueprintCallable, Category = "SteamBridgeCore|HTTP") - bool DeferHTTPRequest(FHTTPRequestHandle RequestHandle) { return SteamHTTP()->DeferHTTPRequest(RequestHandle); } + UFUNCTION(BlueprintCallable, BlueprintPure = false, Category = "SteamBridgeCore|HTTP") + bool DeferHTTPRequest(FHTTPRequestHandle RequestHandle) const { return SteamHTTP()->DeferHTTPRequest(RequestHandle); } /** * Gets progress on downloading the body for the request. @@ -75,8 +75,8 @@ class STEAMBRIDGE_API USteamHTTP final : public UObject * @param float & Percent - Returns the download percentage if the call was successful. * @return bool - Returns true upon success if the download percentage was successfully returned. Otherwise, false if the handle is invalid or pflPercentOut is NULL. */ - UFUNCTION(BlueprintCallable, Category = "SteamBridgeCore|HTTP") - bool GetHTTPDownloadProgressPct(FHTTPRequestHandle RequestHandle, float& Percent) { return SteamHTTP()->GetHTTPDownloadProgressPct(RequestHandle, &Percent); } + UFUNCTION(BlueprintCallable, BlueprintPure = false, Category = "SteamBridgeCore|HTTP") + bool GetHTTPDownloadProgressPct(FHTTPRequestHandle RequestHandle, float& Percent) const { return SteamHTTP()->GetHTTPDownloadProgressPct(RequestHandle, &Percent); } /** * Check if the reason the request failed was because we timed it out (rather than some harder failure). @@ -89,8 +89,8 @@ class STEAMBRIDGE_API USteamHTTP final : public UObject * hRequest was invalid. * The request has not been sent or has not completed. */ - UFUNCTION(BlueprintCallable, Category = "SteamBridgeCore|HTTP") - bool GetHTTPRequestWasTimedOut(FHTTPRequestHandle RequestHandle, bool& bWasTimedOut) { return SteamHTTP()->GetHTTPRequestWasTimedOut(RequestHandle, &bWasTimedOut); } + UFUNCTION(BlueprintCallable, BlueprintPure = false, Category = "SteamBridgeCore|HTTP") + bool GetHTTPRequestWasTimedOut(FHTTPRequestHandle RequestHandle, bool& bWasTimedOut) const { return SteamHTTP()->GetHTTPRequestWasTimedOut(RequestHandle, &bWasTimedOut); } /** * Gets the body data from an HTTP response. @@ -108,8 +108,8 @@ class STEAMBRIDGE_API USteamHTTP final : public UObject * pBodyDataBuffer is NULL. * unBufferSize is not the same size that was provided by GetHTTPResponseBodySize. */ - UFUNCTION(BlueprintCallable, Category = "SteamBridgeCore|HTTP") - bool GetHTTPResponseBodyData(FHTTPRequestHandle RequestHandle, uint8& BodyDataBuffer) { return SteamHTTP()->GetHTTPResponseBodyData(RequestHandle, &BodyDataBuffer, MAX_uint32); } + UFUNCTION(BlueprintCallable, BlueprintPure = false, Category = "SteamBridgeCore|HTTP") + bool GetHTTPResponseBodyData(FHTTPRequestHandle RequestHandle, uint8& BodyDataBuffer) const { return SteamHTTP()->GetHTTPResponseBodyData(RequestHandle, &BodyDataBuffer, MAX_uint32); } /** * Gets the size of the body data from an HTTP response. @@ -124,8 +124,8 @@ class STEAMBRIDGE_API USteamHTTP final : public UObject * The request has not been sent or has not completed. * unBodySize is NULL. */ - UFUNCTION(BlueprintCallable, Category = "SteamBridgeCore|HTTP") - bool GetHTTPResponseBodySize(FHTTPRequestHandle RequestHandle, int32& BodySize); + UFUNCTION(BlueprintCallable, BlueprintPure = false, Category = "SteamBridgeCore|HTTP") + bool GetHTTPResponseBodySize(FHTTPRequestHandle RequestHandle, int32& BodySize) const { return SteamHTTP()->GetHTTPResponseBodySize(RequestHandle, (uint32*)&BodySize); } /** * Checks if a header is present in an HTTP response and returns its size. @@ -143,8 +143,8 @@ class STEAMBRIDGE_API USteamHTTP final : public UObject * unResponseHeaderSize is NULL. * The header name is not present in the response. */ - UFUNCTION(BlueprintCallable, Category = "SteamBridgeCore|HTTP") - bool GetHTTPResponseHeaderSize(FHTTPRequestHandle RequestHandle, const FString& HeaderName, int32& ResponseHeaderSize); + UFUNCTION(BlueprintCallable, BlueprintPure = false, Category = "SteamBridgeCore|HTTP") + bool GetHTTPResponseHeaderSize(FHTTPRequestHandle RequestHandle, const FString& HeaderName, int32& ResponseHeaderSize) const { return SteamHTTP()->GetHTTPResponseHeaderSize(RequestHandle, TCHAR_TO_UTF8(*HeaderName), (uint32*)&ResponseHeaderSize); } /** * Gets a header value from an HTTP response. @@ -163,8 +163,8 @@ class STEAMBRIDGE_API USteamHTTP final : public UObject * The header name is not present in the response. * unBufferSize is not large enough to hold the value. */ - UFUNCTION(BlueprintCallable, Category = "SteamBridgeCore|HTTP") - bool GetHTTPResponseHeaderValue(FHTTPRequestHandle RequestHandle, const FString& HeaderName, uint8& HeaderValueBuffer) { return SteamHTTP()->GetHTTPResponseHeaderValue(RequestHandle, TCHAR_TO_UTF8(*HeaderName), &HeaderValueBuffer, MAX_uint32); } + UFUNCTION(BlueprintCallable, BlueprintPure = false, Category = "SteamBridgeCore|HTTP") + bool GetHTTPResponseHeaderValue(FHTTPRequestHandle RequestHandle, const FString& HeaderName, uint8& HeaderValueBuffer) const { return SteamHTTP()->GetHTTPResponseHeaderValue(RequestHandle, TCHAR_TO_UTF8(*HeaderName), &HeaderValueBuffer, MAX_uint32); } /** * Gets the body data from a streaming HTTP response. @@ -183,8 +183,8 @@ class STEAMBRIDGE_API USteamHTTP final : public UObject * cOffset is not the same offset that was provided by HTTPRequestDataReceived_t. * unBufferSize is not the same size that was provided by HTTPRequestDataReceived_t. */ - UFUNCTION(BlueprintCallable, Category = "SteamBridgeCore|HTTP") - bool GetHTTPStreamingResponseBodyData(FHTTPRequestHandle RequestHandle, int32 Offset, uint8& BodyDataBuffer) { return SteamHTTP()->GetHTTPStreamingResponseBodyData(RequestHandle, Offset, &BodyDataBuffer, MAX_uint32); } + UFUNCTION(BlueprintCallable, BlueprintPure = false, Category = "SteamBridgeCore|HTTP") + bool GetHTTPStreamingResponseBodyData(FHTTPRequestHandle RequestHandle, int32 Offset, uint8& BodyDataBuffer) const { return SteamHTTP()->GetHTTPStreamingResponseBodyData(RequestHandle, Offset, &BodyDataBuffer, MAX_uint32); } /** * Prioritizes a request which has already been sent by moving it at the front of the queue. @@ -192,8 +192,8 @@ class STEAMBRIDGE_API USteamHTTP final : public UObject * @param FHTTPRequestHandle RequestHandle - The request handle to prioritize. * @return bool - Returns true if the request has been successfully prioritized. Otherwise false if hRequest is an invalid handle, or if the request has not been sent yet. */ - UFUNCTION(BlueprintCallable, Category = "SteamBridgeCore|HTTP") - bool PrioritizeHTTPRequest(FHTTPRequestHandle RequestHandle) { return SteamHTTP()->PrioritizeHTTPRequest(RequestHandle); } + UFUNCTION(BlueprintCallable, BlueprintPure = false, Category = "SteamBridgeCore|HTTP") + bool PrioritizeHTTPRequest(FHTTPRequestHandle RequestHandle) const { return SteamHTTP()->PrioritizeHTTPRequest(RequestHandle); } /** * Releases a cookie container, freeing the memory allocated within Steam. @@ -202,8 +202,8 @@ class STEAMBRIDGE_API USteamHTTP final : public UObject * @param FHTTPCookieContainerHandle CookieContainerHandle - The cookie container handle to release. * @return bool - Returns true if the handle has been freed; otherwise, false if the handle was invalid. */ - UFUNCTION(BlueprintCallable, Category = "SteamBridgeCore|HTTP") - bool ReleaseCookieContainer(FHTTPCookieContainerHandle CookieContainerHandle) { return SteamHTTP()->ReleaseCookieContainer(CookieContainerHandle); } + UFUNCTION(BlueprintCallable, BlueprintPure = false, Category = "SteamBridgeCore|HTTP") + bool ReleaseCookieContainer(FHTTPCookieContainerHandle CookieContainerHandle) const { return SteamHTTP()->ReleaseCookieContainer(CookieContainerHandle); } /** * Releases an HTTP request handle, freeing the memory allocated within Steam. @@ -212,8 +212,8 @@ class STEAMBRIDGE_API USteamHTTP final : public UObject * @param FHTTPRequestHandle RequestHandle - The request handle to release. * @return bool - Returns true if the the handle was released successfully, false only if the handle is invalid. */ - UFUNCTION(BlueprintCallable, Category = "SteamBridgeCore|HTTP") - bool ReleaseHTTPRequest(FHTTPRequestHandle RequestHandle) { return SteamHTTP()->ReleaseHTTPRequest(RequestHandle); } + UFUNCTION(BlueprintCallable, BlueprintPure = false, Category = "SteamBridgeCore|HTTP") + bool ReleaseHTTPRequest(FHTTPRequestHandle RequestHandle) const { return SteamHTTP()->ReleaseHTTPRequest(RequestHandle); } /** * Sends an HTTP request. @@ -230,8 +230,8 @@ class STEAMBRIDGE_API USteamHTTP final : public UObject * The request has already been sent. * pCallHandle is NULL. */ - UFUNCTION(BlueprintCallable, Category = "SteamBridgeCore|HTTP") - bool SendHTTPRequest(FHTTPRequestHandle RequestHandle, FSteamAPICall& CallHandle); + UFUNCTION(BlueprintCallable, BlueprintPure = false, Category = "SteamBridgeCore|HTTP") + bool SendHTTPRequest(FHTTPRequestHandle RequestHandle, FSteamAPICall& CallHandle) const { return SteamHTTP()->SendHTTPRequest(RequestHandle, (SteamAPICall_t*)&CallHandle); } /** * Sends an HTTP request and streams the response back in chunks. @@ -252,8 +252,8 @@ class STEAMBRIDGE_API USteamHTTP final : public UObject * The request has already been sent. * pCallHandle is NULL. */ - UFUNCTION(BlueprintCallable, Category = "SteamBridgeCore|HTTP") - bool SendHTTPRequestAndStreamResponse(FHTTPRequestHandle RequestHandle, FSteamAPICall& CallHandle); + UFUNCTION(BlueprintCallable, BlueprintPure = false, Category = "SteamBridgeCore|HTTP") + bool SendHTTPRequestAndStreamResponse(FHTTPRequestHandle RequestHandle, FSteamAPICall& CallHandle) const { return SteamHTTP()->SendHTTPRequestAndStreamResponse(RequestHandle, (SteamAPICall_t*)&CallHandle); } /** * Adds a cookie to the specified cookie container that will be used with future requests. @@ -264,8 +264,8 @@ class STEAMBRIDGE_API USteamHTTP final : public UObject * @param const FString & Cookie - The cookie to set. * @return bool - Returns true if the cookie was set successfully. Otherwise, false if the request handle was invalid or if there was a security issue parsing the cookie. */ - UFUNCTION(BlueprintCallable, Category = "SteamBridgeCore|HTTP") - bool SetCookie(FHTTPCookieContainerHandle CookieContainerHandle, const FString& Host, const FString& Url, const FString& Cookie) { return SteamHTTP()->SetCookie(CookieContainerHandle, TCHAR_TO_UTF8(*Host), TCHAR_TO_UTF8(*Url), TCHAR_TO_UTF8(*Cookie)); } + UFUNCTION(BlueprintCallable, BlueprintPure = false, Category = "SteamBridgeCore|HTTP") + bool SetCookie(FHTTPCookieContainerHandle CookieContainerHandle, const FString& Host, const FString& Url, const FString& Cookie) const { return SteamHTTP()->SetCookie(CookieContainerHandle, TCHAR_TO_UTF8(*Host), TCHAR_TO_UTF8(*Url), TCHAR_TO_UTF8(*Cookie)); } /** * Set an absolute timeout in milliseconds for the HTTP request. @@ -278,8 +278,8 @@ class STEAMBRIDGE_API USteamHTTP final : public UObject * hRequest was invalid. * The request has already been sent. */ - UFUNCTION(BlueprintCallable, Category = "SteamBridgeCore|HTTP") - bool SetHTTPRequestAbsoluteTimeoutMS(FHTTPRequestHandle RequestHandle, int32 Milliseconds) { return SteamHTTP()->SetHTTPRequestAbsoluteTimeoutMS(RequestHandle, Milliseconds); } + UFUNCTION(BlueprintCallable, BlueprintPure = false, Category = "SteamBridgeCore|HTTP") + bool SetHTTPRequestAbsoluteTimeoutMS(FHTTPRequestHandle RequestHandle, int32 Milliseconds) const { return SteamHTTP()->SetHTTPRequestAbsoluteTimeoutMS(RequestHandle, Milliseconds); } /** * Set a context value for the request, which will be returned in the HTTPRequestCompleted_t callback after sending the request. @@ -293,8 +293,8 @@ class STEAMBRIDGE_API USteamHTTP final : public UObject * hRequest was invalid. * The request has already been sent. */ - UFUNCTION(BlueprintCallable, Category = "SteamBridgeCore|HTTP") - bool SetHTTPRequestContextValue(FHTTPRequestHandle RequestHandle, int64 ContextValue) { return SteamHTTP()->SetHTTPRequestContextValue(RequestHandle, ContextValue); } + UFUNCTION(BlueprintCallable, BlueprintPure = false, Category = "SteamBridgeCore|HTTP") + bool SetHTTPRequestContextValue(FHTTPRequestHandle RequestHandle, int64 ContextValue) const { return SteamHTTP()->SetHTTPRequestContextValue(RequestHandle, ContextValue); } /** * Associates a cookie container to use for an HTTP request. @@ -306,8 +306,8 @@ class STEAMBRIDGE_API USteamHTTP final : public UObject * hRequest was invalid. * hCookieContainer was invalid. */ - UFUNCTION(BlueprintCallable, Category = "SteamBridgeCore|HTTP") - bool SetHTTPRequestCookieContainer(FHTTPRequestHandle RequestHandle, FHTTPCookieContainerHandle CookieContainerHandle) { return SteamHTTP()->SetHTTPRequestCookieContainer(RequestHandle, CookieContainerHandle); } + UFUNCTION(BlueprintCallable, BlueprintPure = false, Category = "SteamBridgeCore|HTTP") + bool SetHTTPRequestCookieContainer(FHTTPRequestHandle RequestHandle, FHTTPCookieContainerHandle CookieContainerHandle) const { return SteamHTTP()->SetHTTPRequestCookieContainer(RequestHandle, CookieContainerHandle); } /** * Set a GET or POST parameter value on the HTTP request. @@ -324,8 +324,8 @@ class STEAMBRIDGE_API USteamHTTP final : public UObject * The request method set in CreateHTTPRequest is not k_EHTTPMethodGET, k_EHTTPMethodHEAD, or k_EHTTPMethodPOST. * If the request method is k_EHTTPMethodPOST and a POST body has already been set with SetHTTPRequestRawPostBody. */ - UFUNCTION(BlueprintCallable, Category = "SteamBridgeCore|HTTP") - bool SetHTTPRequestGetOrPostParameter(FHTTPRequestHandle RequestHandle, const FString& Name, const FString& Value) { return SteamHTTP()->SetHTTPRequestGetOrPostParameter(RequestHandle, TCHAR_TO_UTF8(*Name), TCHAR_TO_UTF8(*Value)); } + UFUNCTION(BlueprintCallable, BlueprintPure = false, Category = "SteamBridgeCore|HTTP") + bool SetHTTPRequestGetOrPostParameter(FHTTPRequestHandle RequestHandle, const FString& Name, const FString& Value) const { return SteamHTTP()->SetHTTPRequestGetOrPostParameter(RequestHandle, TCHAR_TO_UTF8(*Name), TCHAR_TO_UTF8(*Value)); } /** * Set a request header value for the HTTP request. @@ -342,8 +342,8 @@ class STEAMBRIDGE_API USteamHTTP final : public UObject * pchHeaderName is "User-Agent". * pchHeaderName or pchHeaderValue are NULL. */ - UFUNCTION(BlueprintCallable, Category = "SteamBridgeCore|HTTP") - bool SetHTTPRequestHeaderValue(FHTTPRequestHandle RequestHandle, const FString& Name, const FString& Value) { return SteamHTTP()->SetHTTPRequestHeaderValue(RequestHandle, TCHAR_TO_UTF8(*Name), TCHAR_TO_UTF8(*Value)); } + UFUNCTION(BlueprintCallable, BlueprintPure = false, Category = "SteamBridgeCore|HTTP") + bool SetHTTPRequestHeaderValue(FHTTPRequestHandle RequestHandle, const FString& Name, const FString& Value) const { return SteamHTTP()->SetHTTPRequestHeaderValue(RequestHandle, TCHAR_TO_UTF8(*Name), TCHAR_TO_UTF8(*Value)); } /** * Set the timeout in seconds for the HTTP request. @@ -356,8 +356,8 @@ class STEAMBRIDGE_API USteamHTTP final : public UObject * hRequest was invalid. * The request has already been sent. */ - UFUNCTION(BlueprintCallable, Category = "SteamBridgeCore|HTTP") - bool SetHTTPRequestNetworkActivityTimeout(FHTTPRequestHandle RequestHandle, int32 TimeoutSeconds) { return SteamHTTP()->SetHTTPRequestNetworkActivityTimeout(RequestHandle, TimeoutSeconds); } + UFUNCTION(BlueprintCallable, BlueprintPure = false, Category = "SteamBridgeCore|HTTP") + bool SetHTTPRequestNetworkActivityTimeout(FHTTPRequestHandle RequestHandle, int32 TimeoutSeconds) const { return SteamHTTP()->SetHTTPRequestNetworkActivityTimeout(RequestHandle, TimeoutSeconds); } /** * Sets the body for an HTTP Post request. @@ -373,8 +373,8 @@ class STEAMBRIDGE_API USteamHTTP final : public UObject * The HTTP Method set in CreateHTTPRequest is not k_EHTTPMethodPOST, k_EHTTPMethodPUT, or k_EHTTPMethodPATCH. * A POST body has already been set for this request either via this function or with SetHTTPRequestGetOrPostParameter. */ - UFUNCTION(BlueprintCallable, Category = "SteamBridgeCore|HTTP") - bool SetHTTPRequestRawPostBody(FHTTPRequestHandle RequestHandle, const FString& ContentType, uint8& Body) { return SteamHTTP()->SetHTTPRequestRawPostBody(RequestHandle, TCHAR_TO_UTF8(*ContentType), &Body, MAX_uint8); } + UFUNCTION(BlueprintCallable, BlueprintPure = false, Category = "SteamBridgeCore|HTTP") + bool SetHTTPRequestRawPostBody(FHTTPRequestHandle RequestHandle, const FString& ContentType, uint8& Body) const { return SteamHTTP()->SetHTTPRequestRawPostBody(RequestHandle, TCHAR_TO_UTF8(*ContentType), &Body, MAX_uint8); } /** * Sets that the HTTPS request should require verified SSL certificate via machines certificate trust store. @@ -384,8 +384,8 @@ class STEAMBRIDGE_API USteamHTTP final : public UObject * @param bool bRequireVerifiedCertificate - Turn on verified certificate? * @return bool - Returns true upon success. Otherwise, false if the request handle is invalid. */ - UFUNCTION(BlueprintCallable, Category = "SteamBridgeCore|HTTP") - bool SetHTTPRequestRequiresVerifiedCertificate(FHTTPRequestHandle RequestHandle, bool bRequireVerifiedCertificate) { return SteamHTTP()->SetHTTPRequestRequiresVerifiedCertificate(RequestHandle, bRequireVerifiedCertificate); } + UFUNCTION(BlueprintCallable, BlueprintPure = false, Category = "SteamBridgeCore|HTTP") + bool SetHTTPRequestRequiresVerifiedCertificate(FHTTPRequestHandle RequestHandle, bool bRequireVerifiedCertificate) const { return SteamHTTP()->SetHTTPRequestRequiresVerifiedCertificate(RequestHandle, bRequireVerifiedCertificate); } /** * Set additional user agent info for a request. @@ -395,8 +395,8 @@ class STEAMBRIDGE_API USteamHTTP final : public UObject * @param const FString & UserAgentInfo - The string to append to the end of the user agent. * @return bool - Returns true upon success indicating that the user agent has been updated. Otherwise, false if the request handle is invalid. */ - UFUNCTION(BlueprintCallable, Category = "SteamBridgeCore|HTTP") - bool SetHTTPRequestUserAgentInfo(FHTTPRequestHandle RequestHandle, const FString& UserAgentInfo) { return SteamHTTP()->SetHTTPRequestUserAgentInfo(RequestHandle, TCHAR_TO_UTF8(*UserAgentInfo)); } + UFUNCTION(BlueprintCallable, BlueprintPure = false, Category = "SteamBridgeCore|HTTP") + bool SetHTTPRequestUserAgentInfo(FHTTPRequestHandle RequestHandle, const FString& UserAgentInfo) const { return SteamHTTP()->SetHTTPRequestUserAgentInfo(RequestHandle, TCHAR_TO_UTF8(*UserAgentInfo)); } /** Delegates */ diff --git a/Source/SteamBridge/Public/Core/SteamInventory.h b/Source/SteamBridge/Public/Core/SteamInventory.h index 1dbe62b..dc9f568 100644 --- a/Source/SteamBridge/Public/Core/SteamInventory.h +++ b/Source/SteamBridge/Public/Core/SteamInventory.h @@ -204,7 +204,7 @@ class STEAMBRIDGE_API USteamInventory final : public UObject * false if the parameters are invalid or if there is no price for the given item definition id. */ UFUNCTION(BlueprintPure, Category = "SteamBridgeCore|Inventory") - bool GetItemPrice(FSteamItemDef ItemDef, int64& CurrentPrice, int64& BasePrice) const; + bool GetItemPrice(FSteamItemDef ItemDef, int64& CurrentPrice, int64& BasePrice) const { return SteamInventory()->GetItemPrice(ItemDef, (uint64*)&CurrentPrice, (uint64*)&BasePrice); } // #TODO GetItemsWithPrices diff --git a/Source/SteamBridge/Public/Core/SteamParties.h b/Source/SteamBridge/Public/Core/SteamParties.h index e9c8c62..dcfd290 100644 --- a/Source/SteamBridge/Public/Core/SteamParties.h +++ b/Source/SteamBridge/Public/Core/SteamParties.h @@ -52,7 +52,7 @@ class STEAMBRIDGE_API USteamParties final : public UObject * @return bool */ UFUNCTION(BlueprintPure, Category = "SteamBridgeCore|Parties") - bool GetNumAvailableBeaconLocations(int32& NumLocations) const; + bool GetNumAvailableBeaconLocations(int32& NumLocations) const { return SteamParties()->GetNumAvailableBeaconLocations((uint32*)&NumLocations); } /** * Get the list of locations in which you can post a party beacon. diff --git a/Source/SteamBridge/Public/Core/SteamUserStats.h b/Source/SteamBridge/Public/Core/SteamUserStats.h index 487c7bb..4d82e2f 100644 --- a/Source/SteamBridge/Public/Core/SteamUserStats.h +++ b/Source/SteamBridge/Public/Core/SteamUserStats.h @@ -148,7 +148,7 @@ class STEAMBRIDGE_API USteamUserStats final : public UObject * If the call is successful then the achieved status and unlock time are provided via the arguments pbAchieved and punUnlockTime. */ UFUNCTION(BlueprintPure, Category = "SteamBridgeCore|UserStats") - bool GetAchievementAndUnlockTime(const FString& Name, bool& bAchieved, int32& UnlockTime) const; + bool GetAchievementAndUnlockTime(const FString& Name, bool& bAchieved, int32& UnlockTime) const { return SteamUserStats()->GetAchievementAndUnlockTime(TCHAR_TO_UTF8(*Name), &bAchieved, (uint32*)&UnlockTime); } /** * Get general attributes for an achievement. Currently provides: Name, Description, and Hidden status. @@ -223,7 +223,7 @@ class STEAMBRIDGE_API USteamUserStats final : public UObject * The type matches the type listed in the App Admin panel of the Steamworks website. */ UFUNCTION(BlueprintPure, Category = "SteamBridgeCore|UserStats") - bool GetGlobalStatFloat(const FString& StatName, float& Data) const; + bool GetGlobalStatFloat(const FString& StatName, float& Data) const { return SteamUserStats()->GetGlobalStat(TCHAR_TO_UTF8(*StatName), (double*)&Data); } /** * Gets the daily history for an aggregated stat. pData will be filled with daily values, starting with today. So when called, pData[0] will be today, pData[1] will be yesterday, and pData[2] will be two days ago, etc. @@ -240,7 +240,7 @@ class STEAMBRIDGE_API USteamUserStats final : public UObject * There is no history available. */ UFUNCTION(BlueprintPure, Category = "SteamBridgeCore|UserStats") - int32 GetGlobalStatHistoryInt64(const FString& StatName, TArray& Data, int32 Size = 10) const; + int32 GetGlobalStatHistoryInt64(const FString& StatName, TArray& Data, int32 Size = 10) const { return SteamUserStats()->GetGlobalStatHistory(TCHAR_TO_UTF8(*StatName), Data.GetData(), Size); } /** * Gets the daily history for an aggregated stat. pData will be filled with daily values, starting with today. So when called, pData[0] will be today, pData[1] will be yesterday, and pData[2] will be two days ago, etc. @@ -378,7 +378,7 @@ class STEAMBRIDGE_API USteamUserStats final : public UObject * If the call is successful then the achieved status and unlock time are provided via the arguments pbAchieved and punUnlockTime. */ UFUNCTION(BlueprintPure, Category = "SteamBridgeCore|UserStats") - bool GetUserAchievementAndUnlockTime(FSteamID SteamIDUser, const FString& Name, bool& bAchieved, int32& UnlockTime) const; + bool GetUserAchievementAndUnlockTime(FSteamID SteamIDUser, const FString& Name, bool& bAchieved, int32& UnlockTime) const { return SteamUserStats()->GetUserAchievementAndUnlockTime(SteamIDUser, TCHAR_TO_UTF8(*Name), &bAchieved, (uint32*)&UnlockTime); } /** * Gets the current value of the a stat for the specified user.