diff --git a/Facepunch.Steamworks.Test/Facepunch.Steamworks.TestWin32.csproj b/Facepunch.Steamworks.Test/Facepunch.Steamworks.TestWin32.csproj index b5d97a7..6ed0245 100644 --- a/Facepunch.Steamworks.Test/Facepunch.Steamworks.TestWin32.csproj +++ b/Facepunch.Steamworks.Test/Facepunch.Steamworks.TestWin32.csproj @@ -44,10 +44,10 @@ - - - - + + + + diff --git a/Facepunch.Steamworks.Test/Facepunch.Steamworks.TestWin64.csproj b/Facepunch.Steamworks.Test/Facepunch.Steamworks.TestWin64.csproj index 2a18571..d3dbb5e 100644 --- a/Facepunch.Steamworks.Test/Facepunch.Steamworks.TestWin64.csproj +++ b/Facepunch.Steamworks.Test/Facepunch.Steamworks.TestWin64.csproj @@ -43,10 +43,10 @@ - - - - + + + + diff --git a/Facepunch.Steamworks.Test/packages.config b/Facepunch.Steamworks.Test/packages.config deleted file mode 100644 index dd2a57a..0000000 --- a/Facepunch.Steamworks.Test/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Facepunch.Steamworks/Facepunch.Steamworks.Posix.csproj b/Facepunch.Steamworks/Facepunch.Steamworks.Posix.csproj index eb41812..525e62d 100644 --- a/Facepunch.Steamworks/Facepunch.Steamworks.Posix.csproj +++ b/Facepunch.Steamworks/Facepunch.Steamworks.Posix.csproj @@ -3,7 +3,7 @@ Facepunch.Steamworks.Posix $(DefineConstants);PLATFORM_POSIX - netstandard2.1;net6.0;net46 + netstandard2.1;net6.0 true 10 true diff --git a/Facepunch.Steamworks/Facepunch.Steamworks.Win32.csproj b/Facepunch.Steamworks/Facepunch.Steamworks.Win32.csproj index 25bab61..3730d8a 100644 --- a/Facepunch.Steamworks/Facepunch.Steamworks.Win32.csproj +++ b/Facepunch.Steamworks/Facepunch.Steamworks.Win32.csproj @@ -3,7 +3,7 @@ Facepunch.Steamworks.Win32 $(DefineConstants);PLATFORM_WIN32;PLATFORM_WIN - netstandard2.1;net6.0;net46 + netstandard2.1;net6.0 true true true diff --git a/Facepunch.Steamworks/Facepunch.Steamworks.Win64.csproj b/Facepunch.Steamworks/Facepunch.Steamworks.Win64.csproj index dcd5682..73ba39c 100644 --- a/Facepunch.Steamworks/Facepunch.Steamworks.Win64.csproj +++ b/Facepunch.Steamworks/Facepunch.Steamworks.Win64.csproj @@ -3,7 +3,7 @@ Facepunch.Steamworks.Win64 $(DefineConstants);PLATFORM_WIN64;PLATFORM_WIN;PLATFORM_64 - netstandard2.1;net6.0;net46 + netstandard2.1;net6.0 true true true diff --git a/Facepunch.Steamworks/Generated/CustomEnums.cs b/Facepunch.Steamworks/Generated/CustomEnums.cs index f4594b2..885b918 100644 --- a/Facepunch.Steamworks/Generated/CustomEnums.cs +++ b/Facepunch.Steamworks/Generated/CustomEnums.cs @@ -52,6 +52,8 @@ namespace Steamworks SetPersonaNameResponse = 347, UnreadChatMessagesChanged = 348, OverlayBrowserProtocolNavigation = 349, + EquippedProfileItemsChanged = 350, + EquippedProfileItems = 351, FavoritesListChanged = 502, LobbyInvite = 503, LobbyEnter = 504, @@ -269,6 +271,8 @@ namespace Steamworks { CallbackType.SetPersonaNameResponse, typeof( SetPersonaNameResponse_t )}, { CallbackType.UnreadChatMessagesChanged, typeof( UnreadChatMessagesChanged_t )}, { CallbackType.OverlayBrowserProtocolNavigation, typeof( OverlayBrowserProtocolNavigation_t )}, + { CallbackType.EquippedProfileItemsChanged, typeof( EquippedProfileItemsChanged_t )}, + { CallbackType.EquippedProfileItems, typeof( EquippedProfileItems_t )}, { CallbackType.FavoritesListChanged, typeof( FavoritesListChanged_t )}, { CallbackType.LobbyInvite, typeof( LobbyInvite_t )}, { CallbackType.LobbyEnter, typeof( LobbyEnter_t )}, diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs index 5f13764..2888c39 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs @@ -357,5 +357,17 @@ namespace Steamworks return returnValue; } + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_SetDlcContext", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetDlcContext( IntPtr self, AppId nAppID ); + + #endregion + internal bool SetDlcContext( AppId nAppID ) + { + var returnValue = _SetDlcContext( Self, nAppID ); + return returnValue; + } + } } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs index eb3538a..b8e5cd4 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs @@ -862,5 +862,50 @@ namespace Steamworks _ActivateGameOverlayInviteDialogConnectString( Self, pchConnectString ); } + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_RequestEquippedProfileItems", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _RequestEquippedProfileItems( IntPtr self, SteamId steamID ); + + #endregion + internal CallResult RequestEquippedProfileItems( SteamId steamID ) + { + var returnValue = _RequestEquippedProfileItems( Self, steamID ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_BHasEquippedProfileItem", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BHasEquippedProfileItem( IntPtr self, SteamId steamID, CommunityProfileItemType itemType ); + + #endregion + internal bool BHasEquippedProfileItem( SteamId steamID, CommunityProfileItemType itemType ) + { + var returnValue = _BHasEquippedProfileItem( Self, steamID, itemType ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetProfileItemPropertyString", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetProfileItemPropertyString( IntPtr self, SteamId steamID, CommunityProfileItemType itemType, CommunityProfileItemProperty prop ); + + #endregion + internal string GetProfileItemPropertyString( SteamId steamID, CommunityProfileItemType itemType, CommunityProfileItemProperty prop ) + { + var returnValue = _GetProfileItemPropertyString( Self, steamID, itemType, prop ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetProfileItemPropertyUint", CallingConvention = Platform.CC)] + private static extern uint _GetProfileItemPropertyUint( IntPtr self, SteamId steamID, CommunityProfileItemType itemType, CommunityProfileItemProperty prop ); + + #endregion + internal uint GetProfileItemPropertyUint( SteamId steamID, CommunityProfileItemType itemType, CommunityProfileItemProperty prop ) + { + var returnValue = _GetProfileItemPropertyUint( Self, steamID, itemType, prop ); + return returnValue; + } + } } diff --git a/Facepunch.Steamworks/Generated/SteamCallbacks.cs b/Facepunch.Steamworks/Generated/SteamCallbacks.cs index 63bc765..2642d41 100644 --- a/Facepunch.Steamworks/Generated/SteamCallbacks.cs +++ b/Facepunch.Steamworks/Generated/SteamCallbacks.cs @@ -487,6 +487,41 @@ namespace Steamworks.Data #endregion } + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct EquippedProfileItemsChanged_t : ICallbackData + { + internal ulong SteamID; // m_steamID CSteamID + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(EquippedProfileItemsChanged_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.EquippedProfileItemsChanged; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct EquippedProfileItems_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal ulong SteamID; // m_steamID CSteamID + [MarshalAs(UnmanagedType.I1)] + internal bool HasAnimatedAvatar; // m_bHasAnimatedAvatar bool + [MarshalAs(UnmanagedType.I1)] + internal bool HasAvatarFrame; // m_bHasAvatarFrame bool + [MarshalAs(UnmanagedType.I1)] + internal bool HasProfileModifier; // m_bHasProfileModifier bool + [MarshalAs(UnmanagedType.I1)] + internal bool HasProfileBackground; // m_bHasProfileBackground bool + [MarshalAs(UnmanagedType.I1)] + internal bool HasMiniProfileBackground; // m_bHasMiniProfileBackground bool + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(EquippedProfileItems_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.EquippedProfileItems; + #endregion + } + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] internal struct IPCountry_t : ICallbackData { diff --git a/Facepunch.Steamworks/Generated/SteamEnums.cs b/Facepunch.Steamworks/Generated/SteamEnums.cs index 4c3246b..f7264c8 100644 --- a/Facepunch.Steamworks/Generated/SteamEnums.cs +++ b/Facepunch.Steamworks/Generated/SteamEnums.cs @@ -156,6 +156,10 @@ namespace Steamworks InvalidSignature = 121, ParseFailure = 122, NoVerifiedPhone = 123, + InsufficientBattery = 124, + ChargerRequired = 125, + CachedCredentialInvalid = 126, + K_EResultPhoneNumberIsVOIP = 127, } // @@ -544,6 +548,37 @@ namespace Steamworks Modal = 1, } + // + // ECommunityProfileItemType + // + internal enum CommunityProfileItemType : int + { + AnimatedAvatar = 0, + AvatarFrame = 1, + ProfileModifier = 2, + ProfileBackground = 3, + MiniProfileBackground = 4, + } + + // + // ECommunityProfileItemProperty + // + internal enum CommunityProfileItemProperty : int + { + ImageSmall = 0, + ImageLarge = 1, + InternalName = 2, + Title = 3, + Description = 4, + AppID = 5, + TypeID = 6, + Class = 7, + MovieWebM = 8, + MovieMP4 = 9, + MovieWebMSmall = 10, + MovieMP4Small = 11, + } + // // EPersonaChange // @@ -2324,6 +2359,10 @@ namespace Steamworks P2P_Transport_ICE_Enable = 104, P2P_Transport_ICE_Penalty = 105, P2P_Transport_SDR_Penalty = 106, + P2P_TURN_ServerList = 107, + P2P_TURN_UserList = 108, + P2P_TURN_PassList = 109, + P2P_Transport_ICE_Implementation = 110, SDRClient_ConsecutitivePingTimeoutsFailInitial = 19, SDRClient_ConsecutitivePingTimeoutsFail = 20, SDRClient_MinPingsBeforePingAccurate = 21, diff --git a/Facepunch.Steamworks/SteamApps.cs b/Facepunch.Steamworks/SteamApps.cs index 1e6410e..b2437f7 100644 --- a/Facepunch.Steamworks/SteamApps.cs +++ b/Facepunch.Steamworks/SteamApps.cs @@ -15,9 +15,12 @@ namespace Steamworks { internal static ISteamApps Internal => Interface as ISteamApps; - internal override void InitializeInterface( bool server ) + internal override bool InitializeInterface( bool server ) { SetInterface( server, new ISteamApps( server ) ); + if ( Interface.Self == IntPtr.Zero ) return false; + + return true; } internal static void InstallEvents() diff --git a/Facepunch.Steamworks/SteamClient.cs b/Facepunch.Steamworks/SteamClient.cs index d725b67..f8f1db2 100644 --- a/Facepunch.Steamworks/SteamClient.cs +++ b/Facepunch.Steamworks/SteamClient.cs @@ -60,6 +60,8 @@ namespace Steamworks AddInterface(); AddInterface(); + initialized = openInterfaces.Count > 0; + if ( asyncCallbacks ) { // @@ -73,8 +75,15 @@ namespace Steamworks internal static void AddInterface() where T : SteamClass, new() { var t = new T(); - t.InitializeInterface( false ); - openInterfaces.Add( t ); + bool valid = t.InitializeInterface( false ); + if ( valid ) + { + openInterfaces.Add( t ); + } + else + { + t.DestroyInterface( false ); + } } static readonly List openInterfaces = new List(); diff --git a/Facepunch.Steamworks/SteamFriends.cs b/Facepunch.Steamworks/SteamFriends.cs index 3e31be6..6b8f86b 100644 --- a/Facepunch.Steamworks/SteamFriends.cs +++ b/Facepunch.Steamworks/SteamFriends.cs @@ -14,13 +14,16 @@ namespace Steamworks { internal static ISteamFriends Internal => Interface as ISteamFriends; - internal override void InitializeInterface( bool server ) + internal override bool InitializeInterface( bool server ) { SetInterface( server, new ISteamFriends( server ) ); + if ( Interface.Self == IntPtr.Zero ) return false; richPresence = new Dictionary(); InstallEvents(); + + return true; } static Dictionary richPresence; diff --git a/Facepunch.Steamworks/SteamInput.cs b/Facepunch.Steamworks/SteamInput.cs index 17f2137..f4c8dc3 100644 --- a/Facepunch.Steamworks/SteamInput.cs +++ b/Facepunch.Steamworks/SteamInput.cs @@ -1,4 +1,5 @@ -using Steamworks.Data; +using System; +using Steamworks.Data; using System.Collections.Generic; namespace Steamworks @@ -10,9 +11,12 @@ namespace Steamworks { internal static ISteamInput Internal => Interface as ISteamInput; - internal override void InitializeInterface( bool server ) + internal override bool InitializeInterface( bool server ) { SetInterface( server, new ISteamInput( server ) ); + if ( Interface.Self == IntPtr.Zero ) return false; + + return true; } internal const int STEAM_CONTROLLER_MAX_COUNT = 16; diff --git a/Facepunch.Steamworks/SteamInventory.cs b/Facepunch.Steamworks/SteamInventory.cs index 5d0dfb3..8a347a9 100644 --- a/Facepunch.Steamworks/SteamInventory.cs +++ b/Facepunch.Steamworks/SteamInventory.cs @@ -16,11 +16,14 @@ namespace Steamworks { internal static ISteamInventory Internal => Interface as ISteamInventory; - internal override void InitializeInterface( bool server ) + internal override bool InitializeInterface( bool server ) { SetInterface( server, new ISteamInventory( server ) ); + if ( Interface.Self == IntPtr.Zero ) return false; InstallEvents( server ); + + return true; } internal static void InstallEvents( bool server ) diff --git a/Facepunch.Steamworks/SteamMatchmaking.cs b/Facepunch.Steamworks/SteamMatchmaking.cs index 1e8fb10..c54baad 100644 --- a/Facepunch.Steamworks/SteamMatchmaking.cs +++ b/Facepunch.Steamworks/SteamMatchmaking.cs @@ -14,11 +14,14 @@ namespace Steamworks { internal static ISteamMatchmaking Internal => Interface as ISteamMatchmaking; - internal override void InitializeInterface( bool server ) + internal override bool InitializeInterface( bool server ) { SetInterface( server, new ISteamMatchmaking( server ) ); + if ( Interface.Self == IntPtr.Zero ) return false; InstallEvents(); + + return true; } /// diff --git a/Facepunch.Steamworks/SteamMatchmakingServers.cs b/Facepunch.Steamworks/SteamMatchmakingServers.cs index bbbdc5c..673cee3 100644 --- a/Facepunch.Steamworks/SteamMatchmakingServers.cs +++ b/Facepunch.Steamworks/SteamMatchmakingServers.cs @@ -14,9 +14,12 @@ namespace Steamworks { internal static ISteamMatchmakingServers Internal => Interface as ISteamMatchmakingServers; - internal override void InitializeInterface( bool server ) + internal override bool InitializeInterface( bool server ) { SetInterface( server, new ISteamMatchmakingServers( server ) ); + if ( Interface.Self == IntPtr.Zero ) return false; + + return true; } } } diff --git a/Facepunch.Steamworks/SteamMusic.cs b/Facepunch.Steamworks/SteamMusic.cs index 7a984a2..7322fd6 100644 --- a/Facepunch.Steamworks/SteamMusic.cs +++ b/Facepunch.Steamworks/SteamMusic.cs @@ -17,11 +17,13 @@ namespace Steamworks { internal static ISteamMusic Internal => Interface as ISteamMusic; - internal override void InitializeInterface( bool server ) + internal override bool InitializeInterface( bool server ) { SetInterface( server, new ISteamMusic( server ) ); + if ( Interface.Self == IntPtr.Zero ) return false; InstallEvents(); + return true; } internal static void InstallEvents() diff --git a/Facepunch.Steamworks/SteamNetworking.cs b/Facepunch.Steamworks/SteamNetworking.cs index b6601ba..7622803 100644 --- a/Facepunch.Steamworks/SteamNetworking.cs +++ b/Facepunch.Steamworks/SteamNetworking.cs @@ -15,11 +15,14 @@ namespace Steamworks { internal static ISteamNetworking Internal => Interface as ISteamNetworking; - internal override void InitializeInterface( bool server ) + internal override bool InitializeInterface( bool server ) { SetInterface( server, new ISteamNetworking( server ) ); + if ( Interface.Self == IntPtr.Zero ) return false; InstallEvents( server ); + + return true; } internal static void InstallEvents( bool server ) diff --git a/Facepunch.Steamworks/SteamNetworkingSockets.cs b/Facepunch.Steamworks/SteamNetworkingSockets.cs index 790b8ff..7fe3ace 100644 --- a/Facepunch.Steamworks/SteamNetworkingSockets.cs +++ b/Facepunch.Steamworks/SteamNetworkingSockets.cs @@ -31,10 +31,13 @@ namespace Steamworks } } - internal override void InitializeInterface( bool server ) + internal override bool InitializeInterface( bool server ) { SetInterface( server, new ISteamNetworkingSockets( server ) ); + if ( Interface.Self == IntPtr.Zero ) return false; + InstallEvents( server ); + return true; } #region SocketInterface diff --git a/Facepunch.Steamworks/SteamNetworkingUtils.cs b/Facepunch.Steamworks/SteamNetworkingUtils.cs index 09a2f18..c34fcb9 100644 --- a/Facepunch.Steamworks/SteamNetworkingUtils.cs +++ b/Facepunch.Steamworks/SteamNetworkingUtils.cs @@ -14,10 +14,14 @@ namespace Steamworks { internal static ISteamNetworkingUtils Internal => Interface as ISteamNetworkingUtils; - internal override void InitializeInterface( bool server ) + internal override bool InitializeInterface( bool server ) { SetInterface( server, new ISteamNetworkingUtils( server ) ); + if ( Interface.Self == IntPtr.Zero ) return false; + InstallCallbacks( server ); + + return true; } static void InstallCallbacks( bool server ) diff --git a/Facepunch.Steamworks/SteamParental.cs b/Facepunch.Steamworks/SteamParental.cs index b746ca3..7ab5a1c 100644 --- a/Facepunch.Steamworks/SteamParental.cs +++ b/Facepunch.Steamworks/SteamParental.cs @@ -14,10 +14,14 @@ namespace Steamworks { internal static ISteamParentalSettings Internal => Interface as ISteamParentalSettings; - internal override void InitializeInterface( bool server ) + internal override bool InitializeInterface( bool server ) { SetInterface( server, new ISteamParentalSettings( server ) ); + if ( Interface.Self == IntPtr.Zero ) return false; + InstallEvents( server ); + + return true; } internal static void InstallEvents( bool server ) diff --git a/Facepunch.Steamworks/SteamParties.cs b/Facepunch.Steamworks/SteamParties.cs index bcccb84..0044207 100644 --- a/Facepunch.Steamworks/SteamParties.cs +++ b/Facepunch.Steamworks/SteamParties.cs @@ -17,10 +17,14 @@ namespace Steamworks { internal static ISteamParties Internal => Interface as ISteamParties; - internal override void InitializeInterface( bool server ) + internal override bool InitializeInterface( bool server ) { SetInterface( server, new ISteamParties( server ) ); + if ( Interface.Self == IntPtr.Zero ) return false; + InstallEvents( server ); + + return true; } internal void InstallEvents( bool server ) diff --git a/Facepunch.Steamworks/SteamRemotePlay.cs b/Facepunch.Steamworks/SteamRemotePlay.cs index d612598..0e7a89c 100644 --- a/Facepunch.Steamworks/SteamRemotePlay.cs +++ b/Facepunch.Steamworks/SteamRemotePlay.cs @@ -14,11 +14,14 @@ namespace Steamworks { internal static ISteamRemotePlay Internal => Interface as ISteamRemotePlay; - internal override void InitializeInterface( bool server ) + internal override bool InitializeInterface( bool server ) { SetInterface( server, new ISteamRemotePlay( server ) ); + if ( Interface.Self == IntPtr.Zero ) return false; InstallEvents( server ); + + return true; } internal void InstallEvents( bool server ) diff --git a/Facepunch.Steamworks/SteamRemoteStorage.cs b/Facepunch.Steamworks/SteamRemoteStorage.cs index 03cadb5..3b4579b 100644 --- a/Facepunch.Steamworks/SteamRemoteStorage.cs +++ b/Facepunch.Steamworks/SteamRemoteStorage.cs @@ -14,9 +14,12 @@ namespace Steamworks { internal static ISteamRemoteStorage Internal => Interface as ISteamRemoteStorage; - internal override void InitializeInterface( bool server ) + internal override bool InitializeInterface( bool server ) { SetInterface( server, new ISteamRemoteStorage( server ) ); + if ( Interface.Self == IntPtr.Zero ) return false; + + return true; } @@ -48,6 +51,10 @@ namespace Steamworks fixed ( byte* ptr = buffer ) { var readsize = Internal.FileRead( filename, (IntPtr)ptr, size ); + if ( readsize != size ) + { + return null; + } return buffer; } } diff --git a/Facepunch.Steamworks/SteamScreenshots.cs b/Facepunch.Steamworks/SteamScreenshots.cs index 2221077..2088845 100644 --- a/Facepunch.Steamworks/SteamScreenshots.cs +++ b/Facepunch.Steamworks/SteamScreenshots.cs @@ -14,10 +14,14 @@ namespace Steamworks { internal static ISteamScreenshots Internal => Interface as ISteamScreenshots; - internal override void InitializeInterface( bool server ) + internal override bool InitializeInterface( bool server ) { SetInterface( server, new ISteamScreenshots( server ) ); + if ( Interface.Self == IntPtr.Zero ) return false; + InstallEvents(); + + return true; } internal static void InstallEvents() diff --git a/Facepunch.Steamworks/SteamServer.cs b/Facepunch.Steamworks/SteamServer.cs index 27d2ddc..68431bb 100644 --- a/Facepunch.Steamworks/SteamServer.cs +++ b/Facepunch.Steamworks/SteamServer.cs @@ -14,10 +14,14 @@ namespace Steamworks { internal static ISteamGameServer Internal => Interface as ISteamGameServer; - internal override void InitializeInterface( bool server ) + internal override bool InitializeInterface( bool server ) { SetInterface( server, new ISteamGameServer( server ) ); + if ( Interface.Self == IntPtr.Zero ) return false; + InstallEvents(); + + return true; } public static bool IsValid => Internal != null && Internal.IsValid; diff --git a/Facepunch.Steamworks/SteamServerStats.cs b/Facepunch.Steamworks/SteamServerStats.cs index 7432fa7..ed0bddf 100644 --- a/Facepunch.Steamworks/SteamServerStats.cs +++ b/Facepunch.Steamworks/SteamServerStats.cs @@ -11,9 +11,12 @@ namespace Steamworks { internal static ISteamGameServerStats Internal => Interface as ISteamGameServerStats; - internal override void InitializeInterface( bool server ) + internal override bool InitializeInterface( bool server ) { SetInterface( server, new ISteamGameServerStats( server ) ); + if ( Interface.Self == IntPtr.Zero ) return false; + + return true; } diff --git a/Facepunch.Steamworks/SteamUgc.cs b/Facepunch.Steamworks/SteamUgc.cs index 6f860e8..57c484f 100644 --- a/Facepunch.Steamworks/SteamUgc.cs +++ b/Facepunch.Steamworks/SteamUgc.cs @@ -17,10 +17,14 @@ namespace Steamworks { internal static ISteamUGC Internal => Interface as ISteamUGC; - internal override void InitializeInterface( bool server ) + internal override bool InitializeInterface( bool server ) { SetInterface( server, new ISteamUGC( server ) ); + if ( Interface.Self == IntPtr.Zero ) return false; + InstallEvents( server ); + + return true; } internal static void InstallEvents( bool server ) diff --git a/Facepunch.Steamworks/SteamUser.cs b/Facepunch.Steamworks/SteamUser.cs index 230f4f4..5ddd777 100644 --- a/Facepunch.Steamworks/SteamUser.cs +++ b/Facepunch.Steamworks/SteamUser.cs @@ -17,13 +17,17 @@ namespace Steamworks { internal static ISteamUser Internal => Interface as ISteamUser; - internal override void InitializeInterface( bool server ) + internal override bool InitializeInterface( bool server ) { SetInterface( server, new ISteamUser( server ) ); + if ( Interface.Self == IntPtr.Zero ) return false; + InstallEvents(); richPresence = new Dictionary(); SampleRate = OptimalSampleRate; + + return true; } static Dictionary richPresence; diff --git a/Facepunch.Steamworks/SteamUserStats.cs b/Facepunch.Steamworks/SteamUserStats.cs index 4a0d8b1..22b8303 100644 --- a/Facepunch.Steamworks/SteamUserStats.cs +++ b/Facepunch.Steamworks/SteamUserStats.cs @@ -11,11 +11,15 @@ namespace Steamworks { internal static ISteamUserStats Internal => Interface as ISteamUserStats; - internal override void InitializeInterface( bool server ) + internal override bool InitializeInterface( bool server ) { SetInterface( server, new ISteamUserStats( server ) ); + if ( Interface.Self == IntPtr.Zero ) return false; + InstallEvents(); RequestCurrentStats(); + + return true; } public static bool StatsRecieved { get; internal set; } diff --git a/Facepunch.Steamworks/SteamUtils.cs b/Facepunch.Steamworks/SteamUtils.cs index 71444dc..8d2c45e 100644 --- a/Facepunch.Steamworks/SteamUtils.cs +++ b/Facepunch.Steamworks/SteamUtils.cs @@ -14,10 +14,14 @@ namespace Steamworks { internal static ISteamUtils Internal => Interface as ISteamUtils; - internal override void InitializeInterface( bool server ) + internal override bool InitializeInterface( bool server ) { SetInterface( server, new ISteamUtils( server ) ); + if ( Interface.Self == IntPtr.Zero ) return false; + InstallEvents( server ); + + return true; } internal static void InstallEvents( bool server ) diff --git a/Facepunch.Steamworks/SteamVideo.cs b/Facepunch.Steamworks/SteamVideo.cs index 74150f3..de4fd19 100644 --- a/Facepunch.Steamworks/SteamVideo.cs +++ b/Facepunch.Steamworks/SteamVideo.cs @@ -14,10 +14,14 @@ namespace Steamworks { internal static ISteamVideo Internal => Interface as ISteamVideo; - internal override void InitializeInterface( bool server ) + internal override bool InitializeInterface( bool server ) { SetInterface( server, new ISteamVideo( server ) ); + if ( Interface.Self == IntPtr.Zero ) return false; + InstallEvents(); + + return true; } internal static void InstallEvents() diff --git a/Facepunch.Steamworks/Utility/SteamInterface.cs b/Facepunch.Steamworks/Utility/SteamInterface.cs index a8b13da..e683cd3 100644 --- a/Facepunch.Steamworks/Utility/SteamInterface.cs +++ b/Facepunch.Steamworks/Utility/SteamInterface.cs @@ -55,7 +55,7 @@ namespace Steamworks public abstract class SteamClass { - internal abstract void InitializeInterface( bool server ); + internal abstract bool InitializeInterface( bool server ); internal abstract void DestroyInterface( bool server ); } @@ -65,9 +65,9 @@ namespace Steamworks internal static SteamInterface InterfaceClient; internal static SteamInterface InterfaceServer; - internal override void InitializeInterface( bool server ) + internal override bool InitializeInterface( bool server ) { - + return false; } internal virtual void SetInterface( bool server, SteamInterface iface ) @@ -101,9 +101,9 @@ namespace Steamworks { internal static SteamInterface Interface; - internal override void InitializeInterface( bool server ) + internal override bool InitializeInterface( bool server ) { - + return false; } internal virtual void SetInterface( bool server, SteamInterface iface ) @@ -124,9 +124,9 @@ namespace Steamworks { internal static SteamInterface Interface; - internal override void InitializeInterface( bool server ) + internal override bool InitializeInterface( bool server ) { - + return false; } internal virtual void SetInterface( bool server, SteamInterface iface ) diff --git a/Generator/Cleanup.cs b/Generator/Cleanup.cs index 66a87a8..3414c58 100644 --- a/Generator/Cleanup.cs +++ b/Generator/Cleanup.cs @@ -168,6 +168,7 @@ public static class Cleanup if ( name.StartsWith( "ISteamInput." ) ) { if ( name.Contains( "EnableActionEventCallbacks" ) ) return true; + if ( name.Contains( "DualSense" ) ) return true; } if ( name.StartsWith( "ISteamRemoteStorage." ) ) diff --git a/Generator/CodeWriter/Enums.cs b/Generator/CodeWriter/Enums.cs index 24ec0b6..5f7e0f2 100644 --- a/Generator/CodeWriter/Enums.cs +++ b/Generator/CodeWriter/Enums.cs @@ -92,6 +92,9 @@ namespace Generator ename = p + ename; } + if (ename.StartsWith( $"k_E{name}" )) + ename = ename[(name.Length + 3)..]; + WriteLine( $"{ename.Trim( ' ', '_' )} = {entry.Value}," ); } } diff --git a/Generator/Generator.csproj b/Generator/Generator.csproj index e1199b0..5ea18c8 100644 --- a/Generator/Generator.csproj +++ b/Generator/Generator.csproj @@ -7,7 +7,7 @@ - + \ No newline at end of file diff --git a/Generator/packages.config b/Generator/packages.config index 9d64bf3..0dcc305 100644 --- a/Generator/packages.config +++ b/Generator/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/Generator/steam_sdk/isteamapps.h b/Generator/steam_sdk/isteamapps.h index 82d0121..fd6b334 100644 --- a/Generator/steam_sdk/isteamapps.h +++ b/Generator/steam_sdk/isteamapps.h @@ -108,6 +108,9 @@ public: // check if game is a timed trial with limited playtime virtual bool BIsTimedTrial( uint32* punSecondsAllowed, uint32* punSecondsPlayed ) = 0; + + // set current DLC AppID being played (or 0 if none). Allows Steam to track usage of major DLC extensions + virtual bool SetDlcContext( AppId_t nAppID ) = 0; }; #define STEAMAPPS_INTERFACE_VERSION "STEAMAPPS_INTERFACE_VERSION008" diff --git a/Generator/steam_sdk/isteamdualsense.h b/Generator/steam_sdk/isteamdualsense.h new file mode 100644 index 0000000..5acc857 --- /dev/null +++ b/Generator/steam_sdk/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/Generator/steam_sdk/isteamfriends.h b/Generator/steam_sdk/isteamfriends.h index b7ebc73..4ac4293 100644 --- a/Generator/steam_sdk/isteamfriends.h +++ b/Generator/steam_sdk/isteamfriends.h @@ -157,6 +157,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, @@ -422,6 +448,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" @@ -687,6 +721,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/Generator/steam_sdk/isteaminput.h b/Generator/steam_sdk/isteaminput.h index 1c18f03..e28f274 100644 --- a/Generator/steam_sdk/isteaminput.h +++ b/Generator/steam_sdk/isteaminput.h @@ -682,6 +682,11 @@ struct SteamInputActionEvent_t }; }; +//----------------------------------------------------------------------------- +// Forward declaration for ScePadTriggerEffectParam, defined in isteamdualsense.h +//----------------------------------------------------------------------------- +struct ScePadTriggerEffectParam; + #pragma pack( pop ) typedef void ( *SteamInputActionEventCallbackPointer )( SteamInputActionEvent_t * ); @@ -895,6 +900,9 @@ public: // Get a bitmask of the Steam Input Configuration types opted in for the current session. Returns ESteamInputConfigurationEnableType values.? // Note: user can override the settings from the Steamworks Partner site so the returned values may not exactly match your default configuration virtual uint16 GetSessionInputConfigurationSettings() = 0; + + // Set the trigger effect for a DualSense controller + virtual void SetDualSenseTriggerEffect( InputHandle_t inputHandle, const ScePadTriggerEffectParam *pParam ) = 0; }; #define STEAMINPUT_INTERFACE_VERSION "SteamInput006" diff --git a/Generator/steam_sdk/isteamnetworkingmessages.h b/Generator/steam_sdk/isteamnetworkingmessages.h index a3d58ae..b7a2cd0 100644 --- a/Generator/steam_sdk/isteamnetworkingmessages.h +++ b/Generator/steam_sdk/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/Generator/steam_sdk/isteamnetworkingsockets.h b/Generator/steam_sdk/isteamnetworkingsockets.h index 157e12c..b4e9ec3 100644 --- a/Generator/steam_sdk/isteamnetworkingsockets.h +++ b/Generator/steam_sdk/isteamnetworkingsockets.h @@ -920,32 +920,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/Generator/steam_sdk/isteamutils.h b/Generator/steam_sdk/isteamutils.h index 7962f18..5f56d8d 100644 --- a/Generator/steam_sdk/isteamutils.h +++ b/Generator/steam_sdk/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/Generator/steam_sdk/steam_api.json b/Generator/steam_sdk/steam_api.json index a848b79..25e3e7e 100644 --- a/Generator/steam_sdk/steam_api.json +++ b/Generator/steam_sdk/steam_api.json @@ -290,6 +290,26 @@ ], "struct": "OverlayBrowserProtocolNavigation_t" }, + { + "callback_id": 350, + "fields": [ + { "fieldname":"m_steamID", "fieldtype":"CSteamID" } + ], + "struct": "EquippedProfileItemsChanged_t" + }, + { + "callback_id": 351, + "fields": [ + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_steamID", "fieldtype":"CSteamID" }, + { "fieldname":"m_bHasAnimatedAvatar", "fieldtype":"bool" }, + { "fieldname":"m_bHasAvatarFrame", "fieldtype":"bool" }, + { "fieldname":"m_bHasProfileModifier", "fieldtype":"bool" }, + { "fieldname":"m_bHasProfileBackground", "fieldtype":"bool" }, + { "fieldname":"m_bHasMiniProfileBackground", "fieldtype":"bool" } + ], + "struct": "EquippedProfileItems_t" + }, { "callback_id": 701, "fields": [], @@ -2076,7 +2096,11 @@ { "name":"k_EResultSteamRealmMismatch", "value":"120" }, { "name":"k_EResultInvalidSignature", "value":"121" }, { "name":"k_EResultParseFailure", "value":"122" }, - { "name":"k_EResultNoVerifiedPhone", "value":"123" } + { "name":"k_EResultNoVerifiedPhone", "value":"123" }, + { "name":"k_EResultInsufficientBattery", "value":"124" }, + { "name":"k_EResultChargerRequired", "value":"125" }, + { "name":"k_EResultCachedCredentialInvalid", "value":"126" }, + { "name":"K_EResultPhoneNumberIsVOIP", "value":"127" } ] }, { @@ -2415,6 +2439,33 @@ { "name":"k_EActivateGameOverlayToWebPageMode_Modal", "value":"1" } ] }, + { + "enumname": "ECommunityProfileItemType", + "values": [ + { "name":"k_ECommunityProfileItemType_AnimatedAvatar", "value":"0" }, + { "name":"k_ECommunityProfileItemType_AvatarFrame", "value":"1" }, + { "name":"k_ECommunityProfileItemType_ProfileModifier", "value":"2" }, + { "name":"k_ECommunityProfileItemType_ProfileBackground", "value":"3" }, + { "name":"k_ECommunityProfileItemType_MiniProfileBackground", "value":"4" } + ] + }, + { + "enumname": "ECommunityProfileItemProperty", + "values": [ + { "name":"k_ECommunityProfileItemProperty_ImageSmall", "value":"0" }, + { "name":"k_ECommunityProfileItemProperty_ImageLarge", "value":"1" }, + { "name":"k_ECommunityProfileItemProperty_InternalName", "value":"2" }, + { "name":"k_ECommunityProfileItemProperty_Title", "value":"3" }, + { "name":"k_ECommunityProfileItemProperty_Description", "value":"4" }, + { "name":"k_ECommunityProfileItemProperty_AppID", "value":"5" }, + { "name":"k_ECommunityProfileItemProperty_TypeID", "value":"6" }, + { "name":"k_ECommunityProfileItemProperty_Class", "value":"7" }, + { "name":"k_ECommunityProfileItemProperty_MovieWebM", "value":"8" }, + { "name":"k_ECommunityProfileItemProperty_MovieMP4", "value":"9" }, + { "name":"k_ECommunityProfileItemProperty_MovieWebMSmall", "value":"10" }, + { "name":"k_ECommunityProfileItemProperty_MovieMP4Small", "value":"11" } + ] + }, { "enumname": "EPersonaChange", "values": [ @@ -4097,6 +4148,10 @@ { "name":"k_ESteamNetworkingConfig_P2P_Transport_ICE_Enable", "value":"104" }, { "name":"k_ESteamNetworkingConfig_P2P_Transport_ICE_Penalty", "value":"105" }, { "name":"k_ESteamNetworkingConfig_P2P_Transport_SDR_Penalty", "value":"106" }, + { "name":"k_ESteamNetworkingConfig_P2P_TURN_ServerList", "value":"107" }, + { "name":"k_ESteamNetworkingConfig_P2P_TURN_UserList", "value":"108" }, + { "name":"k_ESteamNetworkingConfig_P2P_TURN_PassList", "value":"109" }, + { "name":"k_ESteamNetworkingConfig_P2P_Transport_ICE_Implementation", "value":"110" }, { "name":"k_ESteamNetworkingConfig_SDRClient_ConsecutitivePingTimeoutsFailInitial", "value":"19" }, { "name":"k_ESteamNetworkingConfig_SDRClient_ConsecutitivePingTimeoutsFail", "value":"20" }, { "name":"k_ESteamNetworkingConfig_SDRClient_MinPingsBeforePingAccurate", "value":"21" }, @@ -5445,6 +5500,44 @@ { "paramname":"pchConnectString", "paramtype":"const char *" } ], "returntype": "void" + }, + { + "callresult": "EquippedProfileItems_t", + "methodname": "RequestEquippedProfileItems", + "methodname_flat": "SteamAPI_ISteamFriends_RequestEquippedProfileItems", + "params": [ + { "paramname":"steamID", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" } + ], + "returntype": "SteamAPICall_t" + }, + { + "methodname": "BHasEquippedProfileItem", + "methodname_flat": "SteamAPI_ISteamFriends_BHasEquippedProfileItem", + "params": [ + { "paramname":"steamID", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"itemType", "paramtype":"ECommunityProfileItemType" } + ], + "returntype": "bool" + }, + { + "methodname": "GetProfileItemPropertyString", + "methodname_flat": "SteamAPI_ISteamFriends_GetProfileItemPropertyString", + "params": [ + { "paramname":"steamID", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"itemType", "paramtype":"ECommunityProfileItemType" }, + { "paramname":"prop", "paramtype":"ECommunityProfileItemProperty" } + ], + "returntype": "const char *" + }, + { + "methodname": "GetProfileItemPropertyUint", + "methodname_flat": "SteamAPI_ISteamFriends_GetProfileItemPropertyUint", + "params": [ + { "paramname":"steamID", "paramtype":"CSteamID", "paramtype_flat":"uint64_steamid" }, + { "paramname":"itemType", "paramtype":"ECommunityProfileItemType" }, + { "paramname":"prop", "paramtype":"ECommunityProfileItemProperty" } + ], + "returntype": "uint32" } ], "version_string": "SteamFriends017" @@ -7934,6 +8027,14 @@ { "paramname":"punSecondsPlayed", "paramtype":"uint32 *" } ], "returntype": "bool" + }, + { + "methodname": "SetDlcContext", + "methodname_flat": "SteamAPI_ISteamApps_SetDlcContext", + "params": [ + { "paramname":"nAppID", "paramtype":"AppId_t" } + ], + "returntype": "bool" } ], "version_string": "STEAMAPPS_INTERFACE_VERSION008" @@ -9286,6 +9387,15 @@ "methodname_flat": "SteamAPI_ISteamInput_GetSessionInputConfigurationSettings", "params": [], "returntype": "uint16" + }, + { + "methodname": "SetDualSenseTriggerEffect", + "methodname_flat": "SteamAPI_ISteamInput_SetDualSenseTriggerEffect", + "params": [ + { "paramname":"inputHandle", "paramtype":"InputHandle_t" }, + { "paramname":"pParam", "paramtype":"const ScePadTriggerEffectParam *" } + ], + "returntype": "void" } ], "version_string": "SteamInput006" diff --git a/Generator/steam_sdk/steam_api_flat.h b/Generator/steam_sdk/steam_api_flat.h index 5b213f7..d0e3c48 100644 --- a/Generator/steam_sdk/steam_api_flat.h +++ b/Generator/steam_sdk/steam_api_flat.h @@ -176,6 +176,10 @@ S_API int SteamAPI_ISteamFriends_GetNumChatsWithUnreadPriorityMessages( ISteamFr S_API void SteamAPI_ISteamFriends_ActivateGameOverlayRemotePlayTogetherInviteDialog( ISteamFriends* self, uint64_steamid steamIDLobby ); S_API bool SteamAPI_ISteamFriends_RegisterProtocolInOverlayBrowser( ISteamFriends* self, const char * pchProtocol ); S_API void SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialogConnectString( ISteamFriends* self, const char * pchConnectString ); +S_API SteamAPICall_t SteamAPI_ISteamFriends_RequestEquippedProfileItems( ISteamFriends* self, uint64_steamid steamID ); +S_API bool SteamAPI_ISteamFriends_BHasEquippedProfileItem( ISteamFriends* self, uint64_steamid steamID, ECommunityProfileItemType itemType ); +S_API const char * SteamAPI_ISteamFriends_GetProfileItemPropertyString( ISteamFriends* self, uint64_steamid steamID, ECommunityProfileItemType itemType, ECommunityProfileItemProperty prop ); +S_API uint32 SteamAPI_ISteamFriends_GetProfileItemPropertyUint( ISteamFriends* self, uint64_steamid steamID, ECommunityProfileItemType itemType, ECommunityProfileItemProperty prop ); // ISteamUtils @@ -506,6 +510,7 @@ S_API SteamAPICall_t SteamAPI_ISteamApps_GetFileDetails( ISteamApps* self, const S_API int SteamAPI_ISteamApps_GetLaunchCommandLine( ISteamApps* self, char * pszCommandLine, int cubCommandLine ); S_API bool SteamAPI_ISteamApps_BIsSubscribedFromFamilySharing( ISteamApps* self ); S_API bool SteamAPI_ISteamApps_BIsTimedTrial( ISteamApps* self, uint32 * punSecondsAllowed, uint32 * punSecondsPlayed ); +S_API bool SteamAPI_ISteamApps_SetDlcContext( ISteamApps* self, AppId_t nAppID ); // ISteamNetworking @@ -702,6 +707,7 @@ S_API EInputActionOrigin SteamAPI_ISteamInput_TranslateActionOrigin( ISteamInput S_API bool SteamAPI_ISteamInput_GetDeviceBindingRevision( ISteamInput* self, InputHandle_t inputHandle, int * pMajor, int * pMinor ); S_API uint32 SteamAPI_ISteamInput_GetRemotePlaySessionID( ISteamInput* self, InputHandle_t inputHandle ); S_API uint16 SteamAPI_ISteamInput_GetSessionInputConfigurationSettings( ISteamInput* self ); +S_API void SteamAPI_ISteamInput_SetDualSenseTriggerEffect( ISteamInput* self, InputHandle_t inputHandle, const ScePadTriggerEffectParam * pParam ); // ISteamController diff --git a/Generator/steam_sdk/steamclientpublic.h b/Generator/steam_sdk/steamclientpublic.h index 93aa7c6..1521e33 100644 --- a/Generator/steam_sdk/steamclientpublic.h +++ b/Generator/steam_sdk/steamclientpublic.h @@ -137,6 +137,10 @@ 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 + K_EResultPhoneNumberIsVOIP = 127, // The phone number provided is a Voice Over IP number }; // Error codes for use with the voice functions @@ -592,37 +596,6 @@ public: m_steamid.m_comp.m_unAccountInstance = 0; } - -#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 - //----------------------------------------------------------------------------- - void SetFromSteam2( TSteamGlobalUserID *pTSteamGlobalUserID, EUniverse eUniverse ) - { - m_steamid.m_comp.m_unAccountID = pTSteamGlobalUserID->m_SteamLocalUserID.Split.Low32bits * 2 + - pTSteamGlobalUserID->m_SteamLocalUserID.Split.High32bits; - m_steamid.m_comp.m_EUniverse = eUniverse; // set the universe - m_steamid.m_comp.m_EAccountType = k_EAccountTypeIndividual; // Steam 2 accounts always map to account type of individual - m_steamid.m_comp.m_unAccountInstance = k_unSteamUserDefaultInstance; // Steam2 only knew one instance - } - - //----------------------------------------------------------------------------- - // Purpose: Fills out a Steam2 ID structure - // Input: pTSteamGlobalUserID - Steam2 ID to write to - //----------------------------------------------------------------------------- - void ConvertToSteam2( TSteamGlobalUserID *pTSteamGlobalUserID ) const - { - // only individual accounts have any meaning in Steam 2, only they can be mapped - // Assert( m_steamid.m_comp.m_EAccountType == k_EAccountTypeIndividual ); - - pTSteamGlobalUserID->m_SteamInstanceID = 0; - pTSteamGlobalUserID->m_SteamLocalUserID.Split.High32bits = m_steamid.m_comp.m_unAccountID % 2; - pTSteamGlobalUserID->m_SteamLocalUserID.Split.Low32bits = m_steamid.m_comp.m_unAccountID / 2; - } -#endif // defined( INCLUDED_STEAM_COMMON_STEAMCOMMON_H ) - //----------------------------------------------------------------------------- // Purpose: Converts steam ID to its 64-bit representation // Output : 64-bit representation of a Steam ID @@ -794,7 +767,6 @@ public: // and is preferred when the caller knows it's safe to be strict. // Returns whether the string parsed correctly. bool SetFromStringStrict( const char *pchSteamID, EUniverse eDefaultUniverse ); - bool SetFromSteam2String( const char *pchSteam2ID, EUniverse eUniverse ); inline bool operator==( const CSteamID &val ) const { return m_steamid.m_unAll64Bits == val.m_steamid.m_unAll64Bits; } inline bool operator!=( const CSteamID &val ) const { return !operator==( val ); } @@ -863,6 +835,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/Generator/steam_sdk/steamnetworkingtypes.h b/Generator/steam_sdk/steamnetworkingtypes.h index 6692a9c..6f93c04 100644 --- a/Generator/steam_sdk/steamnetworkingtypes.h +++ b/Generator/steam_sdk/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; @@ -1479,7 +1496,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 @@ -1695,7 +1716,9 @@ inline SteamNetworkingPOPID CalculateSteamNetworkingPOPIDFromString( const char template inline void GetSteamNetworkingLocationPOPStringFromID( SteamNetworkingPOPID id, char (&szCode)[N] ) { +#if !defined( __GNUC__ ) || __GNUC__ >= 5 static_assert( N >= 5, "Fixed-size buffer not big enough to hold SDR POP ID" ); +#endif szCode[0] = char( id >> 16U ); szCode[1] = char( id >> 8U ); szCode[2] = char( id ); @@ -1744,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; diff --git a/UnityPlugin/redistributable_bin/linux32/libsteam_api.so b/UnityPlugin/redistributable_bin/linux32/libsteam_api.so index ece5e3b..9476561 100644 Binary files a/UnityPlugin/redistributable_bin/linux32/libsteam_api.so and b/UnityPlugin/redistributable_bin/linux32/libsteam_api.so differ diff --git a/UnityPlugin/redistributable_bin/linux64/libsteam_api.so b/UnityPlugin/redistributable_bin/linux64/libsteam_api.so index 8bf6762..d755843 100644 Binary files a/UnityPlugin/redistributable_bin/linux64/libsteam_api.so and b/UnityPlugin/redistributable_bin/linux64/libsteam_api.so differ diff --git a/UnityPlugin/redistributable_bin/osx/libsteam_api.bundle b/UnityPlugin/redistributable_bin/osx/libsteam_api.bundle deleted file mode 100644 index 8d3c5ee..0000000 Binary files a/UnityPlugin/redistributable_bin/osx/libsteam_api.bundle and /dev/null differ diff --git a/UnityPlugin/redistributable_bin/osx/libsteam_api.dylib b/UnityPlugin/redistributable_bin/osx/libsteam_api.dylib new file mode 100644 index 0000000..41fc923 Binary files /dev/null and b/UnityPlugin/redistributable_bin/osx/libsteam_api.dylib differ diff --git a/UnityPlugin/redistributable_bin/osx/libsteam_api.bundle.meta b/UnityPlugin/redistributable_bin/osx/libsteam_api.dylib.meta similarity index 51% rename from UnityPlugin/redistributable_bin/osx/libsteam_api.bundle.meta rename to UnityPlugin/redistributable_bin/osx/libsteam_api.dylib.meta index c0be5c9..1f2df2e 100644 --- a/UnityPlugin/redistributable_bin/osx/libsteam_api.bundle.meta +++ b/UnityPlugin/redistributable_bin/osx/libsteam_api.dylib.meta @@ -11,6 +11,16 @@ PluginImporter: isExplicitlyReferenced: 0 validateReferences: 1 platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Editor: 0 + Exclude Linux64: 1 + Exclude OSXUniversal: 0 + Exclude Win: 1 + Exclude Win64: 1 - first: Any: second: @@ -21,12 +31,33 @@ PluginImporter: second: enabled: 1 settings: + CPU: AnyCPU DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: x86_64 - first: Standalone: OSXUniversal second: enabled: 1 - settings: {} + settings: + CPU: AnyCPU + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: x86_64 userData: assetBundleName: assetBundleVariant: diff --git a/UnityPlugin/redistributable_bin/steam_api.dll b/UnityPlugin/redistributable_bin/steam_api.dll index 319bb83..3c4d47f 100644 Binary files a/UnityPlugin/redistributable_bin/steam_api.dll and b/UnityPlugin/redistributable_bin/steam_api.dll differ diff --git a/UnityPlugin/redistributable_bin/steam_api.lib b/UnityPlugin/redistributable_bin/steam_api.lib index b413162..44d01ec 100644 Binary files a/UnityPlugin/redistributable_bin/steam_api.lib and b/UnityPlugin/redistributable_bin/steam_api.lib differ diff --git a/UnityPlugin/redistributable_bin/win64/steam_api64.dll b/UnityPlugin/redistributable_bin/win64/steam_api64.dll index e1ca692..5b798af 100644 Binary files a/UnityPlugin/redistributable_bin/win64/steam_api64.dll and b/UnityPlugin/redistributable_bin/win64/steam_api64.dll differ diff --git a/UnityPlugin/redistributable_bin/win64/steam_api64.lib b/UnityPlugin/redistributable_bin/win64/steam_api64.lib index 510d768..7b6b2f8 100644 Binary files a/UnityPlugin/redistributable_bin/win64/steam_api64.lib and b/UnityPlugin/redistributable_bin/win64/steam_api64.lib differ