From 171d563f567c5f65f1336232483e8a0021def230 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Wed, 19 Feb 2020 11:14:50 +0000 Subject: [PATCH] New accessor system --- .../Generated/Interfaces/ISteamAppList.cs | 11 ++- .../Generated/Interfaces/ISteamApps.cs | 14 +++- .../Generated/Interfaces/ISteamClient.cs | 6 +- .../Generated/Interfaces/ISteamController.cs | 11 ++- .../Generated/Interfaces/ISteamFriends.cs | 11 ++- .../Generated/Interfaces/ISteamGameSearch.cs | 11 ++- .../Generated/Interfaces/ISteamGameServer.cs | 11 ++- .../Interfaces/ISteamGameServerStats.cs | 11 ++- .../Generated/Interfaces/ISteamHTMLSurface.cs | 11 ++- .../Generated/Interfaces/ISteamHTTP.cs | 14 +++- .../Generated/Interfaces/ISteamInput.cs | 11 ++- .../Generated/Interfaces/ISteamInventory.cs | 14 +++- .../Generated/Interfaces/ISteamMatchmaking.cs | 11 ++- .../ISteamMatchmakingPingResponse.cs | 6 +- .../ISteamMatchmakingPlayersResponse.cs | 6 +- .../ISteamMatchmakingRulesResponse.cs | 6 +- .../ISteamMatchmakingServerListResponse.cs | 6 +- .../Interfaces/ISteamMatchmakingServers.cs | 11 ++- .../Generated/Interfaces/ISteamMusic.cs | 11 ++- .../Generated/Interfaces/ISteamMusicRemote.cs | 11 ++- .../Generated/Interfaces/ISteamNetworking.cs | 14 +++- ...teamNetworkingConnectionCustomSignaling.cs | 6 +- ...eamNetworkingCustomSignalingRecvContext.cs | 6 +- .../Interfaces/ISteamNetworkingSockets.cs | 14 +++- .../Interfaces/ISteamNetworkingUtils.cs | 11 ++- .../Interfaces/ISteamParentalSettings.cs | 11 ++- .../Generated/Interfaces/ISteamParties.cs | 11 ++- .../Generated/Interfaces/ISteamRemotePlay.cs | 11 ++- .../Interfaces/ISteamRemoteStorage.cs | 11 ++- .../Generated/Interfaces/ISteamScreenshots.cs | 11 ++- .../Generated/Interfaces/ISteamTV.cs | 11 ++- .../Generated/Interfaces/ISteamUGC.cs | 14 +++- .../Generated/Interfaces/ISteamUser.cs | 11 ++- .../Generated/Interfaces/ISteamUserStats.cs | 11 ++- .../Generated/Interfaces/ISteamUtils.cs | 14 +++- .../Generated/Interfaces/ISteamVideo.cs | 11 ++- Facepunch.Steamworks/SteamApps.cs | 4 +- Facepunch.Steamworks/SteamClient.cs | 2 +- Facepunch.Steamworks/SteamFriends.cs | 4 +- Facepunch.Steamworks/SteamInput.cs | 4 +- Facepunch.Steamworks/SteamInventory.cs | 4 +- Facepunch.Steamworks/SteamMatchmaking.cs | 4 +- .../SteamMatchmakingServers.cs | 4 +- Facepunch.Steamworks/SteamMusic.cs | 4 +- Facepunch.Steamworks/SteamNetworking.cs | 4 +- .../SteamNetworkingSockets.cs | 4 +- Facepunch.Steamworks/SteamNetworkingUtils.cs | 4 +- Facepunch.Steamworks/SteamParental.cs | 4 +- Facepunch.Steamworks/SteamParties.cs | 4 +- Facepunch.Steamworks/SteamRemoteStorage.cs | 4 +- Facepunch.Steamworks/SteamScreenshots.cs | 4 +- Facepunch.Steamworks/SteamServer.cs | 6 +- Facepunch.Steamworks/SteamServerStats.cs | 4 +- Facepunch.Steamworks/SteamUgc.cs | 4 +- Facepunch.Steamworks/SteamUser.cs | 4 +- Facepunch.Steamworks/SteamUserStats.cs | 4 +- Facepunch.Steamworks/SteamUtils.cs | 4 +- Facepunch.Steamworks/SteamVideo.cs | 4 +- Facepunch.Steamworks/Utility/GetApi.cs | 83 ------------------- .../Utility/SteamInterface.cs | 18 +++- Generator/CodeWriter/ClassVTable.cs | 35 +++++++- Generator/SteamApiDefinition.cs | 10 +++ 62 files changed, 337 insertions(+), 279 deletions(-) delete mode 100644 Facepunch.Steamworks/Utility/GetApi.cs diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamAppList.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamAppList.cs index e9661c3..be4bb76 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamAppList.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamAppList.cs @@ -9,14 +9,17 @@ namespace Steamworks { internal class ISteamAppList : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamAppList(); - - internal ISteamAppList() + internal ISteamAppList( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamAppList_v001")] + internal static extern IntPtr SteamAPI_SteamAppList_v001(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamAppList_v001(); + + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamAppList_GetNumInstalledApps")] private static extern uint _GetNumInstalledApps( IntPtr self ); diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs index 3d1c272..74ef86a 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs @@ -9,14 +9,20 @@ namespace Steamworks { internal class ISteamApps : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamApps(); - - internal ISteamApps() + internal ISteamApps( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamApps_v008")] + internal static extern IntPtr SteamAPI_SteamApps_v008(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamApps_v008(); + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamGameServerApps_v008")] + internal static extern IntPtr SteamAPI_SteamGameServerApps_v008(); + public override IntPtr GetServerInterfacePointer() => SteamAPI_SteamGameServerApps_v008(); + + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_BIsSubscribed")] [return: MarshalAs( UnmanagedType.I1 )] diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamClient.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamClient.cs index 11d3529..810861e 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamClient.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamClient.cs @@ -9,12 +9,10 @@ namespace Steamworks { internal class ISteamClient : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamClient(); - - internal ISteamClient() + internal ISteamClient( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } #region FunctionMeta diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamController.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamController.cs index 57f9236..2e07a31 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamController.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamController.cs @@ -9,14 +9,17 @@ namespace Steamworks { internal class ISteamController : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamController(); - - internal ISteamController() + internal ISteamController( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamController_v007")] + internal static extern IntPtr SteamAPI_SteamController_v007(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamController_v007(); + + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_Init")] [return: MarshalAs( UnmanagedType.I1 )] diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs index 96c1cac..c7e29cd 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs @@ -9,14 +9,17 @@ namespace Steamworks { internal class ISteamFriends : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamFriends(); - - internal ISteamFriends() + internal ISteamFriends( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamFriends_v017")] + internal static extern IntPtr SteamAPI_SteamFriends_v017(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamFriends_v017(); + + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetPersonaName")] private static extern Utf8StringPointer _GetPersonaName( IntPtr self ); diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamGameSearch.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamGameSearch.cs index f8428f1..57f88fe 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamGameSearch.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamGameSearch.cs @@ -9,14 +9,17 @@ namespace Steamworks { internal class ISteamGameSearch : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamGameSearch(); - - internal ISteamGameSearch() + internal ISteamGameSearch( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamGameSearch_v001")] + internal static extern IntPtr SteamAPI_SteamGameSearch_v001(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamGameSearch_v001(); + + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameSearch_AddGameSearchParams")] private static extern GameSearchErrorCode_t _AddGameSearchParams( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToFind, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValuesToFind ); diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServer.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServer.cs index 48d5b8f..686d748 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServer.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServer.cs @@ -9,14 +9,17 @@ namespace Steamworks { internal class ISteamGameServer : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamGameServer(); - - internal ISteamGameServer() + internal ISteamGameServer( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamGameServer_v013")] + internal static extern IntPtr SteamAPI_SteamGameServer_v013(); + public override IntPtr GetServerInterfacePointer() => SteamAPI_SteamGameServer_v013(); + + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetProduct")] private static extern void _SetProduct( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszProduct ); diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServerStats.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServerStats.cs index a837f20..2e24b62 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServerStats.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServerStats.cs @@ -9,14 +9,17 @@ namespace Steamworks { internal class ISteamGameServerStats : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamGameServerStats(); - - internal ISteamGameServerStats() + internal ISteamGameServerStats( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamGameServerStats_v001")] + internal static extern IntPtr SteamAPI_SteamGameServerStats_v001(); + public override IntPtr GetServerInterfacePointer() => SteamAPI_SteamGameServerStats_v001(); + + #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/ISteamHTMLSurface.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamHTMLSurface.cs index 008e8d7..fa0393f 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamHTMLSurface.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamHTMLSurface.cs @@ -9,14 +9,17 @@ namespace Steamworks { internal class ISteamHTMLSurface : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamHTMLSurface(); - - internal ISteamHTMLSurface() + internal ISteamHTMLSurface( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamHTMLSurface_v005")] + internal static extern IntPtr SteamAPI_SteamHTMLSurface_v005(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamHTMLSurface_v005(); + + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_Init")] [return: MarshalAs( UnmanagedType.I1 )] diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamHTTP.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamHTTP.cs index 36e1821..a217934 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamHTTP.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamHTTP.cs @@ -9,14 +9,20 @@ namespace Steamworks { internal class ISteamHTTP : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamHTTP(); - - internal ISteamHTTP() + internal ISteamHTTP( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamHTTP_v003")] + internal static extern IntPtr SteamAPI_SteamHTTP_v003(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamHTTP_v003(); + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamGameServerHTTP_v003")] + internal static extern IntPtr SteamAPI_SteamGameServerHTTP_v003(); + public override IntPtr GetServerInterfacePointer() => SteamAPI_SteamGameServerHTTP_v003(); + + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_CreateHTTPRequest")] private static extern HTTPRequestHandle _CreateHTTPRequest( IntPtr self, HTTPMethod eHTTPRequestMethod, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchAbsoluteURL ); diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamInput.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamInput.cs index 64bbd9b..0a6464c 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamInput.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamInput.cs @@ -9,14 +9,17 @@ namespace Steamworks { internal class ISteamInput : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamInput(); - - internal ISteamInput() + internal ISteamInput( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamInput_v001")] + internal static extern IntPtr SteamAPI_SteamInput_v001(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamInput_v001(); + + #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 0b6c507..8421998 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamInventory.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamInventory.cs @@ -9,14 +9,20 @@ namespace Steamworks { internal class ISteamInventory : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamInventory(); - - internal ISteamInventory() + internal ISteamInventory( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamInventory_v003")] + internal static extern IntPtr SteamAPI_SteamInventory_v003(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamInventory_v003(); + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamGameServerInventory_v003")] + internal static extern IntPtr SteamAPI_SteamGameServerInventory_v003(); + public override IntPtr GetServerInterfacePointer() => SteamAPI_SteamGameServerInventory_v003(); + + #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 d5aad65..62cd276 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmaking.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmaking.cs @@ -9,14 +9,17 @@ namespace Steamworks { internal class ISteamMatchmaking : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamMatchmaking(); - - internal ISteamMatchmaking() + internal ISteamMatchmaking( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamMatchmaking_v009")] + internal static extern IntPtr SteamAPI_SteamMatchmaking_v009(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamMatchmaking_v009(); + + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetFavoriteGameCount")] private static extern int _GetFavoriteGameCount( IntPtr self ); diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingPingResponse.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingPingResponse.cs index 36e807c..2bbf3ab 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingPingResponse.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingPingResponse.cs @@ -9,12 +9,10 @@ namespace Steamworks { internal class ISteamMatchmakingPingResponse : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamMatchmakingPingResponse(); - - internal ISteamMatchmakingPingResponse() + internal ISteamMatchmakingPingResponse( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } #region FunctionMeta diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingPlayersResponse.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingPlayersResponse.cs index 19d0144..feaaf3f 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingPlayersResponse.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingPlayersResponse.cs @@ -9,12 +9,10 @@ namespace Steamworks { internal class ISteamMatchmakingPlayersResponse : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamMatchmakingPlayersResponse(); - - internal ISteamMatchmakingPlayersResponse() + internal ISteamMatchmakingPlayersResponse( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } #region FunctionMeta diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingRulesResponse.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingRulesResponse.cs index bbebaa4..a1833d9 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingRulesResponse.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingRulesResponse.cs @@ -9,12 +9,10 @@ namespace Steamworks { internal class ISteamMatchmakingRulesResponse : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamMatchmakingRulesResponse(); - - internal ISteamMatchmakingRulesResponse() + internal ISteamMatchmakingRulesResponse( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } #region FunctionMeta diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServerListResponse.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServerListResponse.cs index 68a571e..3f42330 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServerListResponse.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServerListResponse.cs @@ -9,12 +9,10 @@ namespace Steamworks { internal class ISteamMatchmakingServerListResponse : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamMatchmakingServerListResponse(); - - internal ISteamMatchmakingServerListResponse() + internal ISteamMatchmakingServerListResponse( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } #region FunctionMeta diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServers.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServers.cs index 86a3803..b7b8b2c 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServers.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServers.cs @@ -9,14 +9,17 @@ namespace Steamworks { internal class ISteamMatchmakingServers : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamMatchmakingServers(); - - internal ISteamMatchmakingServers() + internal ISteamMatchmakingServers( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamMatchmakingServers_v002")] + internal static extern IntPtr SteamAPI_SteamMatchmakingServers_v002(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamMatchmakingServers_v002(); + + #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 ad2a12c..f80f984 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamMusic.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamMusic.cs @@ -9,14 +9,17 @@ namespace Steamworks { internal class ISteamMusic : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamMusic(); - - internal ISteamMusic() + internal ISteamMusic( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamMusic_v001")] + internal static extern IntPtr SteamAPI_SteamMusic_v001(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamMusic_v001(); + + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusic_BIsEnabled")] [return: MarshalAs( UnmanagedType.I1 )] diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamMusicRemote.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamMusicRemote.cs index 32e70f2..14559e2 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamMusicRemote.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamMusicRemote.cs @@ -9,14 +9,17 @@ namespace Steamworks { internal class ISteamMusicRemote : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamMusicRemote(); - - internal ISteamMusicRemote() + internal ISteamMusicRemote( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamMusicRemote_v001")] + internal static extern IntPtr SteamAPI_SteamMusicRemote_v001(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamMusicRemote_v001(); + + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_RegisterSteamMusicRemote")] [return: MarshalAs( UnmanagedType.I1 )] diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworking.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworking.cs index 15eb2e9..971ad13 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworking.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworking.cs @@ -9,14 +9,20 @@ namespace Steamworks { internal class ISteamNetworking : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamNetworking(); - - internal ISteamNetworking() + internal ISteamNetworking( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworking_v006")] + internal static extern IntPtr SteamAPI_SteamNetworking_v006(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamNetworking_v006(); + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamGameServerNetworking_v006")] + internal static extern IntPtr SteamAPI_SteamGameServerNetworking_v006(); + public override IntPtr GetServerInterfacePointer() => SteamAPI_SteamGameServerNetworking_v006(); + + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_SendP2PPacket")] [return: MarshalAs( UnmanagedType.I1 )] diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingConnectionCustomSignaling.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingConnectionCustomSignaling.cs index 47babaf..40ee6a2 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingConnectionCustomSignaling.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingConnectionCustomSignaling.cs @@ -9,12 +9,10 @@ namespace Steamworks { internal class ISteamNetworkingConnectionCustomSignaling : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamNetworkingConnectionCustomSignaling(); - - internal ISteamNetworkingConnectionCustomSignaling() + internal ISteamNetworkingConnectionCustomSignaling( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } #region FunctionMeta diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingCustomSignalingRecvContext.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingCustomSignalingRecvContext.cs index 4bb9ee4..15b9d5c 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingCustomSignalingRecvContext.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingCustomSignalingRecvContext.cs @@ -9,12 +9,10 @@ namespace Steamworks { internal class ISteamNetworkingCustomSignalingRecvContext : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamNetworkingCustomSignalingRecvContext(); - - internal ISteamNetworkingCustomSignalingRecvContext() + internal ISteamNetworkingCustomSignalingRecvContext( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } #region FunctionMeta diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingSockets.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingSockets.cs index a4b7b98..4900835 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingSockets.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingSockets.cs @@ -9,14 +9,20 @@ namespace Steamworks { internal class ISteamNetworkingSockets : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamNetworkingSockets(); - - internal ISteamNetworkingSockets() + internal ISteamNetworkingSockets( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingSockets_v008")] + internal static extern IntPtr SteamAPI_SteamNetworkingSockets_v008(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamNetworkingSockets_v008(); + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamGameServerNetworkingSockets_v008")] + internal static extern IntPtr SteamAPI_SteamGameServerNetworkingSockets_v008(); + public override IntPtr GetServerInterfacePointer() => SteamAPI_SteamGameServerNetworkingSockets_v008(); + + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_CreateListenSocketIP")] private static extern Socket _CreateListenSocketIP( IntPtr self, ref NetAddress localAddress, int nOptions, [In,Out] NetKeyValue[] pOptions ); diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs index 6285843..c169102 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs @@ -9,14 +9,17 @@ namespace Steamworks { internal class ISteamNetworkingUtils : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamNetworkingUtils(); - - internal ISteamNetworkingUtils() + internal ISteamNetworkingUtils( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingUtils_v003")] + internal static extern IntPtr SteamAPI_SteamNetworkingUtils_v003(); + public override IntPtr GetGlobalInterfacePointer() => SteamAPI_SteamNetworkingUtils_v003(); + + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_AllocateMessage")] private static extern IntPtr _AllocateMessage( IntPtr self, int cbAllocateBuffer ); diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamParentalSettings.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamParentalSettings.cs index f6091ce..602b2df 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamParentalSettings.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamParentalSettings.cs @@ -9,14 +9,17 @@ namespace Steamworks { internal class ISteamParentalSettings : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamParentalSettings(); - - internal ISteamParentalSettings() + internal ISteamParentalSettings( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamParentalSettings_v001")] + internal static extern IntPtr SteamAPI_SteamParentalSettings_v001(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamParentalSettings_v001(); + + #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 05d5ac4..212af23 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamParties.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamParties.cs @@ -9,14 +9,17 @@ namespace Steamworks { internal class ISteamParties : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamParties(); - - internal ISteamParties() + internal ISteamParties( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamParties_v002")] + internal static extern IntPtr SteamAPI_SteamParties_v002(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamParties_v002(); + + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_GetNumActiveBeacons")] private static extern uint _GetNumActiveBeacons( IntPtr self ); diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamRemotePlay.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamRemotePlay.cs index 3605da9..4ca0523 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamRemotePlay.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamRemotePlay.cs @@ -9,14 +9,17 @@ namespace Steamworks { internal class ISteamRemotePlay : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamRemotePlay(); - - internal ISteamRemotePlay() + internal ISteamRemotePlay( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamRemotePlay_v001")] + internal static extern IntPtr SteamAPI_SteamRemotePlay_v001(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamRemotePlay_v001(); + + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemotePlay_GetSessionCount")] private static extern uint _GetSessionCount( IntPtr self ); diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamRemoteStorage.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamRemoteStorage.cs index 462e6e0..08f2eae 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamRemoteStorage.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamRemoteStorage.cs @@ -9,14 +9,17 @@ namespace Steamworks { internal class ISteamRemoteStorage : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamRemoteStorage(); - - internal ISteamRemoteStorage() + internal ISteamRemoteStorage( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamRemoteStorage_v014")] + internal static extern IntPtr SteamAPI_SteamRemoteStorage_v014(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamRemoteStorage_v014(); + + #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 2438c2c..77b4b8d 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamScreenshots.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamScreenshots.cs @@ -9,14 +9,17 @@ namespace Steamworks { internal class ISteamScreenshots : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamScreenshots(); - - internal ISteamScreenshots() + internal ISteamScreenshots( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamScreenshots_v003")] + internal static extern IntPtr SteamAPI_SteamScreenshots_v003(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamScreenshots_v003(); + + #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/ISteamTV.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamTV.cs index dd51cc3..113fc12 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamTV.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamTV.cs @@ -9,14 +9,17 @@ namespace Steamworks { internal class ISteamTV : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamTV(); - - internal ISteamTV() + internal ISteamTV( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamTV_v001")] + internal static extern IntPtr SteamAPI_SteamTV_v001(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamTV_v001(); + + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTV_IsBroadcasting")] [return: MarshalAs( UnmanagedType.I1 )] diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs index b41b108..725e000 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs @@ -9,14 +9,20 @@ namespace Steamworks { internal class ISteamUGC : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamUGC(); - - internal ISteamUGC() + internal ISteamUGC( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamUGC_v014")] + internal static extern IntPtr SteamAPI_SteamUGC_v014(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamUGC_v014(); + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamGameServerUGC_v014")] + internal static extern IntPtr SteamAPI_SteamGameServerUGC_v014(); + public override IntPtr GetServerInterfacePointer() => SteamAPI_SteamGameServerUGC_v014(); + + #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 bbc49e0..5606f3f 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamUser.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamUser.cs @@ -9,14 +9,17 @@ namespace Steamworks { internal class ISteamUser : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamUser(); - - internal ISteamUser() + internal ISteamUser( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamUser_v020")] + internal static extern IntPtr SteamAPI_SteamUser_v020(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamUser_v020(); + + #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 6f2a427..244a368 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamUserStats.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamUserStats.cs @@ -9,14 +9,17 @@ namespace Steamworks { internal class ISteamUserStats : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamUserStats(); - - internal ISteamUserStats() + internal ISteamUserStats( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamUserStats_v011")] + internal static extern IntPtr SteamAPI_SteamUserStats_v011(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamUserStats_v011(); + + #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 5f6f735..93aa76a 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamUtils.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamUtils.cs @@ -9,14 +9,20 @@ namespace Steamworks { internal class ISteamUtils : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamUtils(); - - internal ISteamUtils() + internal ISteamUtils( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamUtils_v009")] + internal static extern IntPtr SteamAPI_SteamUtils_v009(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamUtils_v009(); + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamGameServerUtils_v009")] + internal static extern IntPtr SteamAPI_SteamGameServerUtils_v009(); + public override IntPtr GetServerInterfacePointer() => SteamAPI_SteamGameServerUtils_v009(); + + #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 e81993a..9434f51 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamVideo.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamVideo.cs @@ -9,14 +9,17 @@ namespace Steamworks { internal class ISteamVideo : SteamInterface { - public override IntPtr GetInterfacePointer() => GetApi.SteamVideo(); - - internal ISteamVideo() + internal ISteamVideo( bool IsGameServer ) { - SetupInterface(); + SetupInterface( IsGameServer ); } + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamVideo_v002")] + internal static extern IntPtr SteamAPI_SteamVideo_v002(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamVideo_v002(); + + #region FunctionMeta [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamVideo_GetVideoURL")] private static extern void _GetVideoURL( IntPtr self, AppId unVideoAppID ); diff --git a/Facepunch.Steamworks/SteamApps.cs b/Facepunch.Steamworks/SteamApps.cs index 8c0f923..75271c0 100644 --- a/Facepunch.Steamworks/SteamApps.cs +++ b/Facepunch.Steamworks/SteamApps.cs @@ -16,9 +16,9 @@ namespace Steamworks internal static ISteamApps Internal; internal override SteamInterface Interface => Internal; - internal override void InitializeInterface() + internal override void InitializeInterface( bool server ) { - Internal = new ISteamApps(); + Internal = new ISteamApps( server ); } diff --git a/Facepunch.Steamworks/SteamClient.cs b/Facepunch.Steamworks/SteamClient.cs index d520225..194f39e 100644 --- a/Facepunch.Steamworks/SteamClient.cs +++ b/Facepunch.Steamworks/SteamClient.cs @@ -58,7 +58,7 @@ namespace Steamworks internal static void AddInterface() where T : SteamClass, new() { var t = new T(); - t.InitializeInterface(); + t.InitializeInterface( false ); openInterfaces.Add( t ); } diff --git a/Facepunch.Steamworks/SteamFriends.cs b/Facepunch.Steamworks/SteamFriends.cs index c26c09c..e83d760 100644 --- a/Facepunch.Steamworks/SteamFriends.cs +++ b/Facepunch.Steamworks/SteamFriends.cs @@ -15,9 +15,9 @@ namespace Steamworks internal static ISteamFriends Internal; internal override SteamInterface Interface => Internal; - internal override void InitializeInterface() + internal override void InitializeInterface( bool server ) { - Internal = new ISteamFriends(); + Internal = new ISteamFriends( server ); richPresence = new Dictionary(); } diff --git a/Facepunch.Steamworks/SteamInput.cs b/Facepunch.Steamworks/SteamInput.cs index 75b91e5..3663da7 100644 --- a/Facepunch.Steamworks/SteamInput.cs +++ b/Facepunch.Steamworks/SteamInput.cs @@ -8,9 +8,9 @@ namespace Steamworks internal static ISteamInput Internal; internal override SteamInterface Interface => Internal; - internal override void InitializeInterface() + internal override void InitializeInterface( bool server ) { - Internal = new ISteamInput(); + Internal = new ISteamInput( server ); } internal const int STEAM_CONTROLLER_MAX_COUNT = 16; diff --git a/Facepunch.Steamworks/SteamInventory.cs b/Facepunch.Steamworks/SteamInventory.cs index f93389c..b1e303f 100644 --- a/Facepunch.Steamworks/SteamInventory.cs +++ b/Facepunch.Steamworks/SteamInventory.cs @@ -17,9 +17,9 @@ namespace Steamworks internal static ISteamInventory Internal; internal override SteamInterface Interface => Internal; - internal override void InitializeInterface() + internal override void InitializeInterface( bool server ) { - Internal = new ISteamInventory(); + Internal = new ISteamInventory( server ); InstallEvents(); } diff --git a/Facepunch.Steamworks/SteamMatchmaking.cs b/Facepunch.Steamworks/SteamMatchmaking.cs index 5cb974a..265107b 100644 --- a/Facepunch.Steamworks/SteamMatchmaking.cs +++ b/Facepunch.Steamworks/SteamMatchmaking.cs @@ -15,9 +15,9 @@ namespace Steamworks internal static ISteamMatchmaking Internal; internal override SteamInterface Interface => Internal; - internal override void InitializeInterface() + internal override void InitializeInterface( bool server ) { - Internal = new ISteamMatchmaking(); + Internal = new ISteamMatchmaking( server ); InstallEvents(); } diff --git a/Facepunch.Steamworks/SteamMatchmakingServers.cs b/Facepunch.Steamworks/SteamMatchmakingServers.cs index b7c0173..c748c29 100644 --- a/Facepunch.Steamworks/SteamMatchmakingServers.cs +++ b/Facepunch.Steamworks/SteamMatchmakingServers.cs @@ -15,9 +15,9 @@ namespace Steamworks internal static ISteamMatchmakingServers Internal; internal override SteamInterface Interface => Internal; - internal override void InitializeInterface() + internal override void InitializeInterface( bool server ) { - Internal = new ISteamMatchmakingServers(); + Internal = new ISteamMatchmakingServers( server ); } } } \ No newline at end of file diff --git a/Facepunch.Steamworks/SteamMusic.cs b/Facepunch.Steamworks/SteamMusic.cs index 108f97a..30f0a71 100644 --- a/Facepunch.Steamworks/SteamMusic.cs +++ b/Facepunch.Steamworks/SteamMusic.cs @@ -18,9 +18,9 @@ namespace Steamworks internal static ISteamMusic Internal; internal override SteamInterface Interface => Internal; - internal override void InitializeInterface() + internal override void InitializeInterface( bool server ) { - Internal = new ISteamMusic(); + Internal = new ISteamMusic( server ); InstallEvents(); } diff --git a/Facepunch.Steamworks/SteamNetworking.cs b/Facepunch.Steamworks/SteamNetworking.cs index 4ca18ba..973e7c2 100644 --- a/Facepunch.Steamworks/SteamNetworking.cs +++ b/Facepunch.Steamworks/SteamNetworking.cs @@ -13,9 +13,9 @@ namespace Steamworks internal static ISteamNetworking Internal; internal override SteamInterface Interface => Internal; - internal override void InitializeInterface() + internal override void InitializeInterface( bool server ) { - Internal = new ISteamNetworking(); + Internal = new ISteamNetworking( server ); InstallEvents(); } diff --git a/Facepunch.Steamworks/SteamNetworkingSockets.cs b/Facepunch.Steamworks/SteamNetworkingSockets.cs index ab6dfce..ee04567 100644 --- a/Facepunch.Steamworks/SteamNetworkingSockets.cs +++ b/Facepunch.Steamworks/SteamNetworkingSockets.cs @@ -13,9 +13,9 @@ namespace Steamworks internal static ISteamNetworkingSockets Internal; internal override SteamInterface Interface => Internal; - internal override void InitializeInterface() + internal override void InitializeInterface( bool server ) { - Internal = new ISteamNetworkingSockets(); + Internal = new ISteamNetworkingSockets( server ); SocketInterfaces = new Dictionary(); ConnectionInterfaces = new Dictionary(); diff --git a/Facepunch.Steamworks/SteamNetworkingUtils.cs b/Facepunch.Steamworks/SteamNetworkingUtils.cs index bcb083e..c13b21e 100644 --- a/Facepunch.Steamworks/SteamNetworkingUtils.cs +++ b/Facepunch.Steamworks/SteamNetworkingUtils.cs @@ -15,9 +15,9 @@ namespace Steamworks internal static ISteamNetworkingUtils Internal; internal override SteamInterface Interface => Internal; - internal override void InitializeInterface() + internal override void InitializeInterface( bool server ) { - Internal = new ISteamNetworkingUtils(); + Internal = new ISteamNetworkingUtils( server ); } /// diff --git a/Facepunch.Steamworks/SteamParental.cs b/Facepunch.Steamworks/SteamParental.cs index 96ac0a9..7b5bb96 100644 --- a/Facepunch.Steamworks/SteamParental.cs +++ b/Facepunch.Steamworks/SteamParental.cs @@ -15,9 +15,9 @@ namespace Steamworks internal static ISteamParentalSettings Internal; internal override SteamInterface Interface => Internal; - internal override void InitializeInterface() + internal override void InitializeInterface( bool server ) { - Internal = new ISteamParentalSettings(); + Internal = new ISteamParentalSettings( server ); InstallEvents(); } diff --git a/Facepunch.Steamworks/SteamParties.cs b/Facepunch.Steamworks/SteamParties.cs index 755f38a..c5e4119 100644 --- a/Facepunch.Steamworks/SteamParties.cs +++ b/Facepunch.Steamworks/SteamParties.cs @@ -12,9 +12,9 @@ namespace Steamworks internal static ISteamParties Internal; internal override SteamInterface Interface => Internal; - internal override void InitializeInterface() + internal override void InitializeInterface( bool server ) { - Internal = new ISteamParties(); + Internal = new ISteamParties( server ); InstallEvents(); } diff --git a/Facepunch.Steamworks/SteamRemoteStorage.cs b/Facepunch.Steamworks/SteamRemoteStorage.cs index 9dfc33d..fc3c6bf 100644 --- a/Facepunch.Steamworks/SteamRemoteStorage.cs +++ b/Facepunch.Steamworks/SteamRemoteStorage.cs @@ -15,9 +15,9 @@ namespace Steamworks internal static ISteamRemoteStorage Internal; internal override SteamInterface Interface => Internal; - internal override void InitializeInterface() + internal override void InitializeInterface( bool server ) { - Internal = new ISteamRemoteStorage(); + Internal = new ISteamRemoteStorage( server ); } /// diff --git a/Facepunch.Steamworks/SteamScreenshots.cs b/Facepunch.Steamworks/SteamScreenshots.cs index 8a546c2..c9cf36c 100644 --- a/Facepunch.Steamworks/SteamScreenshots.cs +++ b/Facepunch.Steamworks/SteamScreenshots.cs @@ -15,9 +15,9 @@ namespace Steamworks internal static ISteamScreenshots Internal; internal override SteamInterface Interface => Internal; - internal override void InitializeInterface() + internal override void InitializeInterface( bool server ) { - Internal = new ISteamScreenshots(); + Internal = new ISteamScreenshots( server ); InstallEvents(); } diff --git a/Facepunch.Steamworks/SteamServer.cs b/Facepunch.Steamworks/SteamServer.cs index 50c6c0b..a94c98e 100644 --- a/Facepunch.Steamworks/SteamServer.cs +++ b/Facepunch.Steamworks/SteamServer.cs @@ -15,9 +15,9 @@ namespace Steamworks internal static ISteamGameServer Internal; internal override SteamInterface Interface => Internal; - internal override void InitializeInterface() + internal override void InitializeInterface( bool server ) { - Internal = new ISteamGameServer(); + Internal = new ISteamGameServer( server ); InstallEvents(); } @@ -110,7 +110,7 @@ namespace Steamworks internal static void AddInterface() where T : SteamClass, new() { var t = new T(); - t.InitializeInterface(); + t.InitializeInterface( true ); openInterfaces.Add( t ); } diff --git a/Facepunch.Steamworks/SteamServerStats.cs b/Facepunch.Steamworks/SteamServerStats.cs index 3e27237..84b2b35 100644 --- a/Facepunch.Steamworks/SteamServerStats.cs +++ b/Facepunch.Steamworks/SteamServerStats.cs @@ -12,9 +12,9 @@ namespace Steamworks internal static ISteamGameServerStats Internal; internal override SteamInterface Interface => Internal; - internal override void InitializeInterface() + internal override void InitializeInterface( bool server ) { - Internal = new ISteamGameServerStats(); + Internal = new ISteamGameServerStats( server ); } /// diff --git a/Facepunch.Steamworks/SteamUgc.cs b/Facepunch.Steamworks/SteamUgc.cs index fe8f838..9962146 100644 --- a/Facepunch.Steamworks/SteamUgc.cs +++ b/Facepunch.Steamworks/SteamUgc.cs @@ -17,9 +17,9 @@ namespace Steamworks internal static ISteamUGC Internal; internal override SteamInterface Interface => Internal; - internal override void InitializeInterface() + internal override void InitializeInterface( bool server ) { - Internal = new ISteamUGC(); + Internal = new ISteamUGC( server ); InstallEvents(); } diff --git a/Facepunch.Steamworks/SteamUser.cs b/Facepunch.Steamworks/SteamUser.cs index af6b7e9..9d1741d 100644 --- a/Facepunch.Steamworks/SteamUser.cs +++ b/Facepunch.Steamworks/SteamUser.cs @@ -18,9 +18,9 @@ namespace Steamworks internal static ISteamUser Internal; internal override SteamInterface Interface => Internal; - internal override void InitializeInterface() + internal override void InitializeInterface( bool server ) { - Internal = new ISteamUser(); + Internal = new ISteamUser( server ); InstallEvents(); richPresence = new Dictionary(); diff --git a/Facepunch.Steamworks/SteamUserStats.cs b/Facepunch.Steamworks/SteamUserStats.cs index ae15f5c..792ab49 100644 --- a/Facepunch.Steamworks/SteamUserStats.cs +++ b/Facepunch.Steamworks/SteamUserStats.cs @@ -12,9 +12,9 @@ namespace Steamworks internal static ISteamUserStats Internal; internal override SteamInterface Interface => Internal; - internal override void InitializeInterface() + internal override void InitializeInterface( bool server ) { - Internal = new ISteamUserStats(); + Internal = new ISteamUserStats( server ); InstallEvents(); RequestCurrentStats(); diff --git a/Facepunch.Steamworks/SteamUtils.cs b/Facepunch.Steamworks/SteamUtils.cs index 2e08195..f173df7 100644 --- a/Facepunch.Steamworks/SteamUtils.cs +++ b/Facepunch.Steamworks/SteamUtils.cs @@ -15,9 +15,9 @@ namespace Steamworks internal static ISteamUtils Internal; internal override SteamInterface Interface => Internal; - internal override void InitializeInterface() + internal override void InitializeInterface( bool server ) { - Internal = new ISteamUtils(); + Internal = new ISteamUtils( server ); InstallEvents(); } diff --git a/Facepunch.Steamworks/SteamVideo.cs b/Facepunch.Steamworks/SteamVideo.cs index 4f75a52..95ab9e3 100644 --- a/Facepunch.Steamworks/SteamVideo.cs +++ b/Facepunch.Steamworks/SteamVideo.cs @@ -15,9 +15,9 @@ namespace Steamworks internal static ISteamVideo Internal; internal override SteamInterface Interface => Internal; - internal override void InitializeInterface() + internal override void InitializeInterface( bool server ) { - Internal = new ISteamVideo(); + Internal = new ISteamVideo( server ); InstallEvents(); } diff --git a/Facepunch.Steamworks/Utility/GetApi.cs b/Facepunch.Steamworks/Utility/GetApi.cs deleted file mode 100644 index adf7c1c..0000000 --- a/Facepunch.Steamworks/Utility/GetApi.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net; -using System.Net.Sockets; -using System.Runtime.InteropServices; -using System.Text; - -namespace Steamworks -{ - internal static class GetApi - { - [DllImport( Platform.LibraryName, EntryPoint = "SteamClient" )] - internal static extern IntPtr SteamClient(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamUser" )] - internal static extern IntPtr SteamUser(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamFriends" )] - internal static extern IntPtr SteamFriends(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamUtils" )] - internal static extern IntPtr SteamUtils(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamMatchmaking" )] - internal static extern IntPtr SteamMatchmaking(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamMatchmakingServerListResponse" )] - internal static extern IntPtr SteamMatchmakingServerListResponse(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamMatchmakingPingResponse" )] - internal static extern IntPtr SteamMatchmakingPingResponse(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamMatchmakingPlayersResponse" )] - internal static extern IntPtr SteamMatchmakingPlayersResponse(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamMatchmakingRulesResponse" )] - internal static extern IntPtr SteamMatchmakingRulesResponse(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamMatchmakingServers" )] - internal static extern IntPtr SteamMatchmakingServers(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamGameSearch" )] - internal static extern IntPtr SteamGameSearch(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamParties" )] - internal static extern IntPtr SteamParties(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamRemoteStorage" )] - internal static extern IntPtr SteamRemoteStorage(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamUserStats" )] - internal static extern IntPtr SteamUserStats(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamApps" )] - internal static extern IntPtr SteamApps(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamNetworking" )] - internal static extern IntPtr SteamNetworking(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamScreenshots" )] - internal static extern IntPtr SteamScreenshots(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamMusic" )] - internal static extern IntPtr SteamMusic(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamMusicRemote" )] - internal static extern IntPtr SteamMusicRemote(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamHTTP" )] - internal static extern IntPtr SteamHTTP(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamInput" )] - internal static extern IntPtr SteamInput(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamController" )] - internal static extern IntPtr SteamController(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamUGC" )] - internal static extern IntPtr SteamUGC(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamAppList" )] - internal static extern IntPtr SteamAppList(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamHTMLSurface" )] - internal static extern IntPtr SteamHTMLSurface(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamInventory" )] - internal static extern IntPtr SteamInventory(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamVideo" )] - internal static extern IntPtr SteamVideo(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamParentalSettings" )] - internal static extern IntPtr SteamParentalSettings(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamGameServer" )] - internal static extern IntPtr SteamGameServer(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamGameServerStats" )] - internal static extern IntPtr SteamGameServerStats(); - - // - // NOTE: Stubs - these don't exist - // - [DllImport( Platform.LibraryName, EntryPoint = "SteamNetworkingSockets" )] - internal static extern IntPtr SteamNetworkingSockets(); - [DllImport( Platform.LibraryName, EntryPoint = "SteamNetworkingUtils" )] - internal static extern IntPtr SteamNetworkingUtils(); - } -} \ No newline at end of file diff --git a/Facepunch.Steamworks/Utility/SteamInterface.cs b/Facepunch.Steamworks/Utility/SteamInterface.cs index e4866c4..f012ed8 100644 --- a/Facepunch.Steamworks/Utility/SteamInterface.cs +++ b/Facepunch.Steamworks/Utility/SteamInterface.cs @@ -11,15 +11,25 @@ namespace Steamworks { internal abstract class SteamInterface { - public abstract IntPtr GetInterfacePointer(); + public virtual IntPtr GetUserInterfacePointer() => IntPtr.Zero; + public virtual IntPtr GetServerInterfacePointer() => IntPtr.Zero; + public virtual IntPtr GetGlobalInterfacePointer() => IntPtr.Zero; public IntPtr Self; public bool IsValid => Self != IntPtr.Zero; - internal void SetupInterface() + internal void SetupInterface( bool gameServer ) { - Self = GetInterfacePointer(); + Self = GetGlobalInterfacePointer(); + + if ( Self != IntPtr.Zero ) + return; + + if ( gameServer ) + Self = GetServerInterfacePointer(); + else + Self = GetUserInterfacePointer(); } internal void ShutdownInterface() @@ -30,7 +40,7 @@ namespace Steamworks public abstract class SteamClass { - internal abstract void InitializeInterface(); + internal abstract void InitializeInterface( bool server ); internal virtual void DestroyInterface() { Interface.ShutdownInterface(); diff --git a/Generator/CodeWriter/ClassVTable.cs b/Generator/CodeWriter/ClassVTable.cs index d776d3b..52975bf 100644 --- a/Generator/CodeWriter/ClassVTable.cs +++ b/Generator/CodeWriter/ClassVTable.cs @@ -25,16 +25,43 @@ namespace Generator { StartBlock( $"internal class {iface.Name} : SteamInterface" ); { - WriteLine( $"public override IntPtr GetInterfacePointer() => GetApi.{iface.Name.Substring( 1 )}();" ); WriteLine(); - WriteLine(); - StartBlock( $"internal {iface.Name}()" ); + StartBlock( $"internal {iface.Name}( bool IsGameServer )" ); { - WriteLine( $"SetupInterface();" ); + WriteLine( $"SetupInterface( IsGameServer );" ); } EndBlock(); WriteLine(); + if ( iface.Accessors != null ) + { + foreach ( var func in iface.Accessors ) + { + WriteLine( $"[DllImport( Platform.LibraryName, EntryPoint = \"{func.Name_Flat}\")]" ); + WriteLine( $"internal static extern IntPtr {func.Name_Flat}();" ); + + if ( func.Kind == "user" ) + { + WriteLine( $"public override IntPtr GetUserInterfacePointer() => {func.Name_Flat}();" ); + } + else if ( func.Kind == "gameserver" ) + { + WriteLine( $"public override IntPtr GetServerInterfacePointer() => {func.Name_Flat}();" ); + } + else if ( func.Kind == "global" ) + { + WriteLine( $"public override IntPtr GetGlobalInterfacePointer() => {func.Name_Flat}();" ); + } + else + { + throw new Exception( $"unknown Kind {func.Kind}" ); + } + } + + WriteLine(); + WriteLine(); + } + foreach ( var func in iface.Methods ) { if ( Cleanup.IsDeprecated( $"{iface.Name}.{func.Name}" ) ) diff --git a/Generator/SteamApiDefinition.cs b/Generator/SteamApiDefinition.cs index a6b557b..c6abb5b 100644 --- a/Generator/SteamApiDefinition.cs +++ b/Generator/SteamApiDefinition.cs @@ -38,6 +38,16 @@ namespace Generator public Method[] Methods { get; set; } + + public class Accessor + { + public string Kind { get; set; } + public string Name { get; set; } + public string Name_Flat { get; set; } + } + + public Accessor[] Accessors { get; set; } + } public Interface[] Interfaces { get; set; }