From db07e4aadffc79a07425814e2c449b14aec19f0a Mon Sep 17 00:00:00 2001 From: otavepto Date: Sat, 16 Mar 2024 07:13:43 +0200 Subject: [PATCH] in Steam_Utils::IsAPICallCompleted initialize the pFailed param to false --- dll/dll.cpp | 4 ++-- dll/dll/base.h | 3 ++- dll/dll/steam_remote_storage.h | 2 +- dll/steam_client.cpp | 2 +- dll/steam_utils.cpp | 5 ++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dll/dll.cpp b/dll/dll.cpp index d6011cd4..6c618ea6 100644 --- a/dll/dll.cpp +++ b/dll/dll.cpp @@ -938,7 +938,7 @@ STEAMAPI_API steam_bool S_CALLTYPE SteamAPI_ManualDispatch_GetNextCallback( HSte /// You must call this after dispatching the callback, if SteamAPI_ManualDispatch_GetNextCallback returns true. STEAMAPI_API void S_CALLTYPE SteamAPI_ManualDispatch_FreeLastCallback( HSteamPipe hSteamPipe ) { - PRINT_DEBUG("%s %i\n", __FUNCTION__, hSteamPipe); + PRINT_DEBUG("SteamAPI_ManualDispatch_FreeLastCallback %i\n", hSteamPipe); std::queue *q = NULL; Steam_Client *steam_client = get_steam_client(); auto it = steam_client->steam_pipes.find(hSteamPipe); @@ -1102,7 +1102,7 @@ STEAMCLIENT_API steam_bool Steam_BGetCallback( HSteamPipe hSteamPipe, CallbackMs STEAMCLIENT_API void Steam_FreeLastCallback( HSteamPipe hSteamPipe ) { - PRINT_DEBUG("%s %i\n", __FUNCTION__, hSteamPipe); + PRINT_DEBUG("Steam_FreeLastCallback %i\n", hSteamPipe); SteamAPI_ManualDispatch_FreeLastCallback( hSteamPipe ); } diff --git a/dll/dll/base.h b/dll/dll/base.h index a83ef4c7..4b741dd9 100644 --- a/dll/dll/base.h +++ b/dll/dll/base.h @@ -204,7 +204,7 @@ public: } PRINT_DEBUG("addCallResult ERROR\n"); - return 0; + return k_uAPICallInvalid; } SteamAPICall_t reserveCallResult() { @@ -296,6 +296,7 @@ public: while (c != std::end(callresults)) { if (c->to_delete) { if (c->timed_out()) { + PRINT_DEBUG("runCallResults removed callresult %i\n", c->iCallback); c = callresults.erase(c); } else { ++c; diff --git a/dll/dll/steam_remote_storage.h b/dll/dll/steam_remote_storage.h index bcfd2051..59b2920b 100644 --- a/dll/dll/steam_remote_storage.h +++ b/dll/dll/steam_remote_storage.h @@ -172,7 +172,7 @@ SteamAPICall_t FileReadAsync( const char *pchFile, uint32 nOffset, uint32 cubToR if ((size - nOffset) < cubToRead) cubToRead = size - nOffset; - struct Async_Read a_read; + struct Async_Read a_read{}; data.m_eResult = k_EResultOK; a_read.offset = data.m_nOffset = nOffset; a_read.api_call = data.m_hFileReadAsync = callback_results->reserveCallResult(); diff --git a/dll/steam_client.cpp b/dll/steam_client.cpp index 425b6678..ac49a2ef 100644 --- a/dll/steam_client.cpp +++ b/dll/steam_client.cpp @@ -1910,7 +1910,7 @@ void Steam_Client::RunCallbacks(bool runClientCB, bool runGameserverCB, bool run callbacks_client->runCallBacks(); last_cb_run = std::chrono::duration_cast>(std::chrono::system_clock::now().time_since_epoch()).count(); - PRINT_DEBUG("Steam_Client::RunCallbacks done ------------------------------------------------------\n\n"); + PRINT_DEBUG("Steam_Client::RunCallbacks done ------------------------------------------------------\n"); } void Steam_Client::DestroyAllInterfaces() diff --git a/dll/steam_utils.cpp b/dll/steam_utils.cpp index 76e302a4..c697fb6d 100644 --- a/dll/steam_utils.cpp +++ b/dll/steam_utils.cpp @@ -147,9 +147,9 @@ void Steam_Utils::SetOverlayNotificationPosition( ENotificationPosition eNotific // can be used directly, but more commonly used via the callback dispatch API (see steam_api.h) bool Steam_Utils::IsAPICallCompleted( SteamAPICall_t hSteamAPICall, bool *pbFailed ) { - PRINT_DEBUG("Steam_Utils::IsAPICallCompleted: %llu\n", hSteamAPICall); + PRINT_DEBUG("Steam_Utils::IsAPICallCompleted %llu\n", hSteamAPICall); std::lock_guard lock(global_mutex); - if (pbFailed) *pbFailed = true; + if (pbFailed) *pbFailed = false; if (hSteamAPICall == 1) { //bug ? soul calibur 6 calls this function with the return value 1 of Steam_User_Stats::RequestCurrentStats and expects this function to return true if (pbFailed) *pbFailed = true; @@ -157,7 +157,6 @@ bool Steam_Utils::IsAPICallCompleted( SteamAPICall_t hSteamAPICall, bool *pbFail } if (!callback_results->exists(hSteamAPICall)) return false; - if (pbFailed) *pbFailed = false; return true; //all api calls "complete" right away }