diff --git a/build_env_x64.bat b/build_env_x64.bat index ea51185..35b701b 100755 --- a/build_env_x64.bat +++ b/build_env_x64.bat @@ -9,8 +9,14 @@ if exist "%VS_Base_Path%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Bui if exist "%VS_Base_Path%\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat" goto vs14 if exist "%VS_Base_Path%\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat" goto vs2019_bt if exist "%VS_Base_Path%\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat" goto vs2017_bt +if exist "%VS_Base_Path%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" goto vs2022 +if exist "%VS_Base_Path%\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat" goto vs2022_bt if exist ".\sdk_standalone\set_vars64.bat" goto gitlabci +:vs2022 +call "%VS_Base_Path%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" +goto batend + :vs2019 call "%VS_Base_Path%\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" goto batend @@ -23,6 +29,10 @@ goto batend call "%VS_Base_Path%\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat" goto batend +:vs2022_bt +call "%VS_Base_Path%\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat" +goto batend + :vs2019_bt call "%VS_Base_Path%\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat" goto batend diff --git a/build_env_x86.bat b/build_env_x86.bat index b87efd9..3307a89 100755 --- a/build_env_x86.bat +++ b/build_env_x86.bat @@ -9,8 +9,14 @@ if exist "%VS_Base_Path%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Bui if exist "%VS_Base_Path%\Microsoft Visual Studio 14.0\VC\bin\amd64_x86\vcvarsamd64_x86.bat" goto vs14 if exist "%VS_Base_Path%\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars32.bat" goto vs2019_bt if exist "%VS_Base_Path%\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars32.bat" goto vs2017_bt +if exist "%VS_Base_Path%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars32.bat" goto vs2022 +if exist "%VS_Base_Path%\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars32.bat" goto vs2022_bt if exist ".\sdk_standalone\set_vars32.bat" goto gitlabci +:vs2022 +call "%VS_Base_Path%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars32.bat" +goto batend + :vs2019 call "%VS_Base_Path%\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat" goto batend @@ -23,6 +29,10 @@ goto batend call "%VS_Base_Path%\Microsoft Visual Studio 14.0\VC\bin\amd64_x86\vcvarsamd64_x86.bat" goto batend +:vs2022_bt +call "%VS_Base_Path%\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars32.bat" +goto batend + :vs2019_bt call "%VS_Base_Path%\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars32.bat" goto batend diff --git a/dll/flat.cpp b/dll/flat.cpp index 32bb47c..579c224 100644 --- a/dll/flat.cpp +++ b/dll/flat.cpp @@ -772,6 +772,26 @@ STEAMAPI_API void SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialogConnectS return (get_steam_client()->steam_friends)->ActivateGameOverlayInviteDialogConnectString(pchConnectString); } +STEAMAPI_API SteamAPICall_t SteamAPI_ISteamFriends_RequestEquippedProfileItems( ISteamFriends* self, uint64_steamid steamID ) +{ + return (get_steam_client()->steam_friends)->RequestEquippedProfileItems(steamID); +} + +STEAMAPI_API bool SteamAPI_ISteamFriends_BHasEquippedProfileItem( ISteamFriends* self, uint64_steamid steamID, ECommunityProfileItemType itemType ) +{ + return (get_steam_client()->steam_friends)->BHasEquippedProfileItem(steamID, itemType); +} + +STEAMAPI_API const char * SteamAPI_ISteamFriends_GetProfileItemPropertyString( ISteamFriends* self, uint64_steamid steamID, ECommunityProfileItemType itemType, ECommunityProfileItemProperty prop ) +{ + return (get_steam_client()->steam_friends)->GetProfileItemPropertyString(steamID, itemType, prop); +} + +STEAMAPI_API uint32 SteamAPI_ISteamFriends_GetProfileItemPropertyUint( ISteamFriends* self, uint64_steamid steamID, ECommunityProfileItemType itemType, ECommunityProfileItemProperty prop ) +{ + return (get_steam_client()->steam_friends)->GetProfileItemPropertyUint(steamID, itemType, prop); +} + STEAMAPI_API ISteamUtils *SteamAPI_SteamUtils_v010() { return get_steam_client()->GetISteamUtils(flat_hsteampipe(), "SteamUtils010"); diff --git a/dll/steam_friends.h b/dll/steam_friends.h index 1ed5342..8d6bc17 100644 --- a/dll/steam_friends.h +++ b/dll/steam_friends.h @@ -1014,6 +1014,33 @@ void ActivateGameOverlayInviteDialogConnectString( const char *pchConnectString PRINT_DEBUG("Steam_Friends::ActivateGameOverlayInviteDialogConnectString\n"); } +// Steam Community items equipped by a user on their profile +// You can register for EquippedProfileItemsChanged_t to know when a friend has changed their equipped profile items +STEAM_CALL_RESULT( EquippedProfileItems_t ) +SteamAPICall_t RequestEquippedProfileItems( CSteamID steamID ) +{ + PRINT_DEBUG("Steam_Friends::RequestEquippedProfileItems\n"); + return 0; +} + +bool BHasEquippedProfileItem( CSteamID steamID, ECommunityProfileItemType itemType ) +{ + PRINT_DEBUG("Steam_Friends::BHasEquippedProfileItem\n"); + return false; +} + +const char *GetProfileItemPropertyString( CSteamID steamID, ECommunityProfileItemType itemType, ECommunityProfileItemProperty prop ) +{ + PRINT_DEBUG("Steam_Friends::GetProfileItemPropertyString\n"); + return ""; +} + +uint32 GetProfileItemPropertyUint( CSteamID steamID, ECommunityProfileItemType itemType, ECommunityProfileItemProperty prop ) +{ + PRINT_DEBUG("Steam_Friends::GetProfileItemPropertyUint\n"); + return 0; +} + void RunCallbacks() { PRINT_DEBUG("Steam_Friends::RunCallbacks\n"); diff --git a/sdk_includes/isteamfriends.h b/sdk_includes/isteamfriends.h index 6b0df18..0e36db6 100644 --- a/sdk_includes/isteamfriends.h +++ b/sdk_includes/isteamfriends.h @@ -168,6 +168,32 @@ enum EActivateGameOverlayToWebPageMode // will also close. When the user closes the browser window, the overlay will automatically close. }; +//----------------------------------------------------------------------------- +// Purpose: See GetProfileItemPropertyString and GetProfileItemPropertyUint +//----------------------------------------------------------------------------- +enum ECommunityProfileItemType +{ + k_ECommunityProfileItemType_AnimatedAvatar = 0, + k_ECommunityProfileItemType_AvatarFrame = 1, + k_ECommunityProfileItemType_ProfileModifier = 2, + k_ECommunityProfileItemType_ProfileBackground = 3, + k_ECommunityProfileItemType_MiniProfileBackground = 4, +}; +enum ECommunityProfileItemProperty +{ + k_ECommunityProfileItemProperty_ImageSmall = 0, // string + k_ECommunityProfileItemProperty_ImageLarge = 1, // string + k_ECommunityProfileItemProperty_InternalName = 2, // string + k_ECommunityProfileItemProperty_Title = 3, // string + k_ECommunityProfileItemProperty_Description = 4, // string + k_ECommunityProfileItemProperty_AppID = 5, // uint32 + k_ECommunityProfileItemProperty_TypeID = 6, // uint32 + k_ECommunityProfileItemProperty_Class = 7, // uint32 + k_ECommunityProfileItemProperty_MovieWebM = 8, // string + k_ECommunityProfileItemProperty_MovieMP4 = 9, // string + k_ECommunityProfileItemProperty_MovieWebMSmall = 10, // string + k_ECommunityProfileItemProperty_MovieMP4Small = 11, // string +}; //----------------------------------------------------------------------------- // Purpose: interface to accessing information about individual users, @@ -433,6 +459,14 @@ public: // Activates the game overlay to open an invite dialog that will send the provided Rich Presence connect string to selected friends virtual void ActivateGameOverlayInviteDialogConnectString( const char *pchConnectString ) = 0; + + // Steam Community items equipped by a user on their profile + // You can register for EquippedProfileItemsChanged_t to know when a friend has changed their equipped profile items + STEAM_CALL_RESULT( EquippedProfileItems_t ) + virtual SteamAPICall_t RequestEquippedProfileItems( CSteamID steamID ) = 0; + virtual bool BHasEquippedProfileItem( CSteamID steamID, ECommunityProfileItemType itemType ) = 0; + virtual const char *GetProfileItemPropertyString( CSteamID steamID, ECommunityProfileItemType itemType, ECommunityProfileItemProperty prop ) = 0; + virtual uint32 GetProfileItemPropertyUint( CSteamID steamID, ECommunityProfileItemType itemType, ECommunityProfileItemProperty prop ) = 0; }; #define STEAMFRIENDS_INTERFACE_VERSION "SteamFriends017" @@ -700,6 +734,29 @@ struct OverlayBrowserProtocolNavigation_t char rgchURI[ 1024 ]; }; +//----------------------------------------------------------------------------- +// Purpose: A user's equipped profile items have changed +//----------------------------------------------------------------------------- +struct EquippedProfileItemsChanged_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 50 }; + CSteamID m_steamID; +}; + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +struct EquippedProfileItems_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 51 }; + EResult m_eResult; + CSteamID m_steamID; + bool m_bHasAnimatedAvatar; + bool m_bHasAvatarFrame; + bool m_bHasProfileModifier; + bool m_bHasProfileBackground; + bool m_bHasMiniProfileBackground; +}; #pragma pack( pop ) diff --git a/sdk_includes/isteamnetworkingmessages.h b/sdk_includes/isteamnetworkingmessages.h index a3d58ae..b7a2cd0 100644 --- a/sdk_includes/isteamnetworkingmessages.h +++ b/sdk_includes/isteamnetworkingmessages.h @@ -163,25 +163,22 @@ struct SteamNetworkingMessagesSessionFailed_t #pragma pack(pop) // Global accessors + // Using standalone lib #ifdef STEAMNETWORKINGSOCKETS_STANDALONELIB - // Standalone lib. static_assert( STEAMNETWORKINGMESSAGES_INTERFACE_VERSION[25] == '2', "Version mismatch" ); + STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingMessages *SteamNetworkingMessages_LibV2(); inline ISteamNetworkingMessages *SteamNetworkingMessages_Lib() { return SteamNetworkingMessages_LibV2(); } // If running in context of steam, we also define a gameserver instance. - #ifdef STEAMNETWORKINGSOCKETS_STEAM - STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingMessages *SteamGameServerNetworkingMessages_LibV2(); - inline ISteamNetworkingMessages *SteamGameServerNetworkingMessages_Lib() { return SteamGameServerNetworkingMessages_LibV2(); } - #endif + STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingMessages *SteamGameServerNetworkingMessages_LibV2(); + inline ISteamNetworkingMessages *SteamGameServerNetworkingMessages_Lib() { return SteamGameServerNetworkingMessages_LibV2(); } #ifndef STEAMNETWORKINGSOCKETS_STEAMAPI inline ISteamNetworkingMessages *SteamNetworkingMessages() { return SteamNetworkingMessages_LibV2(); } - #ifdef STEAMNETWORKINGSOCKETS_STEAM - inline ISteamNetworkingMessages *SteamGameServerNetworkingMessages() { return SteamGameServerNetworkingMessages_LibV2(); } - #endif + inline ISteamNetworkingMessages *SteamGameServerNetworkingMessages() { return SteamGameServerNetworkingMessages_LibV2(); } #endif #endif diff --git a/sdk_includes/isteamnetworkingsockets.h b/sdk_includes/isteamnetworkingsockets.h index 5a8cfb8..57ff77c 100644 --- a/sdk_includes/isteamnetworkingsockets.h +++ b/sdk_includes/isteamnetworkingsockets.h @@ -923,32 +923,25 @@ protected: #define STEAMNETWORKINGSOCKETS_INTERFACE_VERSION "SteamNetworkingSockets012" // Global accessors + // Using standalone lib #ifdef STEAMNETWORKINGSOCKETS_STANDALONELIB - // Standalone lib. static_assert( STEAMNETWORKINGSOCKETS_INTERFACE_VERSION[24] == '2', "Version mismatch" ); STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingSockets *SteamNetworkingSockets_LibV12(); inline ISteamNetworkingSockets *SteamNetworkingSockets_Lib() { return SteamNetworkingSockets_LibV12(); } - // If running in context of steam, we also define a gameserver instance. - #ifdef STEAMNETWORKINGSOCKETS_STEAM - STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingSockets *SteamGameServerNetworkingSockets_LibV12(); - inline ISteamNetworkingSockets *SteamGameServerNetworkingSockets_Lib() { return SteamGameServerNetworkingSockets_LibV12(); } - #endif + STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingSockets *SteamGameServerNetworkingSockets_LibV12(); + inline ISteamNetworkingSockets *SteamGameServerNetworkingSockets_Lib() { return SteamGameServerNetworkingSockets_LibV12(); } #ifndef STEAMNETWORKINGSOCKETS_STEAMAPI inline ISteamNetworkingSockets *SteamNetworkingSockets() { return SteamNetworkingSockets_LibV12(); } - #ifdef STEAMNETWORKINGSOCKETS_STEAM - inline ISteamNetworkingSockets *SteamGameServerNetworkingSockets() { return SteamGameServerNetworkingSockets_LibV12(); } - #endif + inline ISteamNetworkingSockets *SteamGameServerNetworkingSockets() { return SteamGameServerNetworkingSockets_LibV12(); } #endif #endif // Using Steamworks SDK #ifdef STEAMNETWORKINGSOCKETS_STEAMAPI - - // Steamworks SDK STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamNetworkingSockets *, SteamNetworkingSockets_SteamAPI, STEAMNETWORKINGSOCKETS_INTERFACE_VERSION ); STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamNetworkingSockets *, SteamGameServerNetworkingSockets_SteamAPI, STEAMNETWORKINGSOCKETS_INTERFACE_VERSION ); diff --git a/sdk_includes/isteamutils.h b/sdk_includes/isteamutils.h index 3a75945..7cab46a 100644 --- a/sdk_includes/isteamutils.h +++ b/sdk_includes/isteamutils.h @@ -43,10 +43,10 @@ enum EGamepadTextInputLineMode enum EFloatingGamepadTextInputMode { - k_EFloatingGamepadTextInputModeModeSingleLine = 0, // Enter dismisses the keyboard - k_EFloatingGamepadTextInputModeModeMultipleLines = 1, // User needs to explictly close the keyboard - k_EFloatingGamepadTextInputModeModeEmail = 2, - k_EFloatingGamepadTextInputModeModeNumeric = 3, + k_EFloatingGamepadTextInputModeModeSingleLine = 0, // Enter dismisses the keyboard + k_EFloatingGamepadTextInputModeModeMultipleLines = 1, // User needs to explictly close the keyboard + k_EFloatingGamepadTextInputModeModeEmail = 2, // Keyboard layout is email, enter dismisses the keyboard + k_EFloatingGamepadTextInputModeModeNumeric = 3, // Keyboard layout is numeric, enter dismisses the keyboard }; diff --git a/sdk_includes/steam_api_flat.h b/sdk_includes/steam_api_flat.h index 9bba177..839d0ab 100644 --- a/sdk_includes/steam_api_flat.h +++ b/sdk_includes/steam_api_flat.h @@ -171,6 +171,10 @@ STEAMAPI_API int SteamAPI_ISteamFriends_GetNumChatsWithUnreadPriorityMessages( I STEAMAPI_API void SteamAPI_ISteamFriends_ActivateGameOverlayRemotePlayTogetherInviteDialog( ISteamFriends* self, uint64_steamid steamIDLobby ); STEAMAPI_API steam_bool SteamAPI_ISteamFriends_RegisterProtocolInOverlayBrowser( ISteamFriends* self, const char * pchProtocol ); STEAMAPI_API void SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialogConnectString( ISteamFriends* self, const char * pchConnectString ); +STEAMAPI_API SteamAPICall_t SteamAPI_ISteamFriends_RequestEquippedProfileItems( ISteamFriends* self, uint64_steamid steamID ); +STEAMAPI_API bool SteamAPI_ISteamFriends_BHasEquippedProfileItem( ISteamFriends* self, uint64_steamid steamID, ECommunityProfileItemType itemType ); +STEAMAPI_API const char * SteamAPI_ISteamFriends_GetProfileItemPropertyString( ISteamFriends* self, uint64_steamid steamID, ECommunityProfileItemType itemType, ECommunityProfileItemProperty prop ); +STEAMAPI_API uint32 SteamAPI_ISteamFriends_GetProfileItemPropertyUint( ISteamFriends* self, uint64_steamid steamID, ECommunityProfileItemType itemType, ECommunityProfileItemProperty prop ); // ISteamUtils STEAMAPI_API ISteamUtils *SteamAPI_SteamUtils_v010(); diff --git a/sdk_includes/steamclientpublic.h b/sdk_includes/steamclientpublic.h index aaf7efb..98df1d9 100644 --- a/sdk_includes/steamclientpublic.h +++ b/sdk_includes/steamclientpublic.h @@ -149,6 +149,9 @@ enum EResult k_EResultInvalidSignature = 121, // signature check did not match k_EResultParseFailure = 122, // Failed to parse input k_EResultNoVerifiedPhone = 123, // account does not have a verified phone number + k_EResultInsufficientBattery = 124, // user device doesn't have enough battery charge currently to complete the action + k_EResultChargerRequired = 125, // The operation requires a charger to be plugged in, which wasn't present + k_EResultCachedCredentialInvalid = 126, // Cached credential was invalid - user must reauthenticate }; // Error codes for use with the voice functions @@ -1137,6 +1140,41 @@ inline bool CSteamID::IsValid() const return true; } +#if defined( INCLUDED_STEAM2_USERID_STRUCTS ) + +//----------------------------------------------------------------------------- +// Purpose: Initializes a steam ID from a Steam2 ID structure +// Input: pTSteamGlobalUserID - Steam2 ID to convert +// eUniverse - universe this ID belongs to +//----------------------------------------------------------------------------- +inline CSteamID SteamIDFromSteam2UserID( TSteamGlobalUserID *pTSteamGlobalUserID, EUniverse eUniverse ) +{ + uint32 unAccountID = pTSteamGlobalUserID->m_SteamLocalUserID.Split.Low32bits * 2 + + pTSteamGlobalUserID->m_SteamLocalUserID.Split.High32bits; + + return CSteamID( unAccountID, k_unSteamUserDefaultInstance, eUniverse, k_EAccountTypeIndividual ); +} + +bool SteamIDFromSteam2String( const char *pchSteam2ID, EUniverse eUniverse, CSteamID *pSteamIDOut ); + +//----------------------------------------------------------------------------- +// Purpose: Fills out a Steam2 ID structure +// Input: pTSteamGlobalUserID - Steam2 ID to write to +//----------------------------------------------------------------------------- +inline TSteamGlobalUserID SteamIDToSteam2UserID( CSteamID steamID ) +{ + TSteamGlobalUserID steamGlobalUserID; + + steamGlobalUserID.m_SteamInstanceID = 0; + steamGlobalUserID.m_SteamLocalUserID.Split.High32bits = steamID.GetAccountID() % 2; + steamGlobalUserID.m_SteamLocalUserID.Split.Low32bits = steamID.GetAccountID() / 2; + + return steamGlobalUserID; +} + + +#endif + // generic invalid CSteamID #define k_steamIDNil CSteamID() diff --git a/sdk_includes/steamnetworkingtypes.h b/sdk_includes/steamnetworkingtypes.h index 92cdab6..540980a 100644 --- a/sdk_includes/steamnetworkingtypes.h +++ b/sdk_includes/steamnetworkingtypes.h @@ -15,13 +15,11 @@ //----------------------------------------------------------------------------- // SteamNetworkingSockets config. -//#define STEAMNETWORKINGSOCKETS_STANDALONELIB // Comment this in to support compiling/linking with the standalone library / gamenetworkingsockets opensource -#define STEAMNETWORKINGSOCKETS_STEAMAPI // Compiling/link with steam_api.h and Steamworks SDK +#if !defined(STEAMNETWORKINGSOCKETS_STANDALONELIB) && !defined(STEAMNETWORKINGSOCKETS_STEAMAPI) + #define STEAMNETWORKINGSOCKETS_STEAMAPI +#endif //----------------------------------------------------------------------------- -#if !defined( STEAMNETWORKINGSOCKETS_OPENSOURCE ) && !defined( STEAMNETWORKINGSOCKETS_STREAMINGCLIENT ) - #define STEAMNETWORKINGSOCKETS_STEAM -#endif #ifdef NN_NINTENDO_SDK // We always static link on Nintendo #define STEAMNETWORKINGSOCKETS_STATIC_LINK #endif @@ -143,6 +141,12 @@ enum ESteamNetworkingIdentityType // Basic platform-specific identifiers. // k_ESteamNetworkingIdentityType_SteamID = 16, // 64-bit CSteamID + k_ESteamNetworkingIdentityType_XboxPairwiseID = 17, // Publisher-specific user identity, as string + k_ESteamNetworkingIdentityType_SonyPSN = 18, // 64-bit ID + k_ESteamNetworkingIdentityType_GoogleStadia = 19, // 64-bit ID + //k_ESteamNetworkingIdentityType_NintendoNetworkServiceAccount, + //k_ESteamNetworkingIdentityType_EpicGameStore + //k_ESteamNetworkingIdentityType_WeGame // // Special identifiers. @@ -271,6 +275,15 @@ struct SteamNetworkingIdentity void SetSteamID64( uint64 steamID ); // Takes SteamID as raw 64-bit number uint64 GetSteamID64() const; // Returns 0 if identity is not SteamID + bool SetXboxPairwiseID( const char *pszString ); // Returns false if invalid length + const char *GetXboxPairwiseID() const; // Returns nullptr if not Xbox ID + + void SetPSNID( uint64 id ); + uint64 GetPSNID() const; // Returns 0 if not PSN + + void SetStadiaID( uint64 id ); + uint64 GetStadiaID() const; // Returns 0 if not Stadia + void SetIPAddr( const SteamNetworkingIPAddr &addr ); // Set to specified IP:port const SteamNetworkingIPAddr *GetIPAddr() const; // returns null if we are not an IP address. void SetIPv4Addr( uint32 nIPv4, uint16 nPort ); // Set to specified IPv4:port @@ -312,6 +325,7 @@ struct SteamNetworkingIdentity enum { k_cchMaxString = 128, // Max length of the buffer needed to hold any identity, formatted in string format by ToString k_cchMaxGenericString = 32, // Max length of the string for generic string identities. Including terminating '\0' + k_cchMaxXboxPairwiseID = 33, // Including terminating '\0' k_cbMaxGenericBytes = 32, }; @@ -324,7 +338,10 @@ struct SteamNetworkingIdentity int m_cbSize; union { uint64 m_steamID64; + uint64 m_PSNID; + uint64 m_stadiaID; char m_szGenericString[ k_cchMaxGenericString ]; + char m_szXboxPairwiseID[ k_cchMaxXboxPairwiseID ]; uint8 m_genericBytes[ k_cbMaxGenericBytes ]; char m_szUnknownRawString[ k_cchMaxString ]; SteamNetworkingIPAddr m_ip; @@ -1481,7 +1498,11 @@ enum ESteamNetworkingConfigValue /// route ping time and is then adjusted.) k_ESteamNetworkingConfig_P2P_Transport_ICE_Penalty = 105, k_ESteamNetworkingConfig_P2P_Transport_SDR_Penalty = 106, + k_ESteamNetworkingConfig_P2P_TURN_ServerList = 107, + k_ESteamNetworkingConfig_P2P_TURN_UserList = 108, + k_ESteamNetworkingConfig_P2P_TURN_PassList = 109, //k_ESteamNetworkingConfig_P2P_Transport_LANBeacon_Penalty = 107, + k_ESteamNetworkingConfig_P2P_Transport_ICE_Implementation = 110, // // Settings for SDR relayed connections @@ -1746,8 +1767,18 @@ inline void SteamNetworkingIdentity::SetSteamID( CSteamID steamID ) { SetSteamID inline CSteamID SteamNetworkingIdentity::GetSteamID() const { return CSteamID( GetSteamID64() ); } inline void SteamNetworkingIdentity::SetSteamID64( uint64 steamID ) { m_eType = k_ESteamNetworkingIdentityType_SteamID; m_cbSize = sizeof( m_steamID64 ); m_steamID64 = steamID; } inline uint64 SteamNetworkingIdentity::GetSteamID64() const { return m_eType == k_ESteamNetworkingIdentityType_SteamID ? m_steamID64 : 0; } +inline bool SteamNetworkingIdentity::SetXboxPairwiseID( const char *pszString ) { size_t l = strlen( pszString ); if ( l < 1 || l >= sizeof(m_szXboxPairwiseID) ) return false; + m_eType = k_ESteamNetworkingIdentityType_XboxPairwiseID; m_cbSize = int(l+1); memcpy( m_szXboxPairwiseID, pszString, m_cbSize ); return true; } +inline const char *SteamNetworkingIdentity::GetXboxPairwiseID() const { return m_eType == k_ESteamNetworkingIdentityType_XboxPairwiseID ? m_szXboxPairwiseID : NULL; } +inline void SteamNetworkingIdentity::SetPSNID( uint64 id ) { m_eType = k_ESteamNetworkingIdentityType_SonyPSN; m_cbSize = sizeof( m_PSNID ); m_PSNID = id; } +inline uint64 SteamNetworkingIdentity::GetPSNID() const { return m_eType == k_ESteamNetworkingIdentityType_SonyPSN ? m_PSNID : 0; } +inline void SteamNetworkingIdentity::SetStadiaID( uint64 id ) { m_eType = k_ESteamNetworkingIdentityType_GoogleStadia; m_cbSize = sizeof( m_stadiaID ); m_stadiaID = id; } +inline uint64 SteamNetworkingIdentity::GetStadiaID() const { return m_eType == k_ESteamNetworkingIdentityType_GoogleStadia ? m_stadiaID : 0; } inline void SteamNetworkingIdentity::SetIPAddr( const SteamNetworkingIPAddr &addr ) { m_eType = k_ESteamNetworkingIdentityType_IPAddress; m_cbSize = (int)sizeof(m_ip); m_ip = addr; } inline const SteamNetworkingIPAddr *SteamNetworkingIdentity::GetIPAddr() const { return m_eType == k_ESteamNetworkingIdentityType_IPAddress ? &m_ip : NULL; } +inline void SteamNetworkingIdentity::SetIPv4Addr( uint32 nIPv4, uint16 nPort ) { m_eType = k_ESteamNetworkingIdentityType_IPAddress; m_cbSize = (int)sizeof(m_ip); m_ip.SetIPv4( nIPv4, nPort ); } +inline uint32 SteamNetworkingIdentity::GetIPv4() const { return m_eType == k_ESteamNetworkingIdentityType_IPAddress ? m_ip.GetIPv4() : 0; } +inline ESteamNetworkingFakeIPType SteamNetworkingIdentity::GetFakeIPType() const { return m_eType == k_ESteamNetworkingIdentityType_IPAddress ? m_ip.GetFakeIPType() : k_ESteamNetworkingFakeIPType_Invalid; } inline void SteamNetworkingIdentity::SetLocalHost() { m_eType = k_ESteamNetworkingIdentityType_IPAddress; m_cbSize = (int)sizeof(m_ip); m_ip.SetIPv6LocalHost(); } inline bool SteamNetworkingIdentity::IsLocalHost() const { return m_eType == k_ESteamNetworkingIdentityType_IPAddress && m_ip.IsLocalHost(); } inline bool SteamNetworkingIdentity::SetGenericString( const char *pszString ) { size_t l = strlen( pszString ); if ( l >= sizeof(m_szGenericString) ) return false;