From 0ffc15352c589238462dde4af9fe93544e1f95d6 Mon Sep 17 00:00:00 2001 From: a Date: Wed, 6 Dec 2023 01:46:59 +0200 Subject: [PATCH] SDK v1.58a + some fixes to the APIs --- dll/dll.cpp | 112 +++++++++---- dll/flat.cpp | 44 ++++- dll/steam_client.cpp | 10 ++ dll/steam_networking_sockets.h | 13 +- dll/steam_remoteplay.h | 7 + dll/steam_ugc.h | 14 +- sdk_includes/isteamapplist.h | 2 +- sdk_includes/isteamdualsense.h | 169 ++++++++++++++++++++ sdk_includes/isteamfriends.h | 1 + sdk_includes/isteamgamecoordinator.h | 4 +- sdk_includes/isteamnetworkingsockets.h | 17 +- sdk_includes/isteamnetworkingsockets009.h | 6 +- sdk_includes/isteamps3overlayrenderer.h | 2 +- sdk_includes/isteamremoteplay.h | 11 +- sdk_includes/isteamremoteplay001.h | 37 +++++ sdk_includes/isteamugc.h | 7 +- sdk_includes/isteamugc017.h | 186 ++++++++++++++++++++++ sdk_includes/isteamuserstats.h | 2 +- sdk_includes/isteamutils.h | 2 +- sdk_includes/isteamvideo.h | 2 +- sdk_includes/steam_api.h | 67 +++++++- sdk_includes/steam_api_common.h | 6 + sdk_includes/steam_api_flat.h | 11 +- sdk_includes/steam_gameserver.h | 25 ++- sdk_includes/steamhttpenums.h | 2 +- sdk_includes/steamnetworkingtypes.h | 36 +++++ sdk_includes/steamtypes.h | 6 +- 27 files changed, 728 insertions(+), 73 deletions(-) create mode 100644 sdk_includes/isteamdualsense.h create mode 100644 sdk_includes/isteamremoteplay001.h create mode 100644 sdk_includes/isteamugc017.h diff --git a/dll/dll.cpp b/dll/dll.cpp index 18e54c9d..2895520b 100644 --- a/dll/dll.cpp +++ b/dll/dll.cpp @@ -19,30 +19,30 @@ #include "dll.h" -static char old_client[128] = "SteamClient017"; -static char old_gameserver[128] = "SteamGameServer012"; -static char old_gameserver_stats[128] = "SteamGameServerStats001"; -static char old_user[128] = "SteamUser018"; -static char old_friends[128] = "SteamFriends015"; -static char old_utils[128] = "SteamUtils007"; -static char old_matchmaking[128] = "SteamMatchMaking009"; -static char old_matchmaking_servers[128] = "SteamMatchMakingServers002"; -static char old_userstats[128] = "STEAMUSERSTATS_INTERFACE_VERSION011"; -static char old_apps[128] = "STEAMAPPS_INTERFACE_VERSION007"; -static char old_networking[128] = "SteamNetworking005"; -static char old_remote_storage_interface[128] = "STEAMREMOTESTORAGE_INTERFACE_VERSION013"; -static char old_screenshots[128] = "STEAMSCREENSHOTS_INTERFACE_VERSION002"; -static char old_http[128] = "STEAMHTTP_INTERFACE_VERSION002"; -static char old_unified_messages[128] = "STEAMUNIFIEDMESSAGES_INTERFACE_VERSION001"; -static char old_controller[128] = "SteamController003"; -static char old_ugc_interface[128] = "STEAMUGC_INTERFACE_VERSION007"; -static char old_applist[128] = "STEAMAPPLIST_INTERFACE_VERSION001"; -static char old_music[128] = "STEAMMUSIC_INTERFACE_VERSION001"; -static char old_music_remote[128] = "STEAMMUSICREMOTE_INTERFACE_VERSION001"; -static char old_html_surface[128] = "STEAMHTMLSURFACE_INTERFACE_VERSION_003"; -static char old_inventory[128] = "STEAMINVENTORY_INTERFACE_V001"; -static char old_video[128] = "STEAMVIDEO_INTERFACE_V001"; -static char old_masterserver_updater[128] = "SteamMasterServerUpdater001"; +static char old_client[128] = STEAMCLIENT_INTERFACE_VERSION; //"SteamClient017"; +static char old_gameserver[128] = STEAMGAMESERVER_INTERFACE_VERSION; //"SteamGameServer012"; +static char old_gameserver_stats[128] = STEAMGAMESERVERSTATS_INTERFACE_VERSION; //"SteamGameServerStats001"; +static char old_user[128] = STEAMUSER_INTERFACE_VERSION; //"SteamUser018"; +static char old_friends[128] = STEAMFRIENDS_INTERFACE_VERSION; //"SteamFriends015"; +static char old_utils[128] = STEAMUTILS_INTERFACE_VERSION; //"SteamUtils007"; +static char old_matchmaking[128] = STEAMMATCHMAKING_INTERFACE_VERSION; //"SteamMatchMaking009"; +static char old_matchmaking_servers[128] = STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION; //"SteamMatchMakingServers002"; +static char old_userstats[128] = STEAMUSERSTATS_INTERFACE_VERSION; //"STEAMUSERSTATS_INTERFACE_VERSION011"; +static char old_apps[128] = STEAMAPPS_INTERFACE_VERSION; //"STEAMAPPS_INTERFACE_VERSION007"; +static char old_networking[128] = STEAMNETWORKING_INTERFACE_VERSION; //"SteamNetworking005"; +static char old_remote_storage_interface[128] = STEAMREMOTESTORAGE_INTERFACE_VERSION; //"STEAMREMOTESTORAGE_INTERFACE_VERSION013"; +static char old_screenshots[128] = STEAMSCREENSHOTS_INTERFACE_VERSION; //"STEAMSCREENSHOTS_INTERFACE_VERSION002"; +static char old_http[128] = STEAMHTTP_INTERFACE_VERSION; //"STEAMHTTP_INTERFACE_VERSION002"; +static char old_unified_messages[128] = STEAMUNIFIEDMESSAGES_INTERFACE_VERSION; //"STEAMUNIFIEDMESSAGES_INTERFACE_VERSION001"; +static char old_controller[128] = STEAMCONTROLLER_INTERFACE_VERSION; //"SteamController003"; +static char old_ugc_interface[128] = STEAMUGC_INTERFACE_VERSION; //"STEAMUGC_INTERFACE_VERSION007"; +static char old_applist[128] = STEAMAPPLIST_INTERFACE_VERSION; //"STEAMAPPLIST_INTERFACE_VERSION001"; +static char old_music[128] = STEAMMUSIC_INTERFACE_VERSION; //"STEAMMUSIC_INTERFACE_VERSION001"; +static char old_music_remote[128] = STEAMMUSICREMOTE_INTERFACE_VERSION; //"STEAMMUSICREMOTE_INTERFACE_VERSION001"; +static char old_html_surface[128] = STEAMHTMLSURFACE_INTERFACE_VERSION; //"STEAMHTMLSURFACE_INTERFACE_VERSION_003"; +static char old_inventory[128] = STEAMINVENTORY_INTERFACE_VERSION; //"STEAMINVENTORY_INTERFACE_V001"; +static char old_video[128] = STEAMVIDEO_INTERFACE_VERSION; //"STEAMVIDEO_INTERFACE_V001"; +static char old_masterserver_updater[128] = STEAMMASTERSERVERUPDATER_INTERFACE_VERSION; //"SteamMasterServerUpdater001"; static bool try_load_steam_interfaces(std::string interfaces_path) { @@ -62,24 +62,31 @@ static bool try_load_steam_interfaces(std::string interfaces_path) line.erase(std::remove(line.begin(), line.end(), '\t'), line.end()); #define REPLACE_WITH_FILE(s, f) {if (line.find(s) != std::string::npos) {strncpy(f, line.c_str(), sizeof(f) - 1); continue;}} REPLACE_WITH_FILE("SteamClient", old_client); + REPLACE_WITH_FILE("SteamGameServer", old_gameserver); REPLACE_WITH_FILE("SteamGameServerStats", old_gameserver_stats); + REPLACE_WITH_FILE("SteamUser", old_user); REPLACE_WITH_FILE("SteamFriends", old_friends); - REPLACE_WITH_FILE("SteamMatchMakingServers", old_matchmaking_servers); + REPLACE_WITH_FILE("SteamUtils", old_utils); REPLACE_WITH_FILE("SteamMatchMaking", old_matchmaking); + REPLACE_WITH_FILE("SteamMatchMakingServers", old_matchmaking_servers); + REPLACE_WITH_FILE("STEAMUSERSTATS_INTERFACE_VERSION", old_userstats); + REPLACE_WITH_FILE("STEAMAPPS_INTERFACE_VERSION", old_apps); + REPLACE_WITH_FILE("SteamNetworking", old_networking); REPLACE_WITH_FILE("STEAMREMOTESTORAGE_INTERFACE_VERSION", old_remote_storage_interface); REPLACE_WITH_FILE("STEAMSCREENSHOTS_INTERFACE_VERSION", old_screenshots); REPLACE_WITH_FILE("STEAMHTTP_INTERFACE_VERSION", old_http); + REPLACE_WITH_FILE("STEAMUNIFIEDMESSAGES_INTERFACE_VERSION", old_unified_messages); REPLACE_WITH_FILE("STEAMCONTROLLER_INTERFACE_VERSION", old_controller); REPLACE_WITH_FILE("SteamController", old_controller); REPLACE_WITH_FILE("STEAMUGC_INTERFACE_VERSION", old_ugc_interface); - REPLACE_WITH_FILE("STEAMINVENTORY_INTERFACE", old_inventory); - REPLACE_WITH_FILE("STEAMUSERSTATS_INTERFACE_VERSION", old_userstats); - REPLACE_WITH_FILE("STEAMAPPS_INTERFACE_VERSION", old_apps); + REPLACE_WITH_FILE("STEAMAPPLIST_INTERFACE_VERSION", old_applist); + REPLACE_WITH_FILE("STEAMMUSIC_INTERFACE_VERSION", old_music); + REPLACE_WITH_FILE("STEAMMUSICREMOTE_INTERFACE_VERSION", old_music_remote); REPLACE_WITH_FILE("STEAMHTMLSURFACE_INTERFACE_VERSION", old_html_surface); - REPLACE_WITH_FILE("SteamNetworking", old_networking); - REPLACE_WITH_FILE("SteamUser", old_user); - REPLACE_WITH_FILE("SteamUtils", old_utils); - REPLACE_WITH_FILE("SteamGameServer", old_gameserver); + REPLACE_WITH_FILE("STEAMVIDEO_INTERFACE", old_video); + REPLACE_WITH_FILE("STEAMINVENTORY_INTERFACE", old_inventory); + REPLACE_WITH_FILE("SteamMasterServerUpdater", old_masterserver_updater); + PRINT_DEBUG("NOT REPLACED %s\n", line.c_str()); #undef REPLACE_WITH_FILE } @@ -238,6 +245,31 @@ STEAMAPI_API void * S_CALLTYPE SteamInternal_ContextInit( void *pContextInitData } //steam_api.h + +// Initialize the Steamworks SDK. +// On success k_ESteamAPIInitResult_OK is returned. Otherwise, if pOutErrMsg is non-NULL, +// it will receive a non-localized message that explains the reason for the failure +// +// Example usage: +// +// SteamErrMsg errMsg; +// if ( SteamAPI_Init(&errMsg) != k_ESteamAPIInitResult_OK ) +// FatalError( "Failed to init Steam. %s", errMsg ); +STEAMAPI_API ESteamAPIInitResult S_CALLTYPE SteamInternal_SteamAPI_Init( const char *pszInternalCheckInterfaceVersions, SteamErrMsg *pOutErrMsg ) +{ + PRINT_DEBUG("SteamInternal_SteamAPI_Init: %s\n", pszInternalCheckInterfaceVersions); + if (SteamAPI_Init()) { + return ESteamAPIInitResult::k_ESteamAPIInitResult_OK; + } + + if (pOutErrMsg) { + memcpy(*pOutErrMsg, "SteamInitEx failed", 18); + (*pOutErrMsg)[18] = 0; + (*pOutErrMsg)[19] = 0; + } + return ESteamAPIInitResult::k_ESteamAPIInitResult_FailedGeneric; +} + // SteamAPI_Init must be called before using any other API functions. If it fails, an // error message will be output to the debugger (or stderr) with further information. static HSteamPipe user_steam_pipe; @@ -642,12 +674,28 @@ STEAMAPI_API steam_bool S_CALLTYPE SteamInternal_GameServer_Init( uint32 unIP, u return get_steam_client()->steam_gameserver->InitGameServer(unIP, usGamePort, usQueryPort, unFlags, 0, pchVersionString); } +STEAMAPI_API ESteamAPIInitResult S_CALLTYPE SteamInternal_GameServer_Init_V2( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString, const char *pszInternalCheckInterfaceVersions, SteamErrMsg *pOutErrMsg ) +{ + PRINT_DEBUG("SteamInternal_GameServer_Init_V2 %u %hu %hu %u %s %s\n", unIP, usGamePort, usQueryPort, eServerMode, pchVersionString, pszInternalCheckInterfaceVersions); + if (SteamInternal_GameServer_Init(unIP, 0, usGamePort, usQueryPort, eServerMode, pchVersionString)) { + return ESteamAPIInitResult::k_ESteamAPIInitResult_OK; + } + if (pOutErrMsg) { + memcpy(*pOutErrMsg, "GameServer_V2 failed", 20); + (*pOutErrMsg)[20] = 0; + (*pOutErrMsg)[21] = 0; + } + return ESteamAPIInitResult::k_ESteamAPIInitResult_FailedGeneric; +} + //SteamGameServer004 and before: //STEAMAPI_API steam_bool SteamGameServer_Init( uint32 unIP, uint16 usPort, uint16 usGamePort, uint16 usSpectatorPort, uint16 usQueryPort, EServerMode eServerMode, int nGameAppId, const char *pchGameDir, const char *pchVersionString ); //SteamGameServer010 and before: //STEAMAPI_API steam_bool SteamGameServer_Init( uint32 unIP, uint16 usPort, uint16 usGamePort, uint16 usSpectatorPort, uint16 usQueryPort, EServerMode eServerMode, const char *pchGameDir, const char *pchVersionString ); //SteamGameServer011 and later: //STEAMAPI_API steam_bool SteamGameServer_Init( uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString ); +//SteamGameServer015 and later: +//STEAMAPI_API steam_bool SteamGameServer_Init( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString ); STEAMAPI_API steam_bool SteamGameServer_Init( uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 unknown, EServerMode eServerMode, void *unknown1, void *unknown2, void *unknown3 ) { const char *pchVersionString; diff --git a/dll/flat.cpp b/dll/flat.cpp index 7ba7a6b2..568a0540 100644 --- a/dll/flat.cpp +++ b/dll/flat.cpp @@ -3513,6 +3513,11 @@ STEAMAPI_API ISteamUGC *SteamAPI_SteamUGC_v017() return get_steam_client()->GetISteamUGC(flat_hsteamuser(), flat_hsteampipe(), "STEAMUGC_INTERFACE_VERSION017"); } +STEAMAPI_API ISteamUGC *SteamAPI_SteamUGC_v018() +{ + return get_steam_client()->GetISteamUGC(flat_hsteamuser(), flat_hsteampipe(), "STEAMUGC_INTERFACE_VERSION018"); +} + STEAMAPI_API ISteamUGC *SteamAPI_SteamGameServerUGC_v014() { return get_steam_client()->GetISteamUGC(flat_gs_hsteamuser(), flat_gs_hsteampipe(), "STEAMUGC_INTERFACE_VERSION014"); @@ -3533,6 +3538,11 @@ STEAMAPI_API ISteamUGC *SteamAPI_SteamGameServerUGC_v017() return get_steam_client()->GetISteamUGC(flat_gs_hsteamuser(), flat_gs_hsteampipe(), "STEAMUGC_INTERFACE_VERSION017"); } +STEAMAPI_API ISteamUGC *SteamAPI_SteamGameServerUGC_v018() +{ + return get_steam_client()->GetISteamUGC(flat_gs_hsteamuser(), flat_gs_hsteampipe(), "STEAMUGC_INTERFACE_VERSION018"); +} + STEAMAPI_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryUserUGCRequest( ISteamUGC* self, AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage ) { long long test1 = ((char *)self - (char*)get_steam_client()->steam_ugc); @@ -4145,7 +4155,8 @@ STEAMAPI_API steam_bool SteamAPI_ISteamUGC_SetItemVisibility( ISteamUGC* self, U return (ptr)->SetItemVisibility(handle, eVisibility); } -STEAMAPI_API steam_bool SteamAPI_ISteamUGC_SetItemTags( ISteamUGC* self, UGCUpdateHandle_t updateHandle, const SteamParamStringArray_t * pTags ) +//STEAMAPI_API steam_bool SteamAPI_ISteamUGC_SetItemTags( ISteamUGC* self, UGCUpdateHandle_t updateHandle, const SteamParamStringArray_t * pTags ) +STEAMAPI_API steam_bool SteamAPI_ISteamUGC_SetItemTags( ISteamUGC* self, UGCUpdateHandle_t updateHandle, const SteamParamStringArray_t * pTags, bool bAllowAdminTags ) { long long test1 = ((char *)self - (char*)get_steam_client()->steam_ugc); long long test2 = ((char *)self - (char*)get_steam_client()->steam_gameserver_ugc); @@ -4154,7 +4165,8 @@ STEAMAPI_API steam_bool SteamAPI_ISteamUGC_SetItemTags( ISteamUGC* self, UGCUpda ptr = get_steam_client()->steam_ugc; } - return (ptr)->SetItemTags(updateHandle, pTags); + //return (ptr)->SetItemTags(updateHandle, pTags); + return (ptr)->SetItemTags(updateHandle, pTags, bAllowAdminTags); } STEAMAPI_API steam_bool SteamAPI_ISteamUGC_SetItemContent( ISteamUGC* self, UGCUpdateHandle_t handle, const char * pszContentFolder ) @@ -4637,6 +4649,18 @@ STEAMAPI_API SteamAPICall_t SteamAPI_ISteamUGC_GetWorkshopEULAStatus( ISteamUGC* return (ptr)->GetWorkshopEULAStatus(); } +STEAMAPI_API uint32 SteamAPI_ISteamUGC_GetUserContentDescriptorPreferences( ISteamUGC* self, EUGCContentDescriptorID * pvecDescriptors, uint32 cMaxEntries ) +{ + long long test1 = ((char *)self - (char*)get_steam_client()->steam_ugc); + long long test2 = ((char *)self - (char*)get_steam_client()->steam_gameserver_ugc); + auto ptr = get_steam_client()->steam_gameserver_ugc; + if (test1 >= 0 && (test2 < 0 || test1 < test2)) { + ptr = get_steam_client()->steam_ugc; + } + + return (ptr)->GetUserContentDescriptorPreferences(pvecDescriptors, cMaxEntries); +} + STEAMAPI_API ISteamAppList *SteamAPI_SteamAppList_v001() { @@ -5482,6 +5506,11 @@ STEAMAPI_API ISteamRemotePlay *SteamAPI_SteamRemotePlay_v001() return get_steam_client()->GetISteamRemotePlay(flat_hsteamuser(), flat_hsteampipe(), "STEAMREMOTEPLAY_INTERFACE_VERSION001"); } +STEAMAPI_API ISteamRemotePlay *SteamAPI_SteamRemotePlay_v002() +{ + return get_steam_client()->GetISteamRemotePlay(flat_hsteamuser(), flat_hsteampipe(), "STEAMREMOTEPLAY_INTERFACE_VERSION002"); +} + STEAMAPI_API uint32 SteamAPI_ISteamRemotePlay_GetSessionCount( ISteamRemotePlay* self ) { return self->GetSessionCount(); @@ -5512,6 +5541,11 @@ STEAMAPI_API steam_bool SteamAPI_ISteamRemotePlay_BGetSessionClientResolution( I return self->BGetSessionClientResolution(unSessionID, pnResolutionX, pnResolutionY); } +STEAMAPI_API steam_bool SteamAPI_ISteamRemotePlay_BStartRemotePlayTogether( ISteamRemotePlay* self, bool bShowOverlay ) +{ + return self->BStartRemotePlayTogether(bShowOverlay); +} + STEAMAPI_API steam_bool SteamAPI_ISteamRemotePlay_BSendRemotePlayTogetherInvite( ISteamRemotePlay* self, uint64_steamid steamIDFriend ) { return self->BSendRemotePlayTogetherInvite(steamIDFriend); @@ -6064,7 +6098,8 @@ STEAMAPI_API EResult SteamAPI_ISteamNetworkingSockets_GetGameCoordinatorServerLo //TODO: implement old version if needed //I don't think anything actually uses this function, especially not in flat api form so I'll just leave it like this. //STEAMAPI_API HSteamNetConnection SteamAPI_ISteamNetworkingSockets_ConnectP2PCustomSignaling( ISteamNetworkingSockets* self, ISteamNetworkingConnectionCustomSignaling * pSignaling, const SteamNetworkingIdentity * pPeerIdentity, int nOptions, const SteamNetworkingConfigValue_t * pOptions ); -STEAMAPI_API HSteamNetConnection SteamAPI_ISteamNetworkingSockets_ConnectP2PCustomSignaling( ISteamNetworkingSockets* self, ISteamNetworkingConnectionCustomSignaling * pSignaling, const SteamNetworkingIdentity * pPeerIdentity, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t * pOptions ) +//STEAMAPI_API HSteamNetConnection SteamAPI_ISteamNetworkingSockets_ConnectP2PCustomSignaling( ISteamNetworkingSockets* self, ISteamNetworkingConnectionCustomSignaling * pSignaling, const SteamNetworkingIdentity * pPeerIdentity, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t * pOptions ) +STEAMAPI_API HSteamNetConnection SteamAPI_ISteamNetworkingSockets_ConnectP2PCustomSignaling( ISteamNetworkingSockets* self, ISteamNetworkingConnectionSignaling * pSignaling, const SteamNetworkingIdentity * pPeerIdentity, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t * pOptions ) { long long test1 = ((char *)self - (char*)get_steam_client()->steam_networking_sockets); long long test2 = ((char *)self - (char*)get_steam_client()->steam_gameserver_networking_sockets); @@ -6076,7 +6111,8 @@ STEAMAPI_API HSteamNetConnection SteamAPI_ISteamNetworkingSockets_ConnectP2PCust return (ptr)->ConnectP2PCustomSignaling(pSignaling, pPeerIdentity, nRemoteVirtualPort, nOptions, pOptions); } -STEAMAPI_API steam_bool SteamAPI_ISteamNetworkingSockets_ReceivedP2PCustomSignal( ISteamNetworkingSockets* self, const void * pMsg, int cbMsg, ISteamNetworkingCustomSignalingRecvContext * pContext ) +//STEAMAPI_API steam_bool SteamAPI_ISteamNetworkingSockets_ReceivedP2PCustomSignal( ISteamNetworkingSockets* self, const void * pMsg, int cbMsg, ISteamNetworkingCustomSignalingRecvContext * pContext ) +STEAMAPI_API steam_bool SteamAPI_ISteamNetworkingSockets_ReceivedP2PCustomSignal( ISteamNetworkingSockets* self, const void * pMsg, int cbMsg, ISteamNetworkingSignalingRecvContext * pContext ) { long long test1 = ((char *)self - (char*)get_steam_client()->steam_networking_sockets); long long test2 = ((char *)self - (char*)get_steam_client()->steam_gameserver_networking_sockets); diff --git a/dll/steam_client.cpp b/dll/steam_client.cpp index 17af33e7..261e51f8 100644 --- a/dll/steam_client.cpp +++ b/dll/steam_client.cpp @@ -1029,6 +1029,8 @@ ISteamUGC *Steam_Client::GetISteamUGC( HSteamUser hSteamUser, HSteamPipe hSteamP return (ISteamUGC *)(void *)(ISteamUGC015 *)steam_ugc_temp; } else if (strcmp(pchVersion, "STEAMUGC_INTERFACE_VERSION016") == 0) { return (ISteamUGC *)(void *)(ISteamUGC016 *)steam_ugc_temp; + } else if (strcmp(pchVersion, "STEAMUGC_INTERFACE_VERSION017") == 0) { + return (ISteamUGC *)(void *)(ISteamUGC017 *)steam_ugc_temp; } else if (strcmp(pchVersion, STEAMUGC_INTERFACE_VERSION) == 0) { return (ISteamUGC *)(void *)(ISteamUGC *)steam_ugc_temp; } else { @@ -1214,6 +1216,14 @@ ISteamRemotePlay *Steam_Client::GetISteamRemotePlay( HSteamUser hSteamUser, HSte PRINT_DEBUG("GetISteamRemotePlay %s\n", pchVersion); if (!steam_pipes.count(hSteamPipe) || !hSteamUser) return NULL; + if (strcmp(pchVersion, "STEAMREMOTEPLAY_INTERFACE_VERSION001") == 0) { + return (ISteamRemotePlay *)(void *)(ISteamRemotePlay001 *)steam_remoteplay; + } else if (strcmp(pchVersion, STEAMREMOTEPLAY_INTERFACE_VERSION) == 0) { + return (ISteamRemotePlay *)(void *)(ISteamRemotePlay *)steam_remoteplay; + } else { + return (ISteamRemotePlay *)(void *)(ISteamRemotePlay *)steam_remoteplay; + } + return steam_remoteplay; } diff --git a/dll/steam_networking_sockets.h b/dll/steam_networking_sockets.h index 235e7bca..b19509ec 100644 --- a/dll/steam_networking_sockets.h +++ b/dll/steam_networking_sockets.h @@ -1785,16 +1785,17 @@ EResult GetGameCoordinatorServerLogin( SteamDatagramGameCoordinatorServerLogin * HSteamNetConnection ConnectP2PCustomSignaling( ISteamNetworkingConnectionCustomSignaling *pSignaling, const SteamNetworkingIdentity *pPeerIdentity, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) { PRINT_DEBUG("Steam_Networking_Sockets::ConnectP2PCustomSignaling old\n"); - return ConnectP2PCustomSignaling(pSignaling, pPeerIdentity, 0, nOptions, pOptions); + //return ConnectP2PCustomSignaling(pSignaling, pPeerIdentity, 0, nOptions, pOptions); + return k_HSteamNetConnection_Invalid; } -HSteamNetConnection ConnectP2PCustomSignaling( ISteamNetworkingConnectionCustomSignaling *pSignaling, const SteamNetworkingIdentity *pPeerIdentity, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) +//HSteamNetConnection ConnectP2PCustomSignaling( ISteamNetworkingConnectionCustomSignaling *pSignaling, const SteamNetworkingIdentity *pPeerIdentity, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) +HSteamNetConnection ConnectP2PCustomSignaling( ISteamNetworkingConnectionSignaling *pSignaling, const SteamNetworkingIdentity *pPeerIdentity, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) { PRINT_DEBUG("Steam_Networking_Sockets::ConnectP2PCustomSignaling\n"); return k_HSteamNetConnection_Invalid; } - /// Called when custom signaling has received a message. When your /// signaling channel receives a message, it should save off whatever /// routing information was in the envelope into the context object, @@ -1825,6 +1826,12 @@ HSteamNetConnection ConnectP2PCustomSignaling( ISteamNetworkingConnectionCustomS /// If you expect to be using relayed connections, then you probably want /// to call ISteamNetworkingUtils::InitRelayNetworkAccess() when your app initializes bool ReceivedP2PCustomSignal( const void *pMsg, int cbMsg, ISteamNetworkingCustomSignalingRecvContext *pContext ) +{ + PRINT_DEBUG("Steam_Networking_Sockets::ReceivedP2PCustomSignal old\n"); + return false; +} + +bool ReceivedP2PCustomSignal( const void *pMsg, int cbMsg, ISteamNetworkingSignalingRecvContext *pContext ) { PRINT_DEBUG("Steam_Networking_Sockets::ReceivedP2PCustomSignal\n"); return false; diff --git a/dll/steam_remoteplay.h b/dll/steam_remoteplay.h index 7bd97ff5..feaeea65 100644 --- a/dll/steam_remoteplay.h +++ b/dll/steam_remoteplay.h @@ -18,6 +18,7 @@ #include "base.h" class Steam_RemotePlay : +public ISteamRemotePlay001, public ISteamRemotePlay { class Settings *settings; @@ -105,6 +106,12 @@ bool BGetSessionClientResolution( uint32 unSessionID, int *pnResolutionX, int *p return false; } +bool BStartRemotePlayTogether( bool bShowOverlay ) +{ + PRINT_DEBUG("Steam_RemotePlay::BStartRemotePlayTogether: %d\n", (int)bShowOverlay); + return false; +} + // Invite a friend to Remote Play Together // This returns false if the invite can't be sent bool BSendRemotePlayTogetherInvite( CSteamID steamIDFriend ) diff --git a/dll/steam_ugc.h b/dll/steam_ugc.h index 53171dcd..c7c752d8 100644 --- a/dll/steam_ugc.h +++ b/dll/steam_ugc.h @@ -41,6 +41,7 @@ public ISteamUGC013, public ISteamUGC014, public ISteamUGC015, public ISteamUGC016, +public ISteamUGC017, public ISteamUGC { class Settings *settings; @@ -536,13 +537,18 @@ bool SetItemVisibility( UGCUpdateHandle_t handle, ERemoteStoragePublishedFileVis bool SetItemTags( UGCUpdateHandle_t updateHandle, const SteamParamStringArray_t *pTags ) +{ + PRINT_DEBUG("Steam_UGC::SetItemTags old\n"); + return false; +} + +bool SetItemTags( UGCUpdateHandle_t updateHandle, const SteamParamStringArray_t *pTags, bool bAllowAdminTags ) { PRINT_DEBUG("Steam_UGC::SetItemTags\n"); return false; } // change the tags of an UGC item - bool SetItemContent( UGCUpdateHandle_t handle, const char *pszContentFolder ) { PRINT_DEBUG("Steam_UGC::SetItemContent\n"); @@ -929,5 +935,11 @@ SteamAPICall_t GetWorkshopEULAStatus() return 0; } +// Return the user's community content descriptor preferences +uint32 GetUserContentDescriptorPreferences( EUGCContentDescriptorID *pvecDescriptors, uint32 cMaxEntries ) +{ + PRINT_DEBUG("%s\n", __FUNCTION__); + return 0; +} }; diff --git a/sdk_includes/isteamapplist.h b/sdk_includes/isteamapplist.h index ffe26186..46b60baf 100644 --- a/sdk_includes/isteamapplist.h +++ b/sdk_includes/isteamapplist.h @@ -48,7 +48,7 @@ STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamAppList *, SteamAppList, STEAMAPPLIS //--------------------------------------------------------------------------------- -// Purpose: Sent when a new app is installed +// Purpose: Sent when a new app is installed (not downloaded yet) //--------------------------------------------------------------------------------- STEAM_CALLBACK_BEGIN( SteamAppInstalled_t, k_iSteamAppListCallbacks + 1 ) STEAM_CALLBACK_MEMBER( 0, AppId_t, m_nAppID ) // ID of the app that installs diff --git a/sdk_includes/isteamdualsense.h b/sdk_includes/isteamdualsense.h new file mode 100644 index 00000000..5acc8574 --- /dev/null +++ b/sdk_includes/isteamdualsense.h @@ -0,0 +1,169 @@ +/* SIE CONFIDENTIAL + * $PSLibId$ + * Copyright (C) 2019 Sony Interactive Entertainment Inc. + * All Rights Reserved. + */ + + +#ifndef _SCE_PAD_TRIGGER_EFFECT_H +#define _SCE_PAD_TRIGGER_EFFECT_H + + +#define SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_L2 0x01 +#define SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_R2 0x02 + +#define SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_L2 0 +#define SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2 1 + +#define SCE_PAD_TRIGGER_EFFECT_TRIGGER_NUM 2 + +/* Definition of control point num */ +#define SCE_PAD_TRIGGER_EFFECT_CONTROL_POINT_NUM 10 + +typedef enum ScePadTriggerEffectMode{ + SCE_PAD_TRIGGER_EFFECT_MODE_OFF, + SCE_PAD_TRIGGER_EFFECT_MODE_FEEDBACK, + SCE_PAD_TRIGGER_EFFECT_MODE_WEAPON, + SCE_PAD_TRIGGER_EFFECT_MODE_VIBRATION, + SCE_PAD_TRIGGER_EFFECT_MODE_MULTIPLE_POSITION_FEEDBACK, + SCE_PAD_TRIGGER_EFFECT_MODE_SLOPE_FEEDBACK, + SCE_PAD_TRIGGER_EFFECT_MODE_MULTIPLE_POSITION_VIBRATION, +} ScePadTriggerEffectMode; + +/** + *E + * @brief parameter for setting the trigger effect to off mode. + * Off Mode: Stop trigger effect. + **/ +typedef struct ScePadTriggerEffectOffParam{ + uint8_t padding[48]; +} ScePadTriggerEffectOffParam; + +/** + *E + * @brief parameter for setting the trigger effect to Feedback mode. + * Feedback Mode: The motor arm pushes back trigger. + * Trigger obtains stiffness at specified position. + **/ +typedef struct ScePadTriggerEffectFeedbackParam{ + uint8_t position; /*E position where the strength of target trigger start changing(0~9). */ + uint8_t strength; /*E strength that the motor arm pushes back target trigger(0~8 (0: Same as Off mode)). */ + uint8_t padding[46]; +} ScePadTriggerEffectFeedbackParam; + +/** + *E + * @brief parameter for setting the trigger effect to Weapon mode. + * Weapon Mode: Emulate weapon like gun trigger. + **/ +typedef struct ScePadTriggerEffectWeaponParam{ + uint8_t startPosition; /*E position where the stiffness of trigger start changing(2~7). */ + uint8_t endPosition; /*E position where the stiffness of trigger finish changing(startPosition+1~8). */ + uint8_t strength; /*E strength of gun trigger(0~8 (0: Same as Off mode)). */ + uint8_t padding[45]; +} ScePadTriggerEffectWeaponParam; + +/** + *E + * @brief parameter for setting the trigger effect to Vibration mode. + * Vibration Mode: Vibrates motor arm around specified position. + **/ +typedef struct ScePadTriggerEffectVibrationParam{ + uint8_t position; /*E position where the motor arm start vibrating(0~9). */ + uint8_t amplitude; /*E vibration amplitude(0~8 (0: Same as Off mode)). */ + uint8_t frequency; /*E vibration frequency(0~255[Hz] (0: Same as Off mode)). */ + uint8_t padding[45]; +} ScePadTriggerEffectVibrationParam; + +/** + *E + * @brief parameter for setting the trigger effect to ScePadTriggerEffectMultiplePositionFeedbackParam mode. + * Multi Position Feedback Mode: The motor arm pushes back trigger. + * Trigger obtains specified stiffness at each control point. + **/ +typedef struct ScePadTriggerEffectMultiplePositionFeedbackParam{ + uint8_t strength[SCE_PAD_TRIGGER_EFFECT_CONTROL_POINT_NUM]; /*E strength that the motor arm pushes back target trigger at position(0~8 (0: Same as Off mode)). + * strength[0] means strength of motor arm at position0. + * strength[1] means strength of motor arm at position1. + * ... + * */ + uint8_t padding[38]; +} ScePadTriggerEffectMultiplePositionFeedbackParam; + +/** + *E + * @brief parameter for setting the trigger effect to Feedback3 mode. + * Slope Feedback Mode: The motor arm pushes back trigger between two spedified control points. + * Stiffness of the trigger is changing depending on the set place. + **/ +typedef struct ScePadTriggerEffectSlopeFeedbackParam{ + + uint8_t startPosition; /*E position where the strength of target trigger start changing(0~endPosition). */ + uint8_t endPosition; /*E position where the strength of target trigger finish changing(startPosition+1~9). */ + uint8_t startStrength; /*E strength when trigger's position is startPosition(1~8) */ + uint8_t endStrength; /*E strength when trigger's position is endPosition(1~8) */ + uint8_t padding[44]; +} ScePadTriggerEffectSlopeFeedbackParam; + +/** + *E + * @brief parameter for setting the trigger effect to Vibration2 mode. + * Multi Position Vibration Mode: Vibrates motor arm around specified control point. + * Trigger vibrates specified amplitude at each control point. + **/ +typedef struct ScePadTriggerEffectMultiplePositionVibrationParam{ + uint8_t frequency; /*E vibration frequency(0~255 (0: Same as Off mode)) */ + uint8_t amplitude[SCE_PAD_TRIGGER_EFFECT_CONTROL_POINT_NUM]; /*E vibration amplitude at position(0~8 (0: Same as Off mode)). + * amplitude[0] means amplitude of vibration at position0. + * amplitude[1] means amplitude of vibration at position1. + * ... + * */ + uint8_t padding[37]; +} ScePadTriggerEffectMultiplePositionVibrationParam; + +/** + *E + * @brief parameter for setting the trigger effect mode. + **/ +typedef union ScePadTriggerEffectCommandData{ + ScePadTriggerEffectOffParam offParam; + ScePadTriggerEffectFeedbackParam feedbackParam; + ScePadTriggerEffectWeaponParam weaponParam; + ScePadTriggerEffectVibrationParam vibrationParam; + ScePadTriggerEffectMultiplePositionFeedbackParam multiplePositionFeedbackParam; + ScePadTriggerEffectSlopeFeedbackParam slopeFeedbackParam; + ScePadTriggerEffectMultiplePositionVibrationParam multiplePositionVibrationParam; +} ScePadTriggerEffectCommandData; + +/** + *E + * @brief parameter for setting the trigger effect. + **/ +typedef struct ScePadTriggerEffectCommand{ + ScePadTriggerEffectMode mode; + uint8_t padding[4]; + ScePadTriggerEffectCommandData commandData; +} ScePadTriggerEffectCommand; + +/** + *E + * @brief parameter for the scePadSetTriggerEffect function. + **/ +typedef struct ScePadTriggerEffectParam{ + + uint8_t triggerMask; /*E Set trigger mask to activate trigger effect commands. + * SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_L2 : 0x01 + * SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_R2 : 0x02 + * */ + uint8_t padding[7]; + + ScePadTriggerEffectCommand command[SCE_PAD_TRIGGER_EFFECT_TRIGGER_NUM]; /*E command[SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_L2] is for L2 trigger setting + * and param[SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2] is for R2 trgger setting. + * */ +} ScePadTriggerEffectParam; + +#if defined(__cplusplus) && __cplusplus >= 201103L +static_assert( sizeof( ScePadTriggerEffectParam ) == 120, "ScePadTriggerEffectParam has incorrect size" ); +#endif + +#endif /* _SCE_PAD_TRIGGER_EFFECT_H */ diff --git a/sdk_includes/isteamfriends.h b/sdk_includes/isteamfriends.h index 9a8b46d6..480d26a1 100644 --- a/sdk_includes/isteamfriends.h +++ b/sdk_includes/isteamfriends.h @@ -530,6 +530,7 @@ struct GameOverlayActivated_t uint8 m_bActive; // true if it's just been activated, false otherwise bool m_bUserInitiated; // true if the user asked for the overlay to be activated/deactivated AppId_t m_nAppID; // the appID of the game (should always be the current game) + uint32 m_dwOverlayPID; // used internally }; diff --git a/sdk_includes/isteamgamecoordinator.h b/sdk_includes/isteamgamecoordinator.h index 5b23aad5..a8fb6df3 100644 --- a/sdk_includes/isteamgamecoordinator.h +++ b/sdk_includes/isteamgamecoordinator.h @@ -1,4 +1,4 @@ -//====== Copyright �, Valve Corporation, All rights reserved. ======= +//====== Copyright ©, Valve Corporation, All rights reserved. ======= // // Purpose: interface to the game coordinator for this application // @@ -33,6 +33,8 @@ class ISteamGameCoordinator public: // sends a message to the Game Coordinator + // Note this underscore isn't a mistake, on MSVC SendMessage is a function defined in WinUser.h + // https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendmessage virtual EGCResults SendMessage_( uint32 unMsgType, const void *pubData, uint32 cubData ) = 0; // returns true if there is a message waiting from the game coordinator diff --git a/sdk_includes/isteamnetworkingsockets.h b/sdk_includes/isteamnetworkingsockets.h index 57ff77c0..1a693d3c 100644 --- a/sdk_includes/isteamnetworkingsockets.h +++ b/sdk_includes/isteamnetworkingsockets.h @@ -209,7 +209,7 @@ public: /// WARNING: Be *very careful* when using the value provided in callbacks structs. /// Callbacks are queued, and the value that you will receive in your /// callback is the userdata that was effective at the time the callback - /// was queued. There are subtle race conditions that can hapen if you + /// was queued. There are subtle race conditions that can happen if you /// don't understand this! /// /// If any incoming messages for this connection are queued, the userdata @@ -400,10 +400,9 @@ public: /// lanes may be sent out of order. Each lane has its own message number /// sequence. The first message sent on each lane will be assigned the number 1. /// - /// Each lane has a "priority". Lower priority lanes will only be processed - /// when all higher-priority lanes are empty. The magnitudes of the priority - /// values are not relevant, only their sort order. Higher numeric values - /// take priority over lower numeric values. + /// Each lane has a "priority". Lanes with higher numeric values will only be processed + /// when all lanes with lower number values are empty. The magnitudes of the priority + /// values are not relevant, only their sort order. /// /// Each lane also is assigned a weight, which controls the approximate proportion /// of the bandwidth that will be consumed by the lane, relative to other lanes @@ -732,7 +731,8 @@ public: /// If you need to set any initial config options, pass them here. See /// SteamNetworkingConfigValue_t for more about why this is preferable to /// setting the options "immediately" after creation. - virtual HSteamNetConnection ConnectP2PCustomSignaling( ISteamNetworkingConnectionCustomSignaling *pSignaling, const SteamNetworkingIdentity *pPeerIdentity, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0; + //virtual HSteamNetConnection ConnectP2PCustomSignaling( ISteamNetworkingConnectionCustomSignaling *pSignaling, const SteamNetworkingIdentity *pPeerIdentity, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0; + virtual HSteamNetConnection ConnectP2PCustomSignaling( ISteamNetworkingConnectionSignaling *pSignaling, const SteamNetworkingIdentity *pPeerIdentity, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0; /// Called when custom signaling has received a message. When your /// signaling channel receives a message, it should save off whatever @@ -763,7 +763,8 @@ public: /// /// If you expect to be using relayed connections, then you probably want /// to call ISteamNetworkingUtils::InitRelayNetworkAccess() when your app initializes - virtual bool ReceivedP2PCustomSignal( const void *pMsg, int cbMsg, ISteamNetworkingCustomSignalingRecvContext *pContext ) = 0; + //virtual bool ReceivedP2PCustomSignal( const void *pMsg, int cbMsg, ISteamNetworkingCustomSignalingRecvContext *pContext ) = 0; + virtual bool ReceivedP2PCustomSignal( const void *pMsg, int cbMsg, ISteamNetworkingSignalingRecvContext *pContext ) = 0; // // Certificate provision by the application. On Steam, we normally handle all this automatically @@ -832,7 +833,7 @@ public: /// different types of traffic. Because these allocations come from a global /// namespace, there is a relatively strict limit on the maximum number of /// ports you may request. (At the time of this writing, the limit is 4.) - /// The Port assignments are *not* guaranteed to have any particular order + /// The port assignments are *not* guaranteed to have any particular order /// or relationship! Do *not* assume they are contiguous, even though that /// may often occur in practice. /// diff --git a/sdk_includes/isteamnetworkingsockets009.h b/sdk_includes/isteamnetworkingsockets009.h index fbef0d52..dd73df60 100644 --- a/sdk_includes/isteamnetworkingsockets009.h +++ b/sdk_includes/isteamnetworkingsockets009.h @@ -590,7 +590,8 @@ public: /// If you need to set any initial config options, pass them here. See /// SteamNetworkingConfigValue_t for more about why this is preferable to /// setting the options "immediately" after creation. - virtual HSteamNetConnection ConnectP2PCustomSignaling( ISteamNetworkingConnectionCustomSignaling *pSignaling, const SteamNetworkingIdentity *pPeerIdentity, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0; + //virtual HSteamNetConnection ConnectP2PCustomSignaling( ISteamNetworkingConnectionCustomSignaling *pSignaling, const SteamNetworkingIdentity *pPeerIdentity, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0; + virtual HSteamNetConnection ConnectP2PCustomSignaling( ISteamNetworkingConnectionSignaling *pSignaling, const SteamNetworkingIdentity *pPeerIdentity, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t *pOptions ) = 0; /// Called when custom signaling has received a message. When your /// signaling channel receives a message, it should save off whatever @@ -621,7 +622,8 @@ public: /// /// If you expect to be using relayed connections, then you probably want /// to call ISteamNetworkingUtils::InitRelayNetworkAccess() when your app initializes - virtual bool ReceivedP2PCustomSignal( const void *pMsg, int cbMsg, ISteamNetworkingCustomSignalingRecvContext *pContext ) = 0; + //virtual bool ReceivedP2PCustomSignal( const void *pMsg, int cbMsg, ISteamNetworkingCustomSignalingRecvContext *pContext ) = 0; + virtual bool ReceivedP2PCustomSignal( const void *pMsg, int cbMsg, ISteamNetworkingSignalingRecvContext *pContext ) = 0; // // Certificate provision by the application. On Steam, we normally handle all this automatically diff --git a/sdk_includes/isteamps3overlayrenderer.h b/sdk_includes/isteamps3overlayrenderer.h index 2b6c5680..bec7c08b 100644 --- a/sdk_includes/isteamps3overlayrenderer.h +++ b/sdk_includes/isteamps3overlayrenderer.h @@ -1,4 +1,4 @@ -//====== Copyright � 1996-2010, Valve Corporation, All rights reserved. ======= +//====== Copyright © 1996-2010, Valve Corporation, All rights reserved. ======= // // Purpose: interface the game must provide Steam with on PS3 in order for the // Steam overlay to render. diff --git a/sdk_includes/isteamremoteplay.h b/sdk_includes/isteamremoteplay.h index 569c2359..79ba57ec 100644 --- a/sdk_includes/isteamremoteplay.h +++ b/sdk_includes/isteamremoteplay.h @@ -2,7 +2,7 @@ #ifndef ISTEAMREMOTEPLAY_H #define ISTEAMREMOTEPLAY_H -#ifdef _WIN32 +#ifdef STEAM_WIN32 #pragma once #endif @@ -51,12 +51,17 @@ public: // This is set to 0x0 if the resolution is not available virtual bool BGetSessionClientResolution( RemotePlaySessionID_t unSessionID, int *pnResolutionX, int *pnResolutionY ) = 0; + // Start Remote Play Together and optionally show the UI in the overlay + // This returns false if Remote Play Together can't be started or your game is not configured for Remote Play Together + virtual bool BStartRemotePlayTogether( bool bShowOverlay = true ) = 0; + // Invite a friend to Remote Play Together, or create a guest invite if steamIDFriend is empty - // This returns false if the invite can't be sent + // This will automatically start Remote Play Together if it hasn't already been started + // This returns false if the invite can't be sent or your game is not configured for Remote Play Together virtual bool BSendRemotePlayTogetherInvite( CSteamID steamIDFriend ) = 0; }; -#define STEAMREMOTEPLAY_INTERFACE_VERSION "STEAMREMOTEPLAY_INTERFACE_VERSION001" +#define STEAMREMOTEPLAY_INTERFACE_VERSION "STEAMREMOTEPLAY_INTERFACE_VERSION002" // Global interface accessor inline ISteamRemotePlay *SteamRemotePlay(); diff --git a/sdk_includes/isteamremoteplay001.h b/sdk_includes/isteamremoteplay001.h new file mode 100644 index 00000000..ef8a5212 --- /dev/null +++ b/sdk_includes/isteamremoteplay001.h @@ -0,0 +1,37 @@ +//============ Copyright (c) Valve Corporation, All rights reserved. ============ + +#ifndef ISTEAMREMOTEPLAY001_H +#define ISTEAMREMOTEPLAY001_H +#ifdef STEAM_WIN32 +#pragma once +#endif + +class ISteamRemotePlay001 +{ +public: + // Get the number of currently connected Steam Remote Play sessions + virtual uint32 GetSessionCount() = 0; + + // Get the currently connected Steam Remote Play session ID at the specified index. Returns zero if index is out of bounds. + virtual RemotePlaySessionID_t GetSessionID( int iSessionIndex ) = 0; + + // Get the SteamID of the connected user + virtual CSteamID GetSessionSteamID( RemotePlaySessionID_t unSessionID ) = 0; + + // Get the name of the session client device + // This returns NULL if the sessionID is not valid + virtual const char *GetSessionClientName( RemotePlaySessionID_t unSessionID ) = 0; + + // Get the form factor of the session client device + virtual ESteamDeviceFormFactor GetSessionClientFormFactor( RemotePlaySessionID_t unSessionID ) = 0; + + // Get the resolution, in pixels, of the session client device + // This is set to 0x0 if the resolution is not available + virtual bool BGetSessionClientResolution( RemotePlaySessionID_t unSessionID, int *pnResolutionX, int *pnResolutionY ) = 0; + + // Invite a friend to Remote Play Together, or create a guest invite if steamIDFriend is empty + // This returns false if the invite can't be sent + virtual bool BSendRemotePlayTogetherInvite( CSteamID steamIDFriend ) = 0; +}; + +#endif // #define ISTEAMREMOTEPLAY001_H diff --git a/sdk_includes/isteamugc.h b/sdk_includes/isteamugc.h index a881136f..17bd8fb2 100644 --- a/sdk_includes/isteamugc.h +++ b/sdk_includes/isteamugc.h @@ -292,7 +292,7 @@ public: virtual bool SetItemUpdateLanguage( UGCUpdateHandle_t handle, const char *pchLanguage ) = 0; // specify the language of the title or description that will be set virtual bool SetItemMetadata( UGCUpdateHandle_t handle, const char *pchMetaData ) = 0; // change the metadata of an UGC item (max = k_cchDeveloperMetadataMax) virtual bool SetItemVisibility( UGCUpdateHandle_t handle, ERemoteStoragePublishedFileVisibility eVisibility ) = 0; // change the visibility of an UGC item - virtual bool SetItemTags( UGCUpdateHandle_t updateHandle, const SteamParamStringArray_t *pTags ) = 0; // change the tags of an UGC item + virtual bool SetItemTags( UGCUpdateHandle_t updateHandle, const SteamParamStringArray_t *pTags, bool bAllowAdminTags = false ) = 0; // change the tags of an UGC item virtual bool SetItemContent( UGCUpdateHandle_t handle, const char *pszContentFolder ) = 0; // update item content from this local folder virtual bool SetItemPreview( UGCUpdateHandle_t handle, const char *pszPreviewFile ) = 0; // change preview image file for this item. pszPreviewFile points to local image file, which must be under 1MB in size virtual bool SetAllowLegacyUpload( UGCUpdateHandle_t handle, bool bAllowLegacyUpload ) = 0; // use legacy upload for a single small file. The parameter to SetItemContent() should either be a directory with one file or the full path to the file. The file must also be less than 10MB in size. @@ -382,9 +382,12 @@ public: // Retrieve information related to the user's acceptance or not of the app's specific Workshop EULA STEAM_CALL_RESULT( WorkshopEULAStatus_t ) virtual SteamAPICall_t GetWorkshopEULAStatus() = 0; + + // Return the user's community content descriptor preferences + virtual uint32 GetUserContentDescriptorPreferences( EUGCContentDescriptorID *pvecDescriptors, uint32 cMaxEntries ) = 0; }; -#define STEAMUGC_INTERFACE_VERSION "STEAMUGC_INTERFACE_VERSION017" +#define STEAMUGC_INTERFACE_VERSION "STEAMUGC_INTERFACE_VERSION018" #ifndef STEAM_API_EXPORTS // Global interface accessor diff --git a/sdk_includes/isteamugc017.h b/sdk_includes/isteamugc017.h new file mode 100644 index 00000000..f1b95fc0 --- /dev/null +++ b/sdk_includes/isteamugc017.h @@ -0,0 +1,186 @@ + +#ifndef ISTEAMUGC017_H +#define ISTEAMUGC017_H +#ifdef STEAM_WIN32 +#pragma once +#endif + +class ISteamUGC017 +{ +public: + + // Query UGC associated with a user. Creator app id or consumer app id must be valid and be set to the current running app. unPage should start at 1. + virtual UGCQueryHandle_t CreateQueryUserUGCRequest( AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage ) = 0; + + // Query for all matching UGC. Creator app id or consumer app id must be valid and be set to the current running app. unPage should start at 1. + STEAM_FLAT_NAME( CreateQueryAllUGCRequestPage ) + virtual UGCQueryHandle_t CreateQueryAllUGCRequest( EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage ) = 0; + + // Query for all matching UGC using the new deep paging interface. Creator app id or consumer app id must be valid and be set to the current running app. pchCursor should be set to NULL or "*" to get the first result set. + STEAM_FLAT_NAME( CreateQueryAllUGCRequestCursor ) + virtual UGCQueryHandle_t CreateQueryAllUGCRequest( EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, const char *pchCursor = NULL ) = 0; + + // Query for the details of the given published file ids (the RequestUGCDetails call is deprecated and replaced with this) + virtual UGCQueryHandle_t CreateQueryUGCDetailsRequest( PublishedFileId_t *pvecPublishedFileID, uint32 unNumPublishedFileIDs ) = 0; + + // Send the query to Steam + STEAM_CALL_RESULT( SteamUGCQueryCompleted_t ) + 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 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; + 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; + virtual bool GetQueryUGCStatistic( UGCQueryHandle_t handle, uint32 index, EItemStatistic eStatType, uint64 *pStatValue ) = 0; + virtual uint32 GetQueryUGCNumAdditionalPreviews( UGCQueryHandle_t handle, uint32 index ) = 0; + virtual bool GetQueryUGCAdditionalPreview( UGCQueryHandle_t handle, uint32 index, uint32 previewIndex, STEAM_OUT_STRING_COUNT(cchURLSize) char *pchURLOrVideoID, uint32 cchURLSize, STEAM_OUT_STRING_COUNT(cchURLSize) char *pchOriginalFileName, uint32 cchOriginalFileNameSize, EItemPreviewType *pPreviewType ) = 0; + virtual uint32 GetQueryUGCNumKeyValueTags( UGCQueryHandle_t handle, uint32 index ) = 0; + virtual bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint32 index, uint32 keyValueTagIndex, STEAM_OUT_STRING_COUNT(cchKeySize) char *pchKey, uint32 cchKeySize, STEAM_OUT_STRING_COUNT(cchValueSize) char *pchValue, uint32 cchValueSize ) = 0; + + // Return the first value matching the pchKey. Note that a key may map to multiple values. Returns false if there was an error or no matching value was found. + STEAM_FLAT_NAME( GetQueryFirstUGCKeyValueTag ) + virtual bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint32 index, const char *pchKey, STEAM_OUT_STRING_COUNT(cchValueSize) char *pchValue, uint32 cchValueSize ) = 0; + + virtual uint32 GetQueryUGCContentDescriptors( UGCQueryHandle_t handle, uint32 index, EUGCContentDescriptorID *pvecDescriptors, uint32 cMaxEntries ) = 0; + + // Release the request to free up memory, after retrieving results + virtual bool ReleaseQueryUGCRequest( UGCQueryHandle_t handle ) = 0; + + // Options to set for querying UGC + virtual bool AddRequiredTag( UGCQueryHandle_t handle, const char *pTagName ) = 0; + virtual bool AddRequiredTagGroup( UGCQueryHandle_t handle, const SteamParamStringArray_t *pTagGroups ) = 0; // match any of the tags in this group + virtual bool AddExcludedTag( UGCQueryHandle_t handle, const char *pTagName ) = 0; + virtual bool SetReturnOnlyIDs( UGCQueryHandle_t handle, bool bReturnOnlyIDs ) = 0; + virtual bool SetReturnKeyValueTags( UGCQueryHandle_t handle, bool bReturnKeyValueTags ) = 0; + virtual bool SetReturnLongDescription( UGCQueryHandle_t handle, bool bReturnLongDescription ) = 0; + virtual bool SetReturnMetadata( UGCQueryHandle_t handle, bool bReturnMetadata ) = 0; + virtual bool SetReturnChildren( UGCQueryHandle_t handle, bool bReturnChildren ) = 0; + virtual bool SetReturnAdditionalPreviews( UGCQueryHandle_t handle, bool bReturnAdditionalPreviews ) = 0; + virtual bool SetReturnTotalOnly( UGCQueryHandle_t handle, bool bReturnTotalOnly ) = 0; + virtual bool SetReturnPlaytimeStats( UGCQueryHandle_t handle, uint32 unDays ) = 0; + virtual bool SetLanguage( UGCQueryHandle_t handle, const char *pchLanguage ) = 0; + virtual bool SetAllowCachedResponse( UGCQueryHandle_t handle, uint32 unMaxAgeSeconds ) = 0; + + // Options only for querying user UGC + virtual bool SetCloudFileNameFilter( UGCQueryHandle_t handle, const char *pMatchCloudFileName ) = 0; + + // Options only for querying all UGC + virtual bool SetMatchAnyTag( UGCQueryHandle_t handle, bool bMatchAnyTag ) = 0; + virtual bool SetSearchText( UGCQueryHandle_t handle, const char *pSearchText ) = 0; + virtual bool SetRankedByTrendDays( UGCQueryHandle_t handle, uint32 unDays ) = 0; + virtual bool SetTimeCreatedDateRange( UGCQueryHandle_t handle, RTime32 rtStart, RTime32 rtEnd ) = 0; + virtual bool SetTimeUpdatedDateRange( UGCQueryHandle_t handle, RTime32 rtStart, RTime32 rtEnd ) = 0; + virtual bool AddRequiredKeyValueTag( UGCQueryHandle_t handle, const char *pKey, const char *pValue ) = 0; + + // DEPRECATED - Use CreateQueryUGCDetailsRequest call above instead! + STEAM_CALL_RESULT( SteamUGCRequestUGCDetailsResult_t ) + virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0; + + // Steam Workshop Creator API + STEAM_CALL_RESULT( CreateItemResult_t ) + virtual SteamAPICall_t CreateItem( AppId_t nConsumerAppId, EWorkshopFileType eFileType ) = 0; // create new item for this app with no content attached yet + + virtual UGCUpdateHandle_t StartItemUpdate( AppId_t nConsumerAppId, PublishedFileId_t nPublishedFileID ) = 0; // start an UGC item update. Set changed properties before commiting update with CommitItemUpdate() + + virtual bool SetItemTitle( UGCUpdateHandle_t handle, const char *pchTitle ) = 0; // change the title of an UGC item + virtual bool SetItemDescription( UGCUpdateHandle_t handle, const char *pchDescription ) = 0; // change the description of an UGC item + virtual bool SetItemUpdateLanguage( UGCUpdateHandle_t handle, const char *pchLanguage ) = 0; // specify the language of the title or description that will be set + virtual bool SetItemMetadata( UGCUpdateHandle_t handle, const char *pchMetaData ) = 0; // change the metadata of an UGC item (max = k_cchDeveloperMetadataMax) + virtual bool SetItemVisibility( UGCUpdateHandle_t handle, ERemoteStoragePublishedFileVisibility eVisibility ) = 0; // change the visibility of an UGC item + virtual bool SetItemTags( UGCUpdateHandle_t updateHandle, const SteamParamStringArray_t *pTags ) = 0; // change the tags of an UGC item + virtual bool SetItemContent( UGCUpdateHandle_t handle, const char *pszContentFolder ) = 0; // update item content from this local folder + virtual bool SetItemPreview( UGCUpdateHandle_t handle, const char *pszPreviewFile ) = 0; // change preview image file for this item. pszPreviewFile points to local image file, which must be under 1MB in size + virtual bool SetAllowLegacyUpload( UGCUpdateHandle_t handle, bool bAllowLegacyUpload ) = 0; // use legacy upload for a single small file. The parameter to SetItemContent() should either be a directory with one file or the full path to the file. The file must also be less than 10MB in size. + virtual bool RemoveAllItemKeyValueTags( UGCUpdateHandle_t handle ) = 0; // remove all existing key-value tags (you can add new ones via the AddItemKeyValueTag function) + virtual bool RemoveItemKeyValueTags( UGCUpdateHandle_t handle, const char *pchKey ) = 0; // remove any existing key-value tags with the specified key + virtual bool AddItemKeyValueTag( UGCUpdateHandle_t handle, const char *pchKey, const char *pchValue ) = 0; // add new key-value tags for the item. Note that there can be multiple values for a tag. + virtual bool AddItemPreviewFile( UGCUpdateHandle_t handle, const char *pszPreviewFile, EItemPreviewType type ) = 0; // add preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size + virtual bool AddItemPreviewVideo( UGCUpdateHandle_t handle, const char *pszVideoID ) = 0; // add preview video for this item + virtual bool UpdateItemPreviewFile( UGCUpdateHandle_t handle, uint32 index, const char *pszPreviewFile ) = 0; // updates an existing preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size + virtual bool UpdateItemPreviewVideo( UGCUpdateHandle_t handle, uint32 index, const char *pszVideoID ) = 0; // updates an existing preview video for this item + virtual bool RemoveItemPreview( UGCUpdateHandle_t handle, uint32 index ) = 0; // remove a preview by index starting at 0 (previews are sorted) + virtual bool AddContentDescriptor( UGCUpdateHandle_t handle, EUGCContentDescriptorID descid ) = 0; + virtual bool RemoveContentDescriptor( UGCUpdateHandle_t handle, EUGCContentDescriptorID descid ) = 0; + + STEAM_CALL_RESULT( SubmitItemUpdateResult_t ) + virtual SteamAPICall_t SubmitItemUpdate( UGCUpdateHandle_t handle, const char *pchChangeNote ) = 0; // commit update process started with StartItemUpdate() + virtual EItemUpdateStatus GetItemUpdateProgress( UGCUpdateHandle_t handle, uint64 *punBytesProcessed, uint64* punBytesTotal ) = 0; + + // Steam Workshop Consumer API + STEAM_CALL_RESULT( SetUserItemVoteResult_t ) + virtual SteamAPICall_t SetUserItemVote( PublishedFileId_t nPublishedFileID, bool bVoteUp ) = 0; + STEAM_CALL_RESULT( GetUserItemVoteResult_t ) + virtual SteamAPICall_t GetUserItemVote( PublishedFileId_t nPublishedFileID ) = 0; + STEAM_CALL_RESULT( UserFavoriteItemsListChanged_t ) + virtual SteamAPICall_t AddItemToFavorites( AppId_t nAppId, PublishedFileId_t nPublishedFileID ) = 0; + STEAM_CALL_RESULT( UserFavoriteItemsListChanged_t ) + virtual SteamAPICall_t RemoveItemFromFavorites( AppId_t nAppId, PublishedFileId_t nPublishedFileID ) = 0; + STEAM_CALL_RESULT( RemoteStorageSubscribePublishedFileResult_t ) + virtual SteamAPICall_t SubscribeItem( PublishedFileId_t nPublishedFileID ) = 0; // subscribe to this item, will be installed ASAP + STEAM_CALL_RESULT( RemoteStorageUnsubscribePublishedFileResult_t ) + virtual SteamAPICall_t UnsubscribeItem( PublishedFileId_t nPublishedFileID ) = 0; // unsubscribe from this item, will be uninstalled after game quits + virtual uint32 GetNumSubscribedItems() = 0; // number of subscribed items + virtual uint32 GetSubscribedItems( PublishedFileId_t* pvecPublishedFileID, uint32 cMaxEntries ) = 0; // all subscribed item PublishFileIDs + + // get EItemState flags about item on this client + virtual uint32 GetItemState( PublishedFileId_t nPublishedFileID ) = 0; + + // get info about currently installed content on disc for items that have k_EItemStateInstalled set + // if k_EItemStateLegacyItem is set, pchFolder contains the path to the legacy file itself (not a folder) + virtual bool GetItemInstallInfo( PublishedFileId_t nPublishedFileID, uint64 *punSizeOnDisk, STEAM_OUT_STRING_COUNT( cchFolderSize ) char *pchFolder, uint32 cchFolderSize, uint32 *punTimeStamp ) = 0; + + // get info about pending update for items that have k_EItemStateNeedsUpdate set. punBytesTotal will be valid after download started once + virtual bool GetItemDownloadInfo( PublishedFileId_t nPublishedFileID, uint64 *punBytesDownloaded, uint64 *punBytesTotal ) = 0; + + // download new or update already installed item. If function returns true, wait for DownloadItemResult_t. If the item is already installed, + // then files on disk should not be used until callback received. If item is not subscribed to, it will be cached for some time. + // If bHighPriority is set, any other item download will be suspended and this item downloaded ASAP. + virtual bool DownloadItem( PublishedFileId_t nPublishedFileID, bool bHighPriority ) = 0; + + // game servers can set a specific workshop folder before issuing any UGC commands. + // This is helpful if you want to support multiple game servers running out of the same install folder + virtual bool BInitWorkshopForGameServer( DepotId_t unWorkshopDepotID, const char *pszFolder ) = 0; + + // SuspendDownloads( true ) will suspend all workshop downloads until SuspendDownloads( false ) is called or the game ends + virtual void SuspendDownloads( bool bSuspend ) = 0; + + // usage tracking + STEAM_CALL_RESULT( StartPlaytimeTrackingResult_t ) + virtual SteamAPICall_t StartPlaytimeTracking( PublishedFileId_t *pvecPublishedFileID, uint32 unNumPublishedFileIDs ) = 0; + STEAM_CALL_RESULT( StopPlaytimeTrackingResult_t ) + virtual SteamAPICall_t StopPlaytimeTracking( PublishedFileId_t *pvecPublishedFileID, uint32 unNumPublishedFileIDs ) = 0; + STEAM_CALL_RESULT( StopPlaytimeTrackingResult_t ) + virtual SteamAPICall_t StopPlaytimeTrackingForAllItems() = 0; + + // parent-child relationship or dependency management + STEAM_CALL_RESULT( AddUGCDependencyResult_t ) + virtual SteamAPICall_t AddDependency( PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID ) = 0; + STEAM_CALL_RESULT( RemoveUGCDependencyResult_t ) + virtual SteamAPICall_t RemoveDependency( PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID ) = 0; + + // add/remove app dependence/requirements (usually DLC) + STEAM_CALL_RESULT( AddAppDependencyResult_t ) + virtual SteamAPICall_t AddAppDependency( PublishedFileId_t nPublishedFileID, AppId_t nAppID ) = 0; + STEAM_CALL_RESULT( RemoveAppDependencyResult_t ) + virtual SteamAPICall_t RemoveAppDependency( PublishedFileId_t nPublishedFileID, AppId_t nAppID ) = 0; + // request app dependencies. note that whatever callback you register for GetAppDependenciesResult_t may be called multiple times + // until all app dependencies have been returned + STEAM_CALL_RESULT( GetAppDependenciesResult_t ) + virtual SteamAPICall_t GetAppDependencies( PublishedFileId_t nPublishedFileID ) = 0; + + // delete the item without prompting the user + STEAM_CALL_RESULT( DeleteItemResult_t ) + virtual SteamAPICall_t DeleteItem( PublishedFileId_t nPublishedFileID ) = 0; + + // Show the app's latest Workshop EULA to the user in an overlay window, where they can accept it or not + virtual bool ShowWorkshopEULA() = 0; + // Retrieve information related to the user's acceptance or not of the app's specific Workshop EULA + STEAM_CALL_RESULT( WorkshopEULAStatus_t ) + virtual SteamAPICall_t GetWorkshopEULAStatus() = 0; +}; + +#endif // ISTEAMUGC017_H diff --git a/sdk_includes/isteamuserstats.h b/sdk_includes/isteamuserstats.h index d96aae8f..4f3d68fd 100644 --- a/sdk_includes/isteamuserstats.h +++ b/sdk_includes/isteamuserstats.h @@ -211,7 +211,7 @@ public: // if a user doesn't have a leaderboard entry, they won't be included in the result // a max of 100 users can be downloaded at a time, with only one outstanding call at a time STEAM_METHOD_DESC(Downloads leaderboard entries for an arbitrary set of users - ELeaderboardDataRequest is k_ELeaderboardDataRequestUsers) - STEAM_CALL_RESULT( LeaderboardScoresDownloaded_t ) + STEAM_CALL_RESULT( LeaderboardScoresDownloaded_t ) virtual SteamAPICall_t DownloadLeaderboardEntriesForUsers( SteamLeaderboard_t hSteamLeaderboard, STEAM_ARRAY_COUNT_D(cUsers, Array of users to retrieve) CSteamID *prgUsers, int cUsers ) = 0; diff --git a/sdk_includes/isteamutils.h b/sdk_includes/isteamutils.h index 3643a899..8a1d79da 100644 --- a/sdk_includes/isteamutils.h +++ b/sdk_includes/isteamutils.h @@ -257,7 +257,7 @@ struct IPCountry_t //----------------------------------------------------------------------------- -// Purpose: Fired when running on a laptop and less than 10 minutes of battery is left, fires then every minute +// Purpose: Fired when running on a handheld PC or laptop with less than 10 minutes of battery is left, fires then every minute //----------------------------------------------------------------------------- struct LowBatteryPower_t { diff --git a/sdk_includes/isteamvideo.h b/sdk_includes/isteamvideo.h index d3862e6a..c2e77222 100644 --- a/sdk_includes/isteamvideo.h +++ b/sdk_includes/isteamvideo.h @@ -1,4 +1,4 @@ -//====== Copyright � 1996-2014 Valve Corporation, All rights reserved. ======= +//====== Copyright © 1996-2014 Valve Corporation, All rights reserved. ======= // // Purpose: interface to Steam Video // diff --git a/sdk_includes/steam_api.h b/sdk_includes/steam_api.h index 40115e5e..f8c2ec3c 100644 --- a/sdk_includes/steam_api.h +++ b/sdk_includes/steam_api.h @@ -163,6 +163,7 @@ #include "isteamugc014.h" #include "isteamugc015.h" #include "isteamugc016.h" +#include "isteamugc017.h" #include "isteamapplist.h" #include "isteamhtmlsurface.h" #include "isteamhtmlsurface001.h" @@ -182,6 +183,7 @@ #include "isteaminput002.h" #include "isteaminput005.h" #include "isteamremoteplay.h" +#include "isteamremoteplay001.h" #include "isteamnetworkingmessages.h" #include "isteamnetworkingsockets.h" #include "isteamnetworkingutils.h" @@ -196,6 +198,27 @@ // //----------------------------------------------------------------------------------------------------------------------------------------------------------// +enum ESteamAPIInitResult +{ + k_ESteamAPIInitResult_OK = 0, + k_ESteamAPIInitResult_FailedGeneric = 1, // Some other failure + k_ESteamAPIInitResult_NoSteamClient = 2, // We cannot connect to Steam, steam probably isn't running + k_ESteamAPIInitResult_VersionMismatch = 3, // Steam client appears to be out of date +}; + + +// Initialize the Steamworks SDK. +// On success k_ESteamAPIInitResult_OK is returned. Otherwise, if pOutErrMsg is non-NULL, +// it will receive a non-localized message that explains the reason for the failure +// +// Example usage: +// +// SteamErrMsg errMsg; +// if ( SteamAPI_Init(&errMsg) != k_ESteamAPIInitResult_OK ) +// FatalError( "Failed to init Steam. %s", errMsg ); +inline ESteamAPIInitResult SteamAPI_InitEx( SteamErrMsg *pOutErrMsg ); + +S_API ESteamAPIInitResult S_CALLTYPE SteamInternal_SteamAPI_Init( const char *pszInternalCheckInterfaceVersions, SteamErrMsg *pOutErrMsg ); // SteamAPI_Init must be called before using any other API functions. If it fails, an // error message will be output to the debugger (or stderr) with further information. @@ -261,7 +284,7 @@ S_API HSteamUser GetHSteamUser(); #if defined( VERSION_SAFE_STEAM_API_INTERFACES ) // exists only for backwards compat with code written against older SDKs -S_API bool S_CALLTYPE SteamAPI_InitSafe(); +S_API steam_bool S_CALLTYPE SteamAPI_InitSafe(); #endif #if defined(USE_BREAKPAD_HANDLER) || defined(STEAM_API_EXPORTS) @@ -450,4 +473,46 @@ inline bool CSteamAPIContext::Init() #endif +// Internal implementation of SteamAPI_InitEx. This is done in a way that checks +// all of the versions of interfaces from headers being compiled into this code. +// If you are not using any of the C++ interfaces and do not need this version checking +// (for example if you are only using the "flat" interfaces, which have a different type +// of version checking), you can pass a NULL interface version string. +inline ESteamAPIInitResult SteamAPI_InitEx( SteamErrMsg *pOutErrMsg ) +{ + const char *pszInternalCheckInterfaceVersions = + STEAMUTILS_INTERFACE_VERSION "\0" + STEAMNETWORKINGUTILS_INTERFACE_VERSION "\0" + + STEAMAPPLIST_INTERFACE_VERSION "\0" + STEAMAPPS_INTERFACE_VERSION "\0" + STEAMCONTROLLER_INTERFACE_VERSION "\0" + STEAMFRIENDS_INTERFACE_VERSION "\0" + STEAMGAMESEARCH_INTERFACE_VERSION "\0" + STEAMHTMLSURFACE_INTERFACE_VERSION "\0" + STEAMHTTP_INTERFACE_VERSION "\0" + STEAMINPUT_INTERFACE_VERSION "\0" + STEAMINVENTORY_INTERFACE_VERSION "\0" + STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION "\0" + STEAMMATCHMAKING_INTERFACE_VERSION "\0" + STEAMMUSICREMOTE_INTERFACE_VERSION "\0" + STEAMMUSIC_INTERFACE_VERSION "\0" + STEAMNETWORKINGMESSAGES_INTERFACE_VERSION "\0" + STEAMNETWORKINGSOCKETS_INTERFACE_VERSION "\0" + STEAMNETWORKING_INTERFACE_VERSION "\0" + STEAMPARENTALSETTINGS_INTERFACE_VERSION "\0" + STEAMPARTIES_INTERFACE_VERSION "\0" + STEAMREMOTEPLAY_INTERFACE_VERSION "\0" + STEAMREMOTESTORAGE_INTERFACE_VERSION "\0" + STEAMSCREENSHOTS_INTERFACE_VERSION "\0" + STEAMUGC_INTERFACE_VERSION "\0" + STEAMUSERSTATS_INTERFACE_VERSION "\0" + STEAMUSER_INTERFACE_VERSION "\0" + STEAMVIDEO_INTERFACE_VERSION "\0" + + "\0"; + + return SteamInternal_SteamAPI_Init( pszInternalCheckInterfaceVersions, pOutErrMsg ); +} + #endif // STEAM_API_H diff --git a/sdk_includes/steam_api_common.h b/sdk_includes/steam_api_common.h index 631a617f..07cf0047 100644 --- a/sdk_includes/steam_api_common.h +++ b/sdk_includes/steam_api_common.h @@ -65,6 +65,12 @@ typedef int32 HSteamPipe; // handle to single instance of a steam user typedef int32 HSteamUser; + +// A fixed size buffer to receive an error message that is returned by some API +// calls. +const int k_cchMaxSteamErrMsg = 1024; +typedef char SteamErrMsg[ k_cchMaxSteamErrMsg ]; + // function prototype #if defined( POSIX ) #define __cdecl diff --git a/sdk_includes/steam_api_flat.h b/sdk_includes/steam_api_flat.h index f3701851..c5ac5f62 100644 --- a/sdk_includes/steam_api_flat.h +++ b/sdk_includes/steam_api_flat.h @@ -697,10 +697,12 @@ STEAMAPI_API ISteamUGC *SteamAPI_SteamUGC_v014(); STEAMAPI_API ISteamUGC *SteamAPI_SteamUGC_v015(); STEAMAPI_API ISteamUGC *SteamAPI_SteamUGC_v016(); STEAMAPI_API ISteamUGC *SteamAPI_SteamUGC_v017(); +STEAMAPI_API ISteamUGC *SteamAPI_SteamUGC_v018(); STEAMAPI_API ISteamUGC *SteamAPI_SteamGameServerUGC_v014(); STEAMAPI_API ISteamUGC *SteamAPI_SteamGameServerUGC_v015(); STEAMAPI_API ISteamUGC *SteamAPI_SteamGameServerUGC_v016(); STEAMAPI_API ISteamUGC *SteamAPI_SteamGameServerUGC_v017(); +STEAMAPI_API ISteamUGC *SteamAPI_SteamGameServerUGC_v018(); STEAMAPI_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryUserUGCRequest( ISteamUGC* self, AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage ); STEAMAPI_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryAllUGCRequestPage( ISteamUGC* self, EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage ); STEAMAPI_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryAllUGCRequestCursor( ISteamUGC* self, EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, const char * pchCursor ); @@ -749,7 +751,7 @@ STEAMAPI_API steam_bool SteamAPI_ISteamUGC_SetItemDescription( ISteamUGC* self, STEAMAPI_API steam_bool SteamAPI_ISteamUGC_SetItemUpdateLanguage( ISteamUGC* self, UGCUpdateHandle_t handle, const char * pchLanguage ); STEAMAPI_API steam_bool SteamAPI_ISteamUGC_SetItemMetadata( ISteamUGC* self, UGCUpdateHandle_t handle, const char * pchMetaData ); STEAMAPI_API steam_bool SteamAPI_ISteamUGC_SetItemVisibility( ISteamUGC* self, UGCUpdateHandle_t handle, ERemoteStoragePublishedFileVisibility eVisibility ); -STEAMAPI_API steam_bool SteamAPI_ISteamUGC_SetItemTags( ISteamUGC* self, UGCUpdateHandle_t updateHandle, const SteamParamStringArray_t * pTags ); +STEAMAPI_API steam_bool SteamAPI_ISteamUGC_SetItemTags( ISteamUGC* self, UGCUpdateHandle_t updateHandle, const SteamParamStringArray_t * pTags, bool bAllowAdminTags ); // Note: param bool bAllowAdminTags was introduced in SDK v158a, but didn't exist before STEAMAPI_API steam_bool SteamAPI_ISteamUGC_SetItemContent( ISteamUGC* self, UGCUpdateHandle_t handle, const char * pszContentFolder ); STEAMAPI_API steam_bool SteamAPI_ISteamUGC_SetItemPreview( ISteamUGC* self, UGCUpdateHandle_t handle, const char * pszPreviewFile ); STEAMAPI_API steam_bool SteamAPI_ISteamUGC_SetAllowLegacyUpload( ISteamUGC* self, UGCUpdateHandle_t handle, bool bAllowLegacyUpload ); @@ -790,6 +792,7 @@ STEAMAPI_API SteamAPICall_t SteamAPI_ISteamUGC_GetAppDependencies( ISteamUGC* se STEAMAPI_API SteamAPICall_t SteamAPI_ISteamUGC_DeleteItem( ISteamUGC* self, PublishedFileId_t nPublishedFileID ); STEAMAPI_API steam_bool SteamAPI_ISteamUGC_ShowWorkshopEULA( ISteamUGC* self ); STEAMAPI_API SteamAPICall_t SteamAPI_ISteamUGC_GetWorkshopEULAStatus( ISteamUGC* self ); +STEAMAPI_API uint32 SteamAPI_ISteamUGC_GetUserContentDescriptorPreferences( ISteamUGC* self, EUGCContentDescriptorID * pvecDescriptors, uint32 cMaxEntries ); // ISteamAppList STEAMAPI_API ISteamAppList *SteamAPI_SteamAppList_v001(); @@ -909,12 +912,14 @@ STEAMAPI_API steam_bool SteamAPI_ISteamParentalSettings_BIsFeatureInBlockList( I // ISteamRemotePlay STEAMAPI_API ISteamRemotePlay *SteamAPI_SteamRemotePlay_v001(); +STEAMAPI_API ISteamRemotePlay *SteamAPI_SteamRemotePlay_v002(); STEAMAPI_API uint32 SteamAPI_ISteamRemotePlay_GetSessionCount( ISteamRemotePlay* self ); STEAMAPI_API RemotePlaySessionID_t SteamAPI_ISteamRemotePlay_GetSessionID( ISteamRemotePlay* self, int iSessionIndex ); STEAMAPI_API uint64_steamid SteamAPI_ISteamRemotePlay_GetSessionSteamID( ISteamRemotePlay* self, RemotePlaySessionID_t unSessionID ); STEAMAPI_API const char * SteamAPI_ISteamRemotePlay_GetSessionClientName( ISteamRemotePlay* self, RemotePlaySessionID_t unSessionID ); STEAMAPI_API ESteamDeviceFormFactor SteamAPI_ISteamRemotePlay_GetSessionClientFormFactor( ISteamRemotePlay* self, RemotePlaySessionID_t unSessionID ); STEAMAPI_API steam_bool SteamAPI_ISteamRemotePlay_BGetSessionClientResolution( ISteamRemotePlay* self, RemotePlaySessionID_t unSessionID, int * pnResolutionX, int * pnResolutionY ); +STEAMAPI_API steam_bool SteamAPI_ISteamRemotePlay_BStartRemotePlayTogether( ISteamRemotePlay* self, bool bShowOverlay ); STEAMAPI_API steam_bool SteamAPI_ISteamRemotePlay_BSendRemotePlayTogetherInvite( ISteamRemotePlay* self, uint64_steamid steamIDFriend ); // ISteamNetworkingMessages @@ -977,8 +982,8 @@ STEAMAPI_API SteamNetworkingPOPID SteamAPI_ISteamNetworkingSockets_GetHostedDedi STEAMAPI_API EResult SteamAPI_ISteamNetworkingSockets_GetHostedDedicatedServerAddress( ISteamNetworkingSockets* self, SteamDatagramHostedAddress * pRouting ); STEAMAPI_API HSteamListenSocket SteamAPI_ISteamNetworkingSockets_CreateHostedDedicatedServerListenSocket( ISteamNetworkingSockets* self, int nLocalVirtualPort, int nOptions, const SteamNetworkingConfigValue_t * pOptions ); STEAMAPI_API EResult SteamAPI_ISteamNetworkingSockets_GetGameCoordinatorServerLogin( ISteamNetworkingSockets* self, SteamDatagramGameCoordinatorServerLogin * pLoginInfo, int * pcbSignedBlob, void * pBlob ); -STEAMAPI_API HSteamNetConnection SteamAPI_ISteamNetworkingSockets_ConnectP2PCustomSignaling( ISteamNetworkingSockets* self, ISteamNetworkingConnectionCustomSignaling * pSignaling, const SteamNetworkingIdentity * pPeerIdentity, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t * pOptions ); -STEAMAPI_API steam_bool SteamAPI_ISteamNetworkingSockets_ReceivedP2PCustomSignal( ISteamNetworkingSockets* self, const void * pMsg, int cbMsg, ISteamNetworkingCustomSignalingRecvContext * pContext ); +STEAMAPI_API HSteamNetConnection SteamAPI_ISteamNetworkingSockets_ConnectP2PCustomSignaling( ISteamNetworkingSockets* self, ISteamNetworkingConnectionSignaling * pSignaling, const SteamNetworkingIdentity * pPeerIdentity, int nRemoteVirtualPort, int nOptions, const SteamNetworkingConfigValue_t * pOptions ); +STEAMAPI_API steam_bool SteamAPI_ISteamNetworkingSockets_ReceivedP2PCustomSignal( ISteamNetworkingSockets* self, const void * pMsg, int cbMsg, ISteamNetworkingSignalingRecvContext * pContext ); STEAMAPI_API steam_bool SteamAPI_ISteamNetworkingSockets_GetCertificateRequest( ISteamNetworkingSockets* self, int * pcbBlob, void * pBlob, SteamNetworkingErrMsg & errMsg ); STEAMAPI_API steam_bool SteamAPI_ISteamNetworkingSockets_SetCertificate( ISteamNetworkingSockets* self, const void * pCertificate, int cbCertificate, SteamNetworkingErrMsg & errMsg ); STEAMAPI_API void SteamAPI_ISteamNetworkingSockets_ResetIdentity( ISteamNetworkingSockets* self, const SteamNetworkingIdentity * pIdentity ); diff --git a/sdk_includes/steam_gameserver.h b/sdk_includes/steam_gameserver.h index 98d92e1a..82696e58 100644 --- a/sdk_includes/steam_gameserver.h +++ b/sdk_includes/steam_gameserver.h @@ -1,4 +1,4 @@ -//====== Copyright � 1996-2008, Valve Corporation, All rights reserved. ======= +//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. ======= // // Purpose: // @@ -65,8 +65,11 @@ const uint16 STEAMGAMESERVER_QUERY_PORT_SHARED = 0xffff; // server is out of date. (Only servers with the latest version will be listed.) #ifndef STEAM_API_EXPORTS S_API steam_bool SteamGameServer_Init( uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString ); +S_API ESteamAPIInitResult SteamGameServer_InitEx( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString, SteamErrMsg *pOutErrMsg ); #endif + S_API steam_bool S_CALLTYPE SteamInternal_GameServer_Init( uint32 unIP, uint16 usPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString ); +S_API ESteamAPIInitResult S_CALLTYPE SteamInternal_GameServer_Init_V2( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString, const char *pszInternalCheckInterfaceVersions, SteamErrMsg *pOutErrMsg ); // Shutdown SteamGameSeverXxx interfaces, log out, and free resources. S_API void SteamGameServer_Shutdown(); @@ -120,13 +123,31 @@ inline bool CSteamGameServerAPIContext::Init() } -inline bool SteamGameServer_Init( uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString ) +inline steam_bool SteamGameServer_Init( uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString ) { if ( !SteamInternal_GameServer_Init( unIP, usSteamPort, usGamePort, usQueryPort, eServerMode, pchVersionString ) ) return false; return true; } + +inline ESteamAPIInitResult SteamGameServer_InitEx( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString, SteamErrMsg *pOutErrMsg ) +{ + const char *pszInternalCheckInterfaceVersions = + STEAMUTILS_INTERFACE_VERSION "\0" + STEAMNETWORKINGUTILS_INTERFACE_VERSION "\0" + + STEAMGAMESERVER_INTERFACE_VERSION "\0" + STEAMGAMESERVERSTATS_INTERFACE_VERSION "\0" + STEAMHTTP_INTERFACE_VERSION "\0" + STEAMINVENTORY_INTERFACE_VERSION "\0" + STEAMNETWORKING_INTERFACE_VERSION "\0" + STEAMNETWORKINGMESSAGES_INTERFACE_VERSION "\0" + STEAMNETWORKINGSOCKETS_INTERFACE_VERSION "\0" + STEAMUGC_INTERFACE_VERSION "\0" + "\0"; + return SteamInternal_GameServer_Init_V2( unIP, usGamePort, usQueryPort, eServerMode, pchVersionString, pszInternalCheckInterfaceVersions, pOutErrMsg ); +} inline void SteamGameServer_ReleaseCurrentThreadMemory() { SteamAPI_ReleaseCurrentThreadMemory(); diff --git a/sdk_includes/steamhttpenums.h b/sdk_includes/steamhttpenums.h index 44209380..af32eb26 100644 --- a/sdk_includes/steamhttpenums.h +++ b/sdk_includes/steamhttpenums.h @@ -1,4 +1,4 @@ -//====== Copyright � 1996-2010, Valve Corporation, All rights reserved. ======= +//====== Copyright © 1996-2010, Valve Corporation, All rights reserved. ======= // // Purpose: HTTP related enums, stuff that is shared by both clients and servers, and our // UI projects goes here. diff --git a/sdk_includes/steamnetworkingtypes.h b/sdk_includes/steamnetworkingtypes.h index 9c4e97f9..4acb0d10 100644 --- a/sdk_includes/steamnetworkingtypes.h +++ b/sdk_includes/steamnetworkingtypes.h @@ -1154,6 +1154,42 @@ enum ESteamNetworkingConfigValue /// Default is 512k (524288 bytes) k_ESteamNetworkingConfig_SendBufferSize = 9, + /// [connection int32] Upper limit on total size (in bytes) of received messages + /// that will be buffered waiting to be processed by the application. If this limit + /// is exceeded, packets will be dropped. This is to protect us from a malicious + /// peer flooding us with messages faster than we can process them. + /// + /// This must be bigger than k_ESteamNetworkingConfig_RecvMaxMessageSize + k_ESteamNetworkingConfig_RecvBufferSize = 47, + + /// [connection int32] Upper limit on the number of received messages that will + /// that will be buffered waiting to be processed by the application. If this limit + /// is exceeded, packets will be dropped. This is to protect us from a malicious + /// peer flooding us with messages faster than we can pull them off the wire. + k_ESteamNetworkingConfig_RecvBufferMessages = 48, + + /// [connection int32] Maximum message size that we are willing to receive. + /// if a client attempts to send us a message larger than this, the connection + /// will be immediately closed. + /// + /// Default is 512k (524288 bytes). Note that the peer needs to be able to + /// send a message this big. (See k_cbMaxSteamNetworkingSocketsMessageSizeSend.) + k_ESteamNetworkingConfig_RecvMaxMessageSize = 49, + + /// [connection int32] Max number of message segments that can be received + /// in a single UDP packet. While decoding a packet, if the number of segments + /// exceeds this, we will abort further packet processing. + /// + /// The default is effectively unlimited. If you know that you very rarely + /// send small packets, you can protect yourself from malicious senders by + /// lowering this number. + /// + /// In particular, if you are NOT using the reliability layer and are only using + /// SteamNetworkingSockets for datagram transport, setting this to a very low + /// number may be beneficial. (We recommend a value of 2.) Make sure your sender + /// disables Nagle! + k_ESteamNetworkingConfig_RecvMaxSegmentsPerPacket = 50, + /// [connection int64] Get/set userdata as a configuration option. /// The default value is -1. You may want to set the user data as /// a config value, instead of using ISteamNetworkingSockets::SetConnectionUserData diff --git a/sdk_includes/steamtypes.h b/sdk_includes/steamtypes.h index b3440eeb..c069fbef 100644 --- a/sdk_includes/steamtypes.h +++ b/sdk_includes/steamtypes.h @@ -1,8 +1,4 @@ -//========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============ -// -// Purpose: -// -//============================================================================= +//========= Copyright 1996-2022, Valve LLC, All rights reserved. ============ #ifndef STEAMTYPES_H #define STEAMTYPES_H