New accessor system

This commit is contained in:
Garry Newman 2020-02-19 11:14:50 +00:00
parent ea60c03b95
commit 171d563f56
62 changed files with 337 additions and 279 deletions

View File

@ -9,14 +9,17 @@ namespace Steamworks
{ {
internal class ISteamAppList : SteamInterface internal class ISteamAppList : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamAppList();
internal ISteamAppList( bool IsGameServer )
internal ISteamAppList()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamAppList_GetNumInstalledApps")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamAppList_GetNumInstalledApps")]
private static extern uint _GetNumInstalledApps( IntPtr self ); private static extern uint _GetNumInstalledApps( IntPtr self );

View File

@ -9,14 +9,20 @@ namespace Steamworks
{ {
internal class ISteamApps : SteamInterface internal class ISteamApps : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamApps();
internal ISteamApps( bool IsGameServer )
internal ISteamApps()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_BIsSubscribed")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_BIsSubscribed")]
[return: MarshalAs( UnmanagedType.I1 )] [return: MarshalAs( UnmanagedType.I1 )]

View File

@ -9,12 +9,10 @@ namespace Steamworks
{ {
internal class ISteamClient : SteamInterface internal class ISteamClient : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamClient();
internal ISteamClient( bool IsGameServer )
internal ISteamClient()
{ {
SetupInterface(); SetupInterface( IsGameServer );
} }
#region FunctionMeta #region FunctionMeta

View File

@ -9,14 +9,17 @@ namespace Steamworks
{ {
internal class ISteamController : SteamInterface internal class ISteamController : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamController();
internal ISteamController( bool IsGameServer )
internal ISteamController()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_Init")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_Init")]
[return: MarshalAs( UnmanagedType.I1 )] [return: MarshalAs( UnmanagedType.I1 )]

View File

@ -9,14 +9,17 @@ namespace Steamworks
{ {
internal class ISteamFriends : SteamInterface internal class ISteamFriends : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamFriends();
internal ISteamFriends( bool IsGameServer )
internal ISteamFriends()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetPersonaName")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetPersonaName")]
private static extern Utf8StringPointer _GetPersonaName( IntPtr self ); private static extern Utf8StringPointer _GetPersonaName( IntPtr self );

View File

@ -9,14 +9,17 @@ namespace Steamworks
{ {
internal class ISteamGameSearch : SteamInterface internal class ISteamGameSearch : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamGameSearch();
internal ISteamGameSearch( bool IsGameServer )
internal ISteamGameSearch()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameSearch_AddGameSearchParams")] [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 ); private static extern GameSearchErrorCode_t _AddGameSearchParams( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToFind, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValuesToFind );

View File

@ -9,14 +9,17 @@ namespace Steamworks
{ {
internal class ISteamGameServer : SteamInterface internal class ISteamGameServer : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamGameServer();
internal ISteamGameServer( bool IsGameServer )
internal ISteamGameServer()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetProduct")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetProduct")]
private static extern void _SetProduct( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszProduct ); private static extern void _SetProduct( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszProduct );

View File

@ -9,14 +9,17 @@ namespace Steamworks
{ {
internal class ISteamGameServerStats : SteamInterface internal class ISteamGameServerStats : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamGameServerStats();
internal ISteamGameServerStats( bool IsGameServer )
internal ISteamGameServerStats()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_RequestUserStats")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_RequestUserStats")]
private static extern SteamAPICall_t _RequestUserStats( IntPtr self, SteamId steamIDUser ); private static extern SteamAPICall_t _RequestUserStats( IntPtr self, SteamId steamIDUser );

View File

@ -9,14 +9,17 @@ namespace Steamworks
{ {
internal class ISteamHTMLSurface : SteamInterface internal class ISteamHTMLSurface : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamHTMLSurface();
internal ISteamHTMLSurface( bool IsGameServer )
internal ISteamHTMLSurface()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_Init")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_Init")]
[return: MarshalAs( UnmanagedType.I1 )] [return: MarshalAs( UnmanagedType.I1 )]

View File

@ -9,14 +9,20 @@ namespace Steamworks
{ {
internal class ISteamHTTP : SteamInterface internal class ISteamHTTP : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamHTTP();
internal ISteamHTTP( bool IsGameServer )
internal ISteamHTTP()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_CreateHTTPRequest")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_CreateHTTPRequest")]
private static extern HTTPRequestHandle _CreateHTTPRequest( IntPtr self, HTTPMethod eHTTPRequestMethod, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchAbsoluteURL ); private static extern HTTPRequestHandle _CreateHTTPRequest( IntPtr self, HTTPMethod eHTTPRequestMethod, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchAbsoluteURL );

View File

@ -9,14 +9,17 @@ namespace Steamworks
{ {
internal class ISteamInput : SteamInterface internal class ISteamInput : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamInput();
internal ISteamInput( bool IsGameServer )
internal ISteamInput()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_Init")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_Init")]
[return: MarshalAs( UnmanagedType.I1 )] [return: MarshalAs( UnmanagedType.I1 )]

View File

@ -9,14 +9,20 @@ namespace Steamworks
{ {
internal class ISteamInventory : SteamInterface internal class ISteamInventory : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamInventory();
internal ISteamInventory( bool IsGameServer )
internal ISteamInventory()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetResultStatus")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetResultStatus")]
private static extern Result _GetResultStatus( IntPtr self, SteamInventoryResult_t resultHandle ); private static extern Result _GetResultStatus( IntPtr self, SteamInventoryResult_t resultHandle );

View File

@ -9,14 +9,17 @@ namespace Steamworks
{ {
internal class ISteamMatchmaking : SteamInterface internal class ISteamMatchmaking : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamMatchmaking();
internal ISteamMatchmaking( bool IsGameServer )
internal ISteamMatchmaking()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetFavoriteGameCount")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetFavoriteGameCount")]
private static extern int _GetFavoriteGameCount( IntPtr self ); private static extern int _GetFavoriteGameCount( IntPtr self );

View File

@ -9,12 +9,10 @@ namespace Steamworks
{ {
internal class ISteamMatchmakingPingResponse : SteamInterface internal class ISteamMatchmakingPingResponse : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamMatchmakingPingResponse();
internal ISteamMatchmakingPingResponse( bool IsGameServer )
internal ISteamMatchmakingPingResponse()
{ {
SetupInterface(); SetupInterface( IsGameServer );
} }
#region FunctionMeta #region FunctionMeta

View File

@ -9,12 +9,10 @@ namespace Steamworks
{ {
internal class ISteamMatchmakingPlayersResponse : SteamInterface internal class ISteamMatchmakingPlayersResponse : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamMatchmakingPlayersResponse();
internal ISteamMatchmakingPlayersResponse( bool IsGameServer )
internal ISteamMatchmakingPlayersResponse()
{ {
SetupInterface(); SetupInterface( IsGameServer );
} }
#region FunctionMeta #region FunctionMeta

View File

@ -9,12 +9,10 @@ namespace Steamworks
{ {
internal class ISteamMatchmakingRulesResponse : SteamInterface internal class ISteamMatchmakingRulesResponse : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamMatchmakingRulesResponse();
internal ISteamMatchmakingRulesResponse( bool IsGameServer )
internal ISteamMatchmakingRulesResponse()
{ {
SetupInterface(); SetupInterface( IsGameServer );
} }
#region FunctionMeta #region FunctionMeta

View File

@ -9,12 +9,10 @@ namespace Steamworks
{ {
internal class ISteamMatchmakingServerListResponse : SteamInterface internal class ISteamMatchmakingServerListResponse : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamMatchmakingServerListResponse();
internal ISteamMatchmakingServerListResponse( bool IsGameServer )
internal ISteamMatchmakingServerListResponse()
{ {
SetupInterface(); SetupInterface( IsGameServer );
} }
#region FunctionMeta #region FunctionMeta

View File

@ -9,14 +9,17 @@ namespace Steamworks
{ {
internal class ISteamMatchmakingServers : SteamInterface internal class ISteamMatchmakingServers : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamMatchmakingServers();
internal ISteamMatchmakingServers( bool IsGameServer )
internal ISteamMatchmakingServers()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_RequestInternetServerList")] [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 ); private static extern HServerListRequest _RequestInternetServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse );

View File

@ -9,14 +9,17 @@ namespace Steamworks
{ {
internal class ISteamMusic : SteamInterface internal class ISteamMusic : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamMusic();
internal ISteamMusic( bool IsGameServer )
internal ISteamMusic()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusic_BIsEnabled")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusic_BIsEnabled")]
[return: MarshalAs( UnmanagedType.I1 )] [return: MarshalAs( UnmanagedType.I1 )]

View File

@ -9,14 +9,17 @@ namespace Steamworks
{ {
internal class ISteamMusicRemote : SteamInterface internal class ISteamMusicRemote : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamMusicRemote();
internal ISteamMusicRemote( bool IsGameServer )
internal ISteamMusicRemote()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_RegisterSteamMusicRemote")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_RegisterSteamMusicRemote")]
[return: MarshalAs( UnmanagedType.I1 )] [return: MarshalAs( UnmanagedType.I1 )]

View File

@ -9,14 +9,20 @@ namespace Steamworks
{ {
internal class ISteamNetworking : SteamInterface internal class ISteamNetworking : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamNetworking();
internal ISteamNetworking( bool IsGameServer )
internal ISteamNetworking()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_SendP2PPacket")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_SendP2PPacket")]
[return: MarshalAs( UnmanagedType.I1 )] [return: MarshalAs( UnmanagedType.I1 )]

View File

@ -9,12 +9,10 @@ namespace Steamworks
{ {
internal class ISteamNetworkingConnectionCustomSignaling : SteamInterface internal class ISteamNetworkingConnectionCustomSignaling : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamNetworkingConnectionCustomSignaling();
internal ISteamNetworkingConnectionCustomSignaling( bool IsGameServer )
internal ISteamNetworkingConnectionCustomSignaling()
{ {
SetupInterface(); SetupInterface( IsGameServer );
} }
#region FunctionMeta #region FunctionMeta

View File

@ -9,12 +9,10 @@ namespace Steamworks
{ {
internal class ISteamNetworkingCustomSignalingRecvContext : SteamInterface internal class ISteamNetworkingCustomSignalingRecvContext : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamNetworkingCustomSignalingRecvContext();
internal ISteamNetworkingCustomSignalingRecvContext( bool IsGameServer )
internal ISteamNetworkingCustomSignalingRecvContext()
{ {
SetupInterface(); SetupInterface( IsGameServer );
} }
#region FunctionMeta #region FunctionMeta

View File

@ -9,14 +9,20 @@ namespace Steamworks
{ {
internal class ISteamNetworkingSockets : SteamInterface internal class ISteamNetworkingSockets : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamNetworkingSockets();
internal ISteamNetworkingSockets( bool IsGameServer )
internal ISteamNetworkingSockets()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_CreateListenSocketIP")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_CreateListenSocketIP")]
private static extern Socket _CreateListenSocketIP( IntPtr self, ref NetAddress localAddress, int nOptions, [In,Out] NetKeyValue[] pOptions ); private static extern Socket _CreateListenSocketIP( IntPtr self, ref NetAddress localAddress, int nOptions, [In,Out] NetKeyValue[] pOptions );

View File

@ -9,14 +9,17 @@ namespace Steamworks
{ {
internal class ISteamNetworkingUtils : SteamInterface internal class ISteamNetworkingUtils : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamNetworkingUtils();
internal ISteamNetworkingUtils( bool IsGameServer )
internal ISteamNetworkingUtils()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_AllocateMessage")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_AllocateMessage")]
private static extern IntPtr _AllocateMessage( IntPtr self, int cbAllocateBuffer ); private static extern IntPtr _AllocateMessage( IntPtr self, int cbAllocateBuffer );

View File

@ -9,14 +9,17 @@ namespace Steamworks
{ {
internal class ISteamParentalSettings : SteamInterface internal class ISteamParentalSettings : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamParentalSettings();
internal ISteamParentalSettings( bool IsGameServer )
internal ISteamParentalSettings()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParentalSettings_BIsParentalLockEnabled")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParentalSettings_BIsParentalLockEnabled")]
[return: MarshalAs( UnmanagedType.I1 )] [return: MarshalAs( UnmanagedType.I1 )]

View File

@ -9,14 +9,17 @@ namespace Steamworks
{ {
internal class ISteamParties : SteamInterface internal class ISteamParties : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamParties();
internal ISteamParties( bool IsGameServer )
internal ISteamParties()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_GetNumActiveBeacons")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_GetNumActiveBeacons")]
private static extern uint _GetNumActiveBeacons( IntPtr self ); private static extern uint _GetNumActiveBeacons( IntPtr self );

View File

@ -9,14 +9,17 @@ namespace Steamworks
{ {
internal class ISteamRemotePlay : SteamInterface internal class ISteamRemotePlay : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamRemotePlay();
internal ISteamRemotePlay( bool IsGameServer )
internal ISteamRemotePlay()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemotePlay_GetSessionCount")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemotePlay_GetSessionCount")]
private static extern uint _GetSessionCount( IntPtr self ); private static extern uint _GetSessionCount( IntPtr self );

View File

@ -9,14 +9,17 @@ namespace Steamworks
{ {
internal class ISteamRemoteStorage : SteamInterface internal class ISteamRemoteStorage : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamRemoteStorage();
internal ISteamRemoteStorage( bool IsGameServer )
internal ISteamRemoteStorage()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWrite")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWrite")]
[return: MarshalAs( UnmanagedType.I1 )] [return: MarshalAs( UnmanagedType.I1 )]

View File

@ -9,14 +9,17 @@ namespace Steamworks
{ {
internal class ISteamScreenshots : SteamInterface internal class ISteamScreenshots : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamScreenshots();
internal ISteamScreenshots( bool IsGameServer )
internal ISteamScreenshots()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamScreenshots_WriteScreenshot")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamScreenshots_WriteScreenshot")]
private static extern ScreenshotHandle _WriteScreenshot( IntPtr self, IntPtr pubRGB, uint cubRGB, int nWidth, int nHeight ); private static extern ScreenshotHandle _WriteScreenshot( IntPtr self, IntPtr pubRGB, uint cubRGB, int nWidth, int nHeight );

View File

@ -9,14 +9,17 @@ namespace Steamworks
{ {
internal class ISteamTV : SteamInterface internal class ISteamTV : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamTV();
internal ISteamTV( bool IsGameServer )
internal ISteamTV()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTV_IsBroadcasting")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTV_IsBroadcasting")]
[return: MarshalAs( UnmanagedType.I1 )] [return: MarshalAs( UnmanagedType.I1 )]

View File

@ -9,14 +9,20 @@ namespace Steamworks
{ {
internal class ISteamUGC : SteamInterface internal class ISteamUGC : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamUGC();
internal ISteamUGC( bool IsGameServer )
internal ISteamUGC()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_CreateQueryUserUGCRequest")] [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 ); private static extern UGCQueryHandle_t _CreateQueryUserUGCRequest( IntPtr self, AccountID_t unAccountID, UserUGCList eListType, UgcType eMatchingUGCType, UserUGCListSortOrder eSortOrder, AppId nCreatorAppID, AppId nConsumerAppID, uint unPage );

View File

@ -9,14 +9,17 @@ namespace Steamworks
{ {
internal class ISteamUser : SteamInterface internal class ISteamUser : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamUser();
internal ISteamUser( bool IsGameServer )
internal ISteamUser()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetHSteamUser")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetHSteamUser")]
private static extern HSteamUser _GetHSteamUser( IntPtr self ); private static extern HSteamUser _GetHSteamUser( IntPtr self );

View File

@ -9,14 +9,17 @@ namespace Steamworks
{ {
internal class ISteamUserStats : SteamInterface internal class ISteamUserStats : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamUserStats();
internal ISteamUserStats( bool IsGameServer )
internal ISteamUserStats()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_RequestCurrentStats")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_RequestCurrentStats")]
[return: MarshalAs( UnmanagedType.I1 )] [return: MarshalAs( UnmanagedType.I1 )]

View File

@ -9,14 +9,20 @@ namespace Steamworks
{ {
internal class ISteamUtils : SteamInterface internal class ISteamUtils : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamUtils();
internal ISteamUtils( bool IsGameServer )
internal ISteamUtils()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetSecondsSinceAppActive")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetSecondsSinceAppActive")]
private static extern uint _GetSecondsSinceAppActive( IntPtr self ); private static extern uint _GetSecondsSinceAppActive( IntPtr self );

View File

@ -9,14 +9,17 @@ namespace Steamworks
{ {
internal class ISteamVideo : SteamInterface internal class ISteamVideo : SteamInterface
{ {
public override IntPtr GetInterfacePointer() => GetApi.SteamVideo();
internal ISteamVideo( bool IsGameServer )
internal ISteamVideo()
{ {
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 #region FunctionMeta
[DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamVideo_GetVideoURL")] [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamVideo_GetVideoURL")]
private static extern void _GetVideoURL( IntPtr self, AppId unVideoAppID ); private static extern void _GetVideoURL( IntPtr self, AppId unVideoAppID );

View File

@ -16,9 +16,9 @@ namespace Steamworks
internal static ISteamApps Internal; internal static ISteamApps Internal;
internal override SteamInterface Interface => Internal; internal override SteamInterface Interface => Internal;
internal override void InitializeInterface() internal override void InitializeInterface( bool server )
{ {
Internal = new ISteamApps(); Internal = new ISteamApps( server );
} }

View File

@ -58,7 +58,7 @@ namespace Steamworks
internal static void AddInterface<T>() where T : SteamClass, new() internal static void AddInterface<T>() where T : SteamClass, new()
{ {
var t = new T(); var t = new T();
t.InitializeInterface(); t.InitializeInterface( false );
openInterfaces.Add( t ); openInterfaces.Add( t );
} }

View File

@ -15,9 +15,9 @@ namespace Steamworks
internal static ISteamFriends Internal; internal static ISteamFriends Internal;
internal override SteamInterface Interface => 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<string, string>(); richPresence = new Dictionary<string, string>();
} }

View File

@ -8,9 +8,9 @@ namespace Steamworks
internal static ISteamInput Internal; internal static ISteamInput Internal;
internal override SteamInterface Interface => 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; internal const int STEAM_CONTROLLER_MAX_COUNT = 16;

View File

@ -17,9 +17,9 @@ namespace Steamworks
internal static ISteamInventory Internal; internal static ISteamInventory Internal;
internal override SteamInterface Interface => Internal; internal override SteamInterface Interface => Internal;
internal override void InitializeInterface() internal override void InitializeInterface( bool server )
{ {
Internal = new ISteamInventory(); Internal = new ISteamInventory( server );
InstallEvents(); InstallEvents();
} }

View File

@ -15,9 +15,9 @@ namespace Steamworks
internal static ISteamMatchmaking Internal; internal static ISteamMatchmaking Internal;
internal override SteamInterface Interface => Internal; internal override SteamInterface Interface => Internal;
internal override void InitializeInterface() internal override void InitializeInterface( bool server )
{ {
Internal = new ISteamMatchmaking(); Internal = new ISteamMatchmaking( server );
InstallEvents(); InstallEvents();
} }

View File

@ -15,9 +15,9 @@ namespace Steamworks
internal static ISteamMatchmakingServers Internal; internal static ISteamMatchmakingServers Internal;
internal override SteamInterface Interface => Internal; internal override SteamInterface Interface => Internal;
internal override void InitializeInterface() internal override void InitializeInterface( bool server )
{ {
Internal = new ISteamMatchmakingServers(); Internal = new ISteamMatchmakingServers( server );
} }
} }
} }

View File

@ -18,9 +18,9 @@ namespace Steamworks
internal static ISteamMusic Internal; internal static ISteamMusic Internal;
internal override SteamInterface Interface => Internal; internal override SteamInterface Interface => Internal;
internal override void InitializeInterface() internal override void InitializeInterface( bool server )
{ {
Internal = new ISteamMusic(); Internal = new ISteamMusic( server );
InstallEvents(); InstallEvents();
} }

View File

@ -13,9 +13,9 @@ namespace Steamworks
internal static ISteamNetworking Internal; internal static ISteamNetworking Internal;
internal override SteamInterface Interface => Internal; internal override SteamInterface Interface => Internal;
internal override void InitializeInterface() internal override void InitializeInterface( bool server )
{ {
Internal = new ISteamNetworking(); Internal = new ISteamNetworking( server );
InstallEvents(); InstallEvents();
} }

View File

@ -13,9 +13,9 @@ namespace Steamworks
internal static ISteamNetworkingSockets Internal; internal static ISteamNetworkingSockets Internal;
internal override SteamInterface Interface => 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<uint, SocketInterface>(); SocketInterfaces = new Dictionary<uint, SocketInterface>();
ConnectionInterfaces = new Dictionary<uint, ConnectionInterface>(); ConnectionInterfaces = new Dictionary<uint, ConnectionInterface>();

View File

@ -15,9 +15,9 @@ namespace Steamworks
internal static ISteamNetworkingUtils Internal; internal static ISteamNetworkingUtils Internal;
internal override SteamInterface Interface => Internal; internal override SteamInterface Interface => Internal;
internal override void InitializeInterface() internal override void InitializeInterface( bool server )
{ {
Internal = new ISteamNetworkingUtils(); Internal = new ISteamNetworkingUtils( server );
} }
/// <summary> /// <summary>

View File

@ -15,9 +15,9 @@ namespace Steamworks
internal static ISteamParentalSettings Internal; internal static ISteamParentalSettings Internal;
internal override SteamInterface Interface => Internal; internal override SteamInterface Interface => Internal;
internal override void InitializeInterface() internal override void InitializeInterface( bool server )
{ {
Internal = new ISteamParentalSettings(); Internal = new ISteamParentalSettings( server );
InstallEvents(); InstallEvents();
} }

View File

@ -12,9 +12,9 @@ namespace Steamworks
internal static ISteamParties Internal; internal static ISteamParties Internal;
internal override SteamInterface Interface => Internal; internal override SteamInterface Interface => Internal;
internal override void InitializeInterface() internal override void InitializeInterface( bool server )
{ {
Internal = new ISteamParties(); Internal = new ISteamParties( server );
InstallEvents(); InstallEvents();
} }

View File

@ -15,9 +15,9 @@ namespace Steamworks
internal static ISteamRemoteStorage Internal; internal static ISteamRemoteStorage Internal;
internal override SteamInterface Interface => Internal; internal override SteamInterface Interface => Internal;
internal override void InitializeInterface() internal override void InitializeInterface( bool server )
{ {
Internal = new ISteamRemoteStorage(); Internal = new ISteamRemoteStorage( server );
} }
/// <summary> /// <summary>

View File

@ -15,9 +15,9 @@ namespace Steamworks
internal static ISteamScreenshots Internal; internal static ISteamScreenshots Internal;
internal override SteamInterface Interface => Internal; internal override SteamInterface Interface => Internal;
internal override void InitializeInterface() internal override void InitializeInterface( bool server )
{ {
Internal = new ISteamScreenshots(); Internal = new ISteamScreenshots( server );
InstallEvents(); InstallEvents();
} }

View File

@ -15,9 +15,9 @@ namespace Steamworks
internal static ISteamGameServer Internal; internal static ISteamGameServer Internal;
internal override SteamInterface Interface => Internal; internal override SteamInterface Interface => Internal;
internal override void InitializeInterface() internal override void InitializeInterface( bool server )
{ {
Internal = new ISteamGameServer(); Internal = new ISteamGameServer( server );
InstallEvents(); InstallEvents();
} }
@ -110,7 +110,7 @@ namespace Steamworks
internal static void AddInterface<T>() where T : SteamClass, new() internal static void AddInterface<T>() where T : SteamClass, new()
{ {
var t = new T(); var t = new T();
t.InitializeInterface(); t.InitializeInterface( true );
openInterfaces.Add( t ); openInterfaces.Add( t );
} }

View File

@ -12,9 +12,9 @@ namespace Steamworks
internal static ISteamGameServerStats Internal; internal static ISteamGameServerStats Internal;
internal override SteamInterface Interface => Internal; internal override SteamInterface Interface => Internal;
internal override void InitializeInterface() internal override void InitializeInterface( bool server )
{ {
Internal = new ISteamGameServerStats(); Internal = new ISteamGameServerStats( server );
} }
/// <summary> /// <summary>

View File

@ -17,9 +17,9 @@ namespace Steamworks
internal static ISteamUGC Internal; internal static ISteamUGC Internal;
internal override SteamInterface Interface => Internal; internal override SteamInterface Interface => Internal;
internal override void InitializeInterface() internal override void InitializeInterface( bool server )
{ {
Internal = new ISteamUGC(); Internal = new ISteamUGC( server );
InstallEvents(); InstallEvents();
} }

View File

@ -18,9 +18,9 @@ namespace Steamworks
internal static ISteamUser Internal; internal static ISteamUser Internal;
internal override SteamInterface Interface => Internal; internal override SteamInterface Interface => Internal;
internal override void InitializeInterface() internal override void InitializeInterface( bool server )
{ {
Internal = new ISteamUser(); Internal = new ISteamUser( server );
InstallEvents(); InstallEvents();
richPresence = new Dictionary<string, string>(); richPresence = new Dictionary<string, string>();

View File

@ -12,9 +12,9 @@ namespace Steamworks
internal static ISteamUserStats Internal; internal static ISteamUserStats Internal;
internal override SteamInterface Interface => Internal; internal override SteamInterface Interface => Internal;
internal override void InitializeInterface() internal override void InitializeInterface( bool server )
{ {
Internal = new ISteamUserStats(); Internal = new ISteamUserStats( server );
InstallEvents(); InstallEvents();
RequestCurrentStats(); RequestCurrentStats();

View File

@ -15,9 +15,9 @@ namespace Steamworks
internal static ISteamUtils Internal; internal static ISteamUtils Internal;
internal override SteamInterface Interface => Internal; internal override SteamInterface Interface => Internal;
internal override void InitializeInterface() internal override void InitializeInterface( bool server )
{ {
Internal = new ISteamUtils(); Internal = new ISteamUtils( server );
InstallEvents(); InstallEvents();
} }

View File

@ -15,9 +15,9 @@ namespace Steamworks
internal static ISteamVideo Internal; internal static ISteamVideo Internal;
internal override SteamInterface Interface => Internal; internal override SteamInterface Interface => Internal;
internal override void InitializeInterface() internal override void InitializeInterface( bool server )
{ {
Internal = new ISteamVideo(); Internal = new ISteamVideo( server );
InstallEvents(); InstallEvents();
} }

View File

@ -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();
}
}

View File

@ -11,15 +11,25 @@ namespace Steamworks
{ {
internal abstract class SteamInterface 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 IntPtr Self;
public bool IsValid => Self != IntPtr.Zero; 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() internal void ShutdownInterface()
@ -30,7 +40,7 @@ namespace Steamworks
public abstract class SteamClass public abstract class SteamClass
{ {
internal abstract void InitializeInterface(); internal abstract void InitializeInterface( bool server );
internal virtual void DestroyInterface() internal virtual void DestroyInterface()
{ {
Interface.ShutdownInterface(); Interface.ShutdownInterface();

View File

@ -25,16 +25,43 @@ namespace Generator
{ {
StartBlock( $"internal class {iface.Name} : SteamInterface" ); StartBlock( $"internal class {iface.Name} : SteamInterface" );
{ {
WriteLine( $"public override IntPtr GetInterfacePointer() => GetApi.{iface.Name.Substring( 1 )}();" );
WriteLine(); WriteLine();
WriteLine(); StartBlock( $"internal {iface.Name}( bool IsGameServer )" );
StartBlock( $"internal {iface.Name}()" );
{ {
WriteLine( $"SetupInterface();" ); WriteLine( $"SetupInterface( IsGameServer );" );
} }
EndBlock(); EndBlock();
WriteLine(); 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 ) foreach ( var func in iface.Methods )
{ {
if ( Cleanup.IsDeprecated( $"{iface.Name}.{func.Name}" ) ) if ( Cleanup.IsDeprecated( $"{iface.Name}.{func.Name}" ) )

View File

@ -38,6 +38,16 @@ namespace Generator
public Method[] Methods { get; set; } 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; } public Interface[] Interfaces { get; set; }