From ead761fe048d682450981e50c7cdfd27246aa553 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Tue, 11 Feb 2020 11:28:30 +0000 Subject: [PATCH] Call SetupInterface on startup --- Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs | 6 ++++++ Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs | 6 ++++++ .../Generated/Interfaces/ISteamGameServer.cs | 6 ++++++ .../Generated/Interfaces/ISteamGameServerStats.cs | 6 ++++++ Facepunch.Steamworks/Generated/Interfaces/ISteamInput.cs | 6 ++++++ .../Generated/Interfaces/ISteamInventory.cs | 6 ++++++ .../Generated/Interfaces/ISteamMatchmaking.cs | 6 ++++++ .../Generated/Interfaces/ISteamMatchmakingServers.cs | 6 ++++++ Facepunch.Steamworks/Generated/Interfaces/ISteamMusic.cs | 6 ++++++ .../Generated/Interfaces/ISteamNetworking.cs | 6 ++++++ .../Generated/Interfaces/ISteamNetworkingSockets.cs | 6 ++++++ .../Generated/Interfaces/ISteamNetworkingUtils.cs | 6 ++++++ .../Generated/Interfaces/ISteamParentalSettings.cs | 6 ++++++ Facepunch.Steamworks/Generated/Interfaces/ISteamParties.cs | 6 ++++++ .../Generated/Interfaces/ISteamRemoteStorage.cs | 6 ++++++ .../Generated/Interfaces/ISteamScreenshots.cs | 6 ++++++ Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs | 6 ++++++ Facepunch.Steamworks/Generated/Interfaces/ISteamUser.cs | 6 ++++++ .../Generated/Interfaces/ISteamUserStats.cs | 6 ++++++ Facepunch.Steamworks/Generated/Interfaces/ISteamUtils.cs | 6 ++++++ Facepunch.Steamworks/Generated/Interfaces/ISteamVideo.cs | 6 ++++++ Generator/CodeWriter/ClassVTable.cs | 7 +++++++ 22 files changed, 133 insertions(+) diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs index b553c16..3d1c272 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs @@ -11,6 +11,12 @@ namespace Steamworks { public override IntPtr GetInterfacePointer() => GetApi.SteamApps(); + + internal ISteamApps() + { + SetupInterface(); + } + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_BIsSubscribed")] [return: MarshalAs( UnmanagedType.I1 )] diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs index 0b08dc7..30a2fdb 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs @@ -11,6 +11,12 @@ namespace Steamworks { public override IntPtr GetInterfacePointer() => GetApi.SteamFriends(); + + internal ISteamFriends() + { + SetupInterface(); + } + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetPersonaName")] private static extern Utf8StringPointer _GetPersonaName( IntPtr self ); diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServer.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServer.cs index fd9f80f..bcdf5bb 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServer.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServer.cs @@ -11,6 +11,12 @@ namespace Steamworks { public override IntPtr GetInterfacePointer() => GetApi.SteamGameServer(); + + internal ISteamGameServer() + { + SetupInterface(); + } + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_InitGameServer")] [return: MarshalAs( UnmanagedType.I1 )] diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServerStats.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServerStats.cs index adc57d4..d58a0ce 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServerStats.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServerStats.cs @@ -11,6 +11,12 @@ namespace Steamworks { public override IntPtr GetInterfacePointer() => GetApi.SteamGameServerStats(); + + internal ISteamGameServerStats() + { + SetupInterface(); + } + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_RequestUserStats")] private static extern SteamAPICall_t _RequestUserStats( IntPtr self, SteamId steamIDUser ); diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamInput.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamInput.cs index 0c336b0..0ac4689 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamInput.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamInput.cs @@ -11,6 +11,12 @@ namespace Steamworks { public override IntPtr GetInterfacePointer() => GetApi.SteamInput(); + + internal ISteamInput() + { + SetupInterface(); + } + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_Init")] [return: MarshalAs( UnmanagedType.I1 )] diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamInventory.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamInventory.cs index 2f785e9..b17ec95 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamInventory.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamInventory.cs @@ -11,6 +11,12 @@ namespace Steamworks { public override IntPtr GetInterfacePointer() => GetApi.SteamInventory(); + + internal ISteamInventory() + { + SetupInterface(); + } + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetResultStatus")] private static extern Result _GetResultStatus( IntPtr self, SteamInventoryResult_t resultHandle ); diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmaking.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmaking.cs index 42d4eaa..d5aad65 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmaking.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmaking.cs @@ -11,6 +11,12 @@ namespace Steamworks { public override IntPtr GetInterfacePointer() => GetApi.SteamMatchmaking(); + + internal ISteamMatchmaking() + { + SetupInterface(); + } + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetFavoriteGameCount")] private static extern int _GetFavoriteGameCount( IntPtr self ); diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServers.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServers.cs index 7ddd68f..71b9bab 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServers.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServers.cs @@ -11,6 +11,12 @@ namespace Steamworks { public override IntPtr GetInterfacePointer() => GetApi.SteamMatchmakingServers(); + + internal ISteamMatchmakingServers() + { + SetupInterface(); + } + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_RequestInternetServerList")] private static extern HServerListRequest _RequestInternetServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamMusic.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamMusic.cs index 4fe8529..ad2a12c 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamMusic.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamMusic.cs @@ -11,6 +11,12 @@ namespace Steamworks { public override IntPtr GetInterfacePointer() => GetApi.SteamMusic(); + + internal ISteamMusic() + { + SetupInterface(); + } + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusic_BIsEnabled")] [return: MarshalAs( UnmanagedType.I1 )] diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworking.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworking.cs index 282a4cb..1806ad3 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworking.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworking.cs @@ -11,6 +11,12 @@ namespace Steamworks { public override IntPtr GetInterfacePointer() => GetApi.SteamNetworking(); + + internal ISteamNetworking() + { + SetupInterface(); + } + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_SendP2PPacket")] [return: MarshalAs( UnmanagedType.I1 )] diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingSockets.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingSockets.cs index 502f6b6..267f65f 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingSockets.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingSockets.cs @@ -11,5 +11,11 @@ namespace Steamworks { public override IntPtr GetInterfacePointer() => GetApi.SteamNetworkingSockets(); + + internal ISteamNetworkingSockets() + { + SetupInterface(); + } + } } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs index a2e8f69..b8de965 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs @@ -11,5 +11,11 @@ namespace Steamworks { public override IntPtr GetInterfacePointer() => GetApi.SteamNetworkingUtils(); + + internal ISteamNetworkingUtils() + { + SetupInterface(); + } + } } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamParentalSettings.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamParentalSettings.cs index 723c1c2..f6091ce 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamParentalSettings.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamParentalSettings.cs @@ -11,6 +11,12 @@ namespace Steamworks { public override IntPtr GetInterfacePointer() => GetApi.SteamParentalSettings(); + + internal ISteamParentalSettings() + { + SetupInterface(); + } + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParentalSettings_BIsParentalLockEnabled")] [return: MarshalAs( UnmanagedType.I1 )] diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamParties.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamParties.cs index 4515a56..05d5ac4 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamParties.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamParties.cs @@ -11,6 +11,12 @@ namespace Steamworks { public override IntPtr GetInterfacePointer() => GetApi.SteamParties(); + + internal ISteamParties() + { + SetupInterface(); + } + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_GetNumActiveBeacons")] private static extern uint _GetNumActiveBeacons( IntPtr self ); diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamRemoteStorage.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamRemoteStorage.cs index 03a2150..462e6e0 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamRemoteStorage.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamRemoteStorage.cs @@ -11,6 +11,12 @@ namespace Steamworks { public override IntPtr GetInterfacePointer() => GetApi.SteamRemoteStorage(); + + internal ISteamRemoteStorage() + { + SetupInterface(); + } + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWrite")] [return: MarshalAs( UnmanagedType.I1 )] diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamScreenshots.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamScreenshots.cs index b652613..2438c2c 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamScreenshots.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamScreenshots.cs @@ -11,6 +11,12 @@ namespace Steamworks { public override IntPtr GetInterfacePointer() => GetApi.SteamScreenshots(); + + internal ISteamScreenshots() + { + SetupInterface(); + } + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamScreenshots_WriteScreenshot")] private static extern ScreenshotHandle _WriteScreenshot( IntPtr self, IntPtr pubRGB, uint cubRGB, int nWidth, int nHeight ); diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs index b8a3112..640fa96 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs @@ -11,6 +11,12 @@ namespace Steamworks { public override IntPtr GetInterfacePointer() => GetApi.SteamUGC(); + + internal ISteamUGC() + { + SetupInterface(); + } + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_CreateQueryUserUGCRequest")] private static extern UGCQueryHandle_t _CreateQueryUserUGCRequest( IntPtr self, AccountID_t unAccountID, UserUGCList eListType, UgcType eMatchingUGCType, UserUGCListSortOrder eSortOrder, AppId nCreatorAppID, AppId nConsumerAppID, uint unPage ); diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamUser.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamUser.cs index e497e84..bba0b37 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamUser.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamUser.cs @@ -11,6 +11,12 @@ namespace Steamworks { public override IntPtr GetInterfacePointer() => GetApi.SteamUser(); + + internal ISteamUser() + { + SetupInterface(); + } + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetHSteamUser")] private static extern HSteamUser _GetHSteamUser( IntPtr self ); diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamUserStats.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamUserStats.cs index c285b36..09ce10b 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamUserStats.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamUserStats.cs @@ -11,6 +11,12 @@ namespace Steamworks { public override IntPtr GetInterfacePointer() => GetApi.SteamUserStats(); + + internal ISteamUserStats() + { + SetupInterface(); + } + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_RequestCurrentStats")] [return: MarshalAs( UnmanagedType.I1 )] diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamUtils.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamUtils.cs index 723bde3..65896a9 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamUtils.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamUtils.cs @@ -11,6 +11,12 @@ namespace Steamworks { public override IntPtr GetInterfacePointer() => GetApi.SteamUtils(); + + internal ISteamUtils() + { + SetupInterface(); + } + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetSecondsSinceAppActive")] private static extern uint _GetSecondsSinceAppActive( IntPtr self ); diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamVideo.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamVideo.cs index 89ec095..e81993a 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamVideo.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamVideo.cs @@ -11,6 +11,12 @@ namespace Steamworks { public override IntPtr GetInterfacePointer() => GetApi.SteamVideo(); + + internal ISteamVideo() + { + SetupInterface(); + } + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamVideo_GetVideoURL")] private static extern void _GetVideoURL( IntPtr self, AppId unVideoAppID ); diff --git a/Generator/CodeWriter/ClassVTable.cs b/Generator/CodeWriter/ClassVTable.cs index e10d021..d2fd8e4 100644 --- a/Generator/CodeWriter/ClassVTable.cs +++ b/Generator/CodeWriter/ClassVTable.cs @@ -27,6 +27,13 @@ namespace Generator { WriteLine( $"public override IntPtr GetInterfacePointer() => GetApi.{className.Substring( 1 )}();" ); WriteLine(); + WriteLine(); + StartBlock( $"internal {className}()" ); + { + WriteLine( $"SetupInterface();" ); + } + EndBlock(); + WriteLine(); var functions = def.methods.Where( x => x.ClassName == className );