diff --git a/dll/callsystem.cpp b/dll/callsystem.cpp index 83352509..d2ba8b22 100644 --- a/dll/callsystem.cpp +++ b/dll/callsystem.cpp @@ -277,7 +277,7 @@ void SteamCallResults::runCallResults() } } - PRINT_DEBUG("erase to_delete"); + // PRINT_DEBUG("erase to_delete"); auto c = std::begin(callresults); while (c != std::end(callresults)) { if (c->to_delete) { diff --git a/dll/dll.cpp b/dll/dll.cpp index 424716e3..85067006 100644 --- a/dll/dll.cpp +++ b/dll/dll.cpp @@ -491,7 +491,7 @@ STEAMAPI_API void S_CALLTYPE SteamAPI_SetMiniDumpComment( const char *pchMsg ) // and call SteamAPI_ReleaseCurrentThreadMemory regularly on other threads. STEAMAPI_API void S_CALLTYPE SteamAPI_RunCallbacks() { - PRINT_DEBUG_ENTRY(); + // PRINT_DEBUG_ENTRY(); get_steam_client()->RunCallbacks(true, false); //std::this_thread::sleep_for(std::chrono::microseconds(1)); //fixes resident evil revelations lagging. (Seems to work fine without this right now, commenting out) } @@ -575,7 +575,7 @@ STEAMAPI_API steam_bool S_CALLTYPE SteamAPI_IsSteamRunning() // NOT THREADSAFE - do not call from multiple threads simultaneously. STEAMAPI_API void Steam_RunCallbacks( HSteamPipe hSteamPipe, bool bGameServerCallbacks ) { - PRINT_DEBUG_ENTRY(); + // PRINT_DEBUG_ENTRY(); SteamAPI_RunCallbacks(); @@ -1007,7 +1007,7 @@ STEAMAPI_API void SteamGameServer_Shutdown() STEAMAPI_API void SteamGameServer_RunCallbacks() { - PRINT_DEBUG_ENTRY(); + // PRINT_DEBUG_ENTRY(); get_steam_client()->RunCallbacks(false, true); } @@ -1027,7 +1027,7 @@ STEAMAPI_API ISteamClient *SteamGameServerClient() { PRINT_DEBUG("old"); if (!get_steam_clientserver_old()->IsServerInit()) return NULL; - return (ISteamClient *)SteamInternal_CreateInterface(old_client); + return reinterpret_cast(SteamInternal_CreateInterface(old_client)); } STEAMAPI_API uint32 SteamGameServer_GetIPCCallCount() @@ -1133,7 +1133,7 @@ STEAMAPI_API steam_bool S_CALLTYPE SteamAPI_ManualDispatch_GetNextCallback( HSte } if (q->empty()) { - PRINT_DEBUG("error queue is empty"); + //PRINT_DEBUG("error queue is empty"); return false; } @@ -1321,13 +1321,13 @@ STEAMCLIENT_API steam_bool Steam_BGetCallback( HSteamPipe hSteamPipe, CallbackMs STEAMCLIENT_API void Steam_FreeLastCallback( HSteamPipe hSteamPipe ) { - PRINT_DEBUG("%i", hSteamPipe); + //PRINT_DEBUG("%i", hSteamPipe); SteamAPI_ManualDispatch_FreeLastCallback( hSteamPipe ); } STEAMCLIENT_API steam_bool Steam_GetAPICallResult( HSteamPipe hSteamPipe, SteamAPICall_t hSteamAPICall, void* pCallback, int cubCallback, int iCallbackExpected, bool* pbFailed ) { - PRINT_DEBUG("%i %llu %i %i", hSteamPipe, hSteamAPICall, cubCallback, iCallbackExpected); + //PRINT_DEBUG("%i %llu %i %i", hSteamPipe, hSteamAPICall, cubCallback, iCallbackExpected); return SteamAPI_ManualDispatch_GetAPICallResult(hSteamPipe, hSteamAPICall, pCallback, cubCallback, iCallbackExpected, pbFailed); } @@ -1351,6 +1351,7 @@ STEAMCLIENT_API void Breakpad_SteamMiniDumpInit( uint32 a, const char *b, const STEAMCLIENT_API void Breakpad_SteamSendMiniDump( void *a, uint32 b ) { PRINT_DEBUG_TODO(); + PRINT_DEBUG(" app is sending a crash dump! [XXXXXXXXXXXXXXXXXXXXXXXXXXX]"); } STEAMCLIENT_API void Breakpad_SteamSetAppID( uint32 unAppID ) diff --git a/dll/dll/steam_client.h b/dll/dll/steam_client.h index 93f53584..b3ac676c 100644 --- a/dll/dll/steam_client.h +++ b/dll/dll/steam_client.h @@ -245,7 +245,7 @@ public: // steam timeline ISteamTimeline *GetISteamTimeline( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ); - // steam appp disable update + // steam app disable update ISteamAppDisableUpdate *GetISteamAppDisableUpdate( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ); diff --git a/dll/dll/steam_ugc.h b/dll/dll/steam_ugc.h index 84da347f..dd335501 100644 --- a/dll/dll/steam_ugc.h +++ b/dll/dll/steam_ugc.h @@ -76,7 +76,7 @@ private: UGCQueryHandle_t new_ugc_query( bool return_all_subscribed = false, - std::set return_only = std::set()); + const std::set &return_only = std::set()); std::optional get_query_ugc(UGCQueryHandle_t handle, uint32 index); diff --git a/dll/steam_controller.cpp b/dll/steam_controller.cpp index 720637b1..27c15e81 100644 --- a/dll/steam_controller.cpp +++ b/dll/steam_controller.cpp @@ -221,7 +221,7 @@ Steam_Controller::Steam_Controller(class Settings *settings, class SteamCallResu this->run_every_runcb = run_every_runcb; set_handles(settings->controller_settings.action_sets); - disabled = !action_handles.size(); + disabled = action_handles.empty(); initialized = false; this->run_every_runcb->add(&Steam_Controller::steam_run_every_runcb, this); @@ -292,6 +292,7 @@ bool Steam_Controller::Shutdown() rumble_thread_data->rumble_thread_cv.notify_one(); background_rumble_thread.join(); delete rumble_thread_data; + rumble_thread_data = nullptr; GamepadShutdown(); initialized = false; return true; @@ -354,10 +355,10 @@ void Steam_Controller::EnableActionEventCallbacks( SteamInputActionEventCallback // possible latency, you call this directly before reading controller state. void Steam_Controller::RunFrame(bool bReservedValue) { - PRINT_DEBUG_ENTRY(); if (disabled || !initialized) { return; } + PRINT_DEBUG_ENTRY(); GamepadUpdate(); } @@ -574,7 +575,7 @@ int Steam_Controller::GetDigitalActionOrigins( ControllerHandle_t controllerHand EInputActionOrigin origins[STEAM_CONTROLLER_MAX_ORIGINS]; int ret = GetDigitalActionOrigins(controllerHandle, actionSetHandle, digitalActionHandle, origins ); for (int i = 0; i < ret; ++i) { - originsOut[i] = (EControllerActionOrigin)(origins[i] - (k_EInputActionOrigin_XBox360_A - k_EControllerActionOrigin_XBox360_A)); + originsOut[i] = (EControllerActionOrigin)(origins[i] - ((long)k_EInputActionOrigin_XBox360_A - (long)k_EControllerActionOrigin_XBox360_A)); } return ret; @@ -768,7 +769,7 @@ int Steam_Controller::GetAnalogActionOrigins( ControllerHandle_t controllerHandl EInputActionOrigin origins[STEAM_CONTROLLER_MAX_ORIGINS]; int ret = GetAnalogActionOrigins(controllerHandle, actionSetHandle, analogActionHandle, origins ); for (int i = 0; i < ret; ++i) { - originsOut[i] = (EControllerActionOrigin)(origins[i] - (k_EInputActionOrigin_XBox360_A - k_EControllerActionOrigin_XBox360_A)); + originsOut[i] = (EControllerActionOrigin)(origins[i] - ((long)k_EInputActionOrigin_XBox360_A - (long)k_EControllerActionOrigin_XBox360_A)); } return ret; diff --git a/dll/steam_matchmaking.cpp b/dll/steam_matchmaking.cpp index 45060f97..c2bc1080 100644 --- a/dll/steam_matchmaking.cpp +++ b/dll/steam_matchmaking.cpp @@ -129,7 +129,7 @@ bool Steam_Matchmaking::send_owner_packet(CSteamID lobby_id, Lobby_Messages *mes return false; } - Common_Message msg; + Common_Message msg{}; msg.set_allocated_lobby_messages(message); msg.set_source_id(settings->get_local_steam_id().ConvertToUint64()); msg.set_dest_id((uint64)lobby->owner()); @@ -1123,7 +1123,7 @@ int Steam_Matchmaking::GetLobbyMemberLimit( CSteamID steamIDLobby ) void Steam_Matchmaking::SetLobbyVoiceEnabled( CSteamID steamIDLobby, bool bVoiceEnabled ) { - PRINT_DEBUG_ENTRY(); + PRINT_DEBUG_TODO(); } // updates which type of lobby it is diff --git a/dll/steam_networking_messages.cpp b/dll/steam_networking_messages.cpp index 5b1885b4..1b89ee9b 100644 --- a/dll/steam_networking_messages.cpp +++ b/dll/steam_networking_messages.cpp @@ -247,7 +247,7 @@ int Steam_Networking_Messages::ReceiveMessagesOnChannel( int nLocalChannel, Stea } } - PRINT_DEBUG("got %u", message_counter); + PRINT_DEBUG("got %i", message_counter); return message_counter; } diff --git a/dll/steam_networking_sockets.cpp b/dll/steam_networking_sockets.cpp index c789968b..35e494dc 100644 --- a/dll/steam_networking_sockets.cpp +++ b/dll/steam_networking_sockets.cpp @@ -195,7 +195,7 @@ void Steam_Networking_Sockets::set_steamnetconnectioninfo(std::mapm_eState = convert_status(connect_socket->second.status); pInfo->m_eEndReason = 0; //TODO pInfo->m_szEndDebug[0] = 0; - sprintf(pInfo->m_szConnectionDescription, "%u", connect_socket->first); + snprintf(pInfo->m_szConnectionDescription, sizeof(pInfo->m_szConnectionDescription), "%u", connect_socket->first); //Note some games might not allocate a struct the whole size of SteamNetConnectionInfo_t when calling GetConnectionInfo //keep this in mind in future interface updates diff --git a/dll/steam_remote_storage.cpp b/dll/steam_remote_storage.cpp index ad61f240..8446e4c6 100644 --- a/dll/steam_remote_storage.cpp +++ b/dll/steam_remote_storage.cpp @@ -476,7 +476,7 @@ SteamAPICall_t Steam_Remote_Storage::UGCDownload( UGCHandle_t hContent ) // or if the transfer hasn't started yet, so be careful to check for that before dividing to get a percentage bool Steam_Remote_Storage::GetUGCDownloadProgress( UGCHandle_t hContent, int32 *pnBytesDownloaded, int32 *pnBytesExpected ) { - PRINT_DEBUG_ENTRY(); + PRINT_DEBUG_TODO(); std::lock_guard lock(global_mutex); return false; @@ -484,7 +484,7 @@ bool Steam_Remote_Storage::GetUGCDownloadProgress( UGCHandle_t hContent, int32 * bool Steam_Remote_Storage::GetUGCDownloadProgress( UGCHandle_t hContent, uint32 *pnBytesDownloaded, uint32 *pnBytesExpected ) { - PRINT_DEBUG("old"); + PRINT_DEBUG_TODO(); std::lock_guard lock(global_mutex); return false; @@ -1206,7 +1206,7 @@ SteamAPICall_t Steam_Remote_Storage::UGCDownloadToLocation( UGCHandle_t hContent // Cloud dynamic state change notification int32 Steam_Remote_Storage::GetLocalFileChangeCount() { - PRINT_DEBUG("GetLocalFileChangeCount"); + PRINT_DEBUG_TODO(); std::lock_guard lock(global_mutex); return 0; @@ -1214,7 +1214,7 @@ int32 Steam_Remote_Storage::GetLocalFileChangeCount() const char* Steam_Remote_Storage::GetLocalFileChange( int iFile, ERemoteStorageLocalFileChange *pEChangeType, ERemoteStorageFilePathType *pEFilePathType ) { - PRINT_DEBUG("GetLocalFileChange"); + PRINT_DEBUG_TODO(); std::lock_guard lock(global_mutex); return ""; @@ -1224,7 +1224,7 @@ const char* Steam_Remote_Storage::GetLocalFileChange( int iFile, ERemoteStorageL // operations - for example, writing a game save that requires updating two files. bool Steam_Remote_Storage::BeginFileWriteBatch() { - PRINT_DEBUG("BeginFileWriteBatch"); + PRINT_DEBUG_ENTRY(); std::lock_guard lock(global_mutex); return true; @@ -1232,7 +1232,7 @@ bool Steam_Remote_Storage::BeginFileWriteBatch() bool Steam_Remote_Storage::EndFileWriteBatch() { - PRINT_DEBUG("EndFileWriteBatch"); + PRINT_DEBUG_ENTRY(); std::lock_guard lock(global_mutex); return true; diff --git a/dll/steam_timeline.cpp b/dll/steam_timeline.cpp index 0a2fb54c..71b8a060 100644 --- a/dll/steam_timeline.cpp +++ b/dll/steam_timeline.cpp @@ -68,6 +68,7 @@ Steam_Timeline::Steam_Timeline(class Settings *settings, class Networking *netwo this->run_every_runcb->add(&Steam_Timeline::steam_run_every_runcb, this); // timeline starts with a default event as seen here: https://www.youtube.com/watch?v=YwBD0E4-EsI + PRINT_DEBUG("adding an initial game mode"); SetTimelineGameMode(ETimelineGameMode::k_ETimelineGameMode_Invalid); } @@ -166,7 +167,7 @@ TimelineEventHandle_t Steam_Timeline::AddRangeTimelineEvent( const char *pchTitl std::lock_guard lock(timeline_mutex); auto event_id = StartRangeTimelineEvent(pchTitle, pchDescription, pchIcon, unIconPriority, flStartOffsetSeconds, ePossibleClip); - if (!event_id || event_id > timeline_events.size()) return event_id; + if (!event_id || event_id > timeline_events.size()) return 0; auto& my_event = timeline_events[static_cast(event_id - 1)]; my_event.ended = true; // ranged and instantaneous events are ended/closed events, they can't be modified later according to docs diff --git a/dll/steam_ugc.cpp b/dll/steam_ugc.cpp index b8ae61d6..75e8cb2f 100644 --- a/dll/steam_ugc.cpp +++ b/dll/steam_ugc.cpp @@ -17,7 +17,7 @@ #include "dll/steam_ugc.h" -UGCQueryHandle_t Steam_UGC::new_ugc_query(bool return_all_subscribed, std::set return_only) +UGCQueryHandle_t Steam_UGC::new_ugc_query(bool return_all_subscribed, const std::set &return_only) { std::lock_guard lock(global_mutex); @@ -29,7 +29,7 @@ UGCQueryHandle_t Steam_UGC::new_ugc_query(bool return_all_subscribed, std::set

lock(global_mutex); - RemoteStorageSubscribePublishedFileResult_t data; + RemoteStorageSubscribePublishedFileResult_t data{}; data.m_nPublishedFileId = nPublishedFileID; if (settings->isModInstalled(nPublishedFileID)) { data.m_eResult = k_EResultOK; @@ -1307,7 +1307,7 @@ SteamAPICall_t Steam_UGC::UnsubscribeItem( PublishedFileId_t nPublishedFileID ) PRINT_DEBUG("%llu", nPublishedFileID); std::lock_guard lock(global_mutex); - RemoteStorageUnsubscribePublishedFileResult_t data; + RemoteStorageUnsubscribePublishedFileResult_t data{}; data.m_nPublishedFileId = nPublishedFileID; if (!ugc_bridge->has_subbed_mod(nPublishedFileID)) { data.m_eResult = k_EResultFail; //TODO: check if this is accurate @@ -1461,7 +1461,7 @@ bool Steam_UGC::BInitWorkshopForGameServer( DepotId_t unWorkshopDepotID, const c // SuspendDownloads( true ) will suspend all workshop downloads until SuspendDownloads( false ) is called or the game ends void Steam_UGC::SuspendDownloads( bool bSuspend ) { - PRINT_DEBUG_ENTRY(); + PRINT_DEBUG_TODO(); std::lock_guard lock(global_mutex); } diff --git a/dll/steam_user_stats_leaderboard.cpp b/dll/steam_user_stats_leaderboard.cpp index e1a8d3e3..860a1cee 100644 --- a/dll/steam_user_stats_leaderboard.cpp +++ b/dll/steam_user_stats_leaderboard.cpp @@ -346,7 +346,9 @@ const char * Steam_User_Stats::GetLeaderboardName( SteamLeaderboard_t hSteamLead std::lock_guard lock(global_mutex); if (hSteamLeaderboard > cached_leaderboards.size() || hSteamLeaderboard <= 0) return ""; - return cached_leaderboards[static_cast(hSteamLeaderboard - 1)].name.c_str(); + auto name_ptr = cached_leaderboards[static_cast(hSteamLeaderboard - 1)].name.c_str(); + PRINT_DEBUG(" returned '%s'", name_ptr); + return name_ptr; } diff --git a/dll/steam_utils.cpp b/dll/steam_utils.cpp index f4395135..3f43559d 100644 --- a/dll/steam_utils.cpp +++ b/dll/steam_utils.cpp @@ -184,7 +184,7 @@ bool Steam_Utils::GetAPICallResult( SteamAPICall_t hSteamAPICall, void *pCallbac STEAM_PRIVATE_API( void Steam_Utils::RunFrame() { - PRINT_DEBUG_TODO(); + //PRINT_DEBUG_TODO(); std::lock_guard lock(global_mutex); // Steam_Client *client = get_steam_client(); // client ->RunCallbacks(true, false, false); diff --git a/sdk/steam/isteamfriends.h b/sdk/steam/isteamfriends.h index 48b313dc..192b95b5 100644 --- a/sdk/steam/isteamfriends.h +++ b/sdk/steam/isteamfriends.h @@ -765,7 +765,7 @@ struct EquippedProfileItems_t bool m_bHasProfileModifier; bool m_bHasProfileBackground; bool m_bHasMiniProfileBackground; - bool m_bFromCache; + bool m_bFromCache; // added in sdk v1.61 }; #pragma pack( pop ) diff --git a/sdk/steam/steam_api_flat.h b/sdk/steam/steam_api_flat.h index 1928e272..348e328c 100644 --- a/sdk/steam/steam_api_flat.h +++ b/sdk/steam/steam_api_flat.h @@ -1213,7 +1213,9 @@ STEAMAPI_API steam_bool SteamAPI_SteamNetworkingIdentity_SetXboxPairwiseID( Stea STEAMAPI_API const char * SteamAPI_SteamNetworkingIdentity_GetXboxPairwiseID( SteamNetworkingIdentity* self ); STEAMAPI_API void SteamAPI_SteamNetworkingIdentity_SetPSNID( SteamNetworkingIdentity* self, uint64 id ); STEAMAPI_API uint64 SteamAPI_SteamNetworkingIdentity_GetPSNID( SteamNetworkingIdentity* self ); +// removed since SDK v1.61 STEAMAPI_API void SteamAPI_SteamNetworkingIdentity_SetStadiaID( SteamNetworkingIdentity* self, uint64 id ); +// removed since SDK v1.61 STEAMAPI_API uint64 SteamAPI_SteamNetworkingIdentity_GetStadiaID( SteamNetworkingIdentity* self ); STEAMAPI_API void SteamAPI_SteamNetworkingIdentity_SetIPAddr( SteamNetworkingIdentity* self, const SteamNetworkingIPAddr & addr ); STEAMAPI_API const SteamNetworkingIPAddr * SteamAPI_SteamNetworkingIdentity_GetIPAddr( SteamNetworkingIdentity* self ); diff --git a/sdk/steam/steamclientpublic.h b/sdk/steam/steamclientpublic.h index 8a302b34..988ac6ce 100644 --- a/sdk/steam/steamclientpublic.h +++ b/sdk/steam/steamclientpublic.h @@ -1088,6 +1088,8 @@ public: // and is preferred when the caller knows it's safe to be strict. // Returns whether the string parsed correctly. bool SetFromStringStrict( const char *pchSteamID, EUniverse eDefaultUniverse ); + + // removed in sdk 1.61 bool SetFromSteam2String( const char *pchSteam2ID, EUniverse eUniverse ); inline bool operator==( const CSteamID &val ) const { return m_steamid.m_unAll64Bits == val.m_steamid.m_unAll64Bits; } diff --git a/sdk/steam/steamnetworkingtypes.h b/sdk/steam/steamnetworkingtypes.h index 8f60221b..a1d9f53b 100644 --- a/sdk/steam/steamnetworkingtypes.h +++ b/sdk/steam/steamnetworkingtypes.h @@ -341,7 +341,7 @@ struct SteamNetworkingIdentity union { uint64 m_steamID64; uint64 m_PSNID; - uint64 m_stadiaID; + uint64 m_stadiaID; // removed in sdk v1.61 char m_szGenericString[ k_cchMaxGenericString ]; char m_szXboxPairwiseID[ k_cchMaxXboxPairwiseID ]; uint8 m_genericBytes[ k_cbMaxGenericBytes ];