diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServers.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServers.cs index 20be4d5..dd0a2f5 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServers.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServers.cs @@ -56,11 +56,11 @@ namespace Steamworks #region FunctionMeta [UnmanagedFunctionPointer( CallingConvention.ThisCall )] - private delegate HServerListRequest FRequestInternetServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); + private delegate HServerListRequest FRequestInternetServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); private FRequestInternetServerList _RequestInternetServerList; #endregion - internal HServerListRequest RequestInternetServerList( AppId iApp, [In,Out] ref MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) + internal HServerListRequest RequestInternetServerList( AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) { return _RequestInternetServerList( Self, iApp, ref ppchFilters, nFilters, pRequestServersResponse ); } @@ -78,44 +78,44 @@ namespace Steamworks #region FunctionMeta [UnmanagedFunctionPointer( CallingConvention.ThisCall )] - private delegate HServerListRequest FRequestFriendsServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); + private delegate HServerListRequest FRequestFriendsServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); private FRequestFriendsServerList _RequestFriendsServerList; #endregion - internal HServerListRequest RequestFriendsServerList( AppId iApp, [In,Out] ref MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) + internal HServerListRequest RequestFriendsServerList( AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) { return _RequestFriendsServerList( Self, iApp, ref ppchFilters, nFilters, pRequestServersResponse ); } #region FunctionMeta [UnmanagedFunctionPointer( CallingConvention.ThisCall )] - private delegate HServerListRequest FRequestFavoritesServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); + private delegate HServerListRequest FRequestFavoritesServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); private FRequestFavoritesServerList _RequestFavoritesServerList; #endregion - internal HServerListRequest RequestFavoritesServerList( AppId iApp, [In,Out] ref MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) + internal HServerListRequest RequestFavoritesServerList( AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) { return _RequestFavoritesServerList( Self, iApp, ref ppchFilters, nFilters, pRequestServersResponse ); } #region FunctionMeta [UnmanagedFunctionPointer( CallingConvention.ThisCall )] - private delegate HServerListRequest FRequestHistoryServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); + private delegate HServerListRequest FRequestHistoryServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); private FRequestHistoryServerList _RequestHistoryServerList; #endregion - internal HServerListRequest RequestHistoryServerList( AppId iApp, [In,Out] ref MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) + internal HServerListRequest RequestHistoryServerList( AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) { return _RequestHistoryServerList( Self, iApp, ref ppchFilters, nFilters, pRequestServersResponse ); } #region FunctionMeta [UnmanagedFunctionPointer( CallingConvention.ThisCall )] - private delegate HServerListRequest FRequestSpectatorServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); + private delegate HServerListRequest FRequestSpectatorServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); private FRequestSpectatorServerList _RequestSpectatorServerList; #endregion - internal HServerListRequest RequestSpectatorServerList( AppId iApp, [In,Out] ref MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) + internal HServerListRequest RequestSpectatorServerList( AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) { return _RequestSpectatorServerList( Self, iApp, ref ppchFilters, nFilters, pRequestServersResponse ); } diff --git a/Facepunch.Steamworks/Generated/SteamStructs.cs b/Facepunch.Steamworks/Generated/SteamStructs.cs index 1d52f28..66839d8 100644 --- a/Facepunch.Steamworks/Generated/SteamStructs.cs +++ b/Facepunch.Steamworks/Generated/SteamStructs.cs @@ -1836,21 +1836,6 @@ namespace Steamworks.Data #endregion } - [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct MatchMakingKeyValuePair_t - { - internal string KeyUTF8() => System.Text.Encoding.UTF8.GetString( Key, 0, System.Array.IndexOf( Key, 0 ) ); - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] // byte[] m_szKey - internal byte[] Key; // m_szKey char [256] - internal string ValueUTF8() => System.Text.Encoding.UTF8.GetString( Value, 0, System.Array.IndexOf( Value, 0 ) ); - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] // byte[] m_szValue - internal byte[] Value; // m_szValue char [256] - - #region Marshalling - internal static MatchMakingKeyValuePair_t Fill( IntPtr p ) => ((MatchMakingKeyValuePair_t)(MatchMakingKeyValuePair_t) Marshal.PtrToStructure( p, typeof(MatchMakingKeyValuePair_t) ) ); - #endregion - } - [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] internal struct servernetadr_t { diff --git a/Facepunch.Steamworks/ServerList/Base.cs b/Facepunch.Steamworks/ServerList/Base.cs index e5137a1..4b66225 100644 --- a/Facepunch.Steamworks/ServerList/Base.cs +++ b/Facepunch.Steamworks/ServerList/Base.cs @@ -122,12 +122,12 @@ namespace Steamworks.ServerList #region Filters - internal List filters = new List(); - internal virtual MatchMakingKeyValuePair_t[] GetFilters() => filters.ToArray(); + internal List filters = new List(); + internal virtual MatchMakingKeyValuePair[] GetFilters() => filters.ToArray(); public void AddFilter( string key, string value ) { - filters.Add( new MatchMakingKeyValuePair_t { Key = System.Text.Encoding.UTF8.GetBytes( key ), Value = System.Text.Encoding.UTF8.GetBytes( key ) } ); + filters.Add( new MatchMakingKeyValuePair { Key = key, Value = value } ); } #endregion diff --git a/Facepunch.Steamworks/Structs/MatchMakingKeyValuePair.cs b/Facepunch.Steamworks/Structs/MatchMakingKeyValuePair.cs new file mode 100644 index 0000000..b82ecf1 --- /dev/null +++ b/Facepunch.Steamworks/Structs/MatchMakingKeyValuePair.cs @@ -0,0 +1,16 @@ +using System; +using System.Runtime.InteropServices; + +namespace Steamworks.Data +{ + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct MatchMakingKeyValuePair + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + internal string Key; + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + internal string Value; + } + +} diff --git a/Generator/Cleanup.cs b/Generator/Cleanup.cs index ddf3dc9..3cd01ed 100644 --- a/Generator/Cleanup.cs +++ b/Generator/Cleanup.cs @@ -43,6 +43,7 @@ public static class Cleanup type = type.Replace( "InputDigitalActionData_t", "DigitalState" ); type = type.Replace( "InputAnalogActionData_t", "AnalogState" ); type = type.Replace( "InputMotionData_t", "MotionState" ); + type = type.Replace( "MatchMakingKeyValuePair_t", "MatchMakingKeyValuePair" ); return type; } @@ -56,6 +57,7 @@ public static class Cleanup if ( type == "AnalogState" ) return false; if ( type == "DigitalState" ) return false; if ( type == "MotionState" ) return false; + if ( type == "MatchMakingKeyValuePair" ) return false; return true; }