diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServers.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServers.cs new file mode 100644 index 0000000..3f89385 --- /dev/null +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServers.cs @@ -0,0 +1,224 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using SteamNative; + + +namespace Steamworks.Internal +{ + public class ISteamMatchmakingServers : BaseSteamInterface + { + public override string InterfaceName => "SteamMatchMakingServers002"; + + public override void InitInternals() + { + RequestInternetServerListDelegatePointer = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 0) ); + RequestLANServerListDelegatePointer = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 8) ); + RequestFriendsServerListDelegatePointer = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 16) ); + RequestFavoritesServerListDelegatePointer = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 24) ); + RequestHistoryServerListDelegatePointer = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 32) ); + RequestSpectatorServerListDelegatePointer = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 40) ); + ReleaseRequestDelegatePointer = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 48) ); + GetServerDetailsDelegatePointer = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 56) ); + CancelQueryDelegatePointer = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 64) ); + RefreshQueryDelegatePointer = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 72) ); + IsRefreshingDelegatePointer = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 80) ); + GetServerCountDelegatePointer = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 88) ); + RefreshServerDelegatePointer = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 96) ); + PingServerDelegatePointer = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 104) ); + PlayerDetailsDelegatePointer = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 112) ); + ServerRulesDelegatePointer = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 120) ); + CancelServerQueryDelegatePointer = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, 128) ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + public delegate HServerListRequest RequestInternetServerListDelegate( IntPtr self, AppId_t iApp, [In,Out] MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); + private RequestInternetServerListDelegate RequestInternetServerListDelegatePointer; + + #endregion + public HServerListRequest RequestInternetServerList( AppId_t iApp, [In,Out] MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) + { + return RequestInternetServerListDelegatePointer( Self, iApp, ppchFilters, nFilters, pRequestServersResponse ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + public delegate HServerListRequest RequestLANServerListDelegate( IntPtr self, AppId_t iApp, IntPtr pRequestServersResponse ); + private RequestLANServerListDelegate RequestLANServerListDelegatePointer; + + #endregion + public HServerListRequest RequestLANServerList( AppId_t iApp, IntPtr pRequestServersResponse ) + { + return RequestLANServerListDelegatePointer( Self, iApp, pRequestServersResponse ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + public delegate HServerListRequest RequestFriendsServerListDelegate( IntPtr self, AppId_t iApp, [In,Out] MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); + private RequestFriendsServerListDelegate RequestFriendsServerListDelegatePointer; + + #endregion + public HServerListRequest RequestFriendsServerList( AppId_t iApp, [In,Out] MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) + { + return RequestFriendsServerListDelegatePointer( Self, iApp, ppchFilters, nFilters, pRequestServersResponse ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + public delegate HServerListRequest RequestFavoritesServerListDelegate( IntPtr self, AppId_t iApp, [In,Out] MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); + private RequestFavoritesServerListDelegate RequestFavoritesServerListDelegatePointer; + + #endregion + public HServerListRequest RequestFavoritesServerList( AppId_t iApp, [In,Out] MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) + { + return RequestFavoritesServerListDelegatePointer( Self, iApp, ppchFilters, nFilters, pRequestServersResponse ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + public delegate HServerListRequest RequestHistoryServerListDelegate( IntPtr self, AppId_t iApp, [In,Out] MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); + private RequestHistoryServerListDelegate RequestHistoryServerListDelegatePointer; + + #endregion + public HServerListRequest RequestHistoryServerList( AppId_t iApp, [In,Out] MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) + { + return RequestHistoryServerListDelegatePointer( Self, iApp, ppchFilters, nFilters, pRequestServersResponse ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + public delegate HServerListRequest RequestSpectatorServerListDelegate( IntPtr self, AppId_t iApp, [In,Out] MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); + private RequestSpectatorServerListDelegate RequestSpectatorServerListDelegatePointer; + + #endregion + public HServerListRequest RequestSpectatorServerList( AppId_t iApp, [In,Out] MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) + { + return RequestSpectatorServerListDelegatePointer( Self, iApp, ppchFilters, nFilters, pRequestServersResponse ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + public delegate void ReleaseRequestDelegate( IntPtr self, HServerListRequest hServerListRequest ); + private ReleaseRequestDelegate ReleaseRequestDelegatePointer; + + #endregion + public void ReleaseRequest( HServerListRequest hServerListRequest ) + { + ReleaseRequestDelegatePointer( Self, hServerListRequest ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + public delegate gameserveritem_t GetServerDetailsDelegate( IntPtr self, HServerListRequest hRequest, int iServer ); + private GetServerDetailsDelegate GetServerDetailsDelegatePointer; + + #endregion + public gameserveritem_t GetServerDetails( HServerListRequest hRequest, int iServer ) + { + return GetServerDetailsDelegatePointer( Self, hRequest, iServer ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + public delegate void CancelQueryDelegate( IntPtr self, HServerListRequest hRequest ); + private CancelQueryDelegate CancelQueryDelegatePointer; + + #endregion + public void CancelQuery( HServerListRequest hRequest ) + { + CancelQueryDelegatePointer( Self, hRequest ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + public delegate void RefreshQueryDelegate( IntPtr self, HServerListRequest hRequest ); + private RefreshQueryDelegate RefreshQueryDelegatePointer; + + #endregion + public void RefreshQuery( HServerListRequest hRequest ) + { + RefreshQueryDelegatePointer( Self, hRequest ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + [return: MarshalAs( UnmanagedType.I1 )] + public delegate bool IsRefreshingDelegate( IntPtr self, HServerListRequest hRequest ); + private IsRefreshingDelegate IsRefreshingDelegatePointer; + + #endregion + public bool IsRefreshing( HServerListRequest hRequest ) + { + return IsRefreshingDelegatePointer( Self, hRequest ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + public delegate int GetServerCountDelegate( IntPtr self, HServerListRequest hRequest ); + private GetServerCountDelegate GetServerCountDelegatePointer; + + #endregion + public int GetServerCount( HServerListRequest hRequest ) + { + return GetServerCountDelegatePointer( Self, hRequest ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + public delegate void RefreshServerDelegate( IntPtr self, HServerListRequest hRequest, int iServer ); + private RefreshServerDelegate RefreshServerDelegatePointer; + + #endregion + public void RefreshServer( HServerListRequest hRequest, int iServer ) + { + RefreshServerDelegatePointer( Self, hRequest, iServer ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + public delegate HServerQuery PingServerDelegate( IntPtr self, uint unIP, ushort usPort, IntPtr pRequestServersResponse ); + private PingServerDelegate PingServerDelegatePointer; + + #endregion + public HServerQuery PingServer( uint unIP, ushort usPort, IntPtr pRequestServersResponse ) + { + return PingServerDelegatePointer( Self, unIP, usPort, pRequestServersResponse ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + public delegate HServerQuery PlayerDetailsDelegate( IntPtr self, uint unIP, ushort usPort, IntPtr pRequestServersResponse ); + private PlayerDetailsDelegate PlayerDetailsDelegatePointer; + + #endregion + public HServerQuery PlayerDetails( uint unIP, ushort usPort, IntPtr pRequestServersResponse ) + { + return PlayerDetailsDelegatePointer( Self, unIP, usPort, pRequestServersResponse ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + public delegate HServerQuery ServerRulesDelegate( IntPtr self, uint unIP, ushort usPort, IntPtr pRequestServersResponse ); + private ServerRulesDelegate ServerRulesDelegatePointer; + + #endregion + public HServerQuery ServerRules( uint unIP, ushort usPort, IntPtr pRequestServersResponse ) + { + return ServerRulesDelegatePointer( Self, unIP, usPort, pRequestServersResponse ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + public delegate void CancelServerQueryDelegate( IntPtr self, HServerQuery hServerQuery ); + private CancelServerQueryDelegate CancelServerQueryDelegatePointer; + + #endregion + public void CancelServerQuery( HServerQuery hServerQuery ) + { + CancelServerQueryDelegatePointer( Self, hServerQuery ); + } + + } +} diff --git a/Generator/CodeParser/ParseClasses.cs b/Generator/CodeParser/ParseClasses.cs index 3a39bfa..7574c52 100644 --- a/Generator/CodeParser/ParseClasses.cs +++ b/Generator/CodeParser/ParseClasses.cs @@ -91,6 +91,7 @@ namespace Generator { str = Regex.Replace( str, @"STEAM_OUT_ARRAY_CALL\((.+?)\)", "" ); str = Regex.Replace( str, @"STEAM_PRIVATE_API\((.+)\)", "$1" ); + str = Regex.Replace( str, @"STEAM_ARRAY_COUNT\((.+?)\) ", "" ); return str; } diff --git a/Generator/CodeWriter/CodeWriter.cs b/Generator/CodeWriter/CodeWriter.cs index d5b90dd..d806ecd 100644 --- a/Generator/CodeWriter/CodeWriter.cs +++ b/Generator/CodeWriter/CodeWriter.cs @@ -98,6 +98,7 @@ namespace Generator GenerateVTableClass( "ISteamMusic", $"{folder}../Generated/Interfaces/ISteamMusic.cs" ); GenerateVTableClass( "ISteamVideo", $"{folder}../Generated/Interfaces/ISteamVideo.cs" ); GenerateVTableClass( "ISteamUser", $"{folder}../Generated/Interfaces/ISteamUser.cs" ); + GenerateVTableClass( "ISteamMatchmakingServers", $"{folder}../Generated/Interfaces/ISteamMatchmakingServers.cs" ); } } diff --git a/Generator/CodeWriter/Types/BaseType.cs b/Generator/CodeWriter/Types/BaseType.cs index cba43a4..b0f29e2 100644 --- a/Generator/CodeWriter/Types/BaseType.cs +++ b/Generator/CodeWriter/Types/BaseType.cs @@ -24,6 +24,7 @@ internal class BaseType var basicType = type.Trim( ' ', '*' ); if ( basicType == "void" ) return new PointerType { NativeType = type, VarName = varname }; + if ( basicType.StartsWith( "ISteam" ) ) return new PointerType { NativeType = type, VarName = varname }; if ( basicType == "const void" ) return new PointerType { NativeType = type, VarName = varname }; if ( basicType == "int32" || basicType == "int" ) return new IntType { NativeType = type, VarName = varname }; if ( basicType == "uint32" ) return new UIntType { NativeType = type, VarName = varname }; @@ -48,7 +49,7 @@ internal class BaseType public virtual string ReturnType => TypeName; public virtual string Ref => !IsVector && NativeType.EndsWith( "*" ) ? "ref " : ""; - public virtual bool IsVector => NativeType.EndsWith( "*" ) && (VarName.StartsWith( "pvec" ) || VarName.StartsWith( "pub" )); + public virtual bool IsVector => (NativeType.EndsWith( "*" ) && (VarName.StartsWith( "pvec" ) || VarName.StartsWith( "pub" ))) || NativeType.EndsWith( "**" ); public virtual bool IsVoid => false; public virtual bool IsReturnedWeird => false;