From 12f95a7f4ec1191498d48fbde7d8d141cfead048 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Mon, 10 Feb 2020 19:21:52 +0000 Subject: [PATCH] Converting to flat --- .../Callbacks/CallbackResult.cs | 50 + .../Callbacks/ICallbackData.cs | 17 + .../Generated/Interfaces/ISteamApps.cs | 156 +- .../Generated/Interfaces/ISteamFriends.cs | 465 +- .../Generated/Interfaces/ISteamGameServer.cs | 254 +- .../Interfaces/ISteamGameServerStats.cs | 76 +- .../Generated/Interfaces/ISteamInput.cs | 205 +- .../Generated/Interfaces/ISteamInventory.cs | 215 +- .../Generated/Interfaces/ISteamMatchmaking.cs | 234 +- .../Interfaces/ISteamMatchmakingServers.cs | 87 +- .../Generated/Interfaces/ISteamMusic.cs | 47 +- .../Generated/Interfaces/ISteamNetworking.cs | 112 +- .../Interfaces/ISteamNetworkingSockets.cs | 363 - .../Interfaces/ISteamNetworkingUtils.cs | 211 - .../Interfaces/ISteamParentalSettings.cs | 32 +- .../Generated/Interfaces/ISteamParties.cs | 74 +- .../Interfaces/ISteamRemoteStorage.cs | 183 +- .../Generated/Interfaces/ISteamScreenshots.cs | 47 +- .../Generated/Interfaces/ISteamUGC.cs | 466 +- .../Generated/Interfaces/ISteamUser.cs | 174 +- .../Generated/Interfaces/ISteamUserStats.cs | 297 +- .../Generated/Interfaces/ISteamUtils.cs | 162 +- .../Generated/Interfaces/ISteamVideo.cs | 22 +- .../Generated/SteamStructs.cs | 7030 ++++------------- Facepunch.Steamworks/SteamApps.cs | 2 +- Facepunch.Steamworks/SteamFriends.cs | 6 +- Facepunch.Steamworks/SteamInput.cs | 4 +- Facepunch.Steamworks/SteamServerStats.cs | 4 +- Facepunch.Steamworks/Structs/InventoryItem.cs | 25 +- Facepunch.Steamworks/Structs/Leaderboard.cs | 12 +- Generator/Cleanup.cs | 3 + Generator/CodeParser/CodeParser.Class.cs | 76 - Generator/CodeParser/ParseClasses.cs | 155 - Generator/CodeWriter/ClassVTable.cs | 185 +- Generator/CodeWriter/Struct.cs | 53 +- Generator/CodeWriter/Types/BaseType.cs | 4 +- Generator/Generator.csproj | 2 - Generator/Program.cs | 1 - Generator/steam_sdk/steam_api.json | 34 +- 39 files changed, 2762 insertions(+), 8783 deletions(-) create mode 100644 Facepunch.Steamworks/Callbacks/CallbackResult.cs create mode 100644 Facepunch.Steamworks/Callbacks/ICallbackData.cs delete mode 100644 Generator/CodeParser/CodeParser.Class.cs delete mode 100644 Generator/CodeParser/ParseClasses.cs diff --git a/Facepunch.Steamworks/Callbacks/CallbackResult.cs b/Facepunch.Steamworks/Callbacks/CallbackResult.cs new file mode 100644 index 0000000..5d1d338 --- /dev/null +++ b/Facepunch.Steamworks/Callbacks/CallbackResult.cs @@ -0,0 +1,50 @@ +using Steamworks.Data; +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Threading.Tasks; + +namespace Steamworks +{ + // + // Created on registration of a callback + // + internal struct CallbackResult + { + SteamAPICall_t call; + + public CallbackResult( SteamAPICall_t call ) + { + this.call = call; + } + + public async Task GetAsync() where T : struct, ICallbackData + { + bool failed = false; + var t = default( T ); + var size = t.DataSize; + + while ( !SteamUtils.IsCallComplete( call, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( size ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( call, ptr, size, t.CallbackId, ref failed ) || failed ) + return null; + + return ((T)Marshal.PtrToStructure( ptr, typeof( T ) )); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Callbacks/ICallbackData.cs b/Facepunch.Steamworks/Callbacks/ICallbackData.cs new file mode 100644 index 0000000..593de9f --- /dev/null +++ b/Facepunch.Steamworks/Callbacks/ICallbackData.cs @@ -0,0 +1,17 @@ +using Steamworks.Data; +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Threading.Tasks; + +namespace Steamworks +{ + // + // Created on registration of a callback + // + internal interface ICallbackData + { + int CallbackId { get; } + int DataSize { get; } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs index daf0b70..eb46653 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs @@ -9,8 +9,6 @@ namespace Steamworks { internal class ISteamApps : SteamInterface { - public override string InterfaceName => "STEAMAPPS_INTERFACE_VERSION008"; - public override void InitInternals() { } @@ -21,10 +19,9 @@ internal override void Shutdown() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_BIsSubscribed")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBIsSubscribed( IntPtr self ); - private FBIsSubscribed _BIsSubscribed; + private static extern bool _BIsSubscribed( IntPtr self ); #endregion internal bool BIsSubscribed() @@ -34,10 +31,9 @@ internal bool BIsSubscribed() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_BIsLowViolence")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBIsLowViolence( IntPtr self ); - private FBIsLowViolence _BIsLowViolence; + private static extern bool _BIsLowViolence( IntPtr self ); #endregion internal bool BIsLowViolence() @@ -47,10 +43,9 @@ internal bool BIsLowViolence() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_BIsCybercafe")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBIsCybercafe( IntPtr self ); - private FBIsCybercafe _BIsCybercafe; + private static extern bool _BIsCybercafe( IntPtr self ); #endregion internal bool BIsCybercafe() @@ -60,10 +55,9 @@ internal bool BIsCybercafe() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_BIsVACBanned")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBIsVACBanned( IntPtr self ); - private FBIsVACBanned _BIsVACBanned; + private static extern bool _BIsVACBanned( IntPtr self ); #endregion internal bool BIsVACBanned() @@ -73,9 +67,8 @@ internal bool BIsVACBanned() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Utf8StringPointer FGetCurrentGameLanguage( IntPtr self ); - private FGetCurrentGameLanguage _GetCurrentGameLanguage; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_GetCurrentGameLanguage")] + private static extern Utf8StringPointer _GetCurrentGameLanguage( IntPtr self ); #endregion internal string GetCurrentGameLanguage() @@ -85,9 +78,8 @@ internal string GetCurrentGameLanguage() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Utf8StringPointer FGetAvailableGameLanguages( IntPtr self ); - private FGetAvailableGameLanguages _GetAvailableGameLanguages; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_GetAvailableGameLanguages")] + private static extern Utf8StringPointer _GetAvailableGameLanguages( IntPtr self ); #endregion internal string GetAvailableGameLanguages() @@ -97,10 +89,9 @@ internal string GetAvailableGameLanguages() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_BIsSubscribedApp")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBIsSubscribedApp( IntPtr self, AppId appID ); - private FBIsSubscribedApp _BIsSubscribedApp; + private static extern bool _BIsSubscribedApp( IntPtr self, AppId appID ); #endregion internal bool BIsSubscribedApp( AppId appID ) @@ -110,10 +101,9 @@ internal bool BIsSubscribedApp( AppId appID ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_BIsDlcInstalled")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBIsDlcInstalled( IntPtr self, AppId appID ); - private FBIsDlcInstalled _BIsDlcInstalled; + private static extern bool _BIsDlcInstalled( IntPtr self, AppId appID ); #endregion internal bool BIsDlcInstalled( AppId appID ) @@ -123,9 +113,8 @@ internal bool BIsDlcInstalled( AppId appID ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate uint FGetEarliestPurchaseUnixTime( IntPtr self, AppId nAppID ); - private FGetEarliestPurchaseUnixTime _GetEarliestPurchaseUnixTime; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_GetEarliestPurchaseUnixTime")] + private static extern uint _GetEarliestPurchaseUnixTime( IntPtr self, AppId nAppID ); #endregion internal uint GetEarliestPurchaseUnixTime( AppId nAppID ) @@ -135,10 +124,9 @@ internal uint GetEarliestPurchaseUnixTime( AppId nAppID ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_BIsSubscribedFromFreeWeekend")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBIsSubscribedFromFreeWeekend( IntPtr self ); - private FBIsSubscribedFromFreeWeekend _BIsSubscribedFromFreeWeekend; + private static extern bool _BIsSubscribedFromFreeWeekend( IntPtr self ); #endregion internal bool BIsSubscribedFromFreeWeekend() @@ -148,9 +136,8 @@ internal bool BIsSubscribedFromFreeWeekend() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetDLCCount( IntPtr self ); - private FGetDLCCount _GetDLCCount; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_GetDLCCount")] + private static extern int _GetDLCCount( IntPtr self ); #endregion internal int GetDLCCount() @@ -160,10 +147,9 @@ internal int GetDLCCount() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_BGetDLCDataByIndex")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBGetDLCDataByIndex( IntPtr self, int iDLC, ref AppId pAppID, [MarshalAs( UnmanagedType.U1 )] ref bool pbAvailable, IntPtr pchName, int cchNameBufferSize ); - private FBGetDLCDataByIndex _BGetDLCDataByIndex; + private static extern bool _BGetDLCDataByIndex( IntPtr self, int iDLC, ref AppId pAppID, [MarshalAs( UnmanagedType.U1 )] ref bool pbAvailable, IntPtr pchName, int cchNameBufferSize ); #endregion internal bool BGetDLCDataByIndex( int iDLC, ref AppId pAppID, [MarshalAs( UnmanagedType.U1 )] ref bool pbAvailable, out string pchName ) @@ -175,9 +161,8 @@ internal bool BGetDLCDataByIndex( int iDLC, ref AppId pAppID, [MarshalAs( Unmana } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FInstallDLC( IntPtr self, AppId nAppID ); - private FInstallDLC _InstallDLC; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_InstallDLC")] + private static extern void _InstallDLC( IntPtr self, AppId nAppID ); #endregion internal void InstallDLC( AppId nAppID ) @@ -186,9 +171,8 @@ internal void InstallDLC( AppId nAppID ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FUninstallDLC( IntPtr self, AppId nAppID ); - private FUninstallDLC _UninstallDLC; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_UninstallDLC")] + private static extern void _UninstallDLC( IntPtr self, AppId nAppID ); #endregion internal void UninstallDLC( AppId nAppID ) @@ -197,9 +181,8 @@ internal void UninstallDLC( AppId nAppID ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FRequestAppProofOfPurchaseKey( IntPtr self, AppId nAppID ); - private FRequestAppProofOfPurchaseKey _RequestAppProofOfPurchaseKey; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_RequestAppProofOfPurchaseKey")] + private static extern void _RequestAppProofOfPurchaseKey( IntPtr self, AppId nAppID ); #endregion internal void RequestAppProofOfPurchaseKey( AppId nAppID ) @@ -208,10 +191,9 @@ internal void RequestAppProofOfPurchaseKey( AppId nAppID ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_GetCurrentBetaName")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetCurrentBetaName( IntPtr self, IntPtr pchName, int cchNameBufferSize ); - private FGetCurrentBetaName _GetCurrentBetaName; + private static extern bool _GetCurrentBetaName( IntPtr self, IntPtr pchName, int cchNameBufferSize ); #endregion internal bool GetCurrentBetaName( out string pchName ) @@ -223,10 +205,9 @@ internal bool GetCurrentBetaName( out string pchName ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_MarkContentCorrupt")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FMarkContentCorrupt( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bMissingFilesOnly ); - private FMarkContentCorrupt _MarkContentCorrupt; + private static extern bool _MarkContentCorrupt( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bMissingFilesOnly ); #endregion internal bool MarkContentCorrupt( [MarshalAs( UnmanagedType.U1 )] bool bMissingFilesOnly ) @@ -236,9 +217,8 @@ internal bool MarkContentCorrupt( [MarshalAs( UnmanagedType.U1 )] bool bMissingF } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate uint FGetInstalledDepots( IntPtr self, AppId appID, [In,Out] DepotId_t[] pvecDepots, uint cMaxDepots ); - private FGetInstalledDepots _GetInstalledDepots; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_GetInstalledDepots")] + private static extern uint _GetInstalledDepots( IntPtr self, AppId appID, [In,Out] DepotId_t[] pvecDepots, uint cMaxDepots ); #endregion internal uint GetInstalledDepots( AppId appID, [In,Out] DepotId_t[] pvecDepots, uint cMaxDepots ) @@ -248,9 +228,8 @@ internal uint GetInstalledDepots( AppId appID, [In,Out] DepotId_t[] pvecDepots, } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate uint FGetAppInstallDir( IntPtr self, AppId appID, IntPtr pchFolder, uint cchFolderBufferSize ); - private FGetAppInstallDir _GetAppInstallDir; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_GetAppInstallDir")] + private static extern uint _GetAppInstallDir( IntPtr self, AppId appID, IntPtr pchFolder, uint cchFolderBufferSize ); #endregion internal uint GetAppInstallDir( AppId appID, out string pchFolder ) @@ -262,10 +241,9 @@ internal uint GetAppInstallDir( AppId appID, out string pchFolder ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_BIsAppInstalled")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBIsAppInstalled( IntPtr self, AppId appID ); - private FBIsAppInstalled _BIsAppInstalled; + private static extern bool _BIsAppInstalled( IntPtr self, AppId appID ); #endregion internal bool BIsAppInstalled( AppId appID ) @@ -275,31 +253,19 @@ internal bool BIsAppInstalled( AppId appID ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - #if PLATFORM_WIN - private delegate void FGetAppOwner( IntPtr self, ref SteamId retVal ); - #else - private delegate SteamId FGetAppOwner( IntPtr self ); - #endif - private FGetAppOwner _GetAppOwner; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_GetAppOwner")] + private static extern SteamId _GetAppOwner( IntPtr self ); #endregion internal SteamId GetAppOwner() { - #if PLATFORM_WIN - var retVal = default( SteamId ); - _GetAppOwner( Self, ref retVal ); - return retVal; - #else var returnValue = _GetAppOwner( Self ); return returnValue; - #endif } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Utf8StringPointer FGetLaunchQueryParam( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); - private FGetLaunchQueryParam _GetLaunchQueryParam; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_GetLaunchQueryParam")] + private static extern Utf8StringPointer _GetLaunchQueryParam( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); #endregion internal string GetLaunchQueryParam( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) @@ -309,10 +275,9 @@ internal string GetLaunchQueryParam( [MarshalAs( UnmanagedType.CustomMarshaler, } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_GetDlcDownloadProgress")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetDlcDownloadProgress( IntPtr self, AppId nAppID, ref ulong punBytesDownloaded, ref ulong punBytesTotal ); - private FGetDlcDownloadProgress _GetDlcDownloadProgress; + private static extern bool _GetDlcDownloadProgress( IntPtr self, AppId nAppID, ref ulong punBytesDownloaded, ref ulong punBytesTotal ); #endregion internal bool GetDlcDownloadProgress( AppId nAppID, ref ulong punBytesDownloaded, ref ulong punBytesTotal ) @@ -322,9 +287,8 @@ internal bool GetDlcDownloadProgress( AppId nAppID, ref ulong punBytesDownloaded } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetAppBuildId( IntPtr self ); - private FGetAppBuildId _GetAppBuildId; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_GetAppBuildId")] + private static extern int _GetAppBuildId( IntPtr self ); #endregion internal int GetAppBuildId() @@ -334,9 +298,8 @@ internal int GetAppBuildId() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FRequestAllProofOfPurchaseKeys( IntPtr self ); - private FRequestAllProofOfPurchaseKeys _RequestAllProofOfPurchaseKeys; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_RequestAllProofOfPurchaseKeys")] + private static extern void _RequestAllProofOfPurchaseKeys( IntPtr self ); #endregion internal void RequestAllProofOfPurchaseKeys() @@ -345,21 +308,19 @@ internal void RequestAllProofOfPurchaseKeys() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FGetFileDetails( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszFileName ); - private FGetFileDetails _GetFileDetails; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_GetFileDetails")] + private static extern SteamAPICall_t _GetFileDetails( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszFileName ); #endregion - internal async Task GetFileDetails( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszFileName ) + internal CallbackResult GetFileDetails( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszFileName ) { var returnValue = _GetFileDetails( Self, pszFileName ); - return await FileDetailsResult_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetLaunchCommandLine( IntPtr self, IntPtr pszCommandLine, int cubCommandLine ); - private FGetLaunchCommandLine _GetLaunchCommandLine; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_GetLaunchCommandLine")] + private static extern int _GetLaunchCommandLine( IntPtr self, IntPtr pszCommandLine, int cubCommandLine ); #endregion internal int GetLaunchCommandLine( out string pszCommandLine ) @@ -371,10 +332,9 @@ internal int GetLaunchCommandLine( out string pszCommandLine ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_BIsSubscribedFromFamilySharing")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBIsSubscribedFromFamilySharing( IntPtr self ); - private FBIsSubscribedFromFamilySharing _BIsSubscribedFromFamilySharing; + private static extern bool _BIsSubscribedFromFamilySharing( IntPtr self ); #endregion internal bool BIsSubscribedFromFamilySharing() diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs index 5cca0ff..fa8e95e 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs @@ -9,8 +9,6 @@ namespace Steamworks { internal class ISteamFriends : SteamInterface { - public override string InterfaceName => "SteamFriends017"; - public override void InitInternals() { } @@ -21,9 +19,8 @@ internal override void Shutdown() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Utf8StringPointer FGetPersonaName( IntPtr self ); - private FGetPersonaName _GetPersonaName; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetPersonaName")] + private static extern Utf8StringPointer _GetPersonaName( IntPtr self ); #endregion internal string GetPersonaName() @@ -33,21 +30,19 @@ internal string GetPersonaName() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FSetPersonaName( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPersonaName ); - private FSetPersonaName _SetPersonaName; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_SetPersonaName")] + private static extern SteamAPICall_t _SetPersonaName( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPersonaName ); #endregion - internal async Task SetPersonaName( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPersonaName ) + internal CallbackResult SetPersonaName( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPersonaName ) { var returnValue = _SetPersonaName( Self, pchPersonaName ); - return await SetPersonaNameResponse_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate FriendState FGetPersonaState( IntPtr self ); - private FGetPersonaState _GetPersonaState; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetPersonaState")] + private static extern FriendState _GetPersonaState( IntPtr self ); #endregion internal FriendState GetPersonaState() @@ -57,9 +52,8 @@ internal FriendState GetPersonaState() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetFriendCount( IntPtr self, int iFriendFlags ); - private FGetFriendCount _GetFriendCount; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendCount")] + private static extern int _GetFriendCount( IntPtr self, int iFriendFlags ); #endregion internal int GetFriendCount( int iFriendFlags ) @@ -69,31 +63,19 @@ internal int GetFriendCount( int iFriendFlags ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - #if PLATFORM_WIN - private delegate void FGetFriendByIndex( IntPtr self, ref SteamId retVal, int iFriend, int iFriendFlags ); - #else - private delegate SteamId FGetFriendByIndex( IntPtr self, int iFriend, int iFriendFlags ); - #endif - private FGetFriendByIndex _GetFriendByIndex; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendByIndex")] + private static extern SteamId _GetFriendByIndex( IntPtr self, int iFriend, int iFriendFlags ); #endregion internal SteamId GetFriendByIndex( int iFriend, int iFriendFlags ) { - #if PLATFORM_WIN - var retVal = default( SteamId ); - _GetFriendByIndex( Self, ref retVal, iFriend, iFriendFlags ); - return retVal; - #else var returnValue = _GetFriendByIndex( Self, iFriend, iFriendFlags ); return returnValue; - #endif } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Relationship FGetFriendRelationship( IntPtr self, SteamId steamIDFriend ); - private FGetFriendRelationship _GetFriendRelationship; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendRelationship")] + private static extern Relationship _GetFriendRelationship( IntPtr self, SteamId steamIDFriend ); #endregion internal Relationship GetFriendRelationship( SteamId steamIDFriend ) @@ -103,9 +85,8 @@ internal Relationship GetFriendRelationship( SteamId steamIDFriend ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate FriendState FGetFriendPersonaState( IntPtr self, SteamId steamIDFriend ); - private FGetFriendPersonaState _GetFriendPersonaState; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendPersonaState")] + private static extern FriendState _GetFriendPersonaState( IntPtr self, SteamId steamIDFriend ); #endregion internal FriendState GetFriendPersonaState( SteamId steamIDFriend ) @@ -115,9 +96,8 @@ internal FriendState GetFriendPersonaState( SteamId steamIDFriend ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Utf8StringPointer FGetFriendPersonaName( IntPtr self, SteamId steamIDFriend ); - private FGetFriendPersonaName _GetFriendPersonaName; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendPersonaName")] + private static extern Utf8StringPointer _GetFriendPersonaName( IntPtr self, SteamId steamIDFriend ); #endregion internal string GetFriendPersonaName( SteamId steamIDFriend ) @@ -127,10 +107,9 @@ internal string GetFriendPersonaName( SteamId steamIDFriend ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendGamePlayed")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetFriendGamePlayed( IntPtr self, SteamId steamIDFriend, ref FriendGameInfo_t pFriendGameInfo ); - private FGetFriendGamePlayed _GetFriendGamePlayed; + private static extern bool _GetFriendGamePlayed( IntPtr self, SteamId steamIDFriend, ref FriendGameInfo_t pFriendGameInfo ); #endregion internal bool GetFriendGamePlayed( SteamId steamIDFriend, ref FriendGameInfo_t pFriendGameInfo ) @@ -140,9 +119,8 @@ internal bool GetFriendGamePlayed( SteamId steamIDFriend, ref FriendGameInfo_t p } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Utf8StringPointer FGetFriendPersonaNameHistory( IntPtr self, SteamId steamIDFriend, int iPersonaName ); - private FGetFriendPersonaNameHistory _GetFriendPersonaNameHistory; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendPersonaNameHistory")] + private static extern Utf8StringPointer _GetFriendPersonaNameHistory( IntPtr self, SteamId steamIDFriend, int iPersonaName ); #endregion internal string GetFriendPersonaNameHistory( SteamId steamIDFriend, int iPersonaName ) @@ -152,9 +130,8 @@ internal string GetFriendPersonaNameHistory( SteamId steamIDFriend, int iPersona } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetFriendSteamLevel( IntPtr self, SteamId steamIDFriend ); - private FGetFriendSteamLevel _GetFriendSteamLevel; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendSteamLevel")] + private static extern int _GetFriendSteamLevel( IntPtr self, SteamId steamIDFriend ); #endregion internal int GetFriendSteamLevel( SteamId steamIDFriend ) @@ -164,9 +141,8 @@ internal int GetFriendSteamLevel( SteamId steamIDFriend ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Utf8StringPointer FGetPlayerNickname( IntPtr self, SteamId steamIDPlayer ); - private FGetPlayerNickname _GetPlayerNickname; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetPlayerNickname")] + private static extern Utf8StringPointer _GetPlayerNickname( IntPtr self, SteamId steamIDPlayer ); #endregion internal string GetPlayerNickname( SteamId steamIDPlayer ) @@ -176,9 +152,8 @@ internal string GetPlayerNickname( SteamId steamIDPlayer ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetFriendsGroupCount( IntPtr self ); - private FGetFriendsGroupCount _GetFriendsGroupCount; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendsGroupCount")] + private static extern int _GetFriendsGroupCount( IntPtr self ); #endregion internal int GetFriendsGroupCount() @@ -188,9 +163,8 @@ internal int GetFriendsGroupCount() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate FriendsGroupID_t FGetFriendsGroupIDByIndex( IntPtr self, int iFG ); - private FGetFriendsGroupIDByIndex _GetFriendsGroupIDByIndex; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendsGroupIDByIndex")] + private static extern FriendsGroupID_t _GetFriendsGroupIDByIndex( IntPtr self, int iFG ); #endregion internal FriendsGroupID_t GetFriendsGroupIDByIndex( int iFG ) @@ -200,9 +174,8 @@ internal FriendsGroupID_t GetFriendsGroupIDByIndex( int iFG ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Utf8StringPointer FGetFriendsGroupName( IntPtr self, FriendsGroupID_t friendsGroupID ); - private FGetFriendsGroupName _GetFriendsGroupName; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendsGroupName")] + private static extern Utf8StringPointer _GetFriendsGroupName( IntPtr self, FriendsGroupID_t friendsGroupID ); #endregion internal string GetFriendsGroupName( FriendsGroupID_t friendsGroupID ) @@ -212,9 +185,8 @@ internal string GetFriendsGroupName( FriendsGroupID_t friendsGroupID ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetFriendsGroupMembersCount( IntPtr self, FriendsGroupID_t friendsGroupID ); - private FGetFriendsGroupMembersCount _GetFriendsGroupMembersCount; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendsGroupMembersCount")] + private static extern int _GetFriendsGroupMembersCount( IntPtr self, FriendsGroupID_t friendsGroupID ); #endregion internal int GetFriendsGroupMembersCount( FriendsGroupID_t friendsGroupID ) @@ -224,9 +196,8 @@ internal int GetFriendsGroupMembersCount( FriendsGroupID_t friendsGroupID ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FGetFriendsGroupMembersList( IntPtr self, FriendsGroupID_t friendsGroupID, [In,Out] SteamId[] pOutSteamIDMembers, int nMembersCount ); - private FGetFriendsGroupMembersList _GetFriendsGroupMembersList; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendsGroupMembersList")] + private static extern void _GetFriendsGroupMembersList( IntPtr self, FriendsGroupID_t friendsGroupID, [In,Out] SteamId[] pOutSteamIDMembers, int nMembersCount ); #endregion internal void GetFriendsGroupMembersList( FriendsGroupID_t friendsGroupID, [In,Out] SteamId[] pOutSteamIDMembers, int nMembersCount ) @@ -235,10 +206,9 @@ internal void GetFriendsGroupMembersList( FriendsGroupID_t friendsGroupID, [In,O } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_HasFriend")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FHasFriend( IntPtr self, SteamId steamIDFriend, int iFriendFlags ); - private FHasFriend _HasFriend; + private static extern bool _HasFriend( IntPtr self, SteamId steamIDFriend, int iFriendFlags ); #endregion internal bool HasFriend( SteamId steamIDFriend, int iFriendFlags ) @@ -248,9 +218,8 @@ internal bool HasFriend( SteamId steamIDFriend, int iFriendFlags ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetClanCount( IntPtr self ); - private FGetClanCount _GetClanCount; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetClanCount")] + private static extern int _GetClanCount( IntPtr self ); #endregion internal int GetClanCount() @@ -260,31 +229,19 @@ internal int GetClanCount() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - #if PLATFORM_WIN - private delegate void FGetClanByIndex( IntPtr self, ref SteamId retVal, int iClan ); - #else - private delegate SteamId FGetClanByIndex( IntPtr self, int iClan ); - #endif - private FGetClanByIndex _GetClanByIndex; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetClanByIndex")] + private static extern SteamId _GetClanByIndex( IntPtr self, int iClan ); #endregion internal SteamId GetClanByIndex( int iClan ) { - #if PLATFORM_WIN - var retVal = default( SteamId ); - _GetClanByIndex( Self, ref retVal, iClan ); - return retVal; - #else var returnValue = _GetClanByIndex( Self, iClan ); return returnValue; - #endif } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Utf8StringPointer FGetClanName( IntPtr self, SteamId steamIDClan ); - private FGetClanName _GetClanName; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetClanName")] + private static extern Utf8StringPointer _GetClanName( IntPtr self, SteamId steamIDClan ); #endregion internal string GetClanName( SteamId steamIDClan ) @@ -294,9 +251,8 @@ internal string GetClanName( SteamId steamIDClan ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Utf8StringPointer FGetClanTag( IntPtr self, SteamId steamIDClan ); - private FGetClanTag _GetClanTag; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetClanTag")] + private static extern Utf8StringPointer _GetClanTag( IntPtr self, SteamId steamIDClan ); #endregion internal string GetClanTag( SteamId steamIDClan ) @@ -306,10 +262,9 @@ internal string GetClanTag( SteamId steamIDClan ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetClanActivityCounts")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetClanActivityCounts( IntPtr self, SteamId steamIDClan, ref int pnOnline, ref int pnInGame, ref int pnChatting ); - private FGetClanActivityCounts _GetClanActivityCounts; + private static extern bool _GetClanActivityCounts( IntPtr self, SteamId steamIDClan, ref int pnOnline, ref int pnInGame, ref int pnChatting ); #endregion internal bool GetClanActivityCounts( SteamId steamIDClan, ref int pnOnline, ref int pnInGame, ref int pnChatting ) @@ -319,21 +274,19 @@ internal bool GetClanActivityCounts( SteamId steamIDClan, ref int pnOnline, ref } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FDownloadClanActivityCounts( IntPtr self, [In,Out] SteamId[] psteamIDClans, int cClansToRequest ); - private FDownloadClanActivityCounts _DownloadClanActivityCounts; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_DownloadClanActivityCounts")] + private static extern SteamAPICall_t _DownloadClanActivityCounts( IntPtr self, [In,Out] SteamId[] psteamIDClans, int cClansToRequest ); #endregion - internal async Task DownloadClanActivityCounts( [In,Out] SteamId[] psteamIDClans, int cClansToRequest ) + internal CallbackResult DownloadClanActivityCounts( [In,Out] SteamId[] psteamIDClans, int cClansToRequest ) { var returnValue = _DownloadClanActivityCounts( Self, psteamIDClans, cClansToRequest ); - return await DownloadClanActivityCountsResult_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetFriendCountFromSource( IntPtr self, SteamId steamIDSource ); - private FGetFriendCountFromSource _GetFriendCountFromSource; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendCountFromSource")] + private static extern int _GetFriendCountFromSource( IntPtr self, SteamId steamIDSource ); #endregion internal int GetFriendCountFromSource( SteamId steamIDSource ) @@ -343,32 +296,20 @@ internal int GetFriendCountFromSource( SteamId steamIDSource ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - #if PLATFORM_WIN - private delegate void FGetFriendFromSourceByIndex( IntPtr self, ref SteamId retVal, SteamId steamIDSource, int iFriend ); - #else - private delegate SteamId FGetFriendFromSourceByIndex( IntPtr self, SteamId steamIDSource, int iFriend ); - #endif - private FGetFriendFromSourceByIndex _GetFriendFromSourceByIndex; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendFromSourceByIndex")] + private static extern SteamId _GetFriendFromSourceByIndex( IntPtr self, SteamId steamIDSource, int iFriend ); #endregion internal SteamId GetFriendFromSourceByIndex( SteamId steamIDSource, int iFriend ) { - #if PLATFORM_WIN - var retVal = default( SteamId ); - _GetFriendFromSourceByIndex( Self, ref retVal, steamIDSource, iFriend ); - return retVal; - #else var returnValue = _GetFriendFromSourceByIndex( Self, steamIDSource, iFriend ); return returnValue; - #endif } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_IsUserInSource")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FIsUserInSource( IntPtr self, SteamId steamIDUser, SteamId steamIDSource ); - private FIsUserInSource _IsUserInSource; + private static extern bool _IsUserInSource( IntPtr self, SteamId steamIDUser, SteamId steamIDSource ); #endregion internal bool IsUserInSource( SteamId steamIDUser, SteamId steamIDSource ) @@ -378,9 +319,8 @@ internal bool IsUserInSource( SteamId steamIDUser, SteamId steamIDSource ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetInGameVoiceSpeaking( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.U1 )] bool bSpeaking ); - private FSetInGameVoiceSpeaking _SetInGameVoiceSpeaking; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_SetInGameVoiceSpeaking")] + private static extern void _SetInGameVoiceSpeaking( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.U1 )] bool bSpeaking ); #endregion internal void SetInGameVoiceSpeaking( SteamId steamIDUser, [MarshalAs( UnmanagedType.U1 )] bool bSpeaking ) @@ -389,9 +329,8 @@ internal void SetInGameVoiceSpeaking( SteamId steamIDUser, [MarshalAs( Unmanaged } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FActivateGameOverlay( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDialog ); - private FActivateGameOverlay _ActivateGameOverlay; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlay")] + private static extern void _ActivateGameOverlay( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDialog ); #endregion internal void ActivateGameOverlay( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDialog ) @@ -400,9 +339,8 @@ internal void ActivateGameOverlay( [MarshalAs( UnmanagedType.CustomMarshaler, Ma } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FActivateGameOverlayToUser( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDialog, SteamId steamID ); - private FActivateGameOverlayToUser _ActivateGameOverlayToUser; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlayToUser")] + private static extern void _ActivateGameOverlayToUser( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDialog, SteamId steamID ); #endregion internal void ActivateGameOverlayToUser( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDialog, SteamId steamID ) @@ -411,9 +349,8 @@ internal void ActivateGameOverlayToUser( [MarshalAs( UnmanagedType.CustomMarshal } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FActivateGameOverlayToWebPage( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchURL, ActivateGameOverlayToWebPageMode eMode ); - private FActivateGameOverlayToWebPage _ActivateGameOverlayToWebPage; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage")] + private static extern void _ActivateGameOverlayToWebPage( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchURL, ActivateGameOverlayToWebPageMode eMode ); #endregion internal void ActivateGameOverlayToWebPage( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchURL, ActivateGameOverlayToWebPageMode eMode ) @@ -422,9 +359,8 @@ internal void ActivateGameOverlayToWebPage( [MarshalAs( UnmanagedType.CustomMars } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FActivateGameOverlayToStore( IntPtr self, AppId nAppID, OverlayToStoreFlag eFlag ); - private FActivateGameOverlayToStore _ActivateGameOverlayToStore; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlayToStore")] + private static extern void _ActivateGameOverlayToStore( IntPtr self, AppId nAppID, OverlayToStoreFlag eFlag ); #endregion internal void ActivateGameOverlayToStore( AppId nAppID, OverlayToStoreFlag eFlag ) @@ -433,9 +369,8 @@ internal void ActivateGameOverlayToStore( AppId nAppID, OverlayToStoreFlag eFlag } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetPlayedWith( IntPtr self, SteamId steamIDUserPlayedWith ); - private FSetPlayedWith _SetPlayedWith; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_SetPlayedWith")] + private static extern void _SetPlayedWith( IntPtr self, SteamId steamIDUserPlayedWith ); #endregion internal void SetPlayedWith( SteamId steamIDUserPlayedWith ) @@ -444,9 +379,8 @@ internal void SetPlayedWith( SteamId steamIDUserPlayedWith ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FActivateGameOverlayInviteDialog( IntPtr self, SteamId steamIDLobby ); - private FActivateGameOverlayInviteDialog _ActivateGameOverlayInviteDialog; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog")] + private static extern void _ActivateGameOverlayInviteDialog( IntPtr self, SteamId steamIDLobby ); #endregion internal void ActivateGameOverlayInviteDialog( SteamId steamIDLobby ) @@ -455,9 +389,8 @@ internal void ActivateGameOverlayInviteDialog( SteamId steamIDLobby ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetSmallFriendAvatar( IntPtr self, SteamId steamIDFriend ); - private FGetSmallFriendAvatar _GetSmallFriendAvatar; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetSmallFriendAvatar")] + private static extern int _GetSmallFriendAvatar( IntPtr self, SteamId steamIDFriend ); #endregion internal int GetSmallFriendAvatar( SteamId steamIDFriend ) @@ -467,9 +400,8 @@ internal int GetSmallFriendAvatar( SteamId steamIDFriend ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetMediumFriendAvatar( IntPtr self, SteamId steamIDFriend ); - private FGetMediumFriendAvatar _GetMediumFriendAvatar; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetMediumFriendAvatar")] + private static extern int _GetMediumFriendAvatar( IntPtr self, SteamId steamIDFriend ); #endregion internal int GetMediumFriendAvatar( SteamId steamIDFriend ) @@ -479,9 +411,8 @@ internal int GetMediumFriendAvatar( SteamId steamIDFriend ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetLargeFriendAvatar( IntPtr self, SteamId steamIDFriend ); - private FGetLargeFriendAvatar _GetLargeFriendAvatar; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetLargeFriendAvatar")] + private static extern int _GetLargeFriendAvatar( IntPtr self, SteamId steamIDFriend ); #endregion internal int GetLargeFriendAvatar( SteamId steamIDFriend ) @@ -491,10 +422,9 @@ internal int GetLargeFriendAvatar( SteamId steamIDFriend ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_RequestUserInformation")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FRequestUserInformation( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.U1 )] bool bRequireNameOnly ); - private FRequestUserInformation _RequestUserInformation; + private static extern bool _RequestUserInformation( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.U1 )] bool bRequireNameOnly ); #endregion internal bool RequestUserInformation( SteamId steamIDUser, [MarshalAs( UnmanagedType.U1 )] bool bRequireNameOnly ) @@ -504,43 +434,30 @@ internal bool RequestUserInformation( SteamId steamIDUser, [MarshalAs( Unmanaged } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FRequestClanOfficerList( IntPtr self, SteamId steamIDClan ); - private FRequestClanOfficerList _RequestClanOfficerList; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_RequestClanOfficerList")] + private static extern SteamAPICall_t _RequestClanOfficerList( IntPtr self, SteamId steamIDClan ); #endregion - internal async Task RequestClanOfficerList( SteamId steamIDClan ) + internal CallbackResult RequestClanOfficerList( SteamId steamIDClan ) { var returnValue = _RequestClanOfficerList( Self, steamIDClan ); - return await ClanOfficerListResponse_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - #if PLATFORM_WIN - private delegate void FGetClanOwner( IntPtr self, ref SteamId retVal, SteamId steamIDClan ); - #else - private delegate SteamId FGetClanOwner( IntPtr self, SteamId steamIDClan ); - #endif - private FGetClanOwner _GetClanOwner; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetClanOwner")] + private static extern SteamId _GetClanOwner( IntPtr self, SteamId steamIDClan ); #endregion internal SteamId GetClanOwner( SteamId steamIDClan ) { - #if PLATFORM_WIN - var retVal = default( SteamId ); - _GetClanOwner( Self, ref retVal, steamIDClan ); - return retVal; - #else var returnValue = _GetClanOwner( Self, steamIDClan ); return returnValue; - #endif } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetClanOfficerCount( IntPtr self, SteamId steamIDClan ); - private FGetClanOfficerCount _GetClanOfficerCount; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetClanOfficerCount")] + private static extern int _GetClanOfficerCount( IntPtr self, SteamId steamIDClan ); #endregion internal int GetClanOfficerCount( SteamId steamIDClan ) @@ -550,31 +467,19 @@ internal int GetClanOfficerCount( SteamId steamIDClan ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - #if PLATFORM_WIN - private delegate void FGetClanOfficerByIndex( IntPtr self, ref SteamId retVal, SteamId steamIDClan, int iOfficer ); - #else - private delegate SteamId FGetClanOfficerByIndex( IntPtr self, SteamId steamIDClan, int iOfficer ); - #endif - private FGetClanOfficerByIndex _GetClanOfficerByIndex; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetClanOfficerByIndex")] + private static extern SteamId _GetClanOfficerByIndex( IntPtr self, SteamId steamIDClan, int iOfficer ); #endregion internal SteamId GetClanOfficerByIndex( SteamId steamIDClan, int iOfficer ) { - #if PLATFORM_WIN - var retVal = default( SteamId ); - _GetClanOfficerByIndex( Self, ref retVal, steamIDClan, iOfficer ); - return retVal; - #else var returnValue = _GetClanOfficerByIndex( Self, steamIDClan, iOfficer ); return returnValue; - #endif } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate uint FGetUserRestrictions( IntPtr self ); - private FGetUserRestrictions _GetUserRestrictions; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetUserRestrictions")] + private static extern uint _GetUserRestrictions( IntPtr self ); #endregion internal uint GetUserRestrictions() @@ -584,10 +489,9 @@ internal uint GetUserRestrictions() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_SetRichPresence")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetRichPresence( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ); - private FSetRichPresence _SetRichPresence; + private static extern bool _SetRichPresence( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ); #endregion internal bool SetRichPresence( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ) @@ -597,9 +501,8 @@ internal bool SetRichPresence( [MarshalAs( UnmanagedType.CustomMarshaler, Marsha } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FClearRichPresence( IntPtr self ); - private FClearRichPresence _ClearRichPresence; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_ClearRichPresence")] + private static extern void _ClearRichPresence( IntPtr self ); #endregion internal void ClearRichPresence() @@ -608,9 +511,8 @@ internal void ClearRichPresence() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Utf8StringPointer FGetFriendRichPresence( IntPtr self, SteamId steamIDFriend, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); - private FGetFriendRichPresence _GetFriendRichPresence; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendRichPresence")] + private static extern Utf8StringPointer _GetFriendRichPresence( IntPtr self, SteamId steamIDFriend, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); #endregion internal string GetFriendRichPresence( SteamId steamIDFriend, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) @@ -620,9 +522,8 @@ internal string GetFriendRichPresence( SteamId steamIDFriend, [MarshalAs( Unmana } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetFriendRichPresenceKeyCount( IntPtr self, SteamId steamIDFriend ); - private FGetFriendRichPresenceKeyCount _GetFriendRichPresenceKeyCount; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendRichPresenceKeyCount")] + private static extern int _GetFriendRichPresenceKeyCount( IntPtr self, SteamId steamIDFriend ); #endregion internal int GetFriendRichPresenceKeyCount( SteamId steamIDFriend ) @@ -632,9 +533,8 @@ internal int GetFriendRichPresenceKeyCount( SteamId steamIDFriend ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Utf8StringPointer FGetFriendRichPresenceKeyByIndex( IntPtr self, SteamId steamIDFriend, int iKey ); - private FGetFriendRichPresenceKeyByIndex _GetFriendRichPresenceKeyByIndex; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendRichPresenceKeyByIndex")] + private static extern Utf8StringPointer _GetFriendRichPresenceKeyByIndex( IntPtr self, SteamId steamIDFriend, int iKey ); #endregion internal string GetFriendRichPresenceKeyByIndex( SteamId steamIDFriend, int iKey ) @@ -644,9 +544,8 @@ internal string GetFriendRichPresenceKeyByIndex( SteamId steamIDFriend, int iKey } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FRequestFriendRichPresence( IntPtr self, SteamId steamIDFriend ); - private FRequestFriendRichPresence _RequestFriendRichPresence; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_RequestFriendRichPresence")] + private static extern void _RequestFriendRichPresence( IntPtr self, SteamId steamIDFriend ); #endregion internal void RequestFriendRichPresence( SteamId steamIDFriend ) @@ -655,10 +554,9 @@ internal void RequestFriendRichPresence( SteamId steamIDFriend ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_InviteUserToGame")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FInviteUserToGame( IntPtr self, SteamId steamIDFriend, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchConnectString ); - private FInviteUserToGame _InviteUserToGame; + private static extern bool _InviteUserToGame( IntPtr self, SteamId steamIDFriend, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchConnectString ); #endregion internal bool InviteUserToGame( SteamId steamIDFriend, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchConnectString ) @@ -668,9 +566,8 @@ internal bool InviteUserToGame( SteamId steamIDFriend, [MarshalAs( UnmanagedType } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetCoplayFriendCount( IntPtr self ); - private FGetCoplayFriendCount _GetCoplayFriendCount; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetCoplayFriendCount")] + private static extern int _GetCoplayFriendCount( IntPtr self ); #endregion internal int GetCoplayFriendCount() @@ -680,31 +577,19 @@ internal int GetCoplayFriendCount() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - #if PLATFORM_WIN - private delegate void FGetCoplayFriend( IntPtr self, ref SteamId retVal, int iCoplayFriend ); - #else - private delegate SteamId FGetCoplayFriend( IntPtr self, int iCoplayFriend ); - #endif - private FGetCoplayFriend _GetCoplayFriend; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetCoplayFriend")] + private static extern SteamId _GetCoplayFriend( IntPtr self, int iCoplayFriend ); #endregion internal SteamId GetCoplayFriend( int iCoplayFriend ) { - #if PLATFORM_WIN - var retVal = default( SteamId ); - _GetCoplayFriend( Self, ref retVal, iCoplayFriend ); - return retVal; - #else var returnValue = _GetCoplayFriend( Self, iCoplayFriend ); return returnValue; - #endif } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetFriendCoplayTime( IntPtr self, SteamId steamIDFriend ); - private FGetFriendCoplayTime _GetFriendCoplayTime; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendCoplayTime")] + private static extern int _GetFriendCoplayTime( IntPtr self, SteamId steamIDFriend ); #endregion internal int GetFriendCoplayTime( SteamId steamIDFriend ) @@ -714,9 +599,8 @@ internal int GetFriendCoplayTime( SteamId steamIDFriend ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate AppId FGetFriendCoplayGame( IntPtr self, SteamId steamIDFriend ); - private FGetFriendCoplayGame _GetFriendCoplayGame; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendCoplayGame")] + private static extern AppId _GetFriendCoplayGame( IntPtr self, SteamId steamIDFriend ); #endregion internal AppId GetFriendCoplayGame( SteamId steamIDFriend ) @@ -726,22 +610,20 @@ internal AppId GetFriendCoplayGame( SteamId steamIDFriend ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FJoinClanChatRoom( IntPtr self, SteamId steamIDClan ); - private FJoinClanChatRoom _JoinClanChatRoom; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_JoinClanChatRoom")] + private static extern SteamAPICall_t _JoinClanChatRoom( IntPtr self, SteamId steamIDClan ); #endregion - internal async Task JoinClanChatRoom( SteamId steamIDClan ) + internal CallbackResult JoinClanChatRoom( SteamId steamIDClan ) { var returnValue = _JoinClanChatRoom( Self, steamIDClan ); - return await JoinClanChatRoomCompletionResult_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_LeaveClanChatRoom")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FLeaveClanChatRoom( IntPtr self, SteamId steamIDClan ); - private FLeaveClanChatRoom _LeaveClanChatRoom; + private static extern bool _LeaveClanChatRoom( IntPtr self, SteamId steamIDClan ); #endregion internal bool LeaveClanChatRoom( SteamId steamIDClan ) @@ -751,9 +633,8 @@ internal bool LeaveClanChatRoom( SteamId steamIDClan ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetClanChatMemberCount( IntPtr self, SteamId steamIDClan ); - private FGetClanChatMemberCount _GetClanChatMemberCount; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetClanChatMemberCount")] + private static extern int _GetClanChatMemberCount( IntPtr self, SteamId steamIDClan ); #endregion internal int GetClanChatMemberCount( SteamId steamIDClan ) @@ -763,32 +644,20 @@ internal int GetClanChatMemberCount( SteamId steamIDClan ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - #if PLATFORM_WIN - private delegate void FGetChatMemberByIndex( IntPtr self, ref SteamId retVal, SteamId steamIDClan, int iUser ); - #else - private delegate SteamId FGetChatMemberByIndex( IntPtr self, SteamId steamIDClan, int iUser ); - #endif - private FGetChatMemberByIndex _GetChatMemberByIndex; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetChatMemberByIndex")] + private static extern SteamId _GetChatMemberByIndex( IntPtr self, SteamId steamIDClan, int iUser ); #endregion internal SteamId GetChatMemberByIndex( SteamId steamIDClan, int iUser ) { - #if PLATFORM_WIN - var retVal = default( SteamId ); - _GetChatMemberByIndex( Self, ref retVal, steamIDClan, iUser ); - return retVal; - #else var returnValue = _GetChatMemberByIndex( Self, steamIDClan, iUser ); return returnValue; - #endif } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_SendClanChatMessage")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSendClanChatMessage( IntPtr self, SteamId steamIDClanChat, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchText ); - private FSendClanChatMessage _SendClanChatMessage; + private static extern bool _SendClanChatMessage( IntPtr self, SteamId steamIDClanChat, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchText ); #endregion internal bool SendClanChatMessage( SteamId steamIDClanChat, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchText ) @@ -798,9 +667,8 @@ internal bool SendClanChatMessage( SteamId steamIDClanChat, [MarshalAs( Unmanage } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetClanChatMessage( IntPtr self, SteamId steamIDClanChat, int iMessage, IntPtr prgchText, int cchTextMax, ref ChatEntryType peChatEntryType, ref SteamId psteamidChatter ); - private FGetClanChatMessage _GetClanChatMessage; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetClanChatMessage")] + private static extern int _GetClanChatMessage( IntPtr self, SteamId steamIDClanChat, int iMessage, IntPtr prgchText, int cchTextMax, ref ChatEntryType peChatEntryType, ref SteamId psteamidChatter ); #endregion internal int GetClanChatMessage( SteamId steamIDClanChat, int iMessage, IntPtr prgchText, int cchTextMax, ref ChatEntryType peChatEntryType, ref SteamId psteamidChatter ) @@ -810,10 +678,9 @@ internal int GetClanChatMessage( SteamId steamIDClanChat, int iMessage, IntPtr p } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_IsClanChatAdmin")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FIsClanChatAdmin( IntPtr self, SteamId steamIDClanChat, SteamId steamIDUser ); - private FIsClanChatAdmin _IsClanChatAdmin; + private static extern bool _IsClanChatAdmin( IntPtr self, SteamId steamIDClanChat, SteamId steamIDUser ); #endregion internal bool IsClanChatAdmin( SteamId steamIDClanChat, SteamId steamIDUser ) @@ -823,10 +690,9 @@ internal bool IsClanChatAdmin( SteamId steamIDClanChat, SteamId steamIDUser ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_IsClanChatWindowOpenInSteam")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FIsClanChatWindowOpenInSteam( IntPtr self, SteamId steamIDClanChat ); - private FIsClanChatWindowOpenInSteam _IsClanChatWindowOpenInSteam; + private static extern bool _IsClanChatWindowOpenInSteam( IntPtr self, SteamId steamIDClanChat ); #endregion internal bool IsClanChatWindowOpenInSteam( SteamId steamIDClanChat ) @@ -836,10 +702,9 @@ internal bool IsClanChatWindowOpenInSteam( SteamId steamIDClanChat ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_OpenClanChatWindowInSteam")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FOpenClanChatWindowInSteam( IntPtr self, SteamId steamIDClanChat ); - private FOpenClanChatWindowInSteam _OpenClanChatWindowInSteam; + private static extern bool _OpenClanChatWindowInSteam( IntPtr self, SteamId steamIDClanChat ); #endregion internal bool OpenClanChatWindowInSteam( SteamId steamIDClanChat ) @@ -849,10 +714,9 @@ internal bool OpenClanChatWindowInSteam( SteamId steamIDClanChat ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_CloseClanChatWindowInSteam")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FCloseClanChatWindowInSteam( IntPtr self, SteamId steamIDClanChat ); - private FCloseClanChatWindowInSteam _CloseClanChatWindowInSteam; + private static extern bool _CloseClanChatWindowInSteam( IntPtr self, SteamId steamIDClanChat ); #endregion internal bool CloseClanChatWindowInSteam( SteamId steamIDClanChat ) @@ -862,10 +726,9 @@ internal bool CloseClanChatWindowInSteam( SteamId steamIDClanChat ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_SetListenForFriendsMessages")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetListenForFriendsMessages( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bInterceptEnabled ); - private FSetListenForFriendsMessages _SetListenForFriendsMessages; + private static extern bool _SetListenForFriendsMessages( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bInterceptEnabled ); #endregion internal bool SetListenForFriendsMessages( [MarshalAs( UnmanagedType.U1 )] bool bInterceptEnabled ) @@ -875,10 +738,9 @@ internal bool SetListenForFriendsMessages( [MarshalAs( UnmanagedType.U1 )] bool } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_ReplyToFriendMessage")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FReplyToFriendMessage( IntPtr self, SteamId steamIDFriend, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMsgToSend ); - private FReplyToFriendMessage _ReplyToFriendMessage; + private static extern bool _ReplyToFriendMessage( IntPtr self, SteamId steamIDFriend, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMsgToSend ); #endregion internal bool ReplyToFriendMessage( SteamId steamIDFriend, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMsgToSend ) @@ -888,9 +750,8 @@ internal bool ReplyToFriendMessage( SteamId steamIDFriend, [MarshalAs( Unmanaged } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetFriendMessage( IntPtr self, SteamId steamIDFriend, int iMessageID, IntPtr pvData, int cubData, ref ChatEntryType peChatEntryType ); - private FGetFriendMessage _GetFriendMessage; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendMessage")] + private static extern int _GetFriendMessage( IntPtr self, SteamId steamIDFriend, int iMessageID, IntPtr pvData, int cubData, ref ChatEntryType peChatEntryType ); #endregion internal int GetFriendMessage( SteamId steamIDFriend, int iMessageID, IntPtr pvData, int cubData, ref ChatEntryType peChatEntryType ) @@ -900,46 +761,42 @@ internal int GetFriendMessage( SteamId steamIDFriend, int iMessageID, IntPtr pvD } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FGetFollowerCount( IntPtr self, SteamId steamID ); - private FGetFollowerCount _GetFollowerCount; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFollowerCount")] + private static extern SteamAPICall_t _GetFollowerCount( IntPtr self, SteamId steamID ); #endregion - internal async Task GetFollowerCount( SteamId steamID ) + internal CallbackResult GetFollowerCount( SteamId steamID ) { var returnValue = _GetFollowerCount( Self, steamID ); - return await FriendsGetFollowerCount_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FIsFollowing( IntPtr self, SteamId steamID ); - private FIsFollowing _IsFollowing; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_IsFollowing")] + private static extern SteamAPICall_t _IsFollowing( IntPtr self, SteamId steamID ); #endregion - internal async Task IsFollowing( SteamId steamID ) + internal CallbackResult IsFollowing( SteamId steamID ) { var returnValue = _IsFollowing( Self, steamID ); - return await FriendsIsFollowing_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FEnumerateFollowingList( IntPtr self, uint unStartIndex ); - private FEnumerateFollowingList _EnumerateFollowingList; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_EnumerateFollowingList")] + private static extern SteamAPICall_t _EnumerateFollowingList( IntPtr self, uint unStartIndex ); #endregion - internal async Task EnumerateFollowingList( uint unStartIndex ) + internal CallbackResult EnumerateFollowingList( uint unStartIndex ) { var returnValue = _EnumerateFollowingList( Self, unStartIndex ); - return await FriendsEnumerateFollowingList_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_IsClanPublic")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FIsClanPublic( IntPtr self, SteamId steamIDClan ); - private FIsClanPublic _IsClanPublic; + private static extern bool _IsClanPublic( IntPtr self, SteamId steamIDClan ); #endregion internal bool IsClanPublic( SteamId steamIDClan ) @@ -949,10 +806,9 @@ internal bool IsClanPublic( SteamId steamIDClan ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_IsClanOfficialGameGroup")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FIsClanOfficialGameGroup( IntPtr self, SteamId steamIDClan ); - private FIsClanOfficialGameGroup _IsClanOfficialGameGroup; + private static extern bool _IsClanOfficialGameGroup( IntPtr self, SteamId steamIDClan ); #endregion internal bool IsClanOfficialGameGroup( SteamId steamIDClan ) @@ -962,9 +818,8 @@ internal bool IsClanOfficialGameGroup( SteamId steamIDClan ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetNumChatsWithUnreadPriorityMessages( IntPtr self ); - private FGetNumChatsWithUnreadPriorityMessages _GetNumChatsWithUnreadPriorityMessages; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetNumChatsWithUnreadPriorityMessages")] + private static extern int _GetNumChatsWithUnreadPriorityMessages( IntPtr self ); #endregion internal int GetNumChatsWithUnreadPriorityMessages() diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServer.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServer.cs index 7118e17..3b90e70 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServer.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServer.cs @@ -9,8 +9,6 @@ namespace Steamworks { internal class ISteamGameServer : SteamInterface { - public override string InterfaceName => "SteamGameServer012"; - public override void InitInternals() { } @@ -21,10 +19,9 @@ internal override void Shutdown() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_InitGameServer")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FInitGameServer( IntPtr self, uint unIP, ushort usGamePort, ushort usQueryPort, uint unFlags, AppId nGameAppId, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersionString ); - private FInitGameServer _InitGameServer; + private static extern bool _InitGameServer( IntPtr self, uint unIP, ushort usGamePort, ushort usQueryPort, uint unFlags, AppId nGameAppId, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersionString ); #endregion internal bool InitGameServer( uint unIP, ushort usGamePort, ushort usQueryPort, uint unFlags, AppId nGameAppId, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersionString ) @@ -34,9 +31,8 @@ internal bool InitGameServer( uint unIP, ushort usGamePort, ushort usQueryPort, } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetProduct( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszProduct ); - private FSetProduct _SetProduct; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetProduct")] + private static extern void _SetProduct( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszProduct ); #endregion internal void SetProduct( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszProduct ) @@ -45,9 +41,8 @@ internal void SetProduct( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalType } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetGameDescription( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszGameDescription ); - private FSetGameDescription _SetGameDescription; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetGameDescription")] + private static extern void _SetGameDescription( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszGameDescription ); #endregion internal void SetGameDescription( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszGameDescription ) @@ -56,9 +51,8 @@ internal void SetGameDescription( [MarshalAs( UnmanagedType.CustomMarshaler, Mar } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetModDir( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszModDir ); - private FSetModDir _SetModDir; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetModDir")] + private static extern void _SetModDir( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszModDir ); #endregion internal void SetModDir( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszModDir ) @@ -67,9 +61,8 @@ internal void SetModDir( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeR } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetDedicatedServer( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bDedicated ); - private FSetDedicatedServer _SetDedicatedServer; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetDedicatedServer")] + private static extern void _SetDedicatedServer( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bDedicated ); #endregion internal void SetDedicatedServer( [MarshalAs( UnmanagedType.U1 )] bool bDedicated ) @@ -78,9 +71,8 @@ internal void SetDedicatedServer( [MarshalAs( UnmanagedType.U1 )] bool bDedicate } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FLogOn( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszToken ); - private FLogOn _LogOn; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_LogOn")] + private static extern void _LogOn( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszToken ); #endregion internal void LogOn( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszToken ) @@ -89,9 +81,8 @@ internal void LogOn( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FLogOnAnonymous( IntPtr self ); - private FLogOnAnonymous _LogOnAnonymous; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_LogOnAnonymous")] + private static extern void _LogOnAnonymous( IntPtr self ); #endregion internal void LogOnAnonymous() @@ -100,9 +91,8 @@ internal void LogOnAnonymous() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FLogOff( IntPtr self ); - private FLogOff _LogOff; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_LogOff")] + private static extern void _LogOff( IntPtr self ); #endregion internal void LogOff() @@ -111,10 +101,9 @@ internal void LogOff() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_BLoggedOn")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBLoggedOn( IntPtr self ); - private FBLoggedOn _BLoggedOn; + private static extern bool _BLoggedOn( IntPtr self ); #endregion internal bool BLoggedOn() @@ -124,10 +113,9 @@ internal bool BLoggedOn() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_BSecure")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBSecure( IntPtr self ); - private FBSecure _BSecure; + private static extern bool _BSecure( IntPtr self ); #endregion internal bool BSecure() @@ -137,32 +125,20 @@ internal bool BSecure() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - #if PLATFORM_WIN - private delegate void FGetSteamID( IntPtr self, ref SteamId retVal ); - #else - private delegate SteamId FGetSteamID( IntPtr self ); - #endif - private FGetSteamID _GetSteamID; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_GetSteamID")] + private static extern SteamId _GetSteamID( IntPtr self ); #endregion internal SteamId GetSteamID() { - #if PLATFORM_WIN - var retVal = default( SteamId ); - _GetSteamID( Self, ref retVal ); - return retVal; - #else var returnValue = _GetSteamID( Self ); return returnValue; - #endif } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_WasRestartRequested")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FWasRestartRequested( IntPtr self ); - private FWasRestartRequested _WasRestartRequested; + private static extern bool _WasRestartRequested( IntPtr self ); #endregion internal bool WasRestartRequested() @@ -172,9 +148,8 @@ internal bool WasRestartRequested() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetMaxPlayerCount( IntPtr self, int cPlayersMax ); - private FSetMaxPlayerCount _SetMaxPlayerCount; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetMaxPlayerCount")] + private static extern void _SetMaxPlayerCount( IntPtr self, int cPlayersMax ); #endregion internal void SetMaxPlayerCount( int cPlayersMax ) @@ -183,9 +158,8 @@ internal void SetMaxPlayerCount( int cPlayersMax ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetBotPlayerCount( IntPtr self, int cBotplayers ); - private FSetBotPlayerCount _SetBotPlayerCount; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetBotPlayerCount")] + private static extern void _SetBotPlayerCount( IntPtr self, int cBotplayers ); #endregion internal void SetBotPlayerCount( int cBotplayers ) @@ -194,9 +168,8 @@ internal void SetBotPlayerCount( int cBotplayers ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetServerName( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszServerName ); - private FSetServerName _SetServerName; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetServerName")] + private static extern void _SetServerName( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszServerName ); #endregion internal void SetServerName( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszServerName ) @@ -205,9 +178,8 @@ internal void SetServerName( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalT } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetMapName( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszMapName ); - private FSetMapName _SetMapName; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetMapName")] + private static extern void _SetMapName( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszMapName ); #endregion internal void SetMapName( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszMapName ) @@ -216,9 +188,8 @@ internal void SetMapName( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalType } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetPasswordProtected( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bPasswordProtected ); - private FSetPasswordProtected _SetPasswordProtected; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetPasswordProtected")] + private static extern void _SetPasswordProtected( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bPasswordProtected ); #endregion internal void SetPasswordProtected( [MarshalAs( UnmanagedType.U1 )] bool bPasswordProtected ) @@ -227,9 +198,8 @@ internal void SetPasswordProtected( [MarshalAs( UnmanagedType.U1 )] bool bPasswo } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetSpectatorPort( IntPtr self, ushort unSpectatorPort ); - private FSetSpectatorPort _SetSpectatorPort; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetSpectatorPort")] + private static extern void _SetSpectatorPort( IntPtr self, ushort unSpectatorPort ); #endregion internal void SetSpectatorPort( ushort unSpectatorPort ) @@ -238,9 +208,8 @@ internal void SetSpectatorPort( ushort unSpectatorPort ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetSpectatorServerName( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszSpectatorServerName ); - private FSetSpectatorServerName _SetSpectatorServerName; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetSpectatorServerName")] + private static extern void _SetSpectatorServerName( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszSpectatorServerName ); #endregion internal void SetSpectatorServerName( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszSpectatorServerName ) @@ -249,9 +218,8 @@ internal void SetSpectatorServerName( [MarshalAs( UnmanagedType.CustomMarshaler, } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FClearAllKeyValues( IntPtr self ); - private FClearAllKeyValues _ClearAllKeyValues; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_ClearAllKeyValues")] + private static extern void _ClearAllKeyValues( IntPtr self ); #endregion internal void ClearAllKeyValues() @@ -260,9 +228,8 @@ internal void ClearAllKeyValues() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetKeyValue( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pValue ); - private FSetKeyValue _SetKeyValue; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetKeyValue")] + private static extern void _SetKeyValue( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pValue ); #endregion internal void SetKeyValue( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pValue ) @@ -271,9 +238,8 @@ internal void SetKeyValue( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTyp } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetGameTags( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchGameTags ); - private FSetGameTags _SetGameTags; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetGameTags")] + private static extern void _SetGameTags( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchGameTags ); #endregion internal void SetGameTags( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchGameTags ) @@ -282,9 +248,8 @@ internal void SetGameTags( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTyp } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetGameData( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchGameData ); - private FSetGameData _SetGameData; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetGameData")] + private static extern void _SetGameData( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchGameData ); #endregion internal void SetGameData( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchGameData ) @@ -293,9 +258,8 @@ internal void SetGameData( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTyp } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetRegion( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszRegion ); - private FSetRegion _SetRegion; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetRegion")] + private static extern void _SetRegion( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszRegion ); #endregion internal void SetRegion( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszRegion ) @@ -304,10 +268,9 @@ internal void SetRegion( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeR } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SendUserConnectAndAuthenticate")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSendUserConnectAndAuthenticate( IntPtr self, uint unIPClient, IntPtr pvAuthBlob, uint cubAuthBlobSize, ref SteamId pSteamIDUser ); - private FSendUserConnectAndAuthenticate _SendUserConnectAndAuthenticate; + private static extern bool _SendUserConnectAndAuthenticate( IntPtr self, uint unIPClient, IntPtr pvAuthBlob, uint cubAuthBlobSize, ref SteamId pSteamIDUser ); #endregion internal bool SendUserConnectAndAuthenticate( uint unIPClient, IntPtr pvAuthBlob, uint cubAuthBlobSize, ref SteamId pSteamIDUser ) @@ -317,31 +280,19 @@ internal bool SendUserConnectAndAuthenticate( uint unIPClient, IntPtr pvAuthBlob } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - #if PLATFORM_WIN - private delegate void FCreateUnauthenticatedUserConnection( IntPtr self, ref SteamId retVal ); - #else - private delegate SteamId FCreateUnauthenticatedUserConnection( IntPtr self ); - #endif - private FCreateUnauthenticatedUserConnection _CreateUnauthenticatedUserConnection; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_CreateUnauthenticatedUserConnection")] + private static extern SteamId _CreateUnauthenticatedUserConnection( IntPtr self ); #endregion internal SteamId CreateUnauthenticatedUserConnection() { - #if PLATFORM_WIN - var retVal = default( SteamId ); - _CreateUnauthenticatedUserConnection( Self, ref retVal ); - return retVal; - #else var returnValue = _CreateUnauthenticatedUserConnection( Self ); return returnValue; - #endif } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSendUserDisconnect( IntPtr self, SteamId steamIDUser ); - private FSendUserDisconnect _SendUserDisconnect; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SendUserDisconnect")] + private static extern void _SendUserDisconnect( IntPtr self, SteamId steamIDUser ); #endregion internal void SendUserDisconnect( SteamId steamIDUser ) @@ -350,10 +301,9 @@ internal void SendUserDisconnect( SteamId steamIDUser ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_BUpdateUserData")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBUpdateUserData( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPlayerName, uint uScore ); - private FBUpdateUserData _BUpdateUserData; + private static extern bool _BUpdateUserData( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPlayerName, uint uScore ); #endregion internal bool BUpdateUserData( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPlayerName, uint uScore ) @@ -363,9 +313,8 @@ internal bool BUpdateUserData( SteamId steamIDUser, [MarshalAs( UnmanagedType.Cu } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate HAuthTicket FGetAuthSessionTicket( IntPtr self, IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket ); - private FGetAuthSessionTicket _GetAuthSessionTicket; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_GetAuthSessionTicket")] + private static extern HAuthTicket _GetAuthSessionTicket( IntPtr self, IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket ); #endregion internal HAuthTicket GetAuthSessionTicket( IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket ) @@ -375,9 +324,8 @@ internal HAuthTicket GetAuthSessionTicket( IntPtr pTicket, int cbMaxTicket, ref } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate BeginAuthResult FBeginAuthSession( IntPtr self, IntPtr pAuthTicket, int cbAuthTicket, SteamId steamID ); - private FBeginAuthSession _BeginAuthSession; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_BeginAuthSession")] + private static extern BeginAuthResult _BeginAuthSession( IntPtr self, IntPtr pAuthTicket, int cbAuthTicket, SteamId steamID ); #endregion internal BeginAuthResult BeginAuthSession( IntPtr pAuthTicket, int cbAuthTicket, SteamId steamID ) @@ -387,9 +335,8 @@ internal BeginAuthResult BeginAuthSession( IntPtr pAuthTicket, int cbAuthTicket, } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FEndAuthSession( IntPtr self, SteamId steamID ); - private FEndAuthSession _EndAuthSession; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_EndAuthSession")] + private static extern void _EndAuthSession( IntPtr self, SteamId steamID ); #endregion internal void EndAuthSession( SteamId steamID ) @@ -398,9 +345,8 @@ internal void EndAuthSession( SteamId steamID ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FCancelAuthTicket( IntPtr self, HAuthTicket hAuthTicket ); - private FCancelAuthTicket _CancelAuthTicket; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_CancelAuthTicket")] + private static extern void _CancelAuthTicket( IntPtr self, HAuthTicket hAuthTicket ); #endregion internal void CancelAuthTicket( HAuthTicket hAuthTicket ) @@ -409,9 +355,8 @@ internal void CancelAuthTicket( HAuthTicket hAuthTicket ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate UserHasLicenseForAppResult FUserHasLicenseForApp( IntPtr self, SteamId steamID, AppId appID ); - private FUserHasLicenseForApp _UserHasLicenseForApp; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_UserHasLicenseForApp")] + private static extern UserHasLicenseForAppResult _UserHasLicenseForApp( IntPtr self, SteamId steamID, AppId appID ); #endregion internal UserHasLicenseForAppResult UserHasLicenseForApp( SteamId steamID, AppId appID ) @@ -421,10 +366,9 @@ internal UserHasLicenseForAppResult UserHasLicenseForApp( SteamId steamID, AppId } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_RequestUserGroupStatus")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FRequestUserGroupStatus( IntPtr self, SteamId steamIDUser, SteamId steamIDGroup ); - private FRequestUserGroupStatus _RequestUserGroupStatus; + private static extern bool _RequestUserGroupStatus( IntPtr self, SteamId steamIDUser, SteamId steamIDGroup ); #endregion internal bool RequestUserGroupStatus( SteamId steamIDUser, SteamId steamIDGroup ) @@ -434,9 +378,8 @@ internal bool RequestUserGroupStatus( SteamId steamIDUser, SteamId steamIDGroup } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FGetGameplayStats( IntPtr self ); - private FGetGameplayStats _GetGameplayStats; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_GetGameplayStats")] + private static extern void _GetGameplayStats( IntPtr self ); #endregion internal void GetGameplayStats() @@ -445,21 +388,19 @@ internal void GetGameplayStats() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FGetServerReputation( IntPtr self ); - private FGetServerReputation _GetServerReputation; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_GetServerReputation")] + private static extern SteamAPICall_t _GetServerReputation( IntPtr self ); #endregion - internal async Task GetServerReputation() + internal CallbackResult GetServerReputation() { var returnValue = _GetServerReputation( Self ); - return await GSReputation_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate uint FGetPublicIP( IntPtr self ); - private FGetPublicIP _GetPublicIP; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_GetPublicIP")] + private static extern uint _GetPublicIP( IntPtr self ); #endregion internal uint GetPublicIP() @@ -469,10 +410,9 @@ internal uint GetPublicIP() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_HandleIncomingPacket")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FHandleIncomingPacket( IntPtr self, IntPtr pData, int cbData, uint srcIP, ushort srcPort ); - private FHandleIncomingPacket _HandleIncomingPacket; + private static extern bool _HandleIncomingPacket( IntPtr self, IntPtr pData, int cbData, uint srcIP, ushort srcPort ); #endregion internal bool HandleIncomingPacket( IntPtr pData, int cbData, uint srcIP, ushort srcPort ) @@ -482,9 +422,8 @@ internal bool HandleIncomingPacket( IntPtr pData, int cbData, uint srcIP, ushort } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetNextOutgoingPacket( IntPtr self, IntPtr pOut, int cbMaxOut, ref uint pNetAdr, ref ushort pPort ); - private FGetNextOutgoingPacket _GetNextOutgoingPacket; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_GetNextOutgoingPacket")] + private static extern int _GetNextOutgoingPacket( IntPtr self, IntPtr pOut, int cbMaxOut, ref uint pNetAdr, ref ushort pPort ); #endregion internal int GetNextOutgoingPacket( IntPtr pOut, int cbMaxOut, ref uint pNetAdr, ref ushort pPort ) @@ -494,9 +433,8 @@ internal int GetNextOutgoingPacket( IntPtr pOut, int cbMaxOut, ref uint pNetAdr, } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FEnableHeartbeats( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bActive ); - private FEnableHeartbeats _EnableHeartbeats; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_EnableHeartbeats")] + private static extern void _EnableHeartbeats( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bActive ); #endregion internal void EnableHeartbeats( [MarshalAs( UnmanagedType.U1 )] bool bActive ) @@ -505,9 +443,8 @@ internal void EnableHeartbeats( [MarshalAs( UnmanagedType.U1 )] bool bActive ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetHeartbeatInterval( IntPtr self, int iHeartbeatInterval ); - private FSetHeartbeatInterval _SetHeartbeatInterval; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetHeartbeatInterval")] + private static extern void _SetHeartbeatInterval( IntPtr self, int iHeartbeatInterval ); #endregion internal void SetHeartbeatInterval( int iHeartbeatInterval ) @@ -516,9 +453,8 @@ internal void SetHeartbeatInterval( int iHeartbeatInterval ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FForceHeartbeat( IntPtr self ); - private FForceHeartbeat _ForceHeartbeat; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_ForceHeartbeat")] + private static extern void _ForceHeartbeat( IntPtr self ); #endregion internal void ForceHeartbeat() @@ -527,27 +463,25 @@ internal void ForceHeartbeat() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FAssociateWithClan( IntPtr self, SteamId steamIDClan ); - private FAssociateWithClan _AssociateWithClan; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_AssociateWithClan")] + private static extern SteamAPICall_t _AssociateWithClan( IntPtr self, SteamId steamIDClan ); #endregion - internal async Task AssociateWithClan( SteamId steamIDClan ) + internal CallbackResult AssociateWithClan( SteamId steamIDClan ) { var returnValue = _AssociateWithClan( Self, steamIDClan ); - return await AssociateWithClanResult_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FComputeNewPlayerCompatibility( IntPtr self, SteamId steamIDNewPlayer ); - private FComputeNewPlayerCompatibility _ComputeNewPlayerCompatibility; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_ComputeNewPlayerCompatibility")] + private static extern SteamAPICall_t _ComputeNewPlayerCompatibility( IntPtr self, SteamId steamIDNewPlayer ); #endregion - internal async Task ComputeNewPlayerCompatibility( SteamId steamIDNewPlayer ) + internal CallbackResult ComputeNewPlayerCompatibility( SteamId steamIDNewPlayer ) { var returnValue = _ComputeNewPlayerCompatibility( Self, steamIDNewPlayer ); - return await ComputeNewPlayerCompatibilityResult_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServerStats.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServerStats.cs index 9aea8c5..a070403 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServerStats.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServerStats.cs @@ -9,8 +9,6 @@ namespace Steamworks { internal class ISteamGameServerStats : SteamInterface { - public override string InterfaceName => "SteamGameServerStats001"; - public override void InitInternals() { } @@ -21,48 +19,44 @@ internal override void Shutdown() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FRequestUserStats( IntPtr self, SteamId steamIDUser ); - private FRequestUserStats _RequestUserStats; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_RequestUserStats")] + private static extern SteamAPICall_t _RequestUserStats( IntPtr self, SteamId steamIDUser ); #endregion - internal async Task RequestUserStats( SteamId steamIDUser ) + internal CallbackResult RequestUserStats( SteamId steamIDUser ) { var returnValue = _RequestUserStats( Self, steamIDUser ); - return await GSStatsReceived_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_GetUserStat")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetUserStat1( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ); - private FGetUserStat1 _GetUserStat1; + private static extern bool _GetUserStat( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ); #endregion - internal bool GetUserStat1( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ) + internal bool GetUserStat( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ) { - var returnValue = _GetUserStat1( Self, steamIDUser, pchName, ref pData ); + var returnValue = _GetUserStat( Self, steamIDUser, pchName, ref pData ); return returnValue; } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_GetUserStat0")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetUserStat2( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ); - private FGetUserStat2 _GetUserStat2; + private static extern bool _GetUserStat0( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ); #endregion - internal bool GetUserStat2( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ) + internal bool GetUserStat0( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ) { - var returnValue = _GetUserStat2( Self, steamIDUser, pchName, ref pData ); + var returnValue = _GetUserStat0( Self, steamIDUser, pchName, ref pData ); return returnValue; } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_GetUserAchievement")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetUserAchievement( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ); - private FGetUserAchievement _GetUserAchievement; + private static extern bool _GetUserAchievement( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ); #endregion internal bool GetUserAchievement( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ) @@ -72,36 +66,33 @@ internal bool GetUserAchievement( SteamId steamIDUser, [MarshalAs( UnmanagedType } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_SetUserStat")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetUserStat1( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, int nData ); - private FSetUserStat1 _SetUserStat1; + private static extern bool _SetUserStat( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, int nData ); #endregion - internal bool SetUserStat1( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, int nData ) + internal bool SetUserStat( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, int nData ) { - var returnValue = _SetUserStat1( Self, steamIDUser, pchName, nData ); + var returnValue = _SetUserStat( Self, steamIDUser, pchName, nData ); return returnValue; } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_SetUserStat0")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetUserStat2( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float fData ); - private FSetUserStat2 _SetUserStat2; + private static extern bool _SetUserStat0( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float fData ); #endregion - internal bool SetUserStat2( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float fData ) + internal bool SetUserStat0( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float fData ) { - var returnValue = _SetUserStat2( Self, steamIDUser, pchName, fData ); + var returnValue = _SetUserStat0( Self, steamIDUser, pchName, fData ); return returnValue; } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_UpdateUserAvgRateStat")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FUpdateUserAvgRateStat( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float flCountThisSession, double dSessionLength ); - private FUpdateUserAvgRateStat _UpdateUserAvgRateStat; + private static extern bool _UpdateUserAvgRateStat( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float flCountThisSession, double dSessionLength ); #endregion internal bool UpdateUserAvgRateStat( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float flCountThisSession, double dSessionLength ) @@ -111,10 +102,9 @@ internal bool UpdateUserAvgRateStat( SteamId steamIDUser, [MarshalAs( UnmanagedT } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_SetUserAchievement")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetUserAchievement( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ); - private FSetUserAchievement _SetUserAchievement; + private static extern bool _SetUserAchievement( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ); #endregion internal bool SetUserAchievement( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ) @@ -124,10 +114,9 @@ internal bool SetUserAchievement( SteamId steamIDUser, [MarshalAs( UnmanagedType } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_ClearUserAchievement")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FClearUserAchievement( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ); - private FClearUserAchievement _ClearUserAchievement; + private static extern bool _ClearUserAchievement( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ); #endregion internal bool ClearUserAchievement( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ) @@ -137,15 +126,14 @@ internal bool ClearUserAchievement( SteamId steamIDUser, [MarshalAs( UnmanagedTy } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FStoreUserStats( IntPtr self, SteamId steamIDUser ); - private FStoreUserStats _StoreUserStats; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_StoreUserStats")] + private static extern SteamAPICall_t _StoreUserStats( IntPtr self, SteamId steamIDUser ); #endregion - internal async Task StoreUserStats( SteamId steamIDUser ) + internal CallbackResult StoreUserStats( SteamId steamIDUser ) { var returnValue = _StoreUserStats( Self, steamIDUser ); - return await GSStatsStored_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamInput.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamInput.cs index 336bc3a..2e252d0 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamInput.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamInput.cs @@ -9,8 +9,6 @@ namespace Steamworks { internal class ISteamInput : SteamInterface { - public override string InterfaceName => "SteamInput001"; - public override void InitInternals() { } @@ -21,35 +19,32 @@ internal override void Shutdown() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_Init")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FDoInit( IntPtr self ); - private FDoInit _DoInit; + private static extern bool _Init( IntPtr self ); #endregion - internal bool DoInit() + internal bool Init() { - var returnValue = _DoInit( Self ); + var returnValue = _Init( Self ); return returnValue; } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_Shutdown")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FDoShutdown( IntPtr self ); - private FDoShutdown _DoShutdown; + private static extern bool _Shutdown( IntPtr self ); #endregion - internal bool DoShutdown() + internal bool Shutdown() { - var returnValue = _DoShutdown( Self ); + var returnValue = _Shutdown( Self ); return returnValue; } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FRunFrame( IntPtr self ); - private FRunFrame _RunFrame; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_RunFrame")] + private static extern void _RunFrame( IntPtr self ); #endregion internal void RunFrame() @@ -58,9 +53,8 @@ internal void RunFrame() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetConnectedControllers( IntPtr self, [In,Out] InputHandle_t[] handlesOut ); - private FGetConnectedControllers _GetConnectedControllers; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetConnectedControllers")] + private static extern int _GetConnectedControllers( IntPtr self, [In,Out] InputHandle_t[] handlesOut ); #endregion internal int GetConnectedControllers( [In,Out] InputHandle_t[] handlesOut ) @@ -70,9 +64,8 @@ internal int GetConnectedControllers( [In,Out] InputHandle_t[] handlesOut ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate InputActionSetHandle_t FGetActionSetHandle( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionSetName ); - private FGetActionSetHandle _GetActionSetHandle; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetActionSetHandle")] + private static extern InputActionSetHandle_t _GetActionSetHandle( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionSetName ); #endregion internal InputActionSetHandle_t GetActionSetHandle( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionSetName ) @@ -82,9 +75,8 @@ internal InputActionSetHandle_t GetActionSetHandle( [MarshalAs( UnmanagedType.Cu } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FActivateActionSet( IntPtr self, InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle ); - private FActivateActionSet _ActivateActionSet; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_ActivateActionSet")] + private static extern void _ActivateActionSet( IntPtr self, InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle ); #endregion internal void ActivateActionSet( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle ) @@ -93,9 +85,8 @@ internal void ActivateActionSet( InputHandle_t inputHandle, InputActionSetHandle } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate InputActionSetHandle_t FGetCurrentActionSet( IntPtr self, InputHandle_t inputHandle ); - private FGetCurrentActionSet _GetCurrentActionSet; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetCurrentActionSet")] + private static extern InputActionSetHandle_t _GetCurrentActionSet( IntPtr self, InputHandle_t inputHandle ); #endregion internal InputActionSetHandle_t GetCurrentActionSet( InputHandle_t inputHandle ) @@ -105,9 +96,8 @@ internal InputActionSetHandle_t GetCurrentActionSet( InputHandle_t inputHandle ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FActivateActionSetLayer( IntPtr self, InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ); - private FActivateActionSetLayer _ActivateActionSetLayer; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_ActivateActionSetLayer")] + private static extern void _ActivateActionSetLayer( IntPtr self, InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ); #endregion internal void ActivateActionSetLayer( InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ) @@ -116,9 +106,8 @@ internal void ActivateActionSetLayer( InputHandle_t inputHandle, InputActionSetH } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FDeactivateActionSetLayer( IntPtr self, InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ); - private FDeactivateActionSetLayer _DeactivateActionSetLayer; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_DeactivateActionSetLayer")] + private static extern void _DeactivateActionSetLayer( IntPtr self, InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ); #endregion internal void DeactivateActionSetLayer( InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ) @@ -127,9 +116,8 @@ internal void DeactivateActionSetLayer( InputHandle_t inputHandle, InputActionSe } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FDeactivateAllActionSetLayers( IntPtr self, InputHandle_t inputHandle ); - private FDeactivateAllActionSetLayers _DeactivateAllActionSetLayers; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_DeactivateAllActionSetLayers")] + private static extern void _DeactivateAllActionSetLayers( IntPtr self, InputHandle_t inputHandle ); #endregion internal void DeactivateAllActionSetLayers( InputHandle_t inputHandle ) @@ -138,9 +126,8 @@ internal void DeactivateAllActionSetLayers( InputHandle_t inputHandle ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetActiveActionSetLayers( IntPtr self, InputHandle_t inputHandle, [In,Out] InputActionSetHandle_t[] handlesOut ); - private FGetActiveActionSetLayers _GetActiveActionSetLayers; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetActiveActionSetLayers")] + private static extern int _GetActiveActionSetLayers( IntPtr self, InputHandle_t inputHandle, [In,Out] InputActionSetHandle_t[] handlesOut ); #endregion internal int GetActiveActionSetLayers( InputHandle_t inputHandle, [In,Out] InputActionSetHandle_t[] handlesOut ) @@ -150,9 +137,8 @@ internal int GetActiveActionSetLayers( InputHandle_t inputHandle, [In,Out] Input } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate InputDigitalActionHandle_t FGetDigitalActionHandle( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionName ); - private FGetDigitalActionHandle _GetDigitalActionHandle; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetDigitalActionHandle")] + private static extern InputDigitalActionHandle_t _GetDigitalActionHandle( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionName ); #endregion internal InputDigitalActionHandle_t GetDigitalActionHandle( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionName ) @@ -162,31 +148,19 @@ internal InputDigitalActionHandle_t GetDigitalActionHandle( [MarshalAs( Unmanage } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - #if PLATFORM_WIN - private delegate void FGetDigitalActionData( IntPtr self, ref DigitalState retVal, InputHandle_t inputHandle, InputDigitalActionHandle_t digitalActionHandle ); - #else - private delegate DigitalState FGetDigitalActionData( IntPtr self, InputHandle_t inputHandle, InputDigitalActionHandle_t digitalActionHandle ); - #endif - private FGetDigitalActionData _GetDigitalActionData; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetDigitalActionData")] + private static extern DigitalState _GetDigitalActionData( IntPtr self, InputHandle_t inputHandle, InputDigitalActionHandle_t digitalActionHandle ); #endregion internal DigitalState GetDigitalActionData( InputHandle_t inputHandle, InputDigitalActionHandle_t digitalActionHandle ) { - #if PLATFORM_WIN - var retVal = default( DigitalState ); - _GetDigitalActionData( Self, ref retVal, inputHandle, digitalActionHandle ); - return retVal; - #else var returnValue = _GetDigitalActionData( Self, inputHandle, digitalActionHandle ); return returnValue; - #endif } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetDigitalActionOrigins( IntPtr self, InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputDigitalActionHandle_t digitalActionHandle, ref InputActionOrigin originsOut ); - private FGetDigitalActionOrigins _GetDigitalActionOrigins; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetDigitalActionOrigins")] + private static extern int _GetDigitalActionOrigins( IntPtr self, InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputDigitalActionHandle_t digitalActionHandle, ref InputActionOrigin originsOut ); #endregion internal int GetDigitalActionOrigins( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputDigitalActionHandle_t digitalActionHandle, ref InputActionOrigin originsOut ) @@ -196,9 +170,8 @@ internal int GetDigitalActionOrigins( InputHandle_t inputHandle, InputActionSetH } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate InputAnalogActionHandle_t FGetAnalogActionHandle( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionName ); - private FGetAnalogActionHandle _GetAnalogActionHandle; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetAnalogActionHandle")] + private static extern InputAnalogActionHandle_t _GetAnalogActionHandle( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionName ); #endregion internal InputAnalogActionHandle_t GetAnalogActionHandle( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionName ) @@ -208,31 +181,19 @@ internal InputAnalogActionHandle_t GetAnalogActionHandle( [MarshalAs( UnmanagedT } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - #if PLATFORM_WIN - private delegate void FGetAnalogActionData( IntPtr self, ref AnalogState retVal, InputHandle_t inputHandle, InputAnalogActionHandle_t analogActionHandle ); - #else - private delegate AnalogState FGetAnalogActionData( IntPtr self, InputHandle_t inputHandle, InputAnalogActionHandle_t analogActionHandle ); - #endif - private FGetAnalogActionData _GetAnalogActionData; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetAnalogActionData")] + private static extern AnalogState _GetAnalogActionData( IntPtr self, InputHandle_t inputHandle, InputAnalogActionHandle_t analogActionHandle ); #endregion internal AnalogState GetAnalogActionData( InputHandle_t inputHandle, InputAnalogActionHandle_t analogActionHandle ) { - #if PLATFORM_WIN - var retVal = default( AnalogState ); - _GetAnalogActionData( Self, ref retVal, inputHandle, analogActionHandle ); - return retVal; - #else var returnValue = _GetAnalogActionData( Self, inputHandle, analogActionHandle ); return returnValue; - #endif } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetAnalogActionOrigins( IntPtr self, InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputAnalogActionHandle_t analogActionHandle, ref InputActionOrigin originsOut ); - private FGetAnalogActionOrigins _GetAnalogActionOrigins; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetAnalogActionOrigins")] + private static extern int _GetAnalogActionOrigins( IntPtr self, InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputAnalogActionHandle_t analogActionHandle, ref InputActionOrigin originsOut ); #endregion internal int GetAnalogActionOrigins( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputAnalogActionHandle_t analogActionHandle, ref InputActionOrigin originsOut ) @@ -242,9 +203,8 @@ internal int GetAnalogActionOrigins( InputHandle_t inputHandle, InputActionSetHa } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Utf8StringPointer FGetGlyphForActionOrigin( IntPtr self, InputActionOrigin eOrigin ); - private FGetGlyphForActionOrigin _GetGlyphForActionOrigin; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetGlyphForActionOrigin")] + private static extern Utf8StringPointer _GetGlyphForActionOrigin( IntPtr self, InputActionOrigin eOrigin ); #endregion internal string GetGlyphForActionOrigin( InputActionOrigin eOrigin ) @@ -254,9 +214,8 @@ internal string GetGlyphForActionOrigin( InputActionOrigin eOrigin ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Utf8StringPointer FGetStringForActionOrigin( IntPtr self, InputActionOrigin eOrigin ); - private FGetStringForActionOrigin _GetStringForActionOrigin; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetStringForActionOrigin")] + private static extern Utf8StringPointer _GetStringForActionOrigin( IntPtr self, InputActionOrigin eOrigin ); #endregion internal string GetStringForActionOrigin( InputActionOrigin eOrigin ) @@ -266,9 +225,8 @@ internal string GetStringForActionOrigin( InputActionOrigin eOrigin ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FStopAnalogActionMomentum( IntPtr self, InputHandle_t inputHandle, InputAnalogActionHandle_t eAction ); - private FStopAnalogActionMomentum _StopAnalogActionMomentum; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_StopAnalogActionMomentum")] + private static extern void _StopAnalogActionMomentum( IntPtr self, InputHandle_t inputHandle, InputAnalogActionHandle_t eAction ); #endregion internal void StopAnalogActionMomentum( InputHandle_t inputHandle, InputAnalogActionHandle_t eAction ) @@ -277,31 +235,19 @@ internal void StopAnalogActionMomentum( InputHandle_t inputHandle, InputAnalogAc } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - #if PLATFORM_WIN - private delegate void FGetMotionData( IntPtr self, ref MotionState retVal, InputHandle_t inputHandle ); - #else - private delegate MotionState FGetMotionData( IntPtr self, InputHandle_t inputHandle ); - #endif - private FGetMotionData _GetMotionData; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetMotionData")] + private static extern MotionState _GetMotionData( IntPtr self, InputHandle_t inputHandle ); #endregion internal MotionState GetMotionData( InputHandle_t inputHandle ) { - #if PLATFORM_WIN - var retVal = default( MotionState ); - _GetMotionData( Self, ref retVal, inputHandle ); - return retVal; - #else var returnValue = _GetMotionData( Self, inputHandle ); return returnValue; - #endif } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FTriggerVibration( IntPtr self, InputHandle_t inputHandle, ushort usLeftSpeed, ushort usRightSpeed ); - private FTriggerVibration _TriggerVibration; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_TriggerVibration")] + private static extern void _TriggerVibration( IntPtr self, InputHandle_t inputHandle, ushort usLeftSpeed, ushort usRightSpeed ); #endregion internal void TriggerVibration( InputHandle_t inputHandle, ushort usLeftSpeed, ushort usRightSpeed ) @@ -310,9 +256,8 @@ internal void TriggerVibration( InputHandle_t inputHandle, ushort usLeftSpeed, u } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetLEDColor( IntPtr self, InputHandle_t inputHandle, byte nColorR, byte nColorG, byte nColorB, uint nFlags ); - private FSetLEDColor _SetLEDColor; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_SetLEDColor")] + private static extern void _SetLEDColor( IntPtr self, InputHandle_t inputHandle, byte nColorR, byte nColorG, byte nColorB, uint nFlags ); #endregion internal void SetLEDColor( InputHandle_t inputHandle, byte nColorR, byte nColorG, byte nColorB, uint nFlags ) @@ -321,9 +266,8 @@ internal void SetLEDColor( InputHandle_t inputHandle, byte nColorR, byte nColorG } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FTriggerHapticPulse( IntPtr self, InputHandle_t inputHandle, SteamControllerPad eTargetPad, ushort usDurationMicroSec ); - private FTriggerHapticPulse _TriggerHapticPulse; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_TriggerHapticPulse")] + private static extern void _TriggerHapticPulse( IntPtr self, InputHandle_t inputHandle, SteamControllerPad eTargetPad, ushort usDurationMicroSec ); #endregion internal void TriggerHapticPulse( InputHandle_t inputHandle, SteamControllerPad eTargetPad, ushort usDurationMicroSec ) @@ -332,9 +276,8 @@ internal void TriggerHapticPulse( InputHandle_t inputHandle, SteamControllerPad } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FTriggerRepeatedHapticPulse( IntPtr self, InputHandle_t inputHandle, SteamControllerPad eTargetPad, ushort usDurationMicroSec, ushort usOffMicroSec, ushort unRepeat, uint nFlags ); - private FTriggerRepeatedHapticPulse _TriggerRepeatedHapticPulse; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_TriggerRepeatedHapticPulse")] + private static extern void _TriggerRepeatedHapticPulse( IntPtr self, InputHandle_t inputHandle, SteamControllerPad eTargetPad, ushort usDurationMicroSec, ushort usOffMicroSec, ushort unRepeat, uint nFlags ); #endregion internal void TriggerRepeatedHapticPulse( InputHandle_t inputHandle, SteamControllerPad eTargetPad, ushort usDurationMicroSec, ushort usOffMicroSec, ushort unRepeat, uint nFlags ) @@ -343,10 +286,9 @@ internal void TriggerRepeatedHapticPulse( InputHandle_t inputHandle, SteamContro } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_ShowBindingPanel")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FShowBindingPanel( IntPtr self, InputHandle_t inputHandle ); - private FShowBindingPanel _ShowBindingPanel; + private static extern bool _ShowBindingPanel( IntPtr self, InputHandle_t inputHandle ); #endregion internal bool ShowBindingPanel( InputHandle_t inputHandle ) @@ -356,9 +298,8 @@ internal bool ShowBindingPanel( InputHandle_t inputHandle ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate InputType FGetInputTypeForHandle( IntPtr self, InputHandle_t inputHandle ); - private FGetInputTypeForHandle _GetInputTypeForHandle; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetInputTypeForHandle")] + private static extern InputType _GetInputTypeForHandle( IntPtr self, InputHandle_t inputHandle ); #endregion internal InputType GetInputTypeForHandle( InputHandle_t inputHandle ) @@ -368,9 +309,8 @@ internal InputType GetInputTypeForHandle( InputHandle_t inputHandle ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate InputHandle_t FGetControllerForGamepadIndex( IntPtr self, int nIndex ); - private FGetControllerForGamepadIndex _GetControllerForGamepadIndex; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetControllerForGamepadIndex")] + private static extern InputHandle_t _GetControllerForGamepadIndex( IntPtr self, int nIndex ); #endregion internal InputHandle_t GetControllerForGamepadIndex( int nIndex ) @@ -380,9 +320,8 @@ internal InputHandle_t GetControllerForGamepadIndex( int nIndex ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetGamepadIndexForController( IntPtr self, InputHandle_t ulinputHandle ); - private FGetGamepadIndexForController _GetGamepadIndexForController; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetGamepadIndexForController")] + private static extern int _GetGamepadIndexForController( IntPtr self, InputHandle_t ulinputHandle ); #endregion internal int GetGamepadIndexForController( InputHandle_t ulinputHandle ) @@ -392,9 +331,8 @@ internal int GetGamepadIndexForController( InputHandle_t ulinputHandle ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Utf8StringPointer FGetStringForXboxOrigin( IntPtr self, XboxOrigin eOrigin ); - private FGetStringForXboxOrigin _GetStringForXboxOrigin; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetStringForXboxOrigin")] + private static extern Utf8StringPointer _GetStringForXboxOrigin( IntPtr self, XboxOrigin eOrigin ); #endregion internal string GetStringForXboxOrigin( XboxOrigin eOrigin ) @@ -404,9 +342,8 @@ internal string GetStringForXboxOrigin( XboxOrigin eOrigin ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Utf8StringPointer FGetGlyphForXboxOrigin( IntPtr self, XboxOrigin eOrigin ); - private FGetGlyphForXboxOrigin _GetGlyphForXboxOrigin; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetGlyphForXboxOrigin")] + private static extern Utf8StringPointer _GetGlyphForXboxOrigin( IntPtr self, XboxOrigin eOrigin ); #endregion internal string GetGlyphForXboxOrigin( XboxOrigin eOrigin ) @@ -416,9 +353,8 @@ internal string GetGlyphForXboxOrigin( XboxOrigin eOrigin ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate InputActionOrigin FGetActionOriginFromXboxOrigin( IntPtr self, InputHandle_t inputHandle, XboxOrigin eOrigin ); - private FGetActionOriginFromXboxOrigin _GetActionOriginFromXboxOrigin; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetActionOriginFromXboxOrigin")] + private static extern InputActionOrigin _GetActionOriginFromXboxOrigin( IntPtr self, InputHandle_t inputHandle, XboxOrigin eOrigin ); #endregion internal InputActionOrigin GetActionOriginFromXboxOrigin( InputHandle_t inputHandle, XboxOrigin eOrigin ) @@ -428,9 +364,8 @@ internal InputActionOrigin GetActionOriginFromXboxOrigin( InputHandle_t inputHan } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate InputActionOrigin FTranslateActionOrigin( IntPtr self, InputType eDestinationInputType, InputActionOrigin eSourceOrigin ); - private FTranslateActionOrigin _TranslateActionOrigin; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_TranslateActionOrigin")] + private static extern InputActionOrigin _TranslateActionOrigin( IntPtr self, InputType eDestinationInputType, InputActionOrigin eSourceOrigin ); #endregion internal InputActionOrigin TranslateActionOrigin( InputType eDestinationInputType, InputActionOrigin eSourceOrigin ) diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamInventory.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamInventory.cs index 696c66c..79cf2f0 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamInventory.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamInventory.cs @@ -9,8 +9,6 @@ namespace Steamworks { internal class ISteamInventory : SteamInterface { - public override string InterfaceName => "STEAMINVENTORY_INTERFACE_V003"; - public override void InitInternals() { } @@ -21,9 +19,8 @@ internal override void Shutdown() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Result FGetResultStatus( IntPtr self, SteamInventoryResult_t resultHandle ); - private FGetResultStatus _GetResultStatus; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetResultStatus")] + private static extern Result _GetResultStatus( IntPtr self, SteamInventoryResult_t resultHandle ); #endregion internal Result GetResultStatus( SteamInventoryResult_t resultHandle ) @@ -33,10 +30,9 @@ internal Result GetResultStatus( SteamInventoryResult_t resultHandle ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetResultItems")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetResultItems( IntPtr self, SteamInventoryResult_t resultHandle, [In,Out] SteamItemDetails_t[] pOutItemsArray, ref uint punOutItemsArraySize ); - private FGetResultItems _GetResultItems; + private static extern bool _GetResultItems( IntPtr self, SteamInventoryResult_t resultHandle, [In,Out] SteamItemDetails_t[] pOutItemsArray, ref uint punOutItemsArraySize ); #endregion internal bool GetResultItems( SteamInventoryResult_t resultHandle, [In,Out] SteamItemDetails_t[] pOutItemsArray, ref uint punOutItemsArraySize ) @@ -46,10 +42,9 @@ internal bool GetResultItems( SteamInventoryResult_t resultHandle, [In,Out] Stea } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetResultItemProperty")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetResultItemProperty( IntPtr self, SteamInventoryResult_t resultHandle, uint unItemIndex, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, IntPtr pchValueBuffer, ref uint punValueBufferSizeOut ); - private FGetResultItemProperty _GetResultItemProperty; + private static extern bool _GetResultItemProperty( IntPtr self, SteamInventoryResult_t resultHandle, uint unItemIndex, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, IntPtr pchValueBuffer, ref uint punValueBufferSizeOut ); #endregion internal bool GetResultItemProperty( SteamInventoryResult_t resultHandle, uint unItemIndex, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, out string pchValueBuffer, ref uint punValueBufferSizeOut ) @@ -61,9 +56,8 @@ internal bool GetResultItemProperty( SteamInventoryResult_t resultHandle, uint u } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate uint FGetResultTimestamp( IntPtr self, SteamInventoryResult_t resultHandle ); - private FGetResultTimestamp _GetResultTimestamp; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetResultTimestamp")] + private static extern uint _GetResultTimestamp( IntPtr self, SteamInventoryResult_t resultHandle ); #endregion internal uint GetResultTimestamp( SteamInventoryResult_t resultHandle ) @@ -73,10 +67,9 @@ internal uint GetResultTimestamp( SteamInventoryResult_t resultHandle ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_CheckResultSteamID")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FCheckResultSteamID( IntPtr self, SteamInventoryResult_t resultHandle, SteamId steamIDExpected ); - private FCheckResultSteamID _CheckResultSteamID; + private static extern bool _CheckResultSteamID( IntPtr self, SteamInventoryResult_t resultHandle, SteamId steamIDExpected ); #endregion internal bool CheckResultSteamID( SteamInventoryResult_t resultHandle, SteamId steamIDExpected ) @@ -86,9 +79,8 @@ internal bool CheckResultSteamID( SteamInventoryResult_t resultHandle, SteamId s } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FDestroyResult( IntPtr self, SteamInventoryResult_t resultHandle ); - private FDestroyResult _DestroyResult; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_DestroyResult")] + private static extern void _DestroyResult( IntPtr self, SteamInventoryResult_t resultHandle ); #endregion internal void DestroyResult( SteamInventoryResult_t resultHandle ) @@ -97,10 +89,9 @@ internal void DestroyResult( SteamInventoryResult_t resultHandle ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetAllItems")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetAllItems( IntPtr self, ref SteamInventoryResult_t pResultHandle ); - private FGetAllItems _GetAllItems; + private static extern bool _GetAllItems( IntPtr self, ref SteamInventoryResult_t pResultHandle ); #endregion internal bool GetAllItems( ref SteamInventoryResult_t pResultHandle ) @@ -110,10 +101,9 @@ internal bool GetAllItems( ref SteamInventoryResult_t pResultHandle ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetItemsByID")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetItemsByID( IntPtr self, ref SteamInventoryResult_t pResultHandle, ref InventoryItemId pInstanceIDs, uint unCountInstanceIDs ); - private FGetItemsByID _GetItemsByID; + private static extern bool _GetItemsByID( IntPtr self, ref SteamInventoryResult_t pResultHandle, ref InventoryItemId pInstanceIDs, uint unCountInstanceIDs ); #endregion internal bool GetItemsByID( ref SteamInventoryResult_t pResultHandle, ref InventoryItemId pInstanceIDs, uint unCountInstanceIDs ) @@ -123,10 +113,9 @@ internal bool GetItemsByID( ref SteamInventoryResult_t pResultHandle, ref Invent } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_SerializeResult")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSerializeResult( IntPtr self, SteamInventoryResult_t resultHandle, IntPtr pOutBuffer, ref uint punOutBufferSize ); - private FSerializeResult _SerializeResult; + private static extern bool _SerializeResult( IntPtr self, SteamInventoryResult_t resultHandle, IntPtr pOutBuffer, ref uint punOutBufferSize ); #endregion internal bool SerializeResult( SteamInventoryResult_t resultHandle, IntPtr pOutBuffer, ref uint punOutBufferSize ) @@ -136,10 +125,9 @@ internal bool SerializeResult( SteamInventoryResult_t resultHandle, IntPtr pOutB } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_DeserializeResult")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FDeserializeResult( IntPtr self, ref SteamInventoryResult_t pOutResultHandle, IntPtr pBuffer, uint unBufferSize, [MarshalAs( UnmanagedType.U1 )] bool bRESERVED_MUST_BE_FALSE ); - private FDeserializeResult _DeserializeResult; + private static extern bool _DeserializeResult( IntPtr self, ref SteamInventoryResult_t pOutResultHandle, IntPtr pBuffer, uint unBufferSize, [MarshalAs( UnmanagedType.U1 )] bool bRESERVED_MUST_BE_FALSE ); #endregion internal bool DeserializeResult( ref SteamInventoryResult_t pOutResultHandle, IntPtr pBuffer, uint unBufferSize, [MarshalAs( UnmanagedType.U1 )] bool bRESERVED_MUST_BE_FALSE ) @@ -149,10 +137,9 @@ internal bool DeserializeResult( ref SteamInventoryResult_t pOutResultHandle, In } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GenerateItems")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGenerateItems( IntPtr self, ref SteamInventoryResult_t pResultHandle, [In,Out] InventoryDefId[] pArrayItemDefs, [In,Out] uint[] punArrayQuantity, uint unArrayLength ); - private FGenerateItems _GenerateItems; + private static extern bool _GenerateItems( IntPtr self, ref SteamInventoryResult_t pResultHandle, [In,Out] InventoryDefId[] pArrayItemDefs, [In,Out] uint[] punArrayQuantity, uint unArrayLength ); #endregion internal bool GenerateItems( ref SteamInventoryResult_t pResultHandle, [In,Out] InventoryDefId[] pArrayItemDefs, [In,Out] uint[] punArrayQuantity, uint unArrayLength ) @@ -162,10 +149,9 @@ internal bool GenerateItems( ref SteamInventoryResult_t pResultHandle, [In,Out] } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GrantPromoItems")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGrantPromoItems( IntPtr self, ref SteamInventoryResult_t pResultHandle ); - private FGrantPromoItems _GrantPromoItems; + private static extern bool _GrantPromoItems( IntPtr self, ref SteamInventoryResult_t pResultHandle ); #endregion internal bool GrantPromoItems( ref SteamInventoryResult_t pResultHandle ) @@ -175,10 +161,9 @@ internal bool GrantPromoItems( ref SteamInventoryResult_t pResultHandle ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_AddPromoItem")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FAddPromoItem( IntPtr self, ref SteamInventoryResult_t pResultHandle, InventoryDefId itemDef ); - private FAddPromoItem _AddPromoItem; + private static extern bool _AddPromoItem( IntPtr self, ref SteamInventoryResult_t pResultHandle, InventoryDefId itemDef ); #endregion internal bool AddPromoItem( ref SteamInventoryResult_t pResultHandle, InventoryDefId itemDef ) @@ -188,10 +173,9 @@ internal bool AddPromoItem( ref SteamInventoryResult_t pResultHandle, InventoryD } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_AddPromoItems")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FAddPromoItems( IntPtr self, ref SteamInventoryResult_t pResultHandle, [In,Out] InventoryDefId[] pArrayItemDefs, uint unArrayLength ); - private FAddPromoItems _AddPromoItems; + private static extern bool _AddPromoItems( IntPtr self, ref SteamInventoryResult_t pResultHandle, [In,Out] InventoryDefId[] pArrayItemDefs, uint unArrayLength ); #endregion internal bool AddPromoItems( ref SteamInventoryResult_t pResultHandle, [In,Out] InventoryDefId[] pArrayItemDefs, uint unArrayLength ) @@ -201,10 +185,9 @@ internal bool AddPromoItems( ref SteamInventoryResult_t pResultHandle, [In,Out] } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_ConsumeItem")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FConsumeItem( IntPtr self, ref SteamInventoryResult_t pResultHandle, InventoryItemId itemConsume, uint unQuantity ); - private FConsumeItem _ConsumeItem; + private static extern bool _ConsumeItem( IntPtr self, ref SteamInventoryResult_t pResultHandle, InventoryItemId itemConsume, uint unQuantity ); #endregion internal bool ConsumeItem( ref SteamInventoryResult_t pResultHandle, InventoryItemId itemConsume, uint unQuantity ) @@ -214,10 +197,9 @@ internal bool ConsumeItem( ref SteamInventoryResult_t pResultHandle, InventoryIt } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_ExchangeItems")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FExchangeItems( IntPtr self, ref SteamInventoryResult_t pResultHandle, [In,Out] InventoryDefId[] pArrayGenerate, [In,Out] uint[] punArrayGenerateQuantity, uint unArrayGenerateLength, [In,Out] InventoryItemId[] pArrayDestroy, [In,Out] uint[] punArrayDestroyQuantity, uint unArrayDestroyLength ); - private FExchangeItems _ExchangeItems; + private static extern bool _ExchangeItems( IntPtr self, ref SteamInventoryResult_t pResultHandle, [In,Out] InventoryDefId[] pArrayGenerate, [In,Out] uint[] punArrayGenerateQuantity, uint unArrayGenerateLength, [In,Out] InventoryItemId[] pArrayDestroy, [In,Out] uint[] punArrayDestroyQuantity, uint unArrayDestroyLength ); #endregion internal bool ExchangeItems( ref SteamInventoryResult_t pResultHandle, [In,Out] InventoryDefId[] pArrayGenerate, [In,Out] uint[] punArrayGenerateQuantity, uint unArrayGenerateLength, [In,Out] InventoryItemId[] pArrayDestroy, [In,Out] uint[] punArrayDestroyQuantity, uint unArrayDestroyLength ) @@ -227,10 +209,9 @@ internal bool ExchangeItems( ref SteamInventoryResult_t pResultHandle, [In,Out] } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_TransferItemQuantity")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FTransferItemQuantity( IntPtr self, ref SteamInventoryResult_t pResultHandle, InventoryItemId itemIdSource, uint unQuantity, InventoryItemId itemIdDest ); - private FTransferItemQuantity _TransferItemQuantity; + private static extern bool _TransferItemQuantity( IntPtr self, ref SteamInventoryResult_t pResultHandle, InventoryItemId itemIdSource, uint unQuantity, InventoryItemId itemIdDest ); #endregion internal bool TransferItemQuantity( ref SteamInventoryResult_t pResultHandle, InventoryItemId itemIdSource, uint unQuantity, InventoryItemId itemIdDest ) @@ -240,9 +221,8 @@ internal bool TransferItemQuantity( ref SteamInventoryResult_t pResultHandle, In } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSendItemDropHeartbeat( IntPtr self ); - private FSendItemDropHeartbeat _SendItemDropHeartbeat; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_SendItemDropHeartbeat")] + private static extern void _SendItemDropHeartbeat( IntPtr self ); #endregion internal void SendItemDropHeartbeat() @@ -251,10 +231,9 @@ internal void SendItemDropHeartbeat() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_TriggerItemDrop")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FTriggerItemDrop( IntPtr self, ref SteamInventoryResult_t pResultHandle, InventoryDefId dropListDefinition ); - private FTriggerItemDrop _TriggerItemDrop; + private static extern bool _TriggerItemDrop( IntPtr self, ref SteamInventoryResult_t pResultHandle, InventoryDefId dropListDefinition ); #endregion internal bool TriggerItemDrop( ref SteamInventoryResult_t pResultHandle, InventoryDefId dropListDefinition ) @@ -264,10 +243,9 @@ internal bool TriggerItemDrop( ref SteamInventoryResult_t pResultHandle, Invento } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_TradeItems")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FTradeItems( IntPtr self, ref SteamInventoryResult_t pResultHandle, SteamId steamIDTradePartner, [In,Out] InventoryItemId[] pArrayGive, [In,Out] uint[] pArrayGiveQuantity, uint nArrayGiveLength, [In,Out] InventoryItemId[] pArrayGet, [In,Out] uint[] pArrayGetQuantity, uint nArrayGetLength ); - private FTradeItems _TradeItems; + private static extern bool _TradeItems( IntPtr self, ref SteamInventoryResult_t pResultHandle, SteamId steamIDTradePartner, [In,Out] InventoryItemId[] pArrayGive, [In,Out] uint[] pArrayGiveQuantity, uint nArrayGiveLength, [In,Out] InventoryItemId[] pArrayGet, [In,Out] uint[] pArrayGetQuantity, uint nArrayGetLength ); #endregion internal bool TradeItems( ref SteamInventoryResult_t pResultHandle, SteamId steamIDTradePartner, [In,Out] InventoryItemId[] pArrayGive, [In,Out] uint[] pArrayGiveQuantity, uint nArrayGiveLength, [In,Out] InventoryItemId[] pArrayGet, [In,Out] uint[] pArrayGetQuantity, uint nArrayGetLength ) @@ -277,10 +255,9 @@ internal bool TradeItems( ref SteamInventoryResult_t pResultHandle, SteamId stea } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_LoadItemDefinitions")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FLoadItemDefinitions( IntPtr self ); - private FLoadItemDefinitions _LoadItemDefinitions; + private static extern bool _LoadItemDefinitions( IntPtr self ); #endregion internal bool LoadItemDefinitions() @@ -290,10 +267,9 @@ internal bool LoadItemDefinitions() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetItemDefinitionIDs")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetItemDefinitionIDs( IntPtr self, [In,Out] InventoryDefId[] pItemDefIDs, ref uint punItemDefIDsArraySize ); - private FGetItemDefinitionIDs _GetItemDefinitionIDs; + private static extern bool _GetItemDefinitionIDs( IntPtr self, [In,Out] InventoryDefId[] pItemDefIDs, ref uint punItemDefIDsArraySize ); #endregion internal bool GetItemDefinitionIDs( [In,Out] InventoryDefId[] pItemDefIDs, ref uint punItemDefIDsArraySize ) @@ -303,10 +279,9 @@ internal bool GetItemDefinitionIDs( [In,Out] InventoryDefId[] pItemDefIDs, ref } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetItemDefinitionProperty")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetItemDefinitionProperty( IntPtr self, InventoryDefId iDefinition, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, IntPtr pchValueBuffer, ref uint punValueBufferSizeOut ); - private FGetItemDefinitionProperty _GetItemDefinitionProperty; + private static extern bool _GetItemDefinitionProperty( IntPtr self, InventoryDefId iDefinition, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, IntPtr pchValueBuffer, ref uint punValueBufferSizeOut ); #endregion internal bool GetItemDefinitionProperty( InventoryDefId iDefinition, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, out string pchValueBuffer, ref uint punValueBufferSizeOut ) @@ -318,22 +293,20 @@ internal bool GetItemDefinitionProperty( InventoryDefId iDefinition, [MarshalAs( } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FRequestEligiblePromoItemDefinitionsIDs( IntPtr self, SteamId steamID ); - private FRequestEligiblePromoItemDefinitionsIDs _RequestEligiblePromoItemDefinitionsIDs; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_RequestEligiblePromoItemDefinitionsIDs")] + private static extern SteamAPICall_t _RequestEligiblePromoItemDefinitionsIDs( IntPtr self, SteamId steamID ); #endregion - internal async Task RequestEligiblePromoItemDefinitionsIDs( SteamId steamID ) + internal CallbackResult RequestEligiblePromoItemDefinitionsIDs( SteamId steamID ) { var returnValue = _RequestEligiblePromoItemDefinitionsIDs( Self, steamID ); - return await SteamInventoryEligiblePromoItemDefIDs_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetEligiblePromoItemDefinitionIDs")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetEligiblePromoItemDefinitionIDs( IntPtr self, SteamId steamID, [In,Out] InventoryDefId[] pItemDefIDs, ref uint punItemDefIDsArraySize ); - private FGetEligiblePromoItemDefinitionIDs _GetEligiblePromoItemDefinitionIDs; + private static extern bool _GetEligiblePromoItemDefinitionIDs( IntPtr self, SteamId steamID, [In,Out] InventoryDefId[] pItemDefIDs, ref uint punItemDefIDsArraySize ); #endregion internal bool GetEligiblePromoItemDefinitionIDs( SteamId steamID, [In,Out] InventoryDefId[] pItemDefIDs, ref uint punItemDefIDsArraySize ) @@ -343,33 +316,30 @@ internal bool GetEligiblePromoItemDefinitionIDs( SteamId steamID, [In,Out] Inven } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FStartPurchase( IntPtr self, [In,Out] InventoryDefId[] pArrayItemDefs, [In,Out] uint[] punArrayQuantity, uint unArrayLength ); - private FStartPurchase _StartPurchase; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_StartPurchase")] + private static extern SteamAPICall_t _StartPurchase( IntPtr self, [In,Out] InventoryDefId[] pArrayItemDefs, [In,Out] uint[] punArrayQuantity, uint unArrayLength ); #endregion - internal async Task StartPurchase( [In,Out] InventoryDefId[] pArrayItemDefs, [In,Out] uint[] punArrayQuantity, uint unArrayLength ) + internal CallbackResult StartPurchase( [In,Out] InventoryDefId[] pArrayItemDefs, [In,Out] uint[] punArrayQuantity, uint unArrayLength ) { var returnValue = _StartPurchase( Self, pArrayItemDefs, punArrayQuantity, unArrayLength ); - return await SteamInventoryStartPurchaseResult_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FRequestPrices( IntPtr self ); - private FRequestPrices _RequestPrices; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_RequestPrices")] + private static extern SteamAPICall_t _RequestPrices( IntPtr self ); #endregion - internal async Task RequestPrices() + internal CallbackResult RequestPrices() { var returnValue = _RequestPrices( Self ); - return await SteamInventoryRequestPricesResult_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate uint FGetNumItemsWithPrices( IntPtr self ); - private FGetNumItemsWithPrices _GetNumItemsWithPrices; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetNumItemsWithPrices")] + private static extern uint _GetNumItemsWithPrices( IntPtr self ); #endregion internal uint GetNumItemsWithPrices() @@ -379,10 +349,9 @@ internal uint GetNumItemsWithPrices() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetItemsWithPrices")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetItemsWithPrices( IntPtr self, [In,Out] InventoryDefId[] pArrayItemDefs, [In,Out] ulong[] pCurrentPrices, [In,Out] ulong[] pBasePrices, uint unArrayLength ); - private FGetItemsWithPrices _GetItemsWithPrices; + private static extern bool _GetItemsWithPrices( IntPtr self, [In,Out] InventoryDefId[] pArrayItemDefs, [In,Out] ulong[] pCurrentPrices, [In,Out] ulong[] pBasePrices, uint unArrayLength ); #endregion internal bool GetItemsWithPrices( [In,Out] InventoryDefId[] pArrayItemDefs, [In,Out] ulong[] pCurrentPrices, [In,Out] ulong[] pBasePrices, uint unArrayLength ) @@ -392,10 +361,9 @@ internal bool GetItemsWithPrices( [In,Out] InventoryDefId[] pArrayItemDefs, [In } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetItemPrice")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetItemPrice( IntPtr self, InventoryDefId iDefinition, ref ulong pCurrentPrice, ref ulong pBasePrice ); - private FGetItemPrice _GetItemPrice; + private static extern bool _GetItemPrice( IntPtr self, InventoryDefId iDefinition, ref ulong pCurrentPrice, ref ulong pBasePrice ); #endregion internal bool GetItemPrice( InventoryDefId iDefinition, ref ulong pCurrentPrice, ref ulong pBasePrice ) @@ -405,9 +373,8 @@ internal bool GetItemPrice( InventoryDefId iDefinition, ref ulong pCurrentPrice, } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamInventoryUpdateHandle_t FStartUpdateProperties( IntPtr self ); - private FStartUpdateProperties _StartUpdateProperties; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_StartUpdateProperties")] + private static extern SteamInventoryUpdateHandle_t _StartUpdateProperties( IntPtr self ); #endregion internal SteamInventoryUpdateHandle_t StartUpdateProperties() @@ -417,10 +384,9 @@ internal SteamInventoryUpdateHandle_t StartUpdateProperties() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_RemoveProperty")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FRemoveProperty( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName ); - private FRemoveProperty _RemoveProperty; + private static extern bool _RemoveProperty( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName ); #endregion internal bool RemoveProperty( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName ) @@ -430,62 +396,57 @@ internal bool RemoveProperty( SteamInventoryUpdateHandle_t handle, InventoryItem } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_SetProperty")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetProperty1( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyValue ); - private FSetProperty1 _SetProperty1; + private static extern bool _SetProperty( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyValue ); #endregion - internal bool SetProperty1( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyValue ) + internal bool SetProperty( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyValue ) { - var returnValue = _SetProperty1( Self, handle, nItemID, pchPropertyName, pchPropertyValue ); + var returnValue = _SetProperty( Self, handle, nItemID, pchPropertyName, pchPropertyValue ); return returnValue; } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_SetProperty0")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetProperty2( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, [MarshalAs( UnmanagedType.U1 )] bool bValue ); - private FSetProperty2 _SetProperty2; + private static extern bool _SetProperty0( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, [MarshalAs( UnmanagedType.U1 )] bool bValue ); #endregion - internal bool SetProperty2( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, [MarshalAs( UnmanagedType.U1 )] bool bValue ) + internal bool SetProperty0( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, [MarshalAs( UnmanagedType.U1 )] bool bValue ) { - var returnValue = _SetProperty2( Self, handle, nItemID, pchPropertyName, bValue ); + var returnValue = _SetProperty0( Self, handle, nItemID, pchPropertyName, bValue ); return returnValue; } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_SetProperty1")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetProperty3( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, long nValue ); - private FSetProperty3 _SetProperty3; + private static extern bool _SetProperty1( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, long nValue ); #endregion - internal bool SetProperty3( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, long nValue ) + internal bool SetProperty1( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, long nValue ) { - var returnValue = _SetProperty3( Self, handle, nItemID, pchPropertyName, nValue ); + var returnValue = _SetProperty1( Self, handle, nItemID, pchPropertyName, nValue ); return returnValue; } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_SetProperty2")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetProperty4( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, float flValue ); - private FSetProperty4 _SetProperty4; + private static extern bool _SetProperty2( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, float flValue ); #endregion - internal bool SetProperty4( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, float flValue ) + internal bool SetProperty2( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, float flValue ) { - var returnValue = _SetProperty4( Self, handle, nItemID, pchPropertyName, flValue ); + var returnValue = _SetProperty2( Self, handle, nItemID, pchPropertyName, flValue ); return returnValue; } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_SubmitUpdateProperties")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSubmitUpdateProperties( IntPtr self, SteamInventoryUpdateHandle_t handle, ref SteamInventoryResult_t pResultHandle ); - private FSubmitUpdateProperties _SubmitUpdateProperties; + private static extern bool _SubmitUpdateProperties( IntPtr self, SteamInventoryUpdateHandle_t handle, ref SteamInventoryResult_t pResultHandle ); #endregion internal bool SubmitUpdateProperties( SteamInventoryUpdateHandle_t handle, ref SteamInventoryResult_t pResultHandle ) diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmaking.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmaking.cs index bb85457..79160c4 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmaking.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmaking.cs @@ -9,8 +9,6 @@ namespace Steamworks { internal class ISteamMatchmaking : SteamInterface { - public override string InterfaceName => "SteamMatchMaking009"; - public override void InitInternals() { } @@ -21,9 +19,8 @@ internal override void Shutdown() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetFavoriteGameCount( IntPtr self ); - private FGetFavoriteGameCount _GetFavoriteGameCount; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetFavoriteGameCount")] + private static extern int _GetFavoriteGameCount( IntPtr self ); #endregion internal int GetFavoriteGameCount() @@ -33,10 +30,9 @@ internal int GetFavoriteGameCount() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetFavoriteGame")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetFavoriteGame( IntPtr self, int iGame, ref AppId pnAppID, ref uint pnIP, ref ushort pnConnPort, ref ushort pnQueryPort, ref uint punFlags, ref uint pRTime32LastPlayedOnServer ); - private FGetFavoriteGame _GetFavoriteGame; + private static extern bool _GetFavoriteGame( IntPtr self, int iGame, ref AppId pnAppID, ref uint pnIP, ref ushort pnConnPort, ref ushort pnQueryPort, ref uint punFlags, ref uint pRTime32LastPlayedOnServer ); #endregion internal bool GetFavoriteGame( int iGame, ref AppId pnAppID, ref uint pnIP, ref ushort pnConnPort, ref ushort pnQueryPort, ref uint punFlags, ref uint pRTime32LastPlayedOnServer ) @@ -46,9 +42,8 @@ internal bool GetFavoriteGame( int iGame, ref AppId pnAppID, ref uint pnIP, ref } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FAddFavoriteGame( IntPtr self, AppId nAppID, uint nIP, ushort nConnPort, ushort nQueryPort, uint unFlags, uint rTime32LastPlayedOnServer ); - private FAddFavoriteGame _AddFavoriteGame; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_AddFavoriteGame")] + private static extern int _AddFavoriteGame( IntPtr self, AppId nAppID, uint nIP, ushort nConnPort, ushort nQueryPort, uint unFlags, uint rTime32LastPlayedOnServer ); #endregion internal int AddFavoriteGame( AppId nAppID, uint nIP, ushort nConnPort, ushort nQueryPort, uint unFlags, uint rTime32LastPlayedOnServer ) @@ -58,10 +53,9 @@ internal int AddFavoriteGame( AppId nAppID, uint nIP, ushort nConnPort, ushort n } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_RemoveFavoriteGame")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FRemoveFavoriteGame( IntPtr self, AppId nAppID, uint nIP, ushort nConnPort, ushort nQueryPort, uint unFlags ); - private FRemoveFavoriteGame _RemoveFavoriteGame; + private static extern bool _RemoveFavoriteGame( IntPtr self, AppId nAppID, uint nIP, ushort nConnPort, ushort nQueryPort, uint unFlags ); #endregion internal bool RemoveFavoriteGame( AppId nAppID, uint nIP, ushort nConnPort, ushort nQueryPort, uint unFlags ) @@ -71,21 +65,19 @@ internal bool RemoveFavoriteGame( AppId nAppID, uint nIP, ushort nConnPort, usho } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FRequestLobbyList( IntPtr self ); - private FRequestLobbyList _RequestLobbyList; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_RequestLobbyList")] + private static extern SteamAPICall_t _RequestLobbyList( IntPtr self ); #endregion - internal async Task RequestLobbyList() + internal CallbackResult RequestLobbyList() { var returnValue = _RequestLobbyList( Self ); - return await LobbyMatchList_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FAddRequestLobbyListStringFilter( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToMatch, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValueToMatch, LobbyComparison eComparisonType ); - private FAddRequestLobbyListStringFilter _AddRequestLobbyListStringFilter; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter")] + private static extern void _AddRequestLobbyListStringFilter( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToMatch, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValueToMatch, LobbyComparison eComparisonType ); #endregion internal void AddRequestLobbyListStringFilter( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToMatch, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValueToMatch, LobbyComparison eComparisonType ) @@ -94,9 +86,8 @@ internal void AddRequestLobbyListStringFilter( [MarshalAs( UnmanagedType.CustomM } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FAddRequestLobbyListNumericalFilter( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToMatch, int nValueToMatch, LobbyComparison eComparisonType ); - private FAddRequestLobbyListNumericalFilter _AddRequestLobbyListNumericalFilter; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter")] + private static extern void _AddRequestLobbyListNumericalFilter( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToMatch, int nValueToMatch, LobbyComparison eComparisonType ); #endregion internal void AddRequestLobbyListNumericalFilter( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToMatch, int nValueToMatch, LobbyComparison eComparisonType ) @@ -105,9 +96,8 @@ internal void AddRequestLobbyListNumericalFilter( [MarshalAs( UnmanagedType.Cust } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FAddRequestLobbyListNearValueFilter( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToMatch, int nValueToBeCloseTo ); - private FAddRequestLobbyListNearValueFilter _AddRequestLobbyListNearValueFilter; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListNearValueFilter")] + private static extern void _AddRequestLobbyListNearValueFilter( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToMatch, int nValueToBeCloseTo ); #endregion internal void AddRequestLobbyListNearValueFilter( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToMatch, int nValueToBeCloseTo ) @@ -116,9 +106,8 @@ internal void AddRequestLobbyListNearValueFilter( [MarshalAs( UnmanagedType.Cust } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FAddRequestLobbyListFilterSlotsAvailable( IntPtr self, int nSlotsAvailable ); - private FAddRequestLobbyListFilterSlotsAvailable _AddRequestLobbyListFilterSlotsAvailable; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable")] + private static extern void _AddRequestLobbyListFilterSlotsAvailable( IntPtr self, int nSlotsAvailable ); #endregion internal void AddRequestLobbyListFilterSlotsAvailable( int nSlotsAvailable ) @@ -127,9 +116,8 @@ internal void AddRequestLobbyListFilterSlotsAvailable( int nSlotsAvailable ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FAddRequestLobbyListDistanceFilter( IntPtr self, LobbyDistanceFilter eLobbyDistanceFilter ); - private FAddRequestLobbyListDistanceFilter _AddRequestLobbyListDistanceFilter; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListDistanceFilter")] + private static extern void _AddRequestLobbyListDistanceFilter( IntPtr self, LobbyDistanceFilter eLobbyDistanceFilter ); #endregion internal void AddRequestLobbyListDistanceFilter( LobbyDistanceFilter eLobbyDistanceFilter ) @@ -138,9 +126,8 @@ internal void AddRequestLobbyListDistanceFilter( LobbyDistanceFilter eLobbyDista } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FAddRequestLobbyListResultCountFilter( IntPtr self, int cMaxResults ); - private FAddRequestLobbyListResultCountFilter _AddRequestLobbyListResultCountFilter; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListResultCountFilter")] + private static extern void _AddRequestLobbyListResultCountFilter( IntPtr self, int cMaxResults ); #endregion internal void AddRequestLobbyListResultCountFilter( int cMaxResults ) @@ -149,9 +136,8 @@ internal void AddRequestLobbyListResultCountFilter( int cMaxResults ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FAddRequestLobbyListCompatibleMembersFilter( IntPtr self, SteamId steamIDLobby ); - private FAddRequestLobbyListCompatibleMembersFilter _AddRequestLobbyListCompatibleMembersFilter; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter")] + private static extern void _AddRequestLobbyListCompatibleMembersFilter( IntPtr self, SteamId steamIDLobby ); #endregion internal void AddRequestLobbyListCompatibleMembersFilter( SteamId steamIDLobby ) @@ -160,55 +146,41 @@ internal void AddRequestLobbyListCompatibleMembersFilter( SteamId steamIDLobby ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - #if PLATFORM_WIN - private delegate void FGetLobbyByIndex( IntPtr self, ref SteamId retVal, int iLobby ); - #else - private delegate SteamId FGetLobbyByIndex( IntPtr self, int iLobby ); - #endif - private FGetLobbyByIndex _GetLobbyByIndex; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyByIndex")] + private static extern SteamId _GetLobbyByIndex( IntPtr self, int iLobby ); #endregion internal SteamId GetLobbyByIndex( int iLobby ) { - #if PLATFORM_WIN - var retVal = default( SteamId ); - _GetLobbyByIndex( Self, ref retVal, iLobby ); - return retVal; - #else var returnValue = _GetLobbyByIndex( Self, iLobby ); return returnValue; - #endif } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FCreateLobby( IntPtr self, LobbyType eLobbyType, int cMaxMembers ); - private FCreateLobby _CreateLobby; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_CreateLobby")] + private static extern SteamAPICall_t _CreateLobby( IntPtr self, LobbyType eLobbyType, int cMaxMembers ); #endregion - internal async Task CreateLobby( LobbyType eLobbyType, int cMaxMembers ) + internal CallbackResult CreateLobby( LobbyType eLobbyType, int cMaxMembers ) { var returnValue = _CreateLobby( Self, eLobbyType, cMaxMembers ); - return await LobbyCreated_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FJoinLobby( IntPtr self, SteamId steamIDLobby ); - private FJoinLobby _JoinLobby; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_JoinLobby")] + private static extern SteamAPICall_t _JoinLobby( IntPtr self, SteamId steamIDLobby ); #endregion - internal async Task JoinLobby( SteamId steamIDLobby ) + internal CallbackResult JoinLobby( SteamId steamIDLobby ) { var returnValue = _JoinLobby( Self, steamIDLobby ); - return await LobbyEnter_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FLeaveLobby( IntPtr self, SteamId steamIDLobby ); - private FLeaveLobby _LeaveLobby; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_LeaveLobby")] + private static extern void _LeaveLobby( IntPtr self, SteamId steamIDLobby ); #endregion internal void LeaveLobby( SteamId steamIDLobby ) @@ -217,10 +189,9 @@ internal void LeaveLobby( SteamId steamIDLobby ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_InviteUserToLobby")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FInviteUserToLobby( IntPtr self, SteamId steamIDLobby, SteamId steamIDInvitee ); - private FInviteUserToLobby _InviteUserToLobby; + private static extern bool _InviteUserToLobby( IntPtr self, SteamId steamIDLobby, SteamId steamIDInvitee ); #endregion internal bool InviteUserToLobby( SteamId steamIDLobby, SteamId steamIDInvitee ) @@ -230,9 +201,8 @@ internal bool InviteUserToLobby( SteamId steamIDLobby, SteamId steamIDInvitee ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetNumLobbyMembers( IntPtr self, SteamId steamIDLobby ); - private FGetNumLobbyMembers _GetNumLobbyMembers; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetNumLobbyMembers")] + private static extern int _GetNumLobbyMembers( IntPtr self, SteamId steamIDLobby ); #endregion internal int GetNumLobbyMembers( SteamId steamIDLobby ) @@ -242,31 +212,19 @@ internal int GetNumLobbyMembers( SteamId steamIDLobby ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - #if PLATFORM_WIN - private delegate void FGetLobbyMemberByIndex( IntPtr self, ref SteamId retVal, SteamId steamIDLobby, int iMember ); - #else - private delegate SteamId FGetLobbyMemberByIndex( IntPtr self, SteamId steamIDLobby, int iMember ); - #endif - private FGetLobbyMemberByIndex _GetLobbyMemberByIndex; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyMemberByIndex")] + private static extern SteamId _GetLobbyMemberByIndex( IntPtr self, SteamId steamIDLobby, int iMember ); #endregion internal SteamId GetLobbyMemberByIndex( SteamId steamIDLobby, int iMember ) { - #if PLATFORM_WIN - var retVal = default( SteamId ); - _GetLobbyMemberByIndex( Self, ref retVal, steamIDLobby, iMember ); - return retVal; - #else var returnValue = _GetLobbyMemberByIndex( Self, steamIDLobby, iMember ); return returnValue; - #endif } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Utf8StringPointer FGetLobbyData( IntPtr self, SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); - private FGetLobbyData _GetLobbyData; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyData")] + private static extern Utf8StringPointer _GetLobbyData( IntPtr self, SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); #endregion internal string GetLobbyData( SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) @@ -276,10 +234,9 @@ internal string GetLobbyData( SteamId steamIDLobby, [MarshalAs( UnmanagedType.Cu } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyData")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetLobbyData( IntPtr self, SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ); - private FSetLobbyData _SetLobbyData; + private static extern bool _SetLobbyData( IntPtr self, SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ); #endregion internal bool SetLobbyData( SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ) @@ -289,9 +246,8 @@ internal bool SetLobbyData( SteamId steamIDLobby, [MarshalAs( UnmanagedType.Cust } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetLobbyDataCount( IntPtr self, SteamId steamIDLobby ); - private FGetLobbyDataCount _GetLobbyDataCount; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyDataCount")] + private static extern int _GetLobbyDataCount( IntPtr self, SteamId steamIDLobby ); #endregion internal int GetLobbyDataCount( SteamId steamIDLobby ) @@ -301,10 +257,9 @@ internal int GetLobbyDataCount( SteamId steamIDLobby ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyDataByIndex")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetLobbyDataByIndex( IntPtr self, SteamId steamIDLobby, int iLobbyData, IntPtr pchKey, int cchKeyBufferSize, IntPtr pchValue, int cchValueBufferSize ); - private FGetLobbyDataByIndex _GetLobbyDataByIndex; + private static extern bool _GetLobbyDataByIndex( IntPtr self, SteamId steamIDLobby, int iLobbyData, IntPtr pchKey, int cchKeyBufferSize, IntPtr pchValue, int cchValueBufferSize ); #endregion internal bool GetLobbyDataByIndex( SteamId steamIDLobby, int iLobbyData, out string pchKey, out string pchValue ) @@ -318,10 +273,9 @@ internal bool GetLobbyDataByIndex( SteamId steamIDLobby, int iLobbyData, out str } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_DeleteLobbyData")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FDeleteLobbyData( IntPtr self, SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); - private FDeleteLobbyData _DeleteLobbyData; + private static extern bool _DeleteLobbyData( IntPtr self, SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); #endregion internal bool DeleteLobbyData( SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) @@ -331,9 +285,8 @@ internal bool DeleteLobbyData( SteamId steamIDLobby, [MarshalAs( UnmanagedType.C } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Utf8StringPointer FGetLobbyMemberData( IntPtr self, SteamId steamIDLobby, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); - private FGetLobbyMemberData _GetLobbyMemberData; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyMemberData")] + private static extern Utf8StringPointer _GetLobbyMemberData( IntPtr self, SteamId steamIDLobby, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); #endregion internal string GetLobbyMemberData( SteamId steamIDLobby, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) @@ -343,9 +296,8 @@ internal string GetLobbyMemberData( SteamId steamIDLobby, SteamId steamIDUser, [ } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetLobbyMemberData( IntPtr self, SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ); - private FSetLobbyMemberData _SetLobbyMemberData; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyMemberData")] + private static extern void _SetLobbyMemberData( IntPtr self, SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ); #endregion internal void SetLobbyMemberData( SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ) @@ -354,10 +306,9 @@ internal void SetLobbyMemberData( SteamId steamIDLobby, [MarshalAs( UnmanagedTyp } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_SendLobbyChatMsg")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSendLobbyChatMsg( IntPtr self, SteamId steamIDLobby, IntPtr pvMsgBody, int cubMsgBody ); - private FSendLobbyChatMsg _SendLobbyChatMsg; + private static extern bool _SendLobbyChatMsg( IntPtr self, SteamId steamIDLobby, IntPtr pvMsgBody, int cubMsgBody ); #endregion internal bool SendLobbyChatMsg( SteamId steamIDLobby, IntPtr pvMsgBody, int cubMsgBody ) @@ -367,9 +318,8 @@ internal bool SendLobbyChatMsg( SteamId steamIDLobby, IntPtr pvMsgBody, int cubM } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetLobbyChatEntry( IntPtr self, SteamId steamIDLobby, int iChatID, ref SteamId pSteamIDUser, IntPtr pvData, int cubData, ref ChatEntryType peChatEntryType ); - private FGetLobbyChatEntry _GetLobbyChatEntry; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyChatEntry")] + private static extern int _GetLobbyChatEntry( IntPtr self, SteamId steamIDLobby, int iChatID, ref SteamId pSteamIDUser, IntPtr pvData, int cubData, ref ChatEntryType peChatEntryType ); #endregion internal int GetLobbyChatEntry( SteamId steamIDLobby, int iChatID, ref SteamId pSteamIDUser, IntPtr pvData, int cubData, ref ChatEntryType peChatEntryType ) @@ -379,10 +329,9 @@ internal int GetLobbyChatEntry( SteamId steamIDLobby, int iChatID, ref SteamId p } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_RequestLobbyData")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FRequestLobbyData( IntPtr self, SteamId steamIDLobby ); - private FRequestLobbyData _RequestLobbyData; + private static extern bool _RequestLobbyData( IntPtr self, SteamId steamIDLobby ); #endregion internal bool RequestLobbyData( SteamId steamIDLobby ) @@ -392,9 +341,8 @@ internal bool RequestLobbyData( SteamId steamIDLobby ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetLobbyGameServer( IntPtr self, SteamId steamIDLobby, uint unGameServerIP, ushort unGameServerPort, SteamId steamIDGameServer ); - private FSetLobbyGameServer _SetLobbyGameServer; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyGameServer")] + private static extern void _SetLobbyGameServer( IntPtr self, SteamId steamIDLobby, uint unGameServerIP, ushort unGameServerPort, SteamId steamIDGameServer ); #endregion internal void SetLobbyGameServer( SteamId steamIDLobby, uint unGameServerIP, ushort unGameServerPort, SteamId steamIDGameServer ) @@ -403,10 +351,9 @@ internal void SetLobbyGameServer( SteamId steamIDLobby, uint unGameServerIP, ush } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyGameServer")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetLobbyGameServer( IntPtr self, SteamId steamIDLobby, ref uint punGameServerIP, ref ushort punGameServerPort, ref SteamId psteamIDGameServer ); - private FGetLobbyGameServer _GetLobbyGameServer; + private static extern bool _GetLobbyGameServer( IntPtr self, SteamId steamIDLobby, ref uint punGameServerIP, ref ushort punGameServerPort, ref SteamId psteamIDGameServer ); #endregion internal bool GetLobbyGameServer( SteamId steamIDLobby, ref uint punGameServerIP, ref ushort punGameServerPort, ref SteamId psteamIDGameServer ) @@ -416,10 +363,9 @@ internal bool GetLobbyGameServer( SteamId steamIDLobby, ref uint punGameServerIP } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyMemberLimit")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetLobbyMemberLimit( IntPtr self, SteamId steamIDLobby, int cMaxMembers ); - private FSetLobbyMemberLimit _SetLobbyMemberLimit; + private static extern bool _SetLobbyMemberLimit( IntPtr self, SteamId steamIDLobby, int cMaxMembers ); #endregion internal bool SetLobbyMemberLimit( SteamId steamIDLobby, int cMaxMembers ) @@ -429,9 +375,8 @@ internal bool SetLobbyMemberLimit( SteamId steamIDLobby, int cMaxMembers ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetLobbyMemberLimit( IntPtr self, SteamId steamIDLobby ); - private FGetLobbyMemberLimit _GetLobbyMemberLimit; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyMemberLimit")] + private static extern int _GetLobbyMemberLimit( IntPtr self, SteamId steamIDLobby ); #endregion internal int GetLobbyMemberLimit( SteamId steamIDLobby ) @@ -441,10 +386,9 @@ internal int GetLobbyMemberLimit( SteamId steamIDLobby ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyType")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetLobbyType( IntPtr self, SteamId steamIDLobby, LobbyType eLobbyType ); - private FSetLobbyType _SetLobbyType; + private static extern bool _SetLobbyType( IntPtr self, SteamId steamIDLobby, LobbyType eLobbyType ); #endregion internal bool SetLobbyType( SteamId steamIDLobby, LobbyType eLobbyType ) @@ -454,10 +398,9 @@ internal bool SetLobbyType( SteamId steamIDLobby, LobbyType eLobbyType ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyJoinable")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetLobbyJoinable( IntPtr self, SteamId steamIDLobby, [MarshalAs( UnmanagedType.U1 )] bool bLobbyJoinable ); - private FSetLobbyJoinable _SetLobbyJoinable; + private static extern bool _SetLobbyJoinable( IntPtr self, SteamId steamIDLobby, [MarshalAs( UnmanagedType.U1 )] bool bLobbyJoinable ); #endregion internal bool SetLobbyJoinable( SteamId steamIDLobby, [MarshalAs( UnmanagedType.U1 )] bool bLobbyJoinable ) @@ -467,32 +410,20 @@ internal bool SetLobbyJoinable( SteamId steamIDLobby, [MarshalAs( UnmanagedType. } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - #if PLATFORM_WIN - private delegate void FGetLobbyOwner( IntPtr self, ref SteamId retVal, SteamId steamIDLobby ); - #else - private delegate SteamId FGetLobbyOwner( IntPtr self, SteamId steamIDLobby ); - #endif - private FGetLobbyOwner _GetLobbyOwner; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyOwner")] + private static extern SteamId _GetLobbyOwner( IntPtr self, SteamId steamIDLobby ); #endregion internal SteamId GetLobbyOwner( SteamId steamIDLobby ) { - #if PLATFORM_WIN - var retVal = default( SteamId ); - _GetLobbyOwner( Self, ref retVal, steamIDLobby ); - return retVal; - #else var returnValue = _GetLobbyOwner( Self, steamIDLobby ); return returnValue; - #endif } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyOwner")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetLobbyOwner( IntPtr self, SteamId steamIDLobby, SteamId steamIDNewOwner ); - private FSetLobbyOwner _SetLobbyOwner; + private static extern bool _SetLobbyOwner( IntPtr self, SteamId steamIDLobby, SteamId steamIDNewOwner ); #endregion internal bool SetLobbyOwner( SteamId steamIDLobby, SteamId steamIDNewOwner ) @@ -502,10 +433,9 @@ internal bool SetLobbyOwner( SteamId steamIDLobby, SteamId steamIDNewOwner ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLinkedLobby")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetLinkedLobby( IntPtr self, SteamId steamIDLobby, SteamId steamIDLobbyDependent ); - private FSetLinkedLobby _SetLinkedLobby; + private static extern bool _SetLinkedLobby( IntPtr self, SteamId steamIDLobby, SteamId steamIDLobbyDependent ); #endregion internal bool SetLinkedLobby( SteamId steamIDLobby, SteamId steamIDLobbyDependent ) diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServers.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServers.cs index d9142e5..a4f0216 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServers.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServers.cs @@ -9,8 +9,6 @@ namespace Steamworks { internal class ISteamMatchmakingServers : SteamInterface { - public override string InterfaceName => "SteamMatchMakingServers002"; - public override void InitInternals() { } @@ -21,9 +19,8 @@ internal override void Shutdown() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate HServerListRequest FRequestInternetServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); - private FRequestInternetServerList _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 ); #endregion internal HServerListRequest RequestInternetServerList( AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) @@ -33,9 +30,8 @@ internal HServerListRequest RequestInternetServerList( AppId iApp, [In,Out] ref } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate HServerListRequest FRequestLANServerList( IntPtr self, AppId iApp, IntPtr pRequestServersResponse ); - private FRequestLANServerList _RequestLANServerList; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_RequestLANServerList")] + private static extern HServerListRequest _RequestLANServerList( IntPtr self, AppId iApp, IntPtr pRequestServersResponse ); #endregion internal HServerListRequest RequestLANServerList( AppId iApp, IntPtr pRequestServersResponse ) @@ -45,9 +41,8 @@ internal HServerListRequest RequestLANServerList( AppId iApp, IntPtr pRequestSer } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate HServerListRequest FRequestFriendsServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); - private FRequestFriendsServerList _RequestFriendsServerList; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_RequestFriendsServerList")] + private static extern HServerListRequest _RequestFriendsServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); #endregion internal HServerListRequest RequestFriendsServerList( AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) @@ -57,9 +52,8 @@ internal HServerListRequest RequestFriendsServerList( AppId iApp, [In,Out] ref M } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate HServerListRequest FRequestFavoritesServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); - private FRequestFavoritesServerList _RequestFavoritesServerList; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_RequestFavoritesServerList")] + private static extern HServerListRequest _RequestFavoritesServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); #endregion internal HServerListRequest RequestFavoritesServerList( AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) @@ -69,9 +63,8 @@ internal HServerListRequest RequestFavoritesServerList( AppId iApp, [In,Out] ref } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate HServerListRequest FRequestHistoryServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); - private FRequestHistoryServerList _RequestHistoryServerList; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_RequestHistoryServerList")] + private static extern HServerListRequest _RequestHistoryServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); #endregion internal HServerListRequest RequestHistoryServerList( AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) @@ -81,9 +74,8 @@ internal HServerListRequest RequestHistoryServerList( AppId iApp, [In,Out] ref M } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate HServerListRequest FRequestSpectatorServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); - private FRequestSpectatorServerList _RequestSpectatorServerList; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_RequestSpectatorServerList")] + private static extern HServerListRequest _RequestSpectatorServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); #endregion internal HServerListRequest RequestSpectatorServerList( AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) @@ -93,9 +85,8 @@ internal HServerListRequest RequestSpectatorServerList( AppId iApp, [In,Out] ref } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FReleaseRequest( IntPtr self, HServerListRequest hServerListRequest ); - private FReleaseRequest _ReleaseRequest; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_ReleaseRequest")] + private static extern void _ReleaseRequest( IntPtr self, HServerListRequest hServerListRequest ); #endregion internal void ReleaseRequest( HServerListRequest hServerListRequest ) @@ -104,9 +95,8 @@ internal void ReleaseRequest( HServerListRequest hServerListRequest ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate IntPtr FGetServerDetails( IntPtr self, HServerListRequest hRequest, int iServer ); - private FGetServerDetails _GetServerDetails; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_GetServerDetails")] + private static extern IntPtr _GetServerDetails( IntPtr self, HServerListRequest hRequest, int iServer ); #endregion internal gameserveritem_t GetServerDetails( HServerListRequest hRequest, int iServer ) @@ -116,9 +106,8 @@ internal gameserveritem_t GetServerDetails( HServerListRequest hRequest, int iSe } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FCancelQuery( IntPtr self, HServerListRequest hRequest ); - private FCancelQuery _CancelQuery; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_CancelQuery")] + private static extern void _CancelQuery( IntPtr self, HServerListRequest hRequest ); #endregion internal void CancelQuery( HServerListRequest hRequest ) @@ -127,9 +116,8 @@ internal void CancelQuery( HServerListRequest hRequest ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FRefreshQuery( IntPtr self, HServerListRequest hRequest ); - private FRefreshQuery _RefreshQuery; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_RefreshQuery")] + private static extern void _RefreshQuery( IntPtr self, HServerListRequest hRequest ); #endregion internal void RefreshQuery( HServerListRequest hRequest ) @@ -138,10 +126,9 @@ internal void RefreshQuery( HServerListRequest hRequest ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_IsRefreshing")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FIsRefreshing( IntPtr self, HServerListRequest hRequest ); - private FIsRefreshing _IsRefreshing; + private static extern bool _IsRefreshing( IntPtr self, HServerListRequest hRequest ); #endregion internal bool IsRefreshing( HServerListRequest hRequest ) @@ -151,9 +138,8 @@ internal bool IsRefreshing( HServerListRequest hRequest ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetServerCount( IntPtr self, HServerListRequest hRequest ); - private FGetServerCount _GetServerCount; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_GetServerCount")] + private static extern int _GetServerCount( IntPtr self, HServerListRequest hRequest ); #endregion internal int GetServerCount( HServerListRequest hRequest ) @@ -163,9 +149,8 @@ internal int GetServerCount( HServerListRequest hRequest ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FRefreshServer( IntPtr self, HServerListRequest hRequest, int iServer ); - private FRefreshServer _RefreshServer; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_RefreshServer")] + private static extern void _RefreshServer( IntPtr self, HServerListRequest hRequest, int iServer ); #endregion internal void RefreshServer( HServerListRequest hRequest, int iServer ) @@ -174,9 +159,8 @@ internal void RefreshServer( HServerListRequest hRequest, int iServer ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate HServerQuery FPingServer( IntPtr self, uint unIP, ushort usPort, IntPtr pRequestServersResponse ); - private FPingServer _PingServer; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_PingServer")] + private static extern HServerQuery _PingServer( IntPtr self, uint unIP, ushort usPort, IntPtr pRequestServersResponse ); #endregion internal HServerQuery PingServer( uint unIP, ushort usPort, IntPtr pRequestServersResponse ) @@ -186,9 +170,8 @@ internal HServerQuery PingServer( uint unIP, ushort usPort, IntPtr pRequestServe } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate HServerQuery FPlayerDetails( IntPtr self, uint unIP, ushort usPort, IntPtr pRequestServersResponse ); - private FPlayerDetails _PlayerDetails; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_PlayerDetails")] + private static extern HServerQuery _PlayerDetails( IntPtr self, uint unIP, ushort usPort, IntPtr pRequestServersResponse ); #endregion internal HServerQuery PlayerDetails( uint unIP, ushort usPort, IntPtr pRequestServersResponse ) @@ -198,9 +181,8 @@ internal HServerQuery PlayerDetails( uint unIP, ushort usPort, IntPtr pRequestSe } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate HServerQuery FServerRules( IntPtr self, uint unIP, ushort usPort, IntPtr pRequestServersResponse ); - private FServerRules _ServerRules; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_ServerRules")] + private static extern HServerQuery _ServerRules( IntPtr self, uint unIP, ushort usPort, IntPtr pRequestServersResponse ); #endregion internal HServerQuery ServerRules( uint unIP, ushort usPort, IntPtr pRequestServersResponse ) @@ -210,9 +192,8 @@ internal HServerQuery ServerRules( uint unIP, ushort usPort, IntPtr pRequestServ } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FCancelServerQuery( IntPtr self, HServerQuery hServerQuery ); - private FCancelServerQuery _CancelServerQuery; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_CancelServerQuery")] + private static extern void _CancelServerQuery( IntPtr self, HServerQuery hServerQuery ); #endregion internal void CancelServerQuery( HServerQuery hServerQuery ) diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamMusic.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamMusic.cs index 1b24701..4f41280 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamMusic.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamMusic.cs @@ -9,8 +9,6 @@ namespace Steamworks { internal class ISteamMusic : SteamInterface { - public override string InterfaceName => "STEAMMUSIC_INTERFACE_VERSION001"; - public override void InitInternals() { } @@ -21,10 +19,9 @@ internal override void Shutdown() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusic_BIsEnabled")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBIsEnabled( IntPtr self ); - private FBIsEnabled _BIsEnabled; + private static extern bool _BIsEnabled( IntPtr self ); #endregion internal bool BIsEnabled() @@ -34,10 +31,9 @@ internal bool BIsEnabled() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusic_BIsPlaying")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBIsPlaying( IntPtr self ); - private FBIsPlaying _BIsPlaying; + private static extern bool _BIsPlaying( IntPtr self ); #endregion internal bool BIsPlaying() @@ -47,9 +43,8 @@ internal bool BIsPlaying() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate MusicStatus FGetPlaybackStatus( IntPtr self ); - private FGetPlaybackStatus _GetPlaybackStatus; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusic_GetPlaybackStatus")] + private static extern MusicStatus _GetPlaybackStatus( IntPtr self ); #endregion internal MusicStatus GetPlaybackStatus() @@ -59,9 +54,8 @@ internal MusicStatus GetPlaybackStatus() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FPlay( IntPtr self ); - private FPlay _Play; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusic_Play")] + private static extern void _Play( IntPtr self ); #endregion internal void Play() @@ -70,9 +64,8 @@ internal void Play() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FPause( IntPtr self ); - private FPause _Pause; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusic_Pause")] + private static extern void _Pause( IntPtr self ); #endregion internal void Pause() @@ -81,9 +74,8 @@ internal void Pause() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FPlayPrevious( IntPtr self ); - private FPlayPrevious _PlayPrevious; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusic_PlayPrevious")] + private static extern void _PlayPrevious( IntPtr self ); #endregion internal void PlayPrevious() @@ -92,9 +84,8 @@ internal void PlayPrevious() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FPlayNext( IntPtr self ); - private FPlayNext _PlayNext; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusic_PlayNext")] + private static extern void _PlayNext( IntPtr self ); #endregion internal void PlayNext() @@ -103,9 +94,8 @@ internal void PlayNext() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetVolume( IntPtr self, float flVolume ); - private FSetVolume _SetVolume; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusic_SetVolume")] + private static extern void _SetVolume( IntPtr self, float flVolume ); #endregion internal void SetVolume( float flVolume ) @@ -114,9 +104,8 @@ internal void SetVolume( float flVolume ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate float FGetVolume( IntPtr self ); - private FGetVolume _GetVolume; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusic_GetVolume")] + private static extern float _GetVolume( IntPtr self ); #endregion internal float GetVolume() diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworking.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworking.cs index e7e76a0..1145e4a 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworking.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworking.cs @@ -9,8 +9,6 @@ namespace Steamworks { internal class ISteamNetworking : SteamInterface { - public override string InterfaceName => "SteamNetworking005"; - public override void InitInternals() { } @@ -21,10 +19,9 @@ internal override void Shutdown() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_SendP2PPacket")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSendP2PPacket( IntPtr self, SteamId steamIDRemote, IntPtr pubData, uint cubData, P2PSend eP2PSendType, int nChannel ); - private FSendP2PPacket _SendP2PPacket; + private static extern bool _SendP2PPacket( IntPtr self, SteamId steamIDRemote, IntPtr pubData, uint cubData, P2PSend eP2PSendType, int nChannel ); #endregion internal bool SendP2PPacket( SteamId steamIDRemote, IntPtr pubData, uint cubData, P2PSend eP2PSendType, int nChannel ) @@ -34,10 +31,9 @@ internal bool SendP2PPacket( SteamId steamIDRemote, IntPtr pubData, uint cubData } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_IsP2PPacketAvailable")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FIsP2PPacketAvailable( IntPtr self, ref uint pcubMsgSize, int nChannel ); - private FIsP2PPacketAvailable _IsP2PPacketAvailable; + private static extern bool _IsP2PPacketAvailable( IntPtr self, ref uint pcubMsgSize, int nChannel ); #endregion internal bool IsP2PPacketAvailable( ref uint pcubMsgSize, int nChannel ) @@ -47,10 +43,9 @@ internal bool IsP2PPacketAvailable( ref uint pcubMsgSize, int nChannel ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_ReadP2PPacket")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FReadP2PPacket( IntPtr self, IntPtr pubDest, uint cubDest, ref uint pcubMsgSize, ref SteamId psteamIDRemote, int nChannel ); - private FReadP2PPacket _ReadP2PPacket; + private static extern bool _ReadP2PPacket( IntPtr self, IntPtr pubDest, uint cubDest, ref uint pcubMsgSize, ref SteamId psteamIDRemote, int nChannel ); #endregion internal bool ReadP2PPacket( IntPtr pubDest, uint cubDest, ref uint pcubMsgSize, ref SteamId psteamIDRemote, int nChannel ) @@ -60,10 +55,9 @@ internal bool ReadP2PPacket( IntPtr pubDest, uint cubDest, ref uint pcubMsgSize, } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_AcceptP2PSessionWithUser")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FAcceptP2PSessionWithUser( IntPtr self, SteamId steamIDRemote ); - private FAcceptP2PSessionWithUser _AcceptP2PSessionWithUser; + private static extern bool _AcceptP2PSessionWithUser( IntPtr self, SteamId steamIDRemote ); #endregion internal bool AcceptP2PSessionWithUser( SteamId steamIDRemote ) @@ -73,10 +67,9 @@ internal bool AcceptP2PSessionWithUser( SteamId steamIDRemote ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_CloseP2PSessionWithUser")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FCloseP2PSessionWithUser( IntPtr self, SteamId steamIDRemote ); - private FCloseP2PSessionWithUser _CloseP2PSessionWithUser; + private static extern bool _CloseP2PSessionWithUser( IntPtr self, SteamId steamIDRemote ); #endregion internal bool CloseP2PSessionWithUser( SteamId steamIDRemote ) @@ -86,10 +79,9 @@ internal bool CloseP2PSessionWithUser( SteamId steamIDRemote ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_CloseP2PChannelWithUser")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FCloseP2PChannelWithUser( IntPtr self, SteamId steamIDRemote, int nChannel ); - private FCloseP2PChannelWithUser _CloseP2PChannelWithUser; + private static extern bool _CloseP2PChannelWithUser( IntPtr self, SteamId steamIDRemote, int nChannel ); #endregion internal bool CloseP2PChannelWithUser( SteamId steamIDRemote, int nChannel ) @@ -99,10 +91,9 @@ internal bool CloseP2PChannelWithUser( SteamId steamIDRemote, int nChannel ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_GetP2PSessionState")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetP2PSessionState( IntPtr self, SteamId steamIDRemote, ref P2PSessionState_t pConnectionState ); - private FGetP2PSessionState _GetP2PSessionState; + private static extern bool _GetP2PSessionState( IntPtr self, SteamId steamIDRemote, ref P2PSessionState_t pConnectionState ); #endregion internal bool GetP2PSessionState( SteamId steamIDRemote, ref P2PSessionState_t pConnectionState ) @@ -112,10 +103,9 @@ internal bool GetP2PSessionState( SteamId steamIDRemote, ref P2PSessionState_t p } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_AllowP2PPacketRelay")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FAllowP2PPacketRelay( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bAllow ); - private FAllowP2PPacketRelay _AllowP2PPacketRelay; + private static extern bool _AllowP2PPacketRelay( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bAllow ); #endregion internal bool AllowP2PPacketRelay( [MarshalAs( UnmanagedType.U1 )] bool bAllow ) @@ -125,9 +115,8 @@ internal bool AllowP2PPacketRelay( [MarshalAs( UnmanagedType.U1 )] bool bAllow ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SNetListenSocket_t FCreateListenSocket( IntPtr self, int nVirtualP2PPort, uint nIP, ushort nPort, [MarshalAs( UnmanagedType.U1 )] bool bAllowUseOfPacketRelay ); - private FCreateListenSocket _CreateListenSocket; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_CreateListenSocket")] + private static extern SNetListenSocket_t _CreateListenSocket( IntPtr self, int nVirtualP2PPort, uint nIP, ushort nPort, [MarshalAs( UnmanagedType.U1 )] bool bAllowUseOfPacketRelay ); #endregion internal SNetListenSocket_t CreateListenSocket( int nVirtualP2PPort, uint nIP, ushort nPort, [MarshalAs( UnmanagedType.U1 )] bool bAllowUseOfPacketRelay ) @@ -137,9 +126,8 @@ internal SNetListenSocket_t CreateListenSocket( int nVirtualP2PPort, uint nIP, u } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SNetSocket_t FCreateP2PConnectionSocket( IntPtr self, SteamId steamIDTarget, int nVirtualPort, int nTimeoutSec, [MarshalAs( UnmanagedType.U1 )] bool bAllowUseOfPacketRelay ); - private FCreateP2PConnectionSocket _CreateP2PConnectionSocket; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_CreateP2PConnectionSocket")] + private static extern SNetSocket_t _CreateP2PConnectionSocket( IntPtr self, SteamId steamIDTarget, int nVirtualPort, int nTimeoutSec, [MarshalAs( UnmanagedType.U1 )] bool bAllowUseOfPacketRelay ); #endregion internal SNetSocket_t CreateP2PConnectionSocket( SteamId steamIDTarget, int nVirtualPort, int nTimeoutSec, [MarshalAs( UnmanagedType.U1 )] bool bAllowUseOfPacketRelay ) @@ -149,9 +137,8 @@ internal SNetSocket_t CreateP2PConnectionSocket( SteamId steamIDTarget, int nVir } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SNetSocket_t FCreateConnectionSocket( IntPtr self, uint nIP, ushort nPort, int nTimeoutSec ); - private FCreateConnectionSocket _CreateConnectionSocket; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_CreateConnectionSocket")] + private static extern SNetSocket_t _CreateConnectionSocket( IntPtr self, uint nIP, ushort nPort, int nTimeoutSec ); #endregion internal SNetSocket_t CreateConnectionSocket( uint nIP, ushort nPort, int nTimeoutSec ) @@ -161,10 +148,9 @@ internal SNetSocket_t CreateConnectionSocket( uint nIP, ushort nPort, int nTimeo } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_DestroySocket")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FDestroySocket( IntPtr self, SNetSocket_t hSocket, [MarshalAs( UnmanagedType.U1 )] bool bNotifyRemoteEnd ); - private FDestroySocket _DestroySocket; + private static extern bool _DestroySocket( IntPtr self, SNetSocket_t hSocket, [MarshalAs( UnmanagedType.U1 )] bool bNotifyRemoteEnd ); #endregion internal bool DestroySocket( SNetSocket_t hSocket, [MarshalAs( UnmanagedType.U1 )] bool bNotifyRemoteEnd ) @@ -174,10 +160,9 @@ internal bool DestroySocket( SNetSocket_t hSocket, [MarshalAs( UnmanagedType.U1 } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_DestroyListenSocket")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FDestroyListenSocket( IntPtr self, SNetListenSocket_t hSocket, [MarshalAs( UnmanagedType.U1 )] bool bNotifyRemoteEnd ); - private FDestroyListenSocket _DestroyListenSocket; + private static extern bool _DestroyListenSocket( IntPtr self, SNetListenSocket_t hSocket, [MarshalAs( UnmanagedType.U1 )] bool bNotifyRemoteEnd ); #endregion internal bool DestroyListenSocket( SNetListenSocket_t hSocket, [MarshalAs( UnmanagedType.U1 )] bool bNotifyRemoteEnd ) @@ -187,10 +172,9 @@ internal bool DestroyListenSocket( SNetListenSocket_t hSocket, [MarshalAs( Unman } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_SendDataOnSocket")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSendDataOnSocket( IntPtr self, SNetSocket_t hSocket, [In,Out] IntPtr[] pubData, uint cubData, [MarshalAs( UnmanagedType.U1 )] bool bReliable ); - private FSendDataOnSocket _SendDataOnSocket; + private static extern bool _SendDataOnSocket( IntPtr self, SNetSocket_t hSocket, [In,Out] IntPtr[] pubData, uint cubData, [MarshalAs( UnmanagedType.U1 )] bool bReliable ); #endregion internal bool SendDataOnSocket( SNetSocket_t hSocket, [In,Out] IntPtr[] pubData, uint cubData, [MarshalAs( UnmanagedType.U1 )] bool bReliable ) @@ -200,10 +184,9 @@ internal bool SendDataOnSocket( SNetSocket_t hSocket, [In,Out] IntPtr[] pubData } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_IsDataAvailableOnSocket")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FIsDataAvailableOnSocket( IntPtr self, SNetSocket_t hSocket, ref uint pcubMsgSize ); - private FIsDataAvailableOnSocket _IsDataAvailableOnSocket; + private static extern bool _IsDataAvailableOnSocket( IntPtr self, SNetSocket_t hSocket, ref uint pcubMsgSize ); #endregion internal bool IsDataAvailableOnSocket( SNetSocket_t hSocket, ref uint pcubMsgSize ) @@ -213,10 +196,9 @@ internal bool IsDataAvailableOnSocket( SNetSocket_t hSocket, ref uint pcubMsgSiz } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_RetrieveDataFromSocket")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FRetrieveDataFromSocket( IntPtr self, SNetSocket_t hSocket, [In,Out] IntPtr[] pubDest, uint cubDest, ref uint pcubMsgSize ); - private FRetrieveDataFromSocket _RetrieveDataFromSocket; + private static extern bool _RetrieveDataFromSocket( IntPtr self, SNetSocket_t hSocket, [In,Out] IntPtr[] pubDest, uint cubDest, ref uint pcubMsgSize ); #endregion internal bool RetrieveDataFromSocket( SNetSocket_t hSocket, [In,Out] IntPtr[] pubDest, uint cubDest, ref uint pcubMsgSize ) @@ -226,10 +208,9 @@ internal bool RetrieveDataFromSocket( SNetSocket_t hSocket, [In,Out] IntPtr[] p } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_IsDataAvailable")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FIsDataAvailable( IntPtr self, SNetListenSocket_t hListenSocket, ref uint pcubMsgSize, ref SNetSocket_t phSocket ); - private FIsDataAvailable _IsDataAvailable; + private static extern bool _IsDataAvailable( IntPtr self, SNetListenSocket_t hListenSocket, ref uint pcubMsgSize, ref SNetSocket_t phSocket ); #endregion internal bool IsDataAvailable( SNetListenSocket_t hListenSocket, ref uint pcubMsgSize, ref SNetSocket_t phSocket ) @@ -239,10 +220,9 @@ internal bool IsDataAvailable( SNetListenSocket_t hListenSocket, ref uint pcubMs } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_RetrieveData")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FRetrieveData( IntPtr self, SNetListenSocket_t hListenSocket, [In,Out] IntPtr[] pubDest, uint cubDest, ref uint pcubMsgSize, ref SNetSocket_t phSocket ); - private FRetrieveData _RetrieveData; + private static extern bool _RetrieveData( IntPtr self, SNetListenSocket_t hListenSocket, [In,Out] IntPtr[] pubDest, uint cubDest, ref uint pcubMsgSize, ref SNetSocket_t phSocket ); #endregion internal bool RetrieveData( SNetListenSocket_t hListenSocket, [In,Out] IntPtr[] pubDest, uint cubDest, ref uint pcubMsgSize, ref SNetSocket_t phSocket ) @@ -252,10 +232,9 @@ internal bool RetrieveData( SNetListenSocket_t hListenSocket, [In,Out] IntPtr[] } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_GetSocketInfo")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetSocketInfo( IntPtr self, SNetSocket_t hSocket, ref SteamId pSteamIDRemote, ref int peSocketStatus, ref uint punIPRemote, ref ushort punPortRemote ); - private FGetSocketInfo _GetSocketInfo; + private static extern bool _GetSocketInfo( IntPtr self, SNetSocket_t hSocket, ref SteamId pSteamIDRemote, ref int peSocketStatus, ref uint punIPRemote, ref ushort punPortRemote ); #endregion internal bool GetSocketInfo( SNetSocket_t hSocket, ref SteamId pSteamIDRemote, ref int peSocketStatus, ref uint punIPRemote, ref ushort punPortRemote ) @@ -265,10 +244,9 @@ internal bool GetSocketInfo( SNetSocket_t hSocket, ref SteamId pSteamIDRemote, r } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_GetListenSocketInfo")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetListenSocketInfo( IntPtr self, SNetListenSocket_t hListenSocket, ref uint pnIP, ref ushort pnPort ); - private FGetListenSocketInfo _GetListenSocketInfo; + private static extern bool _GetListenSocketInfo( IntPtr self, SNetListenSocket_t hListenSocket, ref uint pnIP, ref ushort pnPort ); #endregion internal bool GetListenSocketInfo( SNetListenSocket_t hListenSocket, ref uint pnIP, ref ushort pnPort ) @@ -278,9 +256,8 @@ internal bool GetListenSocketInfo( SNetListenSocket_t hListenSocket, ref uint pn } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SNetSocketConnectionType FGetSocketConnectionType( IntPtr self, SNetSocket_t hSocket ); - private FGetSocketConnectionType _GetSocketConnectionType; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_GetSocketConnectionType")] + private static extern SNetSocketConnectionType _GetSocketConnectionType( IntPtr self, SNetSocket_t hSocket ); #endregion internal SNetSocketConnectionType GetSocketConnectionType( SNetSocket_t hSocket ) @@ -290,9 +267,8 @@ internal SNetSocketConnectionType GetSocketConnectionType( SNetSocket_t hSocket } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetMaxPacketSize( IntPtr self, SNetSocket_t hSocket ); - private FGetMaxPacketSize _GetMaxPacketSize; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_GetMaxPacketSize")] + private static extern int _GetMaxPacketSize( IntPtr self, SNetSocket_t hSocket ); #endregion internal int GetMaxPacketSize( SNetSocket_t hSocket ) diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingSockets.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingSockets.cs index 8094f39..a5b5525 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingSockets.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingSockets.cs @@ -9,8 +9,6 @@ namespace Steamworks { internal class ISteamNetworkingSockets : SteamInterface { - public override string InterfaceName => "SteamNetworkingSockets002"; - public override void InitInternals() { } @@ -20,366 +18,5 @@ internal override void Shutdown() } - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Socket FCreateListenSocketIP( IntPtr self, ref NetAddress localAddress ); - private FCreateListenSocketIP _CreateListenSocketIP; - - #endregion - internal Socket CreateListenSocketIP( ref NetAddress localAddress ) - { - var returnValue = _CreateListenSocketIP( Self, ref localAddress ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Connection FConnectByIPAddress( IntPtr self, ref NetAddress address ); - private FConnectByIPAddress _ConnectByIPAddress; - - #endregion - internal Connection ConnectByIPAddress( ref NetAddress address ) - { - var returnValue = _ConnectByIPAddress( Self, ref address ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Socket FCreateListenSocketP2P( IntPtr self, int nVirtualPort ); - private FCreateListenSocketP2P _CreateListenSocketP2P; - - #endregion - internal Socket CreateListenSocketP2P( int nVirtualPort ) - { - var returnValue = _CreateListenSocketP2P( Self, nVirtualPort ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Connection FConnectP2P( IntPtr self, ref NetIdentity identityRemote, int nVirtualPort ); - private FConnectP2P _ConnectP2P; - - #endregion - internal Connection ConnectP2P( ref NetIdentity identityRemote, int nVirtualPort ) - { - var returnValue = _ConnectP2P( Self, ref identityRemote, nVirtualPort ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Result FAcceptConnection( IntPtr self, Connection hConn ); - private FAcceptConnection _AcceptConnection; - - #endregion - internal Result AcceptConnection( Connection hConn ) - { - var returnValue = _AcceptConnection( Self, hConn ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FCloseConnection( IntPtr self, Connection hPeer, int nReason, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszDebug, [MarshalAs( UnmanagedType.U1 )] bool bEnableLinger ); - private FCloseConnection _CloseConnection; - - #endregion - internal bool CloseConnection( Connection hPeer, int nReason, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszDebug, [MarshalAs( UnmanagedType.U1 )] bool bEnableLinger ) - { - var returnValue = _CloseConnection( Self, hPeer, nReason, pszDebug, bEnableLinger ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FCloseListenSocket( IntPtr self, Socket hSocket ); - private FCloseListenSocket _CloseListenSocket; - - #endregion - internal bool CloseListenSocket( Socket hSocket ) - { - var returnValue = _CloseListenSocket( Self, hSocket ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetConnectionUserData( IntPtr self, Connection hPeer, long nUserData ); - private FSetConnectionUserData _SetConnectionUserData; - - #endregion - internal bool SetConnectionUserData( Connection hPeer, long nUserData ) - { - var returnValue = _SetConnectionUserData( Self, hPeer, nUserData ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate long FGetConnectionUserData( IntPtr self, Connection hPeer ); - private FGetConnectionUserData _GetConnectionUserData; - - #endregion - internal long GetConnectionUserData( Connection hPeer ) - { - var returnValue = _GetConnectionUserData( Self, hPeer ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetConnectionName( IntPtr self, Connection hPeer, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszName ); - private FSetConnectionName _SetConnectionName; - - #endregion - internal void SetConnectionName( Connection hPeer, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszName ) - { - _SetConnectionName( Self, hPeer, pszName ); - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetConnectionName( IntPtr self, Connection hPeer, IntPtr pszName, int nMaxLen ); - private FGetConnectionName _GetConnectionName; - - #endregion - internal bool GetConnectionName( Connection hPeer, out string pszName ) - { - IntPtr mempszName = Helpers.TakeMemory(); - var returnValue = _GetConnectionName( Self, hPeer, mempszName, (1024 * 32) ); - pszName = Helpers.MemoryToString( mempszName ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Result FSendMessageToConnection( IntPtr self, Connection hConn, IntPtr pData, uint cbData, int nSendFlags ); - private FSendMessageToConnection _SendMessageToConnection; - - #endregion - internal Result SendMessageToConnection( Connection hConn, IntPtr pData, uint cbData, int nSendFlags ) - { - var returnValue = _SendMessageToConnection( Self, hConn, pData, cbData, nSendFlags ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Result FFlushMessagesOnConnection( IntPtr self, Connection hConn ); - private FFlushMessagesOnConnection _FlushMessagesOnConnection; - - #endregion - internal Result FlushMessagesOnConnection( Connection hConn ) - { - var returnValue = _FlushMessagesOnConnection( Self, hConn ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FReceiveMessagesOnConnection( IntPtr self, Connection hConn, IntPtr ppOutMessages, int nMaxMessages ); - private FReceiveMessagesOnConnection _ReceiveMessagesOnConnection; - - #endregion - internal int ReceiveMessagesOnConnection( Connection hConn, IntPtr ppOutMessages, int nMaxMessages ) - { - var returnValue = _ReceiveMessagesOnConnection( Self, hConn, ppOutMessages, nMaxMessages ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FReceiveMessagesOnListenSocket( IntPtr self, Socket hSocket, IntPtr ppOutMessages, int nMaxMessages ); - private FReceiveMessagesOnListenSocket _ReceiveMessagesOnListenSocket; - - #endregion - internal int ReceiveMessagesOnListenSocket( Socket hSocket, IntPtr ppOutMessages, int nMaxMessages ) - { - var returnValue = _ReceiveMessagesOnListenSocket( Self, hSocket, ppOutMessages, nMaxMessages ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetConnectionInfo( IntPtr self, Connection hConn, ref ConnectionInfo pInfo ); - private FGetConnectionInfo _GetConnectionInfo; - - #endregion - internal bool GetConnectionInfo( Connection hConn, ref ConnectionInfo pInfo ) - { - var returnValue = _GetConnectionInfo( Self, hConn, ref pInfo ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetQuickConnectionStatus( IntPtr self, Connection hConn, ref SteamNetworkingQuickConnectionStatus pStats ); - private FGetQuickConnectionStatus _GetQuickConnectionStatus; - - #endregion - internal bool GetQuickConnectionStatus( Connection hConn, ref SteamNetworkingQuickConnectionStatus pStats ) - { - var returnValue = _GetQuickConnectionStatus( Self, hConn, ref pStats ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetDetailedConnectionStatus( IntPtr self, Connection hConn, IntPtr pszBuf, int cbBuf ); - private FGetDetailedConnectionStatus _GetDetailedConnectionStatus; - - #endregion - internal int GetDetailedConnectionStatus( Connection hConn, out string pszBuf ) - { - IntPtr mempszBuf = Helpers.TakeMemory(); - var returnValue = _GetDetailedConnectionStatus( Self, hConn, mempszBuf, (1024 * 32) ); - pszBuf = Helpers.MemoryToString( mempszBuf ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetListenSocketAddress( IntPtr self, Socket hSocket, ref NetAddress address ); - private FGetListenSocketAddress _GetListenSocketAddress; - - #endregion - internal bool GetListenSocketAddress( Socket hSocket, ref NetAddress address ) - { - var returnValue = _GetListenSocketAddress( Self, hSocket, ref address ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FCreateSocketPair( IntPtr self, [In,Out] Connection[] pOutConnection1, [In,Out] Connection[] pOutConnection2, [MarshalAs( UnmanagedType.U1 )] bool bUseNetworkLoopback, ref NetIdentity pIdentity1, ref NetIdentity pIdentity2 ); - private FCreateSocketPair _CreateSocketPair; - - #endregion - internal bool CreateSocketPair( [In,Out] Connection[] pOutConnection1, [In,Out] Connection[] pOutConnection2, [MarshalAs( UnmanagedType.U1 )] bool bUseNetworkLoopback, ref NetIdentity pIdentity1, ref NetIdentity pIdentity2 ) - { - var returnValue = _CreateSocketPair( Self, pOutConnection1, pOutConnection2, bUseNetworkLoopback, ref pIdentity1, ref pIdentity2 ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetIdentity( IntPtr self, ref NetIdentity pIdentity ); - private FGetIdentity _GetIdentity; - - #endregion - internal bool GetIdentity( ref NetIdentity pIdentity ) - { - var returnValue = _GetIdentity( Self, ref pIdentity ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FReceivedRelayAuthTicket( IntPtr self, IntPtr pvTicket, int cbTicket, [In,Out] SteamDatagramRelayAuthTicket[] pOutParsedTicket ); - private FReceivedRelayAuthTicket _ReceivedRelayAuthTicket; - - #endregion - internal bool ReceivedRelayAuthTicket( IntPtr pvTicket, int cbTicket, [In,Out] SteamDatagramRelayAuthTicket[] pOutParsedTicket ) - { - var returnValue = _ReceivedRelayAuthTicket( Self, pvTicket, cbTicket, pOutParsedTicket ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FFindRelayAuthTicketForServer( IntPtr self, ref NetIdentity identityGameServer, int nVirtualPort, [In,Out] SteamDatagramRelayAuthTicket[] pOutParsedTicket ); - private FFindRelayAuthTicketForServer _FindRelayAuthTicketForServer; - - #endregion - internal int FindRelayAuthTicketForServer( ref NetIdentity identityGameServer, int nVirtualPort, [In,Out] SteamDatagramRelayAuthTicket[] pOutParsedTicket ) - { - var returnValue = _FindRelayAuthTicketForServer( Self, ref identityGameServer, nVirtualPort, pOutParsedTicket ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Connection FConnectToHostedDedicatedServer( IntPtr self, ref NetIdentity identityTarget, int nVirtualPort ); - private FConnectToHostedDedicatedServer _ConnectToHostedDedicatedServer; - - #endregion - internal Connection ConnectToHostedDedicatedServer( ref NetIdentity identityTarget, int nVirtualPort ) - { - var returnValue = _ConnectToHostedDedicatedServer( Self, ref identityTarget, nVirtualPort ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate ushort FGetHostedDedicatedServerPort( IntPtr self ); - private FGetHostedDedicatedServerPort _GetHostedDedicatedServerPort; - - #endregion - internal ushort GetHostedDedicatedServerPort() - { - var returnValue = _GetHostedDedicatedServerPort( Self ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamNetworkingPOPID FGetHostedDedicatedServerPOPID( IntPtr self ); - private FGetHostedDedicatedServerPOPID _GetHostedDedicatedServerPOPID; - - #endregion - internal SteamNetworkingPOPID GetHostedDedicatedServerPOPID() - { - var returnValue = _GetHostedDedicatedServerPOPID( Self ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetHostedDedicatedServerAddress( IntPtr self, ref SteamDatagramHostedAddress pRouting ); - private FGetHostedDedicatedServerAddress _GetHostedDedicatedServerAddress; - - #endregion - internal bool GetHostedDedicatedServerAddress( ref SteamDatagramHostedAddress pRouting ) - { - var returnValue = _GetHostedDedicatedServerAddress( Self, ref pRouting ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Socket FCreateHostedDedicatedServerListenSocket( IntPtr self, int nVirtualPort ); - private FCreateHostedDedicatedServerListenSocket _CreateHostedDedicatedServerListenSocket; - - #endregion - internal Socket CreateHostedDedicatedServerListenSocket( int nVirtualPort ) - { - var returnValue = _CreateHostedDedicatedServerListenSocket( Self, nVirtualPort ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FRunCallbacks( IntPtr self, IntPtr pCallbacks ); - private FRunCallbacks _RunCallbacks; - - #endregion - internal void RunCallbacks( IntPtr pCallbacks ) - { - _RunCallbacks( Self, pCallbacks ); - } - } } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs index c6ce777..0d5b117 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs @@ -9,8 +9,6 @@ namespace Steamworks { internal class ISteamNetworkingUtils : SteamInterface { - public override string InterfaceName => "SteamNetworkingUtils001"; - public override void InitInternals() { } @@ -20,214 +18,5 @@ internal override void Shutdown() } - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate float FGetLocalPingLocation( IntPtr self, ref PingLocation result ); - private FGetLocalPingLocation _GetLocalPingLocation; - - #endregion - internal float GetLocalPingLocation( ref PingLocation result ) - { - var returnValue = _GetLocalPingLocation( Self, ref result ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FEstimatePingTimeBetweenTwoLocations( IntPtr self, ref PingLocation location1, ref PingLocation location2 ); - private FEstimatePingTimeBetweenTwoLocations _EstimatePingTimeBetweenTwoLocations; - - #endregion - internal int EstimatePingTimeBetweenTwoLocations( ref PingLocation location1, ref PingLocation location2 ) - { - var returnValue = _EstimatePingTimeBetweenTwoLocations( Self, ref location1, ref location2 ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FEstimatePingTimeFromLocalHost( IntPtr self, ref PingLocation remoteLocation ); - private FEstimatePingTimeFromLocalHost _EstimatePingTimeFromLocalHost; - - #endregion - internal int EstimatePingTimeFromLocalHost( ref PingLocation remoteLocation ) - { - var returnValue = _EstimatePingTimeFromLocalHost( Self, ref remoteLocation ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FConvertPingLocationToString( IntPtr self, ref PingLocation location, IntPtr pszBuf, int cchBufSize ); - private FConvertPingLocationToString _ConvertPingLocationToString; - - #endregion - internal void ConvertPingLocationToString( ref PingLocation location, out string pszBuf ) - { - IntPtr mempszBuf = Helpers.TakeMemory(); - _ConvertPingLocationToString( Self, ref location, mempszBuf, (1024 * 32) ); - pszBuf = Helpers.MemoryToString( mempszBuf ); - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FParsePingLocationString( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszString, ref PingLocation result ); - private FParsePingLocationString _ParsePingLocationString; - - #endregion - internal bool ParsePingLocationString( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszString, ref PingLocation result ) - { - var returnValue = _ParsePingLocationString( Self, pszString, ref result ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FCheckPingDataUpToDate( IntPtr self, float flMaxAgeSeconds ); - private FCheckPingDataUpToDate _CheckPingDataUpToDate; - - #endregion - internal bool CheckPingDataUpToDate( float flMaxAgeSeconds ) - { - var returnValue = _CheckPingDataUpToDate( Self, flMaxAgeSeconds ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FIsPingMeasurementInProgress( IntPtr self ); - private FIsPingMeasurementInProgress _IsPingMeasurementInProgress; - - #endregion - internal bool IsPingMeasurementInProgress() - { - var returnValue = _IsPingMeasurementInProgress( Self ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetPingToDataCenter( IntPtr self, SteamNetworkingPOPID popID, ref SteamNetworkingPOPID pViaRelayPoP ); - private FGetPingToDataCenter _GetPingToDataCenter; - - #endregion - internal int GetPingToDataCenter( SteamNetworkingPOPID popID, ref SteamNetworkingPOPID pViaRelayPoP ) - { - var returnValue = _GetPingToDataCenter( Self, popID, ref pViaRelayPoP ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetDirectPingToPOP( IntPtr self, SteamNetworkingPOPID popID ); - private FGetDirectPingToPOP _GetDirectPingToPOP; - - #endregion - internal int GetDirectPingToPOP( SteamNetworkingPOPID popID ) - { - var returnValue = _GetDirectPingToPOP( Self, popID ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetPOPCount( IntPtr self ); - private FGetPOPCount _GetPOPCount; - - #endregion - internal int GetPOPCount() - { - var returnValue = _GetPOPCount( Self ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetPOPList( IntPtr self, ref SteamNetworkingPOPID list, int nListSz ); - private FGetPOPList _GetPOPList; - - #endregion - internal int GetPOPList( ref SteamNetworkingPOPID list, int nListSz ) - { - var returnValue = _GetPOPList( Self, ref list, nListSz ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate long FGetLocalTimestamp( IntPtr self ); - private FGetLocalTimestamp _GetLocalTimestamp; - - #endregion - internal long GetLocalTimestamp() - { - var returnValue = _GetLocalTimestamp( Self ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetDebugOutputFunction( IntPtr self, DebugOutputType eDetailLevel, FSteamNetworkingSocketsDebugOutput pfnFunc ); - private FSetDebugOutputFunction _SetDebugOutputFunction; - - #endregion - internal void SetDebugOutputFunction( DebugOutputType eDetailLevel, FSteamNetworkingSocketsDebugOutput pfnFunc ) - { - _SetDebugOutputFunction( Self, eDetailLevel, pfnFunc ); - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetConfigValue( IntPtr self, NetConfig eValue, NetScope eScopeType, long scopeObj, NetConfigType eDataType, IntPtr pArg ); - private FSetConfigValue _SetConfigValue; - - #endregion - internal bool SetConfigValue( NetConfig eValue, NetScope eScopeType, long scopeObj, NetConfigType eDataType, IntPtr pArg ) - { - var returnValue = _SetConfigValue( Self, eValue, eScopeType, scopeObj, eDataType, pArg ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate NetConfigResult FGetConfigValue( IntPtr self, NetConfig eValue, NetScope eScopeType, long scopeObj, ref NetConfigType pOutDataType, IntPtr pResult, ref ulong cbResult ); - private FGetConfigValue _GetConfigValue; - - #endregion - internal NetConfigResult GetConfigValue( NetConfig eValue, NetScope eScopeType, long scopeObj, ref NetConfigType pOutDataType, IntPtr pResult, ref ulong cbResult ) - { - var returnValue = _GetConfigValue( Self, eValue, eScopeType, scopeObj, ref pOutDataType, pResult, ref cbResult ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetConfigValueInfo( IntPtr self, NetConfig eValue, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pOutName, ref NetConfigType pOutDataType, [In,Out] NetScope[] pOutScope, [In,Out] NetConfig[] pOutNextValue ); - private FGetConfigValueInfo _GetConfigValueInfo; - - #endregion - internal bool GetConfigValueInfo( NetConfig eValue, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pOutName, ref NetConfigType pOutDataType, [In,Out] NetScope[] pOutScope, [In,Out] NetConfig[] pOutNextValue ) - { - var returnValue = _GetConfigValueInfo( Self, eValue, pOutName, ref pOutDataType, pOutScope, pOutNextValue ); - return returnValue; - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate NetConfig FGetFirstConfigValue( IntPtr self ); - private FGetFirstConfigValue _GetFirstConfigValue; - - #endregion - internal NetConfig GetFirstConfigValue() - { - var returnValue = _GetFirstConfigValue( Self ); - return returnValue; - } - } } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamParentalSettings.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamParentalSettings.cs index 475eede..983ef4b 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamParentalSettings.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamParentalSettings.cs @@ -9,8 +9,6 @@ namespace Steamworks { internal class ISteamParentalSettings : SteamInterface { - public override string InterfaceName => "STEAMPARENTALSETTINGS_INTERFACE_VERSION001"; - public override void InitInternals() { } @@ -21,10 +19,9 @@ internal override void Shutdown() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParentalSettings_BIsParentalLockEnabled")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBIsParentalLockEnabled( IntPtr self ); - private FBIsParentalLockEnabled _BIsParentalLockEnabled; + private static extern bool _BIsParentalLockEnabled( IntPtr self ); #endregion internal bool BIsParentalLockEnabled() @@ -34,10 +31,9 @@ internal bool BIsParentalLockEnabled() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParentalSettings_BIsParentalLockLocked")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBIsParentalLockLocked( IntPtr self ); - private FBIsParentalLockLocked _BIsParentalLockLocked; + private static extern bool _BIsParentalLockLocked( IntPtr self ); #endregion internal bool BIsParentalLockLocked() @@ -47,10 +43,9 @@ internal bool BIsParentalLockLocked() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParentalSettings_BIsAppBlocked")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBIsAppBlocked( IntPtr self, AppId nAppID ); - private FBIsAppBlocked _BIsAppBlocked; + private static extern bool _BIsAppBlocked( IntPtr self, AppId nAppID ); #endregion internal bool BIsAppBlocked( AppId nAppID ) @@ -60,10 +55,9 @@ internal bool BIsAppBlocked( AppId nAppID ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParentalSettings_BIsAppInBlockList")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBIsAppInBlockList( IntPtr self, AppId nAppID ); - private FBIsAppInBlockList _BIsAppInBlockList; + private static extern bool _BIsAppInBlockList( IntPtr self, AppId nAppID ); #endregion internal bool BIsAppInBlockList( AppId nAppID ) @@ -73,10 +67,9 @@ internal bool BIsAppInBlockList( AppId nAppID ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParentalSettings_BIsFeatureBlocked")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBIsFeatureBlocked( IntPtr self, ParentalFeature eFeature ); - private FBIsFeatureBlocked _BIsFeatureBlocked; + private static extern bool _BIsFeatureBlocked( IntPtr self, ParentalFeature eFeature ); #endregion internal bool BIsFeatureBlocked( ParentalFeature eFeature ) @@ -86,10 +79,9 @@ internal bool BIsFeatureBlocked( ParentalFeature eFeature ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParentalSettings_BIsFeatureInBlockList")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBIsFeatureInBlockList( IntPtr self, ParentalFeature eFeature ); - private FBIsFeatureInBlockList _BIsFeatureInBlockList; + private static extern bool _BIsFeatureInBlockList( IntPtr self, ParentalFeature eFeature ); #endregion internal bool BIsFeatureInBlockList( ParentalFeature eFeature ) diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamParties.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamParties.cs index 5ad64e6..b26f09f 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamParties.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamParties.cs @@ -9,8 +9,6 @@ namespace Steamworks { internal class ISteamParties : SteamInterface { - public override string InterfaceName => "SteamParties002"; - public override void InitInternals() { } @@ -21,9 +19,8 @@ internal override void Shutdown() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate uint FGetNumActiveBeacons( IntPtr self ); - private FGetNumActiveBeacons _GetNumActiveBeacons; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_GetNumActiveBeacons")] + private static extern uint _GetNumActiveBeacons( IntPtr self ); #endregion internal uint GetNumActiveBeacons() @@ -33,9 +30,8 @@ internal uint GetNumActiveBeacons() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate PartyBeaconID_t FGetBeaconByIndex( IntPtr self, uint unIndex ); - private FGetBeaconByIndex _GetBeaconByIndex; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_GetBeaconByIndex")] + private static extern PartyBeaconID_t _GetBeaconByIndex( IntPtr self, uint unIndex ); #endregion internal PartyBeaconID_t GetBeaconByIndex( uint unIndex ) @@ -45,10 +41,9 @@ internal PartyBeaconID_t GetBeaconByIndex( uint unIndex ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_GetBeaconDetails")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetBeaconDetails( IntPtr self, PartyBeaconID_t ulBeaconID, ref SteamId pSteamIDBeaconOwner, ref SteamPartyBeaconLocation_t pLocation, IntPtr pchMetadata, int cchMetadata ); - private FGetBeaconDetails _GetBeaconDetails; + private static extern bool _GetBeaconDetails( IntPtr self, PartyBeaconID_t ulBeaconID, ref SteamId pSteamIDBeaconOwner, ref SteamPartyBeaconLocation_t pLocation, IntPtr pchMetadata, int cchMetadata ); #endregion internal bool GetBeaconDetails( PartyBeaconID_t ulBeaconID, ref SteamId pSteamIDBeaconOwner, ref SteamPartyBeaconLocation_t pLocation, out string pchMetadata ) @@ -60,22 +55,20 @@ internal bool GetBeaconDetails( PartyBeaconID_t ulBeaconID, ref SteamId pSteamID } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FJoinParty( IntPtr self, PartyBeaconID_t ulBeaconID ); - private FJoinParty _JoinParty; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_JoinParty")] + private static extern SteamAPICall_t _JoinParty( IntPtr self, PartyBeaconID_t ulBeaconID ); #endregion - internal async Task JoinParty( PartyBeaconID_t ulBeaconID ) + internal CallbackResult JoinParty( PartyBeaconID_t ulBeaconID ) { var returnValue = _JoinParty( Self, ulBeaconID ); - return await JoinPartyCallback_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_GetNumAvailableBeaconLocations")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetNumAvailableBeaconLocations( IntPtr self, ref uint puNumLocations ); - private FGetNumAvailableBeaconLocations _GetNumAvailableBeaconLocations; + private static extern bool _GetNumAvailableBeaconLocations( IntPtr self, ref uint puNumLocations ); #endregion internal bool GetNumAvailableBeaconLocations( ref uint puNumLocations ) @@ -85,10 +78,9 @@ internal bool GetNumAvailableBeaconLocations( ref uint puNumLocations ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_GetAvailableBeaconLocations")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetAvailableBeaconLocations( IntPtr self, ref SteamPartyBeaconLocation_t pLocationList, uint uMaxNumLocations ); - private FGetAvailableBeaconLocations _GetAvailableBeaconLocations; + private static extern bool _GetAvailableBeaconLocations( IntPtr self, ref SteamPartyBeaconLocation_t pLocationList, uint uMaxNumLocations ); #endregion internal bool GetAvailableBeaconLocations( ref SteamPartyBeaconLocation_t pLocationList, uint uMaxNumLocations ) @@ -98,21 +90,19 @@ internal bool GetAvailableBeaconLocations( ref SteamPartyBeaconLocation_t pLocat } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FCreateBeacon( IntPtr self, uint unOpenSlots, ref SteamPartyBeaconLocation_t pBeaconLocation, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchConnectString, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMetadata ); - private FCreateBeacon _CreateBeacon; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_CreateBeacon")] + private static extern SteamAPICall_t _CreateBeacon( IntPtr self, uint unOpenSlots, ref SteamPartyBeaconLocation_t pBeaconLocation, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchConnectString, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMetadata ); #endregion - internal async Task CreateBeacon( uint unOpenSlots, /* ref */ SteamPartyBeaconLocation_t pBeaconLocation, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchConnectString, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMetadata ) + internal CallbackResult CreateBeacon( uint unOpenSlots, /* ref */ SteamPartyBeaconLocation_t pBeaconLocation, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchConnectString, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMetadata ) { var returnValue = _CreateBeacon( Self, unOpenSlots, ref pBeaconLocation, pchConnectString, pchMetadata ); - return await CreateBeaconCallback_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FOnReservationCompleted( IntPtr self, PartyBeaconID_t ulBeacon, SteamId steamIDUser ); - private FOnReservationCompleted _OnReservationCompleted; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_OnReservationCompleted")] + private static extern void _OnReservationCompleted( IntPtr self, PartyBeaconID_t ulBeacon, SteamId steamIDUser ); #endregion internal void OnReservationCompleted( PartyBeaconID_t ulBeacon, SteamId steamIDUser ) @@ -121,9 +111,8 @@ internal void OnReservationCompleted( PartyBeaconID_t ulBeacon, SteamId steamIDU } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FCancelReservation( IntPtr self, PartyBeaconID_t ulBeacon, SteamId steamIDUser ); - private FCancelReservation _CancelReservation; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_CancelReservation")] + private static extern void _CancelReservation( IntPtr self, PartyBeaconID_t ulBeacon, SteamId steamIDUser ); #endregion internal void CancelReservation( PartyBeaconID_t ulBeacon, SteamId steamIDUser ) @@ -132,22 +121,20 @@ internal void CancelReservation( PartyBeaconID_t ulBeacon, SteamId steamIDUser ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FChangeNumOpenSlots( IntPtr self, PartyBeaconID_t ulBeacon, uint unOpenSlots ); - private FChangeNumOpenSlots _ChangeNumOpenSlots; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_ChangeNumOpenSlots")] + private static extern SteamAPICall_t _ChangeNumOpenSlots( IntPtr self, PartyBeaconID_t ulBeacon, uint unOpenSlots ); #endregion - internal async Task ChangeNumOpenSlots( PartyBeaconID_t ulBeacon, uint unOpenSlots ) + internal CallbackResult ChangeNumOpenSlots( PartyBeaconID_t ulBeacon, uint unOpenSlots ) { var returnValue = _ChangeNumOpenSlots( Self, ulBeacon, unOpenSlots ); - return await ChangeNumOpenSlotsCallback_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_DestroyBeacon")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FDestroyBeacon( IntPtr self, PartyBeaconID_t ulBeacon ); - private FDestroyBeacon _DestroyBeacon; + private static extern bool _DestroyBeacon( IntPtr self, PartyBeaconID_t ulBeacon ); #endregion internal bool DestroyBeacon( PartyBeaconID_t ulBeacon ) @@ -157,10 +144,9 @@ internal bool DestroyBeacon( PartyBeaconID_t ulBeacon ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_GetBeaconLocationData")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetBeaconLocationData( IntPtr self, SteamPartyBeaconLocation_t BeaconLocation, SteamPartyBeaconLocationData eData, IntPtr pchDataStringOut, int cchDataStringOut ); - private FGetBeaconLocationData _GetBeaconLocationData; + private static extern bool _GetBeaconLocationData( IntPtr self, SteamPartyBeaconLocation_t BeaconLocation, SteamPartyBeaconLocationData eData, IntPtr pchDataStringOut, int cchDataStringOut ); #endregion internal bool GetBeaconLocationData( SteamPartyBeaconLocation_t BeaconLocation, SteamPartyBeaconLocationData eData, out string pchDataStringOut ) diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamRemoteStorage.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamRemoteStorage.cs index 5f49917..e174094 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamRemoteStorage.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamRemoteStorage.cs @@ -9,8 +9,6 @@ namespace Steamworks { internal class ISteamRemoteStorage : SteamInterface { - public override string InterfaceName => "STEAMREMOTESTORAGE_INTERFACE_VERSION014"; - public override void InitInternals() { } @@ -21,10 +19,9 @@ internal override void Shutdown() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWrite")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FFileWrite( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, int cubData ); - private FFileWrite _FileWrite; + private static extern bool _FileWrite( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, int cubData ); #endregion internal bool FileWrite( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, int cubData ) @@ -34,9 +31,8 @@ internal bool FileWrite( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeR } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FFileRead( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, int cubDataToRead ); - private FFileRead _FileRead; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileRead")] + private static extern int _FileRead( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, int cubDataToRead ); #endregion internal int FileRead( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, int cubDataToRead ) @@ -46,34 +42,31 @@ internal int FileRead( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FFileWriteAsync( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, uint cubData ); - private FFileWriteAsync _FileWriteAsync; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWriteAsync")] + private static extern SteamAPICall_t _FileWriteAsync( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, uint cubData ); #endregion - internal async Task FileWriteAsync( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, uint cubData ) + internal CallbackResult FileWriteAsync( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, uint cubData ) { var returnValue = _FileWriteAsync( Self, pchFile, pvData, cubData ); - return await RemoteStorageFileWriteAsyncComplete_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FFileReadAsync( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, uint nOffset, uint cubToRead ); - private FFileReadAsync _FileReadAsync; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileReadAsync")] + private static extern SteamAPICall_t _FileReadAsync( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, uint nOffset, uint cubToRead ); #endregion - internal async Task FileReadAsync( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, uint nOffset, uint cubToRead ) + internal CallbackResult FileReadAsync( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, uint nOffset, uint cubToRead ) { var returnValue = _FileReadAsync( Self, pchFile, nOffset, cubToRead ); - return await RemoteStorageFileReadAsyncComplete_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileReadAsyncComplete")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FFileReadAsyncComplete( IntPtr self, SteamAPICall_t hReadCall, IntPtr pvBuffer, uint cubToRead ); - private FFileReadAsyncComplete _FileReadAsyncComplete; + private static extern bool _FileReadAsyncComplete( IntPtr self, SteamAPICall_t hReadCall, IntPtr pvBuffer, uint cubToRead ); #endregion internal bool FileReadAsyncComplete( SteamAPICall_t hReadCall, IntPtr pvBuffer, uint cubToRead ) @@ -83,10 +76,9 @@ internal bool FileReadAsyncComplete( SteamAPICall_t hReadCall, IntPtr pvBuffer, } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileForget")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FFileForget( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); - private FFileForget _FileForget; + private static extern bool _FileForget( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); #endregion internal bool FileForget( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) @@ -96,10 +88,9 @@ internal bool FileForget( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalType } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileDelete")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FFileDelete( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); - private FFileDelete _FileDelete; + private static extern bool _FileDelete( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); #endregion internal bool FileDelete( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) @@ -109,22 +100,20 @@ internal bool FileDelete( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalType } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FFileShare( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); - private FFileShare _FileShare; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileShare")] + private static extern SteamAPICall_t _FileShare( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); #endregion - internal async Task FileShare( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + internal CallbackResult FileShare( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) { var returnValue = _FileShare( Self, pchFile ); - return await RemoteStorageFileShareResult_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_SetSyncPlatforms")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetSyncPlatforms( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, RemoteStoragePlatform eRemoteStoragePlatform ); - private FSetSyncPlatforms _SetSyncPlatforms; + private static extern bool _SetSyncPlatforms( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, RemoteStoragePlatform eRemoteStoragePlatform ); #endregion internal bool SetSyncPlatforms( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, RemoteStoragePlatform eRemoteStoragePlatform ) @@ -134,9 +123,8 @@ internal bool SetSyncPlatforms( [MarshalAs( UnmanagedType.CustomMarshaler, Marsh } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate UGCFileWriteStreamHandle_t FFileWriteStreamOpen( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); - private FFileWriteStreamOpen _FileWriteStreamOpen; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWriteStreamOpen")] + private static extern UGCFileWriteStreamHandle_t _FileWriteStreamOpen( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); #endregion internal UGCFileWriteStreamHandle_t FileWriteStreamOpen( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) @@ -146,10 +134,9 @@ internal UGCFileWriteStreamHandle_t FileWriteStreamOpen( [MarshalAs( UnmanagedTy } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWriteStreamWriteChunk")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FFileWriteStreamWriteChunk( IntPtr self, UGCFileWriteStreamHandle_t writeHandle, IntPtr pvData, int cubData ); - private FFileWriteStreamWriteChunk _FileWriteStreamWriteChunk; + private static extern bool _FileWriteStreamWriteChunk( IntPtr self, UGCFileWriteStreamHandle_t writeHandle, IntPtr pvData, int cubData ); #endregion internal bool FileWriteStreamWriteChunk( UGCFileWriteStreamHandle_t writeHandle, IntPtr pvData, int cubData ) @@ -159,10 +146,9 @@ internal bool FileWriteStreamWriteChunk( UGCFileWriteStreamHandle_t writeHandle, } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWriteStreamClose")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FFileWriteStreamClose( IntPtr self, UGCFileWriteStreamHandle_t writeHandle ); - private FFileWriteStreamClose _FileWriteStreamClose; + private static extern bool _FileWriteStreamClose( IntPtr self, UGCFileWriteStreamHandle_t writeHandle ); #endregion internal bool FileWriteStreamClose( UGCFileWriteStreamHandle_t writeHandle ) @@ -172,10 +158,9 @@ internal bool FileWriteStreamClose( UGCFileWriteStreamHandle_t writeHandle ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWriteStreamCancel")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FFileWriteStreamCancel( IntPtr self, UGCFileWriteStreamHandle_t writeHandle ); - private FFileWriteStreamCancel _FileWriteStreamCancel; + private static extern bool _FileWriteStreamCancel( IntPtr self, UGCFileWriteStreamHandle_t writeHandle ); #endregion internal bool FileWriteStreamCancel( UGCFileWriteStreamHandle_t writeHandle ) @@ -185,10 +170,9 @@ internal bool FileWriteStreamCancel( UGCFileWriteStreamHandle_t writeHandle ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileExists")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FFileExists( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); - private FFileExists _FileExists; + private static extern bool _FileExists( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); #endregion internal bool FileExists( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) @@ -198,10 +182,9 @@ internal bool FileExists( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalType } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FilePersisted")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FFilePersisted( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); - private FFilePersisted _FilePersisted; + private static extern bool _FilePersisted( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); #endregion internal bool FilePersisted( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) @@ -211,9 +194,8 @@ internal bool FilePersisted( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalT } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetFileSize( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); - private FGetFileSize _GetFileSize; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetFileSize")] + private static extern int _GetFileSize( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); #endregion internal int GetFileSize( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) @@ -223,9 +205,8 @@ internal int GetFileSize( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalType } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate long FGetFileTimestamp( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); - private FGetFileTimestamp _GetFileTimestamp; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetFileTimestamp")] + private static extern long _GetFileTimestamp( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); #endregion internal long GetFileTimestamp( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) @@ -235,9 +216,8 @@ internal long GetFileTimestamp( [MarshalAs( UnmanagedType.CustomMarshaler, Marsh } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate RemoteStoragePlatform FGetSyncPlatforms( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); - private FGetSyncPlatforms _GetSyncPlatforms; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetSyncPlatforms")] + private static extern RemoteStoragePlatform _GetSyncPlatforms( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); #endregion internal RemoteStoragePlatform GetSyncPlatforms( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) @@ -247,9 +227,8 @@ internal RemoteStoragePlatform GetSyncPlatforms( [MarshalAs( UnmanagedType.Custo } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetFileCount( IntPtr self ); - private FGetFileCount _GetFileCount; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetFileCount")] + private static extern int _GetFileCount( IntPtr self ); #endregion internal int GetFileCount() @@ -259,9 +238,8 @@ internal int GetFileCount() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Utf8StringPointer FGetFileNameAndSize( IntPtr self, int iFile, ref int pnFileSizeInBytes ); - private FGetFileNameAndSize _GetFileNameAndSize; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetFileNameAndSize")] + private static extern Utf8StringPointer _GetFileNameAndSize( IntPtr self, int iFile, ref int pnFileSizeInBytes ); #endregion internal string GetFileNameAndSize( int iFile, ref int pnFileSizeInBytes ) @@ -271,10 +249,9 @@ internal string GetFileNameAndSize( int iFile, ref int pnFileSizeInBytes ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetQuota")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetQuota( IntPtr self, ref ulong pnTotalBytes, ref ulong puAvailableBytes ); - private FGetQuota _GetQuota; + private static extern bool _GetQuota( IntPtr self, ref ulong pnTotalBytes, ref ulong puAvailableBytes ); #endregion internal bool GetQuota( ref ulong pnTotalBytes, ref ulong puAvailableBytes ) @@ -284,10 +261,9 @@ internal bool GetQuota( ref ulong pnTotalBytes, ref ulong puAvailableBytes ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_IsCloudEnabledForAccount")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FIsCloudEnabledForAccount( IntPtr self ); - private FIsCloudEnabledForAccount _IsCloudEnabledForAccount; + private static extern bool _IsCloudEnabledForAccount( IntPtr self ); #endregion internal bool IsCloudEnabledForAccount() @@ -297,10 +273,9 @@ internal bool IsCloudEnabledForAccount() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_IsCloudEnabledForApp")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FIsCloudEnabledForApp( IntPtr self ); - private FIsCloudEnabledForApp _IsCloudEnabledForApp; + private static extern bool _IsCloudEnabledForApp( IntPtr self ); #endregion internal bool IsCloudEnabledForApp() @@ -310,9 +285,8 @@ internal bool IsCloudEnabledForApp() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetCloudEnabledForApp( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bEnabled ); - private FSetCloudEnabledForApp _SetCloudEnabledForApp; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_SetCloudEnabledForApp")] + private static extern void _SetCloudEnabledForApp( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bEnabled ); #endregion internal void SetCloudEnabledForApp( [MarshalAs( UnmanagedType.U1 )] bool bEnabled ) @@ -321,22 +295,20 @@ internal void SetCloudEnabledForApp( [MarshalAs( UnmanagedType.U1 )] bool bEnabl } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FUGCDownload( IntPtr self, UGCHandle_t hContent, uint unPriority ); - private FUGCDownload _UGCDownload; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_UGCDownload")] + private static extern SteamAPICall_t _UGCDownload( IntPtr self, UGCHandle_t hContent, uint unPriority ); #endregion - internal async Task UGCDownload( UGCHandle_t hContent, uint unPriority ) + internal CallbackResult UGCDownload( UGCHandle_t hContent, uint unPriority ) { var returnValue = _UGCDownload( Self, hContent, unPriority ); - return await RemoteStorageDownloadUGCResult_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetUGCDownloadProgress")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetUGCDownloadProgress( IntPtr self, UGCHandle_t hContent, ref int pnBytesDownloaded, ref int pnBytesExpected ); - private FGetUGCDownloadProgress _GetUGCDownloadProgress; + private static extern bool _GetUGCDownloadProgress( IntPtr self, UGCHandle_t hContent, ref int pnBytesDownloaded, ref int pnBytesExpected ); #endregion internal bool GetUGCDownloadProgress( UGCHandle_t hContent, ref int pnBytesDownloaded, ref int pnBytesExpected ) @@ -346,10 +318,9 @@ internal bool GetUGCDownloadProgress( UGCHandle_t hContent, ref int pnBytesDownl } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetUGCDetails")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetUGCDetails( IntPtr self, UGCHandle_t hContent, ref AppId pnAppID, [In,Out] ref char[] ppchName, ref int pnFileSizeInBytes, ref SteamId pSteamIDOwner ); - private FGetUGCDetails _GetUGCDetails; + private static extern bool _GetUGCDetails( IntPtr self, UGCHandle_t hContent, ref AppId pnAppID, [In,Out] ref char[] ppchName, ref int pnFileSizeInBytes, ref SteamId pSteamIDOwner ); #endregion internal bool GetUGCDetails( UGCHandle_t hContent, ref AppId pnAppID, [In,Out] ref char[] ppchName, ref int pnFileSizeInBytes, ref SteamId pSteamIDOwner ) @@ -359,9 +330,8 @@ internal bool GetUGCDetails( UGCHandle_t hContent, ref AppId pnAppID, [In,Out] r } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FUGCRead( IntPtr self, UGCHandle_t hContent, IntPtr pvData, int cubDataToRead, uint cOffset, UGCReadAction eAction ); - private FUGCRead _UGCRead; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_UGCRead")] + private static extern int _UGCRead( IntPtr self, UGCHandle_t hContent, IntPtr pvData, int cubDataToRead, uint cOffset, UGCReadAction eAction ); #endregion internal int UGCRead( UGCHandle_t hContent, IntPtr pvData, int cubDataToRead, uint cOffset, UGCReadAction eAction ) @@ -371,9 +341,8 @@ internal int UGCRead( UGCHandle_t hContent, IntPtr pvData, int cubDataToRead, ui } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetCachedUGCCount( IntPtr self ); - private FGetCachedUGCCount _GetCachedUGCCount; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetCachedUGCCount")] + private static extern int _GetCachedUGCCount( IntPtr self ); #endregion internal int GetCachedUGCCount() @@ -383,15 +352,25 @@ internal int GetCachedUGCCount() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FUGCDownloadToLocation( IntPtr self, UGCHandle_t hContent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLocation, uint unPriority ); - private FUGCDownloadToLocation _UGCDownloadToLocation; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle")] + private static extern UGCHandle_t _GetCachedUGCHandle( IntPtr self, int iCachedContent ); #endregion - internal async Task UGCDownloadToLocation( UGCHandle_t hContent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLocation, uint unPriority ) + internal UGCHandle_t GetCachedUGCHandle( int iCachedContent ) + { + var returnValue = _GetCachedUGCHandle( Self, iCachedContent ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation")] + private static extern SteamAPICall_t _UGCDownloadToLocation( IntPtr self, UGCHandle_t hContent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLocation, uint unPriority ); + + #endregion + internal CallbackResult UGCDownloadToLocation( UGCHandle_t hContent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLocation, uint unPriority ) { var returnValue = _UGCDownloadToLocation( Self, hContent, pchLocation, unPriority ); - return await RemoteStorageDownloadUGCResult_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamScreenshots.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamScreenshots.cs index e59764f..5320b8d 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamScreenshots.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamScreenshots.cs @@ -9,8 +9,6 @@ namespace Steamworks { internal class ISteamScreenshots : SteamInterface { - public override string InterfaceName => "STEAMSCREENSHOTS_INTERFACE_VERSION003"; - public override void InitInternals() { } @@ -21,9 +19,8 @@ internal override void Shutdown() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate ScreenshotHandle FWriteScreenshot( IntPtr self, IntPtr pubRGB, uint cubRGB, int nWidth, int nHeight ); - private FWriteScreenshot _WriteScreenshot; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamScreenshots_WriteScreenshot")] + private static extern ScreenshotHandle _WriteScreenshot( IntPtr self, IntPtr pubRGB, uint cubRGB, int nWidth, int nHeight ); #endregion internal ScreenshotHandle WriteScreenshot( IntPtr pubRGB, uint cubRGB, int nWidth, int nHeight ) @@ -33,9 +30,8 @@ internal ScreenshotHandle WriteScreenshot( IntPtr pubRGB, uint cubRGB, int nWidt } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate ScreenshotHandle FAddScreenshotToLibrary( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFilename, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchThumbnailFilename, int nWidth, int nHeight ); - private FAddScreenshotToLibrary _AddScreenshotToLibrary; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamScreenshots_AddScreenshotToLibrary")] + private static extern ScreenshotHandle _AddScreenshotToLibrary( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFilename, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchThumbnailFilename, int nWidth, int nHeight ); #endregion internal ScreenshotHandle AddScreenshotToLibrary( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFilename, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchThumbnailFilename, int nWidth, int nHeight ) @@ -45,9 +41,8 @@ internal ScreenshotHandle AddScreenshotToLibrary( [MarshalAs( UnmanagedType.Cust } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FTriggerScreenshot( IntPtr self ); - private FTriggerScreenshot _TriggerScreenshot; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamScreenshots_TriggerScreenshot")] + private static extern void _TriggerScreenshot( IntPtr self ); #endregion internal void TriggerScreenshot() @@ -56,9 +51,8 @@ internal void TriggerScreenshot() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FHookScreenshots( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bHook ); - private FHookScreenshots _HookScreenshots; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamScreenshots_HookScreenshots")] + private static extern void _HookScreenshots( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bHook ); #endregion internal void HookScreenshots( [MarshalAs( UnmanagedType.U1 )] bool bHook ) @@ -67,10 +61,9 @@ internal void HookScreenshots( [MarshalAs( UnmanagedType.U1 )] bool bHook ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamScreenshots_SetLocation")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetLocation( IntPtr self, ScreenshotHandle hScreenshot, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLocation ); - private FSetLocation _SetLocation; + private static extern bool _SetLocation( IntPtr self, ScreenshotHandle hScreenshot, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLocation ); #endregion internal bool SetLocation( ScreenshotHandle hScreenshot, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLocation ) @@ -80,10 +73,9 @@ internal bool SetLocation( ScreenshotHandle hScreenshot, [MarshalAs( UnmanagedTy } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamScreenshots_TagUser")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FTagUser( IntPtr self, ScreenshotHandle hScreenshot, SteamId steamID ); - private FTagUser _TagUser; + private static extern bool _TagUser( IntPtr self, ScreenshotHandle hScreenshot, SteamId steamID ); #endregion internal bool TagUser( ScreenshotHandle hScreenshot, SteamId steamID ) @@ -93,10 +85,9 @@ internal bool TagUser( ScreenshotHandle hScreenshot, SteamId steamID ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamScreenshots_TagPublishedFile")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FTagPublishedFile( IntPtr self, ScreenshotHandle hScreenshot, PublishedFileId unPublishedFileID ); - private FTagPublishedFile _TagPublishedFile; + private static extern bool _TagPublishedFile( IntPtr self, ScreenshotHandle hScreenshot, PublishedFileId unPublishedFileID ); #endregion internal bool TagPublishedFile( ScreenshotHandle hScreenshot, PublishedFileId unPublishedFileID ) @@ -106,10 +97,9 @@ internal bool TagPublishedFile( ScreenshotHandle hScreenshot, PublishedFileId un } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamScreenshots_IsScreenshotsHooked")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FIsScreenshotsHooked( IntPtr self ); - private FIsScreenshotsHooked _IsScreenshotsHooked; + private static extern bool _IsScreenshotsHooked( IntPtr self ); #endregion internal bool IsScreenshotsHooked() @@ -119,9 +109,8 @@ internal bool IsScreenshotsHooked() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate ScreenshotHandle FAddVRScreenshotToLibrary( IntPtr self, VRScreenshotType eType, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFilename, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVRFilename ); - private FAddVRScreenshotToLibrary _AddVRScreenshotToLibrary; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamScreenshots_AddVRScreenshotToLibrary")] + private static extern ScreenshotHandle _AddVRScreenshotToLibrary( IntPtr self, VRScreenshotType eType, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFilename, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVRFilename ); #endregion internal ScreenshotHandle AddVRScreenshotToLibrary( VRScreenshotType eType, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFilename, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVRFilename ) diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs index 89de48d..dbd4449 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs @@ -9,8 +9,6 @@ namespace Steamworks { internal class ISteamUGC : SteamInterface { - public override string InterfaceName => "STEAMUGC_INTERFACE_VERSION012"; - public override void InitInternals() { } @@ -21,9 +19,8 @@ internal override void Shutdown() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate UGCQueryHandle_t FCreateQueryUserUGCRequest( IntPtr self, AccountID_t unAccountID, UserUGCList eListType, UgcType eMatchingUGCType, UserUGCListSortOrder eSortOrder, AppId nCreatorAppID, AppId nConsumerAppID, uint unPage ); - private FCreateQueryUserUGCRequest _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 ); #endregion internal UGCQueryHandle_t CreateQueryUserUGCRequest( AccountID_t unAccountID, UserUGCList eListType, UgcType eMatchingUGCType, UserUGCListSortOrder eSortOrder, AppId nCreatorAppID, AppId nConsumerAppID, uint unPage ) @@ -33,33 +30,30 @@ internal UGCQueryHandle_t CreateQueryUserUGCRequest( AccountID_t unAccountID, Us } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate UGCQueryHandle_t FCreateQueryAllUGCRequest1( IntPtr self, UGCQuery eQueryType, UgcType eMatchingeMatchingUGCTypeFileType, AppId nCreatorAppID, AppId nConsumerAppID, uint unPage ); - private FCreateQueryAllUGCRequest1 _CreateQueryAllUGCRequest1; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_CreateQueryAllUGCRequest")] + private static extern UGCQueryHandle_t _CreateQueryAllUGCRequest( IntPtr self, UGCQuery eQueryType, UgcType eMatchingeMatchingUGCTypeFileType, AppId nCreatorAppID, AppId nConsumerAppID, uint unPage ); #endregion - internal UGCQueryHandle_t CreateQueryAllUGCRequest1( UGCQuery eQueryType, UgcType eMatchingeMatchingUGCTypeFileType, AppId nCreatorAppID, AppId nConsumerAppID, uint unPage ) + internal UGCQueryHandle_t CreateQueryAllUGCRequest( UGCQuery eQueryType, UgcType eMatchingeMatchingUGCTypeFileType, AppId nCreatorAppID, AppId nConsumerAppID, uint unPage ) { - var returnValue = _CreateQueryAllUGCRequest1( Self, eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, unPage ); + var returnValue = _CreateQueryAllUGCRequest( Self, eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, unPage ); return returnValue; } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate UGCQueryHandle_t FCreateQueryAllUGCRequest2( IntPtr self, UGCQuery eQueryType, UgcType eMatchingeMatchingUGCTypeFileType, AppId nCreatorAppID, AppId nConsumerAppID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchCursor ); - private FCreateQueryAllUGCRequest2 _CreateQueryAllUGCRequest2; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_CreateQueryAllUGCRequest0")] + private static extern UGCQueryHandle_t _CreateQueryAllUGCRequest0( IntPtr self, UGCQuery eQueryType, UgcType eMatchingeMatchingUGCTypeFileType, AppId nCreatorAppID, AppId nConsumerAppID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchCursor ); #endregion - internal UGCQueryHandle_t CreateQueryAllUGCRequest2( UGCQuery eQueryType, UgcType eMatchingeMatchingUGCTypeFileType, AppId nCreatorAppID, AppId nConsumerAppID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchCursor ) + internal UGCQueryHandle_t CreateQueryAllUGCRequest0( UGCQuery eQueryType, UgcType eMatchingeMatchingUGCTypeFileType, AppId nCreatorAppID, AppId nConsumerAppID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchCursor ) { - var returnValue = _CreateQueryAllUGCRequest2( Self, eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, pchCursor ); + var returnValue = _CreateQueryAllUGCRequest0( Self, eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, pchCursor ); return returnValue; } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate UGCQueryHandle_t FCreateQueryUGCDetailsRequest( IntPtr self, [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ); - private FCreateQueryUGCDetailsRequest _CreateQueryUGCDetailsRequest; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest")] + private static extern UGCQueryHandle_t _CreateQueryUGCDetailsRequest( IntPtr self, [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ); #endregion internal UGCQueryHandle_t CreateQueryUGCDetailsRequest( [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ) @@ -69,22 +63,20 @@ internal UGCQueryHandle_t CreateQueryUGCDetailsRequest( [In,Out] PublishedFileId } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FSendQueryUGCRequest( IntPtr self, UGCQueryHandle_t handle ); - private FSendQueryUGCRequest _SendQueryUGCRequest; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SendQueryUGCRequest")] + private static extern SteamAPICall_t _SendQueryUGCRequest( IntPtr self, UGCQueryHandle_t handle ); #endregion - internal async Task SendQueryUGCRequest( UGCQueryHandle_t handle ) + internal CallbackResult SendQueryUGCRequest( UGCQueryHandle_t handle ) { var returnValue = _SendQueryUGCRequest( Self, handle ); - return await SteamUGCQueryCompleted_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCResult")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetQueryUGCResult( IntPtr self, UGCQueryHandle_t handle, uint index, ref SteamUGCDetails_t pDetails ); - private FGetQueryUGCResult _GetQueryUGCResult; + private static extern bool _GetQueryUGCResult( IntPtr self, UGCQueryHandle_t handle, uint index, ref SteamUGCDetails_t pDetails ); #endregion internal bool GetQueryUGCResult( UGCQueryHandle_t handle, uint index, ref SteamUGCDetails_t pDetails ) @@ -94,10 +86,9 @@ internal bool GetQueryUGCResult( UGCQueryHandle_t handle, uint index, ref SteamU } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCPreviewURL")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetQueryUGCPreviewURL( IntPtr self, UGCQueryHandle_t handle, uint index, IntPtr pchURL, uint cchURLSize ); - private FGetQueryUGCPreviewURL _GetQueryUGCPreviewURL; + private static extern bool _GetQueryUGCPreviewURL( IntPtr self, UGCQueryHandle_t handle, uint index, IntPtr pchURL, uint cchURLSize ); #endregion internal bool GetQueryUGCPreviewURL( UGCQueryHandle_t handle, uint index, out string pchURL ) @@ -109,10 +100,9 @@ internal bool GetQueryUGCPreviewURL( UGCQueryHandle_t handle, uint index, out st } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCMetadata")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetQueryUGCMetadata( IntPtr self, UGCQueryHandle_t handle, uint index, IntPtr pchMetadata, uint cchMetadatasize ); - private FGetQueryUGCMetadata _GetQueryUGCMetadata; + private static extern bool _GetQueryUGCMetadata( IntPtr self, UGCQueryHandle_t handle, uint index, IntPtr pchMetadata, uint cchMetadatasize ); #endregion internal bool GetQueryUGCMetadata( UGCQueryHandle_t handle, uint index, out string pchMetadata ) @@ -124,10 +114,9 @@ internal bool GetQueryUGCMetadata( UGCQueryHandle_t handle, uint index, out stri } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCChildren")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetQueryUGCChildren( IntPtr self, UGCQueryHandle_t handle, uint index, [In,Out] PublishedFileId[] pvecPublishedFileID, uint cMaxEntries ); - private FGetQueryUGCChildren _GetQueryUGCChildren; + private static extern bool _GetQueryUGCChildren( IntPtr self, UGCQueryHandle_t handle, uint index, [In,Out] PublishedFileId[] pvecPublishedFileID, uint cMaxEntries ); #endregion internal bool GetQueryUGCChildren( UGCQueryHandle_t handle, uint index, [In,Out] PublishedFileId[] pvecPublishedFileID, uint cMaxEntries ) @@ -137,10 +126,9 @@ internal bool GetQueryUGCChildren( UGCQueryHandle_t handle, uint index, [In,Out] } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCStatistic")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetQueryUGCStatistic( IntPtr self, UGCQueryHandle_t handle, uint index, ItemStatistic eStatType, ref ulong pStatValue ); - private FGetQueryUGCStatistic _GetQueryUGCStatistic; + private static extern bool _GetQueryUGCStatistic( IntPtr self, UGCQueryHandle_t handle, uint index, ItemStatistic eStatType, ref ulong pStatValue ); #endregion internal bool GetQueryUGCStatistic( UGCQueryHandle_t handle, uint index, ItemStatistic eStatType, ref ulong pStatValue ) @@ -150,9 +138,8 @@ internal bool GetQueryUGCStatistic( UGCQueryHandle_t handle, uint index, ItemSta } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate uint FGetQueryUGCNumAdditionalPreviews( IntPtr self, UGCQueryHandle_t handle, uint index ); - private FGetQueryUGCNumAdditionalPreviews _GetQueryUGCNumAdditionalPreviews; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCNumAdditionalPreviews")] + private static extern uint _GetQueryUGCNumAdditionalPreviews( IntPtr self, UGCQueryHandle_t handle, uint index ); #endregion internal uint GetQueryUGCNumAdditionalPreviews( UGCQueryHandle_t handle, uint index ) @@ -162,10 +149,9 @@ internal uint GetQueryUGCNumAdditionalPreviews( UGCQueryHandle_t handle, uint in } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCAdditionalPreview")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetQueryUGCAdditionalPreview( IntPtr self, UGCQueryHandle_t handle, uint index, uint previewIndex, IntPtr pchURLOrVideoID, uint cchURLSize, IntPtr pchOriginalFileName, uint cchOriginalFileNameSize, ref ItemPreviewType pPreviewType ); - private FGetQueryUGCAdditionalPreview _GetQueryUGCAdditionalPreview; + private static extern bool _GetQueryUGCAdditionalPreview( IntPtr self, UGCQueryHandle_t handle, uint index, uint previewIndex, IntPtr pchURLOrVideoID, uint cchURLSize, IntPtr pchOriginalFileName, uint cchOriginalFileNameSize, ref ItemPreviewType pPreviewType ); #endregion internal bool GetQueryUGCAdditionalPreview( UGCQueryHandle_t handle, uint index, uint previewIndex, out string pchURLOrVideoID, out string pchOriginalFileName, ref ItemPreviewType pPreviewType ) @@ -179,9 +165,8 @@ internal bool GetQueryUGCAdditionalPreview( UGCQueryHandle_t handle, uint index, } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate uint FGetQueryUGCNumKeyValueTags( IntPtr self, UGCQueryHandle_t handle, uint index ); - private FGetQueryUGCNumKeyValueTags _GetQueryUGCNumKeyValueTags; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCNumKeyValueTags")] + private static extern uint _GetQueryUGCNumKeyValueTags( IntPtr self, UGCQueryHandle_t handle, uint index ); #endregion internal uint GetQueryUGCNumKeyValueTags( UGCQueryHandle_t handle, uint index ) @@ -191,10 +176,9 @@ internal uint GetQueryUGCNumKeyValueTags( UGCQueryHandle_t handle, uint index ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCKeyValueTag")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetQueryUGCKeyValueTag( IntPtr self, UGCQueryHandle_t handle, uint index, uint keyValueTagIndex, IntPtr pchKey, uint cchKeySize, IntPtr pchValue, uint cchValueSize ); - private FGetQueryUGCKeyValueTag _GetQueryUGCKeyValueTag; + private static extern bool _GetQueryUGCKeyValueTag( IntPtr self, UGCQueryHandle_t handle, uint index, uint keyValueTagIndex, IntPtr pchKey, uint cchKeySize, IntPtr pchValue, uint cchValueSize ); #endregion internal bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint index, uint keyValueTagIndex, out string pchKey, out string pchValue ) @@ -208,10 +192,9 @@ internal bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint index, uint } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_ReleaseQueryUGCRequest")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FReleaseQueryUGCRequest( IntPtr self, UGCQueryHandle_t handle ); - private FReleaseQueryUGCRequest _ReleaseQueryUGCRequest; + private static extern bool _ReleaseQueryUGCRequest( IntPtr self, UGCQueryHandle_t handle ); #endregion internal bool ReleaseQueryUGCRequest( UGCQueryHandle_t handle ) @@ -221,10 +204,9 @@ internal bool ReleaseQueryUGCRequest( UGCQueryHandle_t handle ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_AddRequiredTag")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FAddRequiredTag( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pTagName ); - private FAddRequiredTag _AddRequiredTag; + private static extern bool _AddRequiredTag( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pTagName ); #endregion internal bool AddRequiredTag( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pTagName ) @@ -234,10 +216,9 @@ internal bool AddRequiredTag( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_AddExcludedTag")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FAddExcludedTag( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pTagName ); - private FAddExcludedTag _AddExcludedTag; + private static extern bool _AddExcludedTag( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pTagName ); #endregion internal bool AddExcludedTag( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pTagName ) @@ -247,10 +228,9 @@ internal bool AddExcludedTag( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetReturnOnlyIDs")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetReturnOnlyIDs( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnOnlyIDs ); - private FSetReturnOnlyIDs _SetReturnOnlyIDs; + private static extern bool _SetReturnOnlyIDs( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnOnlyIDs ); #endregion internal bool SetReturnOnlyIDs( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnOnlyIDs ) @@ -260,10 +240,9 @@ internal bool SetReturnOnlyIDs( UGCQueryHandle_t handle, [MarshalAs( UnmanagedTy } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetReturnKeyValueTags")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetReturnKeyValueTags( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnKeyValueTags ); - private FSetReturnKeyValueTags _SetReturnKeyValueTags; + private static extern bool _SetReturnKeyValueTags( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnKeyValueTags ); #endregion internal bool SetReturnKeyValueTags( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnKeyValueTags ) @@ -273,10 +252,9 @@ internal bool SetReturnKeyValueTags( UGCQueryHandle_t handle, [MarshalAs( Unmana } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetReturnLongDescription")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetReturnLongDescription( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnLongDescription ); - private FSetReturnLongDescription _SetReturnLongDescription; + private static extern bool _SetReturnLongDescription( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnLongDescription ); #endregion internal bool SetReturnLongDescription( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnLongDescription ) @@ -286,10 +264,9 @@ internal bool SetReturnLongDescription( UGCQueryHandle_t handle, [MarshalAs( Unm } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetReturnMetadata")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetReturnMetadata( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnMetadata ); - private FSetReturnMetadata _SetReturnMetadata; + private static extern bool _SetReturnMetadata( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnMetadata ); #endregion internal bool SetReturnMetadata( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnMetadata ) @@ -299,10 +276,9 @@ internal bool SetReturnMetadata( UGCQueryHandle_t handle, [MarshalAs( UnmanagedT } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetReturnChildren")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetReturnChildren( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnChildren ); - private FSetReturnChildren _SetReturnChildren; + private static extern bool _SetReturnChildren( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnChildren ); #endregion internal bool SetReturnChildren( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnChildren ) @@ -312,10 +288,9 @@ internal bool SetReturnChildren( UGCQueryHandle_t handle, [MarshalAs( UnmanagedT } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetReturnAdditionalPreviews")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetReturnAdditionalPreviews( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnAdditionalPreviews ); - private FSetReturnAdditionalPreviews _SetReturnAdditionalPreviews; + private static extern bool _SetReturnAdditionalPreviews( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnAdditionalPreviews ); #endregion internal bool SetReturnAdditionalPreviews( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnAdditionalPreviews ) @@ -325,10 +300,9 @@ internal bool SetReturnAdditionalPreviews( UGCQueryHandle_t handle, [MarshalAs( } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetReturnTotalOnly")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetReturnTotalOnly( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnTotalOnly ); - private FSetReturnTotalOnly _SetReturnTotalOnly; + private static extern bool _SetReturnTotalOnly( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnTotalOnly ); #endregion internal bool SetReturnTotalOnly( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnTotalOnly ) @@ -338,10 +312,9 @@ internal bool SetReturnTotalOnly( UGCQueryHandle_t handle, [MarshalAs( Unmanaged } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetReturnPlaytimeStats")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetReturnPlaytimeStats( IntPtr self, UGCQueryHandle_t handle, uint unDays ); - private FSetReturnPlaytimeStats _SetReturnPlaytimeStats; + private static extern bool _SetReturnPlaytimeStats( IntPtr self, UGCQueryHandle_t handle, uint unDays ); #endregion internal bool SetReturnPlaytimeStats( UGCQueryHandle_t handle, uint unDays ) @@ -351,10 +324,9 @@ internal bool SetReturnPlaytimeStats( UGCQueryHandle_t handle, uint unDays ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetLanguage")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetLanguage( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLanguage ); - private FSetLanguage _SetLanguage; + private static extern bool _SetLanguage( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLanguage ); #endregion internal bool SetLanguage( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLanguage ) @@ -364,10 +336,9 @@ internal bool SetLanguage( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.Cu } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetAllowCachedResponse")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetAllowCachedResponse( IntPtr self, UGCQueryHandle_t handle, uint unMaxAgeSeconds ); - private FSetAllowCachedResponse _SetAllowCachedResponse; + private static extern bool _SetAllowCachedResponse( IntPtr self, UGCQueryHandle_t handle, uint unMaxAgeSeconds ); #endregion internal bool SetAllowCachedResponse( UGCQueryHandle_t handle, uint unMaxAgeSeconds ) @@ -377,10 +348,9 @@ internal bool SetAllowCachedResponse( UGCQueryHandle_t handle, uint unMaxAgeSeco } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetCloudFileNameFilter")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetCloudFileNameFilter( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pMatchCloudFileName ); - private FSetCloudFileNameFilter _SetCloudFileNameFilter; + private static extern bool _SetCloudFileNameFilter( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pMatchCloudFileName ); #endregion internal bool SetCloudFileNameFilter( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pMatchCloudFileName ) @@ -390,10 +360,9 @@ internal bool SetCloudFileNameFilter( UGCQueryHandle_t handle, [MarshalAs( Unman } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetMatchAnyTag")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetMatchAnyTag( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bMatchAnyTag ); - private FSetMatchAnyTag _SetMatchAnyTag; + private static extern bool _SetMatchAnyTag( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bMatchAnyTag ); #endregion internal bool SetMatchAnyTag( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bMatchAnyTag ) @@ -403,10 +372,9 @@ internal bool SetMatchAnyTag( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetSearchText")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetSearchText( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pSearchText ); - private FSetSearchText _SetSearchText; + private static extern bool _SetSearchText( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pSearchText ); #endregion internal bool SetSearchText( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pSearchText ) @@ -416,10 +384,9 @@ internal bool SetSearchText( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType. } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetRankedByTrendDays")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetRankedByTrendDays( IntPtr self, UGCQueryHandle_t handle, uint unDays ); - private FSetRankedByTrendDays _SetRankedByTrendDays; + private static extern bool _SetRankedByTrendDays( IntPtr self, UGCQueryHandle_t handle, uint unDays ); #endregion internal bool SetRankedByTrendDays( UGCQueryHandle_t handle, uint unDays ) @@ -429,10 +396,9 @@ internal bool SetRankedByTrendDays( UGCQueryHandle_t handle, uint unDays ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_AddRequiredKeyValueTag")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FAddRequiredKeyValueTag( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pValue ); - private FAddRequiredKeyValueTag _AddRequiredKeyValueTag; + private static extern bool _AddRequiredKeyValueTag( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pValue ); #endregion internal bool AddRequiredKeyValueTag( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pValue ) @@ -442,33 +408,30 @@ internal bool AddRequiredKeyValueTag( UGCQueryHandle_t handle, [MarshalAs( Unman } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FRequestUGCDetails( IntPtr self, PublishedFileId nPublishedFileID, uint unMaxAgeSeconds ); - private FRequestUGCDetails _RequestUGCDetails; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_RequestUGCDetails")] + private static extern SteamAPICall_t _RequestUGCDetails( IntPtr self, PublishedFileId nPublishedFileID, uint unMaxAgeSeconds ); #endregion - internal async Task RequestUGCDetails( PublishedFileId nPublishedFileID, uint unMaxAgeSeconds ) + internal CallbackResult RequestUGCDetails( PublishedFileId nPublishedFileID, uint unMaxAgeSeconds ) { var returnValue = _RequestUGCDetails( Self, nPublishedFileID, unMaxAgeSeconds ); - return await SteamUGCRequestUGCDetailsResult_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FCreateItem( IntPtr self, AppId nConsumerAppId, WorkshopFileType eFileType ); - private FCreateItem _CreateItem; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_CreateItem")] + private static extern SteamAPICall_t _CreateItem( IntPtr self, AppId nConsumerAppId, WorkshopFileType eFileType ); #endregion - internal async Task CreateItem( AppId nConsumerAppId, WorkshopFileType eFileType ) + internal CallbackResult CreateItem( AppId nConsumerAppId, WorkshopFileType eFileType ) { var returnValue = _CreateItem( Self, nConsumerAppId, eFileType ); - return await CreateItemResult_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate UGCUpdateHandle_t FStartItemUpdate( IntPtr self, AppId nConsumerAppId, PublishedFileId nPublishedFileID ); - private FStartItemUpdate _StartItemUpdate; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_StartItemUpdate")] + private static extern UGCUpdateHandle_t _StartItemUpdate( IntPtr self, AppId nConsumerAppId, PublishedFileId nPublishedFileID ); #endregion internal UGCUpdateHandle_t StartItemUpdate( AppId nConsumerAppId, PublishedFileId nPublishedFileID ) @@ -478,10 +441,9 @@ internal UGCUpdateHandle_t StartItemUpdate( AppId nConsumerAppId, PublishedFileI } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetItemTitle")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetItemTitle( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle ); - private FSetItemTitle _SetItemTitle; + private static extern bool _SetItemTitle( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle ); #endregion internal bool SetItemTitle( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle ) @@ -491,10 +453,9 @@ internal bool SetItemTitle( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType. } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetItemDescription")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetItemDescription( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription ); - private FSetItemDescription _SetItemDescription; + private static extern bool _SetItemDescription( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription ); #endregion internal bool SetItemDescription( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription ) @@ -504,10 +465,9 @@ internal bool SetItemDescription( UGCUpdateHandle_t handle, [MarshalAs( Unmanage } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetItemUpdateLanguage")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetItemUpdateLanguage( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLanguage ); - private FSetItemUpdateLanguage _SetItemUpdateLanguage; + private static extern bool _SetItemUpdateLanguage( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLanguage ); #endregion internal bool SetItemUpdateLanguage( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLanguage ) @@ -517,10 +477,9 @@ internal bool SetItemUpdateLanguage( UGCUpdateHandle_t handle, [MarshalAs( Unman } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetItemMetadata")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetItemMetadata( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMetaData ); - private FSetItemMetadata _SetItemMetadata; + private static extern bool _SetItemMetadata( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMetaData ); #endregion internal bool SetItemMetadata( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMetaData ) @@ -530,10 +489,9 @@ internal bool SetItemMetadata( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedTy } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetItemVisibility")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetItemVisibility( IntPtr self, UGCUpdateHandle_t handle, RemoteStoragePublishedFileVisibility eVisibility ); - private FSetItemVisibility _SetItemVisibility; + private static extern bool _SetItemVisibility( IntPtr self, UGCUpdateHandle_t handle, RemoteStoragePublishedFileVisibility eVisibility ); #endregion internal bool SetItemVisibility( UGCUpdateHandle_t handle, RemoteStoragePublishedFileVisibility eVisibility ) @@ -543,10 +501,9 @@ internal bool SetItemVisibility( UGCUpdateHandle_t handle, RemoteStoragePublishe } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetItemTags")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetItemTags( IntPtr self, UGCUpdateHandle_t updateHandle, ref SteamParamStringArray_t pTags ); - private FSetItemTags _SetItemTags; + private static extern bool _SetItemTags( IntPtr self, UGCUpdateHandle_t updateHandle, ref SteamParamStringArray_t pTags ); #endregion internal bool SetItemTags( UGCUpdateHandle_t updateHandle, ref SteamParamStringArray_t pTags ) @@ -556,10 +513,9 @@ internal bool SetItemTags( UGCUpdateHandle_t updateHandle, ref SteamParamStringA } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetItemContent")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetItemContent( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszContentFolder ); - private FSetItemContent _SetItemContent; + private static extern bool _SetItemContent( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszContentFolder ); #endregion internal bool SetItemContent( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszContentFolder ) @@ -569,10 +525,9 @@ internal bool SetItemContent( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedTyp } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetItemPreview")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetItemPreview( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszPreviewFile ); - private FSetItemPreview _SetItemPreview; + private static extern bool _SetItemPreview( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszPreviewFile ); #endregion internal bool SetItemPreview( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszPreviewFile ) @@ -582,10 +537,9 @@ internal bool SetItemPreview( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedTyp } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetAllowLegacyUpload")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetAllowLegacyUpload( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bAllowLegacyUpload ); - private FSetAllowLegacyUpload _SetAllowLegacyUpload; + private static extern bool _SetAllowLegacyUpload( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bAllowLegacyUpload ); #endregion internal bool SetAllowLegacyUpload( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bAllowLegacyUpload ) @@ -595,10 +549,9 @@ internal bool SetAllowLegacyUpload( UGCUpdateHandle_t handle, [MarshalAs( Unmana } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_RemoveItemKeyValueTags")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FRemoveItemKeyValueTags( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); - private FRemoveItemKeyValueTags _RemoveItemKeyValueTags; + private static extern bool _RemoveItemKeyValueTags( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); #endregion internal bool RemoveItemKeyValueTags( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) @@ -608,10 +561,9 @@ internal bool RemoveItemKeyValueTags( UGCUpdateHandle_t handle, [MarshalAs( Unma } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_AddItemKeyValueTag")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FAddItemKeyValueTag( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ); - private FAddItemKeyValueTag _AddItemKeyValueTag; + private static extern bool _AddItemKeyValueTag( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ); #endregion internal bool AddItemKeyValueTag( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ) @@ -621,10 +573,9 @@ internal bool AddItemKeyValueTag( UGCUpdateHandle_t handle, [MarshalAs( Unmanage } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_AddItemPreviewFile")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FAddItemPreviewFile( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszPreviewFile, ItemPreviewType type ); - private FAddItemPreviewFile _AddItemPreviewFile; + private static extern bool _AddItemPreviewFile( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszPreviewFile, ItemPreviewType type ); #endregion internal bool AddItemPreviewFile( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszPreviewFile, ItemPreviewType type ) @@ -634,10 +585,9 @@ internal bool AddItemPreviewFile( UGCUpdateHandle_t handle, [MarshalAs( Unmanage } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_AddItemPreviewVideo")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FAddItemPreviewVideo( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszVideoID ); - private FAddItemPreviewVideo _AddItemPreviewVideo; + private static extern bool _AddItemPreviewVideo( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszVideoID ); #endregion internal bool AddItemPreviewVideo( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszVideoID ) @@ -647,10 +597,9 @@ internal bool AddItemPreviewVideo( UGCUpdateHandle_t handle, [MarshalAs( Unmanag } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_UpdateItemPreviewFile")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FUpdateItemPreviewFile( IntPtr self, UGCUpdateHandle_t handle, uint index, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszPreviewFile ); - private FUpdateItemPreviewFile _UpdateItemPreviewFile; + private static extern bool _UpdateItemPreviewFile( IntPtr self, UGCUpdateHandle_t handle, uint index, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszPreviewFile ); #endregion internal bool UpdateItemPreviewFile( UGCUpdateHandle_t handle, uint index, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszPreviewFile ) @@ -660,10 +609,9 @@ internal bool UpdateItemPreviewFile( UGCUpdateHandle_t handle, uint index, [Mars } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_UpdateItemPreviewVideo")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FUpdateItemPreviewVideo( IntPtr self, UGCUpdateHandle_t handle, uint index, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszVideoID ); - private FUpdateItemPreviewVideo _UpdateItemPreviewVideo; + private static extern bool _UpdateItemPreviewVideo( IntPtr self, UGCUpdateHandle_t handle, uint index, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszVideoID ); #endregion internal bool UpdateItemPreviewVideo( UGCUpdateHandle_t handle, uint index, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszVideoID ) @@ -673,10 +621,9 @@ internal bool UpdateItemPreviewVideo( UGCUpdateHandle_t handle, uint index, [Mar } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_RemoveItemPreview")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FRemoveItemPreview( IntPtr self, UGCUpdateHandle_t handle, uint index ); - private FRemoveItemPreview _RemoveItemPreview; + private static extern bool _RemoveItemPreview( IntPtr self, UGCUpdateHandle_t handle, uint index ); #endregion internal bool RemoveItemPreview( UGCUpdateHandle_t handle, uint index ) @@ -686,21 +633,19 @@ internal bool RemoveItemPreview( UGCUpdateHandle_t handle, uint index ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FSubmitItemUpdate( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchChangeNote ); - private FSubmitItemUpdate _SubmitItemUpdate; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SubmitItemUpdate")] + private static extern SteamAPICall_t _SubmitItemUpdate( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchChangeNote ); #endregion - internal async Task SubmitItemUpdate( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchChangeNote ) + internal CallbackResult SubmitItemUpdate( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchChangeNote ) { var returnValue = _SubmitItemUpdate( Self, handle, pchChangeNote ); - return await SubmitItemUpdateResult_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate ItemUpdateStatus FGetItemUpdateProgress( IntPtr self, UGCUpdateHandle_t handle, ref ulong punBytesProcessed, ref ulong punBytesTotal ); - private FGetItemUpdateProgress _GetItemUpdateProgress; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetItemUpdateProgress")] + private static extern ItemUpdateStatus _GetItemUpdateProgress( IntPtr self, UGCUpdateHandle_t handle, ref ulong punBytesProcessed, ref ulong punBytesTotal ); #endregion internal ItemUpdateStatus GetItemUpdateProgress( UGCUpdateHandle_t handle, ref ulong punBytesProcessed, ref ulong punBytesTotal ) @@ -710,81 +655,74 @@ internal ItemUpdateStatus GetItemUpdateProgress( UGCUpdateHandle_t handle, ref u } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FSetUserItemVote( IntPtr self, PublishedFileId nPublishedFileID, [MarshalAs( UnmanagedType.U1 )] bool bVoteUp ); - private FSetUserItemVote _SetUserItemVote; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetUserItemVote")] + private static extern SteamAPICall_t _SetUserItemVote( IntPtr self, PublishedFileId nPublishedFileID, [MarshalAs( UnmanagedType.U1 )] bool bVoteUp ); #endregion - internal async Task SetUserItemVote( PublishedFileId nPublishedFileID, [MarshalAs( UnmanagedType.U1 )] bool bVoteUp ) + internal CallbackResult SetUserItemVote( PublishedFileId nPublishedFileID, [MarshalAs( UnmanagedType.U1 )] bool bVoteUp ) { var returnValue = _SetUserItemVote( Self, nPublishedFileID, bVoteUp ); - return await SetUserItemVoteResult_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FGetUserItemVote( IntPtr self, PublishedFileId nPublishedFileID ); - private FGetUserItemVote _GetUserItemVote; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetUserItemVote")] + private static extern SteamAPICall_t _GetUserItemVote( IntPtr self, PublishedFileId nPublishedFileID ); #endregion - internal async Task GetUserItemVote( PublishedFileId nPublishedFileID ) + internal CallbackResult GetUserItemVote( PublishedFileId nPublishedFileID ) { var returnValue = _GetUserItemVote( Self, nPublishedFileID ); - return await GetUserItemVoteResult_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FAddItemToFavorites( IntPtr self, AppId nAppId, PublishedFileId nPublishedFileID ); - private FAddItemToFavorites _AddItemToFavorites; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_AddItemToFavorites")] + private static extern SteamAPICall_t _AddItemToFavorites( IntPtr self, AppId nAppId, PublishedFileId nPublishedFileID ); #endregion - internal async Task AddItemToFavorites( AppId nAppId, PublishedFileId nPublishedFileID ) + internal CallbackResult AddItemToFavorites( AppId nAppId, PublishedFileId nPublishedFileID ) { var returnValue = _AddItemToFavorites( Self, nAppId, nPublishedFileID ); - return await UserFavoriteItemsListChanged_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FRemoveItemFromFavorites( IntPtr self, AppId nAppId, PublishedFileId nPublishedFileID ); - private FRemoveItemFromFavorites _RemoveItemFromFavorites; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_RemoveItemFromFavorites")] + private static extern SteamAPICall_t _RemoveItemFromFavorites( IntPtr self, AppId nAppId, PublishedFileId nPublishedFileID ); #endregion - internal async Task RemoveItemFromFavorites( AppId nAppId, PublishedFileId nPublishedFileID ) + internal CallbackResult RemoveItemFromFavorites( AppId nAppId, PublishedFileId nPublishedFileID ) { var returnValue = _RemoveItemFromFavorites( Self, nAppId, nPublishedFileID ); - return await UserFavoriteItemsListChanged_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FSubscribeItem( IntPtr self, PublishedFileId nPublishedFileID ); - private FSubscribeItem _SubscribeItem; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SubscribeItem")] + private static extern SteamAPICall_t _SubscribeItem( IntPtr self, PublishedFileId nPublishedFileID ); #endregion - internal async Task SubscribeItem( PublishedFileId nPublishedFileID ) + internal CallbackResult SubscribeItem( PublishedFileId nPublishedFileID ) { var returnValue = _SubscribeItem( Self, nPublishedFileID ); - return await RemoteStorageSubscribePublishedFileResult_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FUnsubscribeItem( IntPtr self, PublishedFileId nPublishedFileID ); - private FUnsubscribeItem _UnsubscribeItem; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_UnsubscribeItem")] + private static extern SteamAPICall_t _UnsubscribeItem( IntPtr self, PublishedFileId nPublishedFileID ); #endregion - internal async Task UnsubscribeItem( PublishedFileId nPublishedFileID ) + internal CallbackResult UnsubscribeItem( PublishedFileId nPublishedFileID ) { var returnValue = _UnsubscribeItem( Self, nPublishedFileID ); - return await RemoteStorageUnsubscribePublishedFileResult_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate uint FGetNumSubscribedItems( IntPtr self ); - private FGetNumSubscribedItems _GetNumSubscribedItems; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetNumSubscribedItems")] + private static extern uint _GetNumSubscribedItems( IntPtr self ); #endregion internal uint GetNumSubscribedItems() @@ -794,9 +732,8 @@ internal uint GetNumSubscribedItems() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate uint FGetSubscribedItems( IntPtr self, [In,Out] PublishedFileId[] pvecPublishedFileID, uint cMaxEntries ); - private FGetSubscribedItems _GetSubscribedItems; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetSubscribedItems")] + private static extern uint _GetSubscribedItems( IntPtr self, [In,Out] PublishedFileId[] pvecPublishedFileID, uint cMaxEntries ); #endregion internal uint GetSubscribedItems( [In,Out] PublishedFileId[] pvecPublishedFileID, uint cMaxEntries ) @@ -806,9 +743,8 @@ internal uint GetSubscribedItems( [In,Out] PublishedFileId[] pvecPublishedFileI } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate uint FGetItemState( IntPtr self, PublishedFileId nPublishedFileID ); - private FGetItemState _GetItemState; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetItemState")] + private static extern uint _GetItemState( IntPtr self, PublishedFileId nPublishedFileID ); #endregion internal uint GetItemState( PublishedFileId nPublishedFileID ) @@ -818,10 +754,9 @@ internal uint GetItemState( PublishedFileId nPublishedFileID ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetItemInstallInfo")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetItemInstallInfo( IntPtr self, PublishedFileId nPublishedFileID, ref ulong punSizeOnDisk, IntPtr pchFolder, uint cchFolderSize, ref uint punTimeStamp ); - private FGetItemInstallInfo _GetItemInstallInfo; + private static extern bool _GetItemInstallInfo( IntPtr self, PublishedFileId nPublishedFileID, ref ulong punSizeOnDisk, IntPtr pchFolder, uint cchFolderSize, ref uint punTimeStamp ); #endregion internal bool GetItemInstallInfo( PublishedFileId nPublishedFileID, ref ulong punSizeOnDisk, out string pchFolder, ref uint punTimeStamp ) @@ -833,10 +768,9 @@ internal bool GetItemInstallInfo( PublishedFileId nPublishedFileID, ref ulong pu } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetItemDownloadInfo")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetItemDownloadInfo( IntPtr self, PublishedFileId nPublishedFileID, ref ulong punBytesDownloaded, ref ulong punBytesTotal ); - private FGetItemDownloadInfo _GetItemDownloadInfo; + private static extern bool _GetItemDownloadInfo( IntPtr self, PublishedFileId nPublishedFileID, ref ulong punBytesDownloaded, ref ulong punBytesTotal ); #endregion internal bool GetItemDownloadInfo( PublishedFileId nPublishedFileID, ref ulong punBytesDownloaded, ref ulong punBytesTotal ) @@ -846,10 +780,9 @@ internal bool GetItemDownloadInfo( PublishedFileId nPublishedFileID, ref ulong p } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_DownloadItem")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FDownloadItem( IntPtr self, PublishedFileId nPublishedFileID, [MarshalAs( UnmanagedType.U1 )] bool bHighPriority ); - private FDownloadItem _DownloadItem; + private static extern bool _DownloadItem( IntPtr self, PublishedFileId nPublishedFileID, [MarshalAs( UnmanagedType.U1 )] bool bHighPriority ); #endregion internal bool DownloadItem( PublishedFileId nPublishedFileID, [MarshalAs( UnmanagedType.U1 )] bool bHighPriority ) @@ -859,10 +792,9 @@ internal bool DownloadItem( PublishedFileId nPublishedFileID, [MarshalAs( Unmana } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_BInitWorkshopForGameServer")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBInitWorkshopForGameServer( IntPtr self, DepotId_t unWorkshopDepotID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszFolder ); - private FBInitWorkshopForGameServer _BInitWorkshopForGameServer; + private static extern bool _BInitWorkshopForGameServer( IntPtr self, DepotId_t unWorkshopDepotID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszFolder ); #endregion internal bool BInitWorkshopForGameServer( DepotId_t unWorkshopDepotID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszFolder ) @@ -872,9 +804,8 @@ internal bool BInitWorkshopForGameServer( DepotId_t unWorkshopDepotID, [MarshalA } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSuspendDownloads( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bSuspend ); - private FSuspendDownloads _SuspendDownloads; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SuspendDownloads")] + private static extern void _SuspendDownloads( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bSuspend ); #endregion internal void SuspendDownloads( [MarshalAs( UnmanagedType.U1 )] bool bSuspend ) @@ -883,111 +814,102 @@ internal void SuspendDownloads( [MarshalAs( UnmanagedType.U1 )] bool bSuspend ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FStartPlaytimeTracking( IntPtr self, [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ); - private FStartPlaytimeTracking _StartPlaytimeTracking; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_StartPlaytimeTracking")] + private static extern SteamAPICall_t _StartPlaytimeTracking( IntPtr self, [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ); #endregion - internal async Task StartPlaytimeTracking( [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ) + internal CallbackResult StartPlaytimeTracking( [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ) { var returnValue = _StartPlaytimeTracking( Self, pvecPublishedFileID, unNumPublishedFileIDs ); - return await StartPlaytimeTrackingResult_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FStopPlaytimeTracking( IntPtr self, [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ); - private FStopPlaytimeTracking _StopPlaytimeTracking; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_StopPlaytimeTracking")] + private static extern SteamAPICall_t _StopPlaytimeTracking( IntPtr self, [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ); #endregion - internal async Task StopPlaytimeTracking( [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ) + internal CallbackResult StopPlaytimeTracking( [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ) { var returnValue = _StopPlaytimeTracking( Self, pvecPublishedFileID, unNumPublishedFileIDs ); - return await StopPlaytimeTrackingResult_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FStopPlaytimeTrackingForAllItems( IntPtr self ); - private FStopPlaytimeTrackingForAllItems _StopPlaytimeTrackingForAllItems; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_StopPlaytimeTrackingForAllItems")] + private static extern SteamAPICall_t _StopPlaytimeTrackingForAllItems( IntPtr self ); #endregion - internal async Task StopPlaytimeTrackingForAllItems() + internal CallbackResult StopPlaytimeTrackingForAllItems() { var returnValue = _StopPlaytimeTrackingForAllItems( Self ); - return await StopPlaytimeTrackingResult_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FAddDependency( IntPtr self, PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID ); - private FAddDependency _AddDependency; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_AddDependency")] + private static extern SteamAPICall_t _AddDependency( IntPtr self, PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID ); #endregion - internal async Task AddDependency( PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID ) + internal CallbackResult AddDependency( PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID ) { var returnValue = _AddDependency( Self, nParentPublishedFileID, nChildPublishedFileID ); - return await AddUGCDependencyResult_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FRemoveDependency( IntPtr self, PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID ); - private FRemoveDependency _RemoveDependency; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_RemoveDependency")] + private static extern SteamAPICall_t _RemoveDependency( IntPtr self, PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID ); #endregion - internal async Task RemoveDependency( PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID ) + internal CallbackResult RemoveDependency( PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID ) { var returnValue = _RemoveDependency( Self, nParentPublishedFileID, nChildPublishedFileID ); - return await RemoveUGCDependencyResult_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FAddAppDependency( IntPtr self, PublishedFileId nPublishedFileID, AppId nAppID ); - private FAddAppDependency _AddAppDependency; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_AddAppDependency")] + private static extern SteamAPICall_t _AddAppDependency( IntPtr self, PublishedFileId nPublishedFileID, AppId nAppID ); #endregion - internal async Task AddAppDependency( PublishedFileId nPublishedFileID, AppId nAppID ) + internal CallbackResult AddAppDependency( PublishedFileId nPublishedFileID, AppId nAppID ) { var returnValue = _AddAppDependency( Self, nPublishedFileID, nAppID ); - return await AddAppDependencyResult_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FRemoveAppDependency( IntPtr self, PublishedFileId nPublishedFileID, AppId nAppID ); - private FRemoveAppDependency _RemoveAppDependency; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_RemoveAppDependency")] + private static extern SteamAPICall_t _RemoveAppDependency( IntPtr self, PublishedFileId nPublishedFileID, AppId nAppID ); #endregion - internal async Task RemoveAppDependency( PublishedFileId nPublishedFileID, AppId nAppID ) + internal CallbackResult RemoveAppDependency( PublishedFileId nPublishedFileID, AppId nAppID ) { var returnValue = _RemoveAppDependency( Self, nPublishedFileID, nAppID ); - return await RemoveAppDependencyResult_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FGetAppDependencies( IntPtr self, PublishedFileId nPublishedFileID ); - private FGetAppDependencies _GetAppDependencies; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetAppDependencies")] + private static extern SteamAPICall_t _GetAppDependencies( IntPtr self, PublishedFileId nPublishedFileID ); #endregion - internal async Task GetAppDependencies( PublishedFileId nPublishedFileID ) + internal CallbackResult GetAppDependencies( PublishedFileId nPublishedFileID ) { var returnValue = _GetAppDependencies( Self, nPublishedFileID ); - return await GetAppDependenciesResult_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FDeleteItem( IntPtr self, PublishedFileId nPublishedFileID ); - private FDeleteItem _DeleteItem; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_DeleteItem")] + private static extern SteamAPICall_t _DeleteItem( IntPtr self, PublishedFileId nPublishedFileID ); #endregion - internal async Task DeleteItem( PublishedFileId nPublishedFileID ) + internal CallbackResult DeleteItem( PublishedFileId nPublishedFileID ) { var returnValue = _DeleteItem( Self, nPublishedFileID ); - return await DeleteItemResult_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamUser.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamUser.cs index cc26ef6..752b07e 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamUser.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamUser.cs @@ -9,8 +9,6 @@ namespace Steamworks { internal class ISteamUser : SteamInterface { - public override string InterfaceName => "SteamUser020"; - public override void InitInternals() { } @@ -21,9 +19,8 @@ internal override void Shutdown() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate HSteamUser FGetHSteamUser( IntPtr self ); - private FGetHSteamUser _GetHSteamUser; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetHSteamUser")] + private static extern HSteamUser _GetHSteamUser( IntPtr self ); #endregion internal HSteamUser GetHSteamUser() @@ -33,10 +30,9 @@ internal HSteamUser GetHSteamUser() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_BLoggedOn")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBLoggedOn( IntPtr self ); - private FBLoggedOn _BLoggedOn; + private static extern bool _BLoggedOn( IntPtr self ); #endregion internal bool BLoggedOn() @@ -46,31 +42,19 @@ internal bool BLoggedOn() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - #if PLATFORM_WIN - private delegate void FGetSteamID( IntPtr self, ref SteamId retVal ); - #else - private delegate SteamId FGetSteamID( IntPtr self ); - #endif - private FGetSteamID _GetSteamID; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetSteamID")] + private static extern SteamId _GetSteamID( IntPtr self ); #endregion internal SteamId GetSteamID() { - #if PLATFORM_WIN - var retVal = default( SteamId ); - _GetSteamID( Self, ref retVal ); - return retVal; - #else var returnValue = _GetSteamID( Self ); return returnValue; - #endif } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FInitiateGameConnection( IntPtr self, IntPtr pAuthBlob, int cbMaxAuthBlob, SteamId steamIDGameServer, uint unIPServer, ushort usPortServer, [MarshalAs( UnmanagedType.U1 )] bool bSecure ); - private FInitiateGameConnection _InitiateGameConnection; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_InitiateGameConnection")] + private static extern int _InitiateGameConnection( IntPtr self, IntPtr pAuthBlob, int cbMaxAuthBlob, SteamId steamIDGameServer, uint unIPServer, ushort usPortServer, [MarshalAs( UnmanagedType.U1 )] bool bSecure ); #endregion internal int InitiateGameConnection( IntPtr pAuthBlob, int cbMaxAuthBlob, SteamId steamIDGameServer, uint unIPServer, ushort usPortServer, [MarshalAs( UnmanagedType.U1 )] bool bSecure ) @@ -80,9 +64,8 @@ internal int InitiateGameConnection( IntPtr pAuthBlob, int cbMaxAuthBlob, SteamI } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FTerminateGameConnection( IntPtr self, uint unIPServer, ushort usPortServer ); - private FTerminateGameConnection _TerminateGameConnection; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_TerminateGameConnection")] + private static extern void _TerminateGameConnection( IntPtr self, uint unIPServer, ushort usPortServer ); #endregion internal void TerminateGameConnection( uint unIPServer, ushort usPortServer ) @@ -91,9 +74,8 @@ internal void TerminateGameConnection( uint unIPServer, ushort usPortServer ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FTrackAppUsageEvent( IntPtr self, GameId gameID, int eAppUsageEvent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchExtraInfo ); - private FTrackAppUsageEvent _TrackAppUsageEvent; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_TrackAppUsageEvent")] + private static extern void _TrackAppUsageEvent( IntPtr self, GameId gameID, int eAppUsageEvent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchExtraInfo ); #endregion internal void TrackAppUsageEvent( GameId gameID, int eAppUsageEvent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchExtraInfo ) @@ -102,10 +84,9 @@ internal void TrackAppUsageEvent( GameId gameID, int eAppUsageEvent, [MarshalAs( } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetUserDataFolder")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetUserDataFolder( IntPtr self, IntPtr pchBuffer, int cubBuffer ); - private FGetUserDataFolder _GetUserDataFolder; + private static extern bool _GetUserDataFolder( IntPtr self, IntPtr pchBuffer, int cubBuffer ); #endregion internal bool GetUserDataFolder( out string pchBuffer ) @@ -117,9 +98,8 @@ internal bool GetUserDataFolder( out string pchBuffer ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FStartVoiceRecording( IntPtr self ); - private FStartVoiceRecording _StartVoiceRecording; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_StartVoiceRecording")] + private static extern void _StartVoiceRecording( IntPtr self ); #endregion internal void StartVoiceRecording() @@ -128,9 +108,8 @@ internal void StartVoiceRecording() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FStopVoiceRecording( IntPtr self ); - private FStopVoiceRecording _StopVoiceRecording; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_StopVoiceRecording")] + private static extern void _StopVoiceRecording( IntPtr self ); #endregion internal void StopVoiceRecording() @@ -139,9 +118,8 @@ internal void StopVoiceRecording() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate VoiceResult FGetAvailableVoice( IntPtr self, ref uint pcbCompressed, ref uint pcbUncompressed_Deprecated, uint nUncompressedVoiceDesiredSampleRate_Deprecated ); - private FGetAvailableVoice _GetAvailableVoice; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetAvailableVoice")] + private static extern VoiceResult _GetAvailableVoice( IntPtr self, ref uint pcbCompressed, ref uint pcbUncompressed_Deprecated, uint nUncompressedVoiceDesiredSampleRate_Deprecated ); #endregion internal VoiceResult GetAvailableVoice( ref uint pcbCompressed, ref uint pcbUncompressed_Deprecated, uint nUncompressedVoiceDesiredSampleRate_Deprecated ) @@ -151,9 +129,8 @@ internal VoiceResult GetAvailableVoice( ref uint pcbCompressed, ref uint pcbUnco } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate VoiceResult FGetVoice( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bWantCompressed, IntPtr pDestBuffer, uint cbDestBufferSize, ref uint nBytesWritten, [MarshalAs( UnmanagedType.U1 )] bool bWantUncompressed_Deprecated, IntPtr pUncompressedDestBuffer_Deprecated, uint cbUncompressedDestBufferSize_Deprecated, ref uint nUncompressBytesWritten_Deprecated, uint nUncompressedVoiceDesiredSampleRate_Deprecated ); - private FGetVoice _GetVoice; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetVoice")] + private static extern VoiceResult _GetVoice( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bWantCompressed, IntPtr pDestBuffer, uint cbDestBufferSize, ref uint nBytesWritten, [MarshalAs( UnmanagedType.U1 )] bool bWantUncompressed_Deprecated, IntPtr pUncompressedDestBuffer_Deprecated, uint cbUncompressedDestBufferSize_Deprecated, ref uint nUncompressBytesWritten_Deprecated, uint nUncompressedVoiceDesiredSampleRate_Deprecated ); #endregion internal VoiceResult GetVoice( [MarshalAs( UnmanagedType.U1 )] bool bWantCompressed, IntPtr pDestBuffer, uint cbDestBufferSize, ref uint nBytesWritten, [MarshalAs( UnmanagedType.U1 )] bool bWantUncompressed_Deprecated, IntPtr pUncompressedDestBuffer_Deprecated, uint cbUncompressedDestBufferSize_Deprecated, ref uint nUncompressBytesWritten_Deprecated, uint nUncompressedVoiceDesiredSampleRate_Deprecated ) @@ -163,9 +140,8 @@ internal VoiceResult GetVoice( [MarshalAs( UnmanagedType.U1 )] bool bWantCompres } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate VoiceResult FDecompressVoice( IntPtr self, IntPtr pCompressed, uint cbCompressed, IntPtr pDestBuffer, uint cbDestBufferSize, ref uint nBytesWritten, uint nDesiredSampleRate ); - private FDecompressVoice _DecompressVoice; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_DecompressVoice")] + private static extern VoiceResult _DecompressVoice( IntPtr self, IntPtr pCompressed, uint cbCompressed, IntPtr pDestBuffer, uint cbDestBufferSize, ref uint nBytesWritten, uint nDesiredSampleRate ); #endregion internal VoiceResult DecompressVoice( IntPtr pCompressed, uint cbCompressed, IntPtr pDestBuffer, uint cbDestBufferSize, ref uint nBytesWritten, uint nDesiredSampleRate ) @@ -175,9 +151,8 @@ internal VoiceResult DecompressVoice( IntPtr pCompressed, uint cbCompressed, Int } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate uint FGetVoiceOptimalSampleRate( IntPtr self ); - private FGetVoiceOptimalSampleRate _GetVoiceOptimalSampleRate; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetVoiceOptimalSampleRate")] + private static extern uint _GetVoiceOptimalSampleRate( IntPtr self ); #endregion internal uint GetVoiceOptimalSampleRate() @@ -187,9 +162,8 @@ internal uint GetVoiceOptimalSampleRate() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate HAuthTicket FGetAuthSessionTicket( IntPtr self, IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket ); - private FGetAuthSessionTicket _GetAuthSessionTicket; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetAuthSessionTicket")] + private static extern HAuthTicket _GetAuthSessionTicket( IntPtr self, IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket ); #endregion internal HAuthTicket GetAuthSessionTicket( IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket ) @@ -199,9 +173,8 @@ internal HAuthTicket GetAuthSessionTicket( IntPtr pTicket, int cbMaxTicket, ref } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate BeginAuthResult FBeginAuthSession( IntPtr self, IntPtr pAuthTicket, int cbAuthTicket, SteamId steamID ); - private FBeginAuthSession _BeginAuthSession; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_BeginAuthSession")] + private static extern BeginAuthResult _BeginAuthSession( IntPtr self, IntPtr pAuthTicket, int cbAuthTicket, SteamId steamID ); #endregion internal BeginAuthResult BeginAuthSession( IntPtr pAuthTicket, int cbAuthTicket, SteamId steamID ) @@ -211,9 +184,8 @@ internal BeginAuthResult BeginAuthSession( IntPtr pAuthTicket, int cbAuthTicket, } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FEndAuthSession( IntPtr self, SteamId steamID ); - private FEndAuthSession _EndAuthSession; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_EndAuthSession")] + private static extern void _EndAuthSession( IntPtr self, SteamId steamID ); #endregion internal void EndAuthSession( SteamId steamID ) @@ -222,9 +194,8 @@ internal void EndAuthSession( SteamId steamID ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FCancelAuthTicket( IntPtr self, HAuthTicket hAuthTicket ); - private FCancelAuthTicket _CancelAuthTicket; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_CancelAuthTicket")] + private static extern void _CancelAuthTicket( IntPtr self, HAuthTicket hAuthTicket ); #endregion internal void CancelAuthTicket( HAuthTicket hAuthTicket ) @@ -233,9 +204,8 @@ internal void CancelAuthTicket( HAuthTicket hAuthTicket ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate UserHasLicenseForAppResult FUserHasLicenseForApp( IntPtr self, SteamId steamID, AppId appID ); - private FUserHasLicenseForApp _UserHasLicenseForApp; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_UserHasLicenseForApp")] + private static extern UserHasLicenseForAppResult _UserHasLicenseForApp( IntPtr self, SteamId steamID, AppId appID ); #endregion internal UserHasLicenseForAppResult UserHasLicenseForApp( SteamId steamID, AppId appID ) @@ -245,10 +215,9 @@ internal UserHasLicenseForAppResult UserHasLicenseForApp( SteamId steamID, AppId } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_BIsBehindNAT")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBIsBehindNAT( IntPtr self ); - private FBIsBehindNAT _BIsBehindNAT; + private static extern bool _BIsBehindNAT( IntPtr self ); #endregion internal bool BIsBehindNAT() @@ -258,9 +227,8 @@ internal bool BIsBehindNAT() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FAdvertiseGame( IntPtr self, SteamId steamIDGameServer, uint unIPServer, ushort usPortServer ); - private FAdvertiseGame _AdvertiseGame; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_AdvertiseGame")] + private static extern void _AdvertiseGame( IntPtr self, SteamId steamIDGameServer, uint unIPServer, ushort usPortServer ); #endregion internal void AdvertiseGame( SteamId steamIDGameServer, uint unIPServer, ushort usPortServer ) @@ -269,22 +237,20 @@ internal void AdvertiseGame( SteamId steamIDGameServer, uint unIPServer, ushort } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FRequestEncryptedAppTicket( IntPtr self, IntPtr pDataToInclude, int cbDataToInclude ); - private FRequestEncryptedAppTicket _RequestEncryptedAppTicket; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_RequestEncryptedAppTicket")] + private static extern SteamAPICall_t _RequestEncryptedAppTicket( IntPtr self, IntPtr pDataToInclude, int cbDataToInclude ); #endregion - internal async Task RequestEncryptedAppTicket( IntPtr pDataToInclude, int cbDataToInclude ) + internal CallbackResult RequestEncryptedAppTicket( IntPtr pDataToInclude, int cbDataToInclude ) { var returnValue = _RequestEncryptedAppTicket( Self, pDataToInclude, cbDataToInclude ); - return await EncryptedAppTicketResponse_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetEncryptedAppTicket")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetEncryptedAppTicket( IntPtr self, IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket ); - private FGetEncryptedAppTicket _GetEncryptedAppTicket; + private static extern bool _GetEncryptedAppTicket( IntPtr self, IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket ); #endregion internal bool GetEncryptedAppTicket( IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket ) @@ -294,9 +260,8 @@ internal bool GetEncryptedAppTicket( IntPtr pTicket, int cbMaxTicket, ref uint p } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetGameBadgeLevel( IntPtr self, int nSeries, [MarshalAs( UnmanagedType.U1 )] bool bFoil ); - private FGetGameBadgeLevel _GetGameBadgeLevel; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetGameBadgeLevel")] + private static extern int _GetGameBadgeLevel( IntPtr self, int nSeries, [MarshalAs( UnmanagedType.U1 )] bool bFoil ); #endregion internal int GetGameBadgeLevel( int nSeries, [MarshalAs( UnmanagedType.U1 )] bool bFoil ) @@ -306,9 +271,8 @@ internal int GetGameBadgeLevel( int nSeries, [MarshalAs( UnmanagedType.U1 )] boo } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetPlayerSteamLevel( IntPtr self ); - private FGetPlayerSteamLevel _GetPlayerSteamLevel; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetPlayerSteamLevel")] + private static extern int _GetPlayerSteamLevel( IntPtr self ); #endregion internal int GetPlayerSteamLevel() @@ -318,22 +282,20 @@ internal int GetPlayerSteamLevel() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FRequestStoreAuthURL( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchRedirectURL ); - private FRequestStoreAuthURL _RequestStoreAuthURL; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_RequestStoreAuthURL")] + private static extern SteamAPICall_t _RequestStoreAuthURL( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchRedirectURL ); #endregion - internal async Task RequestStoreAuthURL( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchRedirectURL ) + internal CallbackResult RequestStoreAuthURL( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchRedirectURL ) { var returnValue = _RequestStoreAuthURL( Self, pchRedirectURL ); - return await StoreAuthURLResponse_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_BIsPhoneVerified")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBIsPhoneVerified( IntPtr self ); - private FBIsPhoneVerified _BIsPhoneVerified; + private static extern bool _BIsPhoneVerified( IntPtr self ); #endregion internal bool BIsPhoneVerified() @@ -343,10 +305,9 @@ internal bool BIsPhoneVerified() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_BIsTwoFactorEnabled")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBIsTwoFactorEnabled( IntPtr self ); - private FBIsTwoFactorEnabled _BIsTwoFactorEnabled; + private static extern bool _BIsTwoFactorEnabled( IntPtr self ); #endregion internal bool BIsTwoFactorEnabled() @@ -356,10 +317,9 @@ internal bool BIsTwoFactorEnabled() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_BIsPhoneIdentifying")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBIsPhoneIdentifying( IntPtr self ); - private FBIsPhoneIdentifying _BIsPhoneIdentifying; + private static extern bool _BIsPhoneIdentifying( IntPtr self ); #endregion internal bool BIsPhoneIdentifying() @@ -369,10 +329,9 @@ internal bool BIsPhoneIdentifying() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_BIsPhoneRequiringVerification")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBIsPhoneRequiringVerification( IntPtr self ); - private FBIsPhoneRequiringVerification _BIsPhoneRequiringVerification; + private static extern bool _BIsPhoneRequiringVerification( IntPtr self ); #endregion internal bool BIsPhoneRequiringVerification() @@ -382,15 +341,14 @@ internal bool BIsPhoneRequiringVerification() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FGetMarketEligibility( IntPtr self ); - private FGetMarketEligibility _GetMarketEligibility; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetMarketEligibility")] + private static extern SteamAPICall_t _GetMarketEligibility( IntPtr self ); #endregion - internal async Task GetMarketEligibility() + internal CallbackResult GetMarketEligibility() { var returnValue = _GetMarketEligibility( Self ); - return await MarketEligibilityResponse_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamUserStats.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamUserStats.cs index 17f3d0d..cfd59bc 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamUserStats.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamUserStats.cs @@ -9,8 +9,6 @@ namespace Steamworks { internal class ISteamUserStats : SteamInterface { - public override string InterfaceName => "STEAMUSERSTATS_INTERFACE_VERSION011"; - public override void InitInternals() { } @@ -21,10 +19,9 @@ internal override void Shutdown() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_RequestCurrentStats")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FRequestCurrentStats( IntPtr self ); - private FRequestCurrentStats _RequestCurrentStats; + private static extern bool _RequestCurrentStats( IntPtr self ); #endregion internal bool RequestCurrentStats() @@ -34,62 +31,57 @@ internal bool RequestCurrentStats() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetStat")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetStat1( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ); - private FGetStat1 _GetStat1; + private static extern bool _GetStat( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ); #endregion - internal bool GetStat1( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ) + internal bool GetStat( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ) { - var returnValue = _GetStat1( Self, pchName, ref pData ); + var returnValue = _GetStat( Self, pchName, ref pData ); return returnValue; } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetStat0")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetStat2( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ); - private FGetStat2 _GetStat2; + private static extern bool _GetStat0( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ); #endregion - internal bool GetStat2( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ) + internal bool GetStat0( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ) { - var returnValue = _GetStat2( Self, pchName, ref pData ); + var returnValue = _GetStat0( Self, pchName, ref pData ); return returnValue; } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_SetStat")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetStat1( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, int nData ); - private FSetStat1 _SetStat1; + private static extern bool _SetStat( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, int nData ); #endregion - internal bool SetStat1( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, int nData ) + internal bool SetStat( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, int nData ) { - var returnValue = _SetStat1( Self, pchName, nData ); + var returnValue = _SetStat( Self, pchName, nData ); return returnValue; } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_SetStat")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetStat2( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float fData ); - private FSetStat2 _SetStat2; + private static extern bool _SetStat( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float fData ); #endregion - internal bool SetStat2( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float fData ) + internal bool SetStat( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float fData ) { - var returnValue = _SetStat2( Self, pchName, fData ); + var returnValue = _SetStat( Self, pchName, fData ); return returnValue; } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_UpdateAvgRateStat")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FUpdateAvgRateStat( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float flCountThisSession, double dSessionLength ); - private FUpdateAvgRateStat _UpdateAvgRateStat; + private static extern bool _UpdateAvgRateStat( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float flCountThisSession, double dSessionLength ); #endregion internal bool UpdateAvgRateStat( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float flCountThisSession, double dSessionLength ) @@ -99,10 +91,9 @@ internal bool UpdateAvgRateStat( [MarshalAs( UnmanagedType.CustomMarshaler, Mars } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetAchievement")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetAchievement( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ); - private FGetAchievement _GetAchievement; + private static extern bool _GetAchievement( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ); #endregion internal bool GetAchievement( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ) @@ -112,10 +103,9 @@ internal bool GetAchievement( [MarshalAs( UnmanagedType.CustomMarshaler, Marshal } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_SetAchievement")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FSetAchievement( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ); - private FSetAchievement _SetAchievement; + private static extern bool _SetAchievement( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ); #endregion internal bool SetAchievement( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ) @@ -125,10 +115,9 @@ internal bool SetAchievement( [MarshalAs( UnmanagedType.CustomMarshaler, Marshal } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_ClearAchievement")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FClearAchievement( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ); - private FClearAchievement _ClearAchievement; + private static extern bool _ClearAchievement( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ); #endregion internal bool ClearAchievement( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ) @@ -138,10 +127,9 @@ internal bool ClearAchievement( [MarshalAs( UnmanagedType.CustomMarshaler, Marsh } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetAchievementAndUnlockTime")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetAchievementAndUnlockTime( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved, ref uint punUnlockTime ); - private FGetAchievementAndUnlockTime _GetAchievementAndUnlockTime; + private static extern bool _GetAchievementAndUnlockTime( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved, ref uint punUnlockTime ); #endregion internal bool GetAchievementAndUnlockTime( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved, ref uint punUnlockTime ) @@ -151,10 +139,9 @@ internal bool GetAchievementAndUnlockTime( [MarshalAs( UnmanagedType.CustomMarsh } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_StoreStats")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FStoreStats( IntPtr self ); - private FStoreStats _StoreStats; + private static extern bool _StoreStats( IntPtr self ); #endregion internal bool StoreStats() @@ -164,9 +151,8 @@ internal bool StoreStats() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetAchievementIcon( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ); - private FGetAchievementIcon _GetAchievementIcon; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetAchievementIcon")] + private static extern int _GetAchievementIcon( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ); #endregion internal int GetAchievementIcon( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ) @@ -176,9 +162,8 @@ internal int GetAchievementIcon( [MarshalAs( UnmanagedType.CustomMarshaler, Mars } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Utf8StringPointer FGetAchievementDisplayAttribute( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); - private FGetAchievementDisplayAttribute _GetAchievementDisplayAttribute; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetAchievementDisplayAttribute")] + private static extern Utf8StringPointer _GetAchievementDisplayAttribute( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); #endregion internal string GetAchievementDisplayAttribute( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) @@ -188,10 +173,9 @@ internal string GetAchievementDisplayAttribute( [MarshalAs( UnmanagedType.Custom } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_IndicateAchievementProgress")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FIndicateAchievementProgress( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, uint nCurProgress, uint nMaxProgress ); - private FIndicateAchievementProgress _IndicateAchievementProgress; + private static extern bool _IndicateAchievementProgress( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, uint nCurProgress, uint nMaxProgress ); #endregion internal bool IndicateAchievementProgress( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, uint nCurProgress, uint nMaxProgress ) @@ -201,9 +185,8 @@ internal bool IndicateAchievementProgress( [MarshalAs( UnmanagedType.CustomMarsh } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate uint FGetNumAchievements( IntPtr self ); - private FGetNumAchievements _GetNumAchievements; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetNumAchievements")] + private static extern uint _GetNumAchievements( IntPtr self ); #endregion internal uint GetNumAchievements() @@ -213,9 +196,8 @@ internal uint GetNumAchievements() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Utf8StringPointer FGetAchievementName( IntPtr self, uint iAchievement ); - private FGetAchievementName _GetAchievementName; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetAchievementName")] + private static extern Utf8StringPointer _GetAchievementName( IntPtr self, uint iAchievement ); #endregion internal string GetAchievementName( uint iAchievement ) @@ -225,48 +207,44 @@ internal string GetAchievementName( uint iAchievement ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FRequestUserStats( IntPtr self, SteamId steamIDUser ); - private FRequestUserStats _RequestUserStats; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_RequestUserStats")] + private static extern SteamAPICall_t _RequestUserStats( IntPtr self, SteamId steamIDUser ); #endregion - internal async Task RequestUserStats( SteamId steamIDUser ) + internal CallbackResult RequestUserStats( SteamId steamIDUser ) { var returnValue = _RequestUserStats( Self, steamIDUser ); - return await UserStatsReceived_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetUserStat")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetUserStat1( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ); - private FGetUserStat1 _GetUserStat1; + private static extern bool _GetUserStat( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ); #endregion - internal bool GetUserStat1( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ) + internal bool GetUserStat( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ) { - var returnValue = _GetUserStat1( Self, steamIDUser, pchName, ref pData ); + var returnValue = _GetUserStat( Self, steamIDUser, pchName, ref pData ); return returnValue; } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetUserStat0")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetUserStat2( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ); - private FGetUserStat2 _GetUserStat2; + private static extern bool _GetUserStat0( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ); #endregion - internal bool GetUserStat2( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ) + internal bool GetUserStat0( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ) { - var returnValue = _GetUserStat2( Self, steamIDUser, pchName, ref pData ); + var returnValue = _GetUserStat0( Self, steamIDUser, pchName, ref pData ); return returnValue; } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetUserAchievement")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetUserAchievement( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ); - private FGetUserAchievement _GetUserAchievement; + private static extern bool _GetUserAchievement( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ); #endregion internal bool GetUserAchievement( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ) @@ -276,10 +254,9 @@ internal bool GetUserAchievement( SteamId steamIDUser, [MarshalAs( UnmanagedType } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetUserAchievementAndUnlockTime")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetUserAchievementAndUnlockTime( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved, ref uint punUnlockTime ); - private FGetUserAchievementAndUnlockTime _GetUserAchievementAndUnlockTime; + private static extern bool _GetUserAchievementAndUnlockTime( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved, ref uint punUnlockTime ); #endregion internal bool GetUserAchievementAndUnlockTime( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved, ref uint punUnlockTime ) @@ -289,10 +266,9 @@ internal bool GetUserAchievementAndUnlockTime( SteamId steamIDUser, [MarshalAs( } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_ResetAllStats")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FResetAllStats( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bAchievementsToo ); - private FResetAllStats _ResetAllStats; + private static extern bool _ResetAllStats( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bAchievementsToo ); #endregion internal bool ResetAllStats( [MarshalAs( UnmanagedType.U1 )] bool bAchievementsToo ) @@ -302,33 +278,30 @@ internal bool ResetAllStats( [MarshalAs( UnmanagedType.U1 )] bool bAchievementsT } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FFindOrCreateLeaderboard( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName, LeaderboardSort eLeaderboardSortMethod, LeaderboardDisplay eLeaderboardDisplayType ); - private FFindOrCreateLeaderboard _FindOrCreateLeaderboard; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_FindOrCreateLeaderboard")] + private static extern SteamAPICall_t _FindOrCreateLeaderboard( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName, LeaderboardSort eLeaderboardSortMethod, LeaderboardDisplay eLeaderboardDisplayType ); #endregion - internal async Task FindOrCreateLeaderboard( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName, LeaderboardSort eLeaderboardSortMethod, LeaderboardDisplay eLeaderboardDisplayType ) + internal CallbackResult FindOrCreateLeaderboard( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName, LeaderboardSort eLeaderboardSortMethod, LeaderboardDisplay eLeaderboardDisplayType ) { var returnValue = _FindOrCreateLeaderboard( Self, pchLeaderboardName, eLeaderboardSortMethod, eLeaderboardDisplayType ); - return await LeaderboardFindResult_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FFindLeaderboard( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName ); - private FFindLeaderboard _FindLeaderboard; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_FindLeaderboard")] + private static extern SteamAPICall_t _FindLeaderboard( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName ); #endregion - internal async Task FindLeaderboard( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName ) + internal CallbackResult FindLeaderboard( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName ) { var returnValue = _FindLeaderboard( Self, pchLeaderboardName ); - return await LeaderboardFindResult_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Utf8StringPointer FGetLeaderboardName( IntPtr self, SteamLeaderboard_t hSteamLeaderboard ); - private FGetLeaderboardName _GetLeaderboardName; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetLeaderboardName")] + private static extern Utf8StringPointer _GetLeaderboardName( IntPtr self, SteamLeaderboard_t hSteamLeaderboard ); #endregion internal string GetLeaderboardName( SteamLeaderboard_t hSteamLeaderboard ) @@ -338,9 +311,8 @@ internal string GetLeaderboardName( SteamLeaderboard_t hSteamLeaderboard ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetLeaderboardEntryCount( IntPtr self, SteamLeaderboard_t hSteamLeaderboard ); - private FGetLeaderboardEntryCount _GetLeaderboardEntryCount; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetLeaderboardEntryCount")] + private static extern int _GetLeaderboardEntryCount( IntPtr self, SteamLeaderboard_t hSteamLeaderboard ); #endregion internal int GetLeaderboardEntryCount( SteamLeaderboard_t hSteamLeaderboard ) @@ -350,9 +322,8 @@ internal int GetLeaderboardEntryCount( SteamLeaderboard_t hSteamLeaderboard ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate LeaderboardSort FGetLeaderboardSortMethod( IntPtr self, SteamLeaderboard_t hSteamLeaderboard ); - private FGetLeaderboardSortMethod _GetLeaderboardSortMethod; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetLeaderboardSortMethod")] + private static extern LeaderboardSort _GetLeaderboardSortMethod( IntPtr self, SteamLeaderboard_t hSteamLeaderboard ); #endregion internal LeaderboardSort GetLeaderboardSortMethod( SteamLeaderboard_t hSteamLeaderboard ) @@ -362,9 +333,8 @@ internal LeaderboardSort GetLeaderboardSortMethod( SteamLeaderboard_t hSteamLead } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate LeaderboardDisplay FGetLeaderboardDisplayType( IntPtr self, SteamLeaderboard_t hSteamLeaderboard ); - private FGetLeaderboardDisplayType _GetLeaderboardDisplayType; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetLeaderboardDisplayType")] + private static extern LeaderboardDisplay _GetLeaderboardDisplayType( IntPtr self, SteamLeaderboard_t hSteamLeaderboard ); #endregion internal LeaderboardDisplay GetLeaderboardDisplayType( SteamLeaderboard_t hSteamLeaderboard ) @@ -374,34 +344,31 @@ internal LeaderboardDisplay GetLeaderboardDisplayType( SteamLeaderboard_t hSteam } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FDownloadLeaderboardEntries( IntPtr self, SteamLeaderboard_t hSteamLeaderboard, LeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd ); - private FDownloadLeaderboardEntries _DownloadLeaderboardEntries; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_DownloadLeaderboardEntries")] + private static extern SteamAPICall_t _DownloadLeaderboardEntries( IntPtr self, SteamLeaderboard_t hSteamLeaderboard, LeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd ); #endregion - internal async Task DownloadLeaderboardEntries( SteamLeaderboard_t hSteamLeaderboard, LeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd ) + internal CallbackResult DownloadLeaderboardEntries( SteamLeaderboard_t hSteamLeaderboard, LeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd ) { var returnValue = _DownloadLeaderboardEntries( Self, hSteamLeaderboard, eLeaderboardDataRequest, nRangeStart, nRangeEnd ); - return await LeaderboardScoresDownloaded_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FDownloadLeaderboardEntriesForUsers( IntPtr self, SteamLeaderboard_t hSteamLeaderboard, [In,Out] SteamId[] prgUsers, int cUsers ); - private FDownloadLeaderboardEntriesForUsers _DownloadLeaderboardEntriesForUsers; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_DownloadLeaderboardEntriesForUsers")] + private static extern SteamAPICall_t _DownloadLeaderboardEntriesForUsers( IntPtr self, SteamLeaderboard_t hSteamLeaderboard, [In,Out] SteamId[] prgUsers, int cUsers ); #endregion - internal async Task DownloadLeaderboardEntriesForUsers( SteamLeaderboard_t hSteamLeaderboard, [In,Out] SteamId[] prgUsers, int cUsers ) + internal CallbackResult DownloadLeaderboardEntriesForUsers( SteamLeaderboard_t hSteamLeaderboard, [In,Out] SteamId[] prgUsers, int cUsers ) { var returnValue = _DownloadLeaderboardEntriesForUsers( Self, hSteamLeaderboard, prgUsers, cUsers ); - return await LeaderboardScoresDownloaded_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetDownloadedLeaderboardEntry")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetDownloadedLeaderboardEntry( IntPtr self, SteamLeaderboardEntries_t hSteamLeaderboardEntries, int index, ref LeaderboardEntry_t pLeaderboardEntry, [In,Out] int[] pDetails, int cDetailsMax ); - private FGetDownloadedLeaderboardEntry _GetDownloadedLeaderboardEntry; + private static extern bool _GetDownloadedLeaderboardEntry( IntPtr self, SteamLeaderboardEntries_t hSteamLeaderboardEntries, int index, ref LeaderboardEntry_t pLeaderboardEntry, [In,Out] int[] pDetails, int cDetailsMax ); #endregion internal bool GetDownloadedLeaderboardEntry( SteamLeaderboardEntries_t hSteamLeaderboardEntries, int index, ref LeaderboardEntry_t pLeaderboardEntry, [In,Out] int[] pDetails, int cDetailsMax ) @@ -411,57 +378,52 @@ internal bool GetDownloadedLeaderboardEntry( SteamLeaderboardEntries_t hSteamLea } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FUploadLeaderboardScore( IntPtr self, SteamLeaderboard_t hSteamLeaderboard, LeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int nScore, [In,Out] int[] pScoreDetails, int cScoreDetailsCount ); - private FUploadLeaderboardScore _UploadLeaderboardScore; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_UploadLeaderboardScore")] + private static extern SteamAPICall_t _UploadLeaderboardScore( IntPtr self, SteamLeaderboard_t hSteamLeaderboard, LeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int nScore, [In,Out] int[] pScoreDetails, int cScoreDetailsCount ); #endregion - internal async Task UploadLeaderboardScore( SteamLeaderboard_t hSteamLeaderboard, LeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int nScore, [In,Out] int[] pScoreDetails, int cScoreDetailsCount ) + internal CallbackResult UploadLeaderboardScore( SteamLeaderboard_t hSteamLeaderboard, LeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int nScore, [In,Out] int[] pScoreDetails, int cScoreDetailsCount ) { var returnValue = _UploadLeaderboardScore( Self, hSteamLeaderboard, eLeaderboardUploadScoreMethod, nScore, pScoreDetails, cScoreDetailsCount ); - return await LeaderboardScoreUploaded_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FAttachLeaderboardUGC( IntPtr self, SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC ); - private FAttachLeaderboardUGC _AttachLeaderboardUGC; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_AttachLeaderboardUGC")] + private static extern SteamAPICall_t _AttachLeaderboardUGC( IntPtr self, SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC ); #endregion - internal async Task AttachLeaderboardUGC( SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC ) + internal CallbackResult AttachLeaderboardUGC( SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC ) { var returnValue = _AttachLeaderboardUGC( Self, hSteamLeaderboard, hUGC ); - return await LeaderboardUGCSet_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FGetNumberOfCurrentPlayers( IntPtr self ); - private FGetNumberOfCurrentPlayers _GetNumberOfCurrentPlayers; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetNumberOfCurrentPlayers")] + private static extern SteamAPICall_t _GetNumberOfCurrentPlayers( IntPtr self ); #endregion - internal async Task GetNumberOfCurrentPlayers() + internal CallbackResult GetNumberOfCurrentPlayers() { var returnValue = _GetNumberOfCurrentPlayers( Self ); - return await NumberOfCurrentPlayers_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FRequestGlobalAchievementPercentages( IntPtr self ); - private FRequestGlobalAchievementPercentages _RequestGlobalAchievementPercentages; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_RequestGlobalAchievementPercentages")] + private static extern SteamAPICall_t _RequestGlobalAchievementPercentages( IntPtr self ); #endregion - internal async Task RequestGlobalAchievementPercentages() + internal CallbackResult RequestGlobalAchievementPercentages() { var returnValue = _RequestGlobalAchievementPercentages( Self ); - return await GlobalAchievementPercentagesReady_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetMostAchievedAchievementInfo( IntPtr self, IntPtr pchName, uint unNameBufLen, ref float pflPercent, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ); - private FGetMostAchievedAchievementInfo _GetMostAchievedAchievementInfo; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetMostAchievedAchievementInfo")] + private static extern int _GetMostAchievedAchievementInfo( IntPtr self, IntPtr pchName, uint unNameBufLen, ref float pflPercent, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ); #endregion internal int GetMostAchievedAchievementInfo( out string pchName, ref float pflPercent, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ) @@ -473,9 +435,8 @@ internal int GetMostAchievedAchievementInfo( out string pchName, ref float pflPe } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetNextMostAchievedAchievementInfo( IntPtr self, int iIteratorPrevious, IntPtr pchName, uint unNameBufLen, ref float pflPercent, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ); - private FGetNextMostAchievedAchievementInfo _GetNextMostAchievedAchievementInfo; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetNextMostAchievedAchievementInfo")] + private static extern int _GetNextMostAchievedAchievementInfo( IntPtr self, int iIteratorPrevious, IntPtr pchName, uint unNameBufLen, ref float pflPercent, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ); #endregion internal int GetNextMostAchievedAchievementInfo( int iIteratorPrevious, out string pchName, ref float pflPercent, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ) @@ -487,10 +448,9 @@ internal int GetNextMostAchievedAchievementInfo( int iIteratorPrevious, out stri } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetAchievementAchievedPercent")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetAchievementAchievedPercent( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pflPercent ); - private FGetAchievementAchievedPercent _GetAchievementAchievedPercent; + private static extern bool _GetAchievementAchievedPercent( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pflPercent ); #endregion internal bool GetAchievementAchievedPercent( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pflPercent ) @@ -500,64 +460,59 @@ internal bool GetAchievementAchievedPercent( [MarshalAs( UnmanagedType.CustomMar } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FRequestGlobalStats( IntPtr self, int nHistoryDays ); - private FRequestGlobalStats _RequestGlobalStats; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_RequestGlobalStats")] + private static extern SteamAPICall_t _RequestGlobalStats( IntPtr self, int nHistoryDays ); #endregion - internal async Task RequestGlobalStats( int nHistoryDays ) + internal CallbackResult RequestGlobalStats( int nHistoryDays ) { var returnValue = _RequestGlobalStats( Self, nHistoryDays ); - return await GlobalStatsReceived_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetGlobalStat")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetGlobalStat1( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, ref long pData ); - private FGetGlobalStat1 _GetGlobalStat1; + private static extern bool _GetGlobalStat( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, ref long pData ); #endregion - internal bool GetGlobalStat1( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, ref long pData ) + internal bool GetGlobalStat( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, ref long pData ) { - var returnValue = _GetGlobalStat1( Self, pchStatName, ref pData ); + var returnValue = _GetGlobalStat( Self, pchStatName, ref pData ); return returnValue; } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetGlobalStat0")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetGlobalStat2( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, ref double pData ); - private FGetGlobalStat2 _GetGlobalStat2; + private static extern bool _GetGlobalStat0( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, ref double pData ); #endregion - internal bool GetGlobalStat2( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, ref double pData ) + internal bool GetGlobalStat0( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, ref double pData ) { - var returnValue = _GetGlobalStat2( Self, pchStatName, ref pData ); + var returnValue = _GetGlobalStat0( Self, pchStatName, ref pData ); return returnValue; } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetGlobalStatHistory1( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, [In,Out] long[] pData, uint cubData ); - private FGetGlobalStatHistory1 _GetGlobalStatHistory1; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetGlobalStatHistory")] + private static extern int _GetGlobalStatHistory( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, [In,Out] long[] pData, uint cubData ); #endregion - internal int GetGlobalStatHistory1( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, [In,Out] long[] pData, uint cubData ) + internal int GetGlobalStatHistory( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, [In,Out] long[] pData, uint cubData ) { - var returnValue = _GetGlobalStatHistory1( Self, pchStatName, pData, cubData ); + var returnValue = _GetGlobalStatHistory( Self, pchStatName, pData, cubData ); return returnValue; } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate int FGetGlobalStatHistory2( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, [In,Out] double[] pData, uint cubData ); - private FGetGlobalStatHistory2 _GetGlobalStatHistory2; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetGlobalStatHistory0")] + private static extern int _GetGlobalStatHistory0( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, [In,Out] double[] pData, uint cubData ); #endregion - internal int GetGlobalStatHistory2( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, [In,Out] double[] pData, uint cubData ) + internal int GetGlobalStatHistory0( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, [In,Out] double[] pData, uint cubData ) { - var returnValue = _GetGlobalStatHistory2( Self, pchStatName, pData, cubData ); + var returnValue = _GetGlobalStatHistory0( Self, pchStatName, pData, cubData ); return returnValue; } diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamUtils.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamUtils.cs index 0018722..a25a908 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamUtils.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamUtils.cs @@ -9,8 +9,6 @@ namespace Steamworks { internal class ISteamUtils : SteamInterface { - public override string InterfaceName => "SteamUtils009"; - public override void InitInternals() { } @@ -21,9 +19,8 @@ internal override void Shutdown() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate uint FGetSecondsSinceAppActive( IntPtr self ); - private FGetSecondsSinceAppActive _GetSecondsSinceAppActive; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetSecondsSinceAppActive")] + private static extern uint _GetSecondsSinceAppActive( IntPtr self ); #endregion internal uint GetSecondsSinceAppActive() @@ -33,9 +30,8 @@ internal uint GetSecondsSinceAppActive() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate uint FGetSecondsSinceComputerActive( IntPtr self ); - private FGetSecondsSinceComputerActive _GetSecondsSinceComputerActive; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetSecondsSinceComputerActive")] + private static extern uint _GetSecondsSinceComputerActive( IntPtr self ); #endregion internal uint GetSecondsSinceComputerActive() @@ -45,9 +41,8 @@ internal uint GetSecondsSinceComputerActive() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Universe FGetConnectedUniverse( IntPtr self ); - private FGetConnectedUniverse _GetConnectedUniverse; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetConnectedUniverse")] + private static extern Universe _GetConnectedUniverse( IntPtr self ); #endregion internal Universe GetConnectedUniverse() @@ -57,9 +52,8 @@ internal Universe GetConnectedUniverse() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate uint FGetServerRealTime( IntPtr self ); - private FGetServerRealTime _GetServerRealTime; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetServerRealTime")] + private static extern uint _GetServerRealTime( IntPtr self ); #endregion internal uint GetServerRealTime() @@ -69,9 +63,8 @@ internal uint GetServerRealTime() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Utf8StringPointer FGetIPCountry( IntPtr self ); - private FGetIPCountry _GetIPCountry; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetIPCountry")] + private static extern Utf8StringPointer _GetIPCountry( IntPtr self ); #endregion internal string GetIPCountry() @@ -81,10 +74,9 @@ internal string GetIPCountry() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetImageSize")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetImageSize( IntPtr self, int iImage, ref uint pnWidth, ref uint pnHeight ); - private FGetImageSize _GetImageSize; + private static extern bool _GetImageSize( IntPtr self, int iImage, ref uint pnWidth, ref uint pnHeight ); #endregion internal bool GetImageSize( int iImage, ref uint pnWidth, ref uint pnHeight ) @@ -94,10 +86,9 @@ internal bool GetImageSize( int iImage, ref uint pnWidth, ref uint pnHeight ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetImageRGBA")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetImageRGBA( IntPtr self, int iImage, [In,Out] byte[] pubDest, int nDestBufferSize ); - private FGetImageRGBA _GetImageRGBA; + private static extern bool _GetImageRGBA( IntPtr self, int iImage, [In,Out] byte[] pubDest, int nDestBufferSize ); #endregion internal bool GetImageRGBA( int iImage, [In,Out] byte[] pubDest, int nDestBufferSize ) @@ -107,10 +98,9 @@ internal bool GetImageRGBA( int iImage, [In,Out] byte[] pubDest, int nDestBuffe } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetCSERIPPort")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetCSERIPPort( IntPtr self, ref uint unIP, ref ushort usPort ); - private FGetCSERIPPort _GetCSERIPPort; + private static extern bool _GetCSERIPPort( IntPtr self, ref uint unIP, ref ushort usPort ); #endregion internal bool GetCSERIPPort( ref uint unIP, ref ushort usPort ) @@ -120,9 +110,8 @@ internal bool GetCSERIPPort( ref uint unIP, ref ushort usPort ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate byte FGetCurrentBatteryPower( IntPtr self ); - private FGetCurrentBatteryPower _GetCurrentBatteryPower; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetCurrentBatteryPower")] + private static extern byte _GetCurrentBatteryPower( IntPtr self ); #endregion internal byte GetCurrentBatteryPower() @@ -132,9 +121,8 @@ internal byte GetCurrentBatteryPower() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate uint FGetAppID( IntPtr self ); - private FGetAppID _GetAppID; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetAppID")] + private static extern uint _GetAppID( IntPtr self ); #endregion internal uint GetAppID() @@ -144,9 +132,8 @@ internal uint GetAppID() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetOverlayNotificationPosition( IntPtr self, NotificationPosition eNotificationPosition ); - private FSetOverlayNotificationPosition _SetOverlayNotificationPosition; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_SetOverlayNotificationPosition")] + private static extern void _SetOverlayNotificationPosition( IntPtr self, NotificationPosition eNotificationPosition ); #endregion internal void SetOverlayNotificationPosition( NotificationPosition eNotificationPosition ) @@ -155,10 +142,9 @@ internal void SetOverlayNotificationPosition( NotificationPosition eNotification } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_IsAPICallCompleted")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FIsAPICallCompleted( IntPtr self, SteamAPICall_t hSteamAPICall, [MarshalAs( UnmanagedType.U1 )] ref bool pbFailed ); - private FIsAPICallCompleted _IsAPICallCompleted; + private static extern bool _IsAPICallCompleted( IntPtr self, SteamAPICall_t hSteamAPICall, [MarshalAs( UnmanagedType.U1 )] ref bool pbFailed ); #endregion internal bool IsAPICallCompleted( SteamAPICall_t hSteamAPICall, [MarshalAs( UnmanagedType.U1 )] ref bool pbFailed ) @@ -168,9 +154,8 @@ internal bool IsAPICallCompleted( SteamAPICall_t hSteamAPICall, [MarshalAs( Unma } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICallFailure FGetAPICallFailureReason( IntPtr self, SteamAPICall_t hSteamAPICall ); - private FGetAPICallFailureReason _GetAPICallFailureReason; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetAPICallFailureReason")] + private static extern SteamAPICallFailure _GetAPICallFailureReason( IntPtr self, SteamAPICall_t hSteamAPICall ); #endregion internal SteamAPICallFailure GetAPICallFailureReason( SteamAPICall_t hSteamAPICall ) @@ -180,10 +165,9 @@ internal SteamAPICallFailure GetAPICallFailureReason( SteamAPICall_t hSteamAPICa } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetAPICallResult")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetAPICallResult( IntPtr self, SteamAPICall_t hSteamAPICall, IntPtr pCallback, int cubCallback, int iCallbackExpected, [MarshalAs( UnmanagedType.U1 )] ref bool pbFailed ); - private FGetAPICallResult _GetAPICallResult; + private static extern bool _GetAPICallResult( IntPtr self, SteamAPICall_t hSteamAPICall, IntPtr pCallback, int cubCallback, int iCallbackExpected, [MarshalAs( UnmanagedType.U1 )] ref bool pbFailed ); #endregion internal bool GetAPICallResult( SteamAPICall_t hSteamAPICall, IntPtr pCallback, int cubCallback, int iCallbackExpected, [MarshalAs( UnmanagedType.U1 )] ref bool pbFailed ) @@ -193,20 +177,8 @@ internal bool GetAPICallResult( SteamAPICall_t hSteamAPICall, IntPtr pCallback, } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FRunFrame( IntPtr self ); - private FRunFrame _RunFrame; - - #endregion - internal void RunFrame() - { - _RunFrame( Self ); - } - - #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate uint FGetIPCCallCount( IntPtr self ); - private FGetIPCCallCount _GetIPCCallCount; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetIPCCallCount")] + private static extern uint _GetIPCCallCount( IntPtr self ); #endregion internal uint GetIPCCallCount() @@ -216,9 +188,8 @@ internal uint GetIPCCallCount() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetWarningMessageHook( IntPtr self, IntPtr pFunction ); - private FSetWarningMessageHook _SetWarningMessageHook; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_SetWarningMessageHook")] + private static extern void _SetWarningMessageHook( IntPtr self, IntPtr pFunction ); #endregion internal void SetWarningMessageHook( IntPtr pFunction ) @@ -227,10 +198,9 @@ internal void SetWarningMessageHook( IntPtr pFunction ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_IsOverlayEnabled")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FIsOverlayEnabled( IntPtr self ); - private FIsOverlayEnabled _IsOverlayEnabled; + private static extern bool _IsOverlayEnabled( IntPtr self ); #endregion internal bool IsOverlayEnabled() @@ -240,10 +210,9 @@ internal bool IsOverlayEnabled() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_BOverlayNeedsPresent")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FBOverlayNeedsPresent( IntPtr self ); - private FBOverlayNeedsPresent _BOverlayNeedsPresent; + private static extern bool _BOverlayNeedsPresent( IntPtr self ); #endregion internal bool BOverlayNeedsPresent() @@ -253,22 +222,20 @@ internal bool BOverlayNeedsPresent() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate SteamAPICall_t FCheckFileSignature( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string szFileName ); - private FCheckFileSignature _CheckFileSignature; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_CheckFileSignature")] + private static extern SteamAPICall_t _CheckFileSignature( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string szFileName ); #endregion - internal async Task CheckFileSignature( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string szFileName ) + internal CallbackResult CheckFileSignature( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string szFileName ) { var returnValue = _CheckFileSignature( Self, szFileName ); - return await CheckFileSignature_t.GetResultAsync( returnValue ); + return new CallbackResult( returnValue ); } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_ShowGamepadTextInput")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FShowGamepadTextInput( IntPtr self, GamepadTextInputMode eInputMode, GamepadTextInputLineMode eLineInputMode, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, uint unCharMax, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchExistingText ); - private FShowGamepadTextInput _ShowGamepadTextInput; + private static extern bool _ShowGamepadTextInput( IntPtr self, GamepadTextInputMode eInputMode, GamepadTextInputLineMode eLineInputMode, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, uint unCharMax, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchExistingText ); #endregion internal bool ShowGamepadTextInput( GamepadTextInputMode eInputMode, GamepadTextInputLineMode eLineInputMode, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, uint unCharMax, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchExistingText ) @@ -278,9 +245,8 @@ internal bool ShowGamepadTextInput( GamepadTextInputMode eInputMode, GamepadText } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate uint FGetEnteredGamepadTextLength( IntPtr self ); - private FGetEnteredGamepadTextLength _GetEnteredGamepadTextLength; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetEnteredGamepadTextLength")] + private static extern uint _GetEnteredGamepadTextLength( IntPtr self ); #endregion internal uint GetEnteredGamepadTextLength() @@ -290,10 +256,9 @@ internal uint GetEnteredGamepadTextLength() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetEnteredGamepadTextInput")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetEnteredGamepadTextInput( IntPtr self, IntPtr pchText, uint cchText ); - private FGetEnteredGamepadTextInput _GetEnteredGamepadTextInput; + private static extern bool _GetEnteredGamepadTextInput( IntPtr self, IntPtr pchText, uint cchText ); #endregion internal bool GetEnteredGamepadTextInput( out string pchText ) @@ -305,9 +270,8 @@ internal bool GetEnteredGamepadTextInput( out string pchText ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate Utf8StringPointer FGetSteamUILanguage( IntPtr self ); - private FGetSteamUILanguage _GetSteamUILanguage; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetSteamUILanguage")] + private static extern Utf8StringPointer _GetSteamUILanguage( IntPtr self ); #endregion internal string GetSteamUILanguage() @@ -317,10 +281,9 @@ internal string GetSteamUILanguage() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_IsSteamRunningInVR")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FIsSteamRunningInVR( IntPtr self ); - private FIsSteamRunningInVR _IsSteamRunningInVR; + private static extern bool _IsSteamRunningInVR( IntPtr self ); #endregion internal bool IsSteamRunningInVR() @@ -330,9 +293,8 @@ internal bool IsSteamRunningInVR() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetOverlayNotificationInset( IntPtr self, int nHorizontalInset, int nVerticalInset ); - private FSetOverlayNotificationInset _SetOverlayNotificationInset; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_SetOverlayNotificationInset")] + private static extern void _SetOverlayNotificationInset( IntPtr self, int nHorizontalInset, int nVerticalInset ); #endregion internal void SetOverlayNotificationInset( int nHorizontalInset, int nVerticalInset ) @@ -341,10 +303,9 @@ internal void SetOverlayNotificationInset( int nHorizontalInset, int nVerticalIn } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_IsSteamInBigPictureMode")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FIsSteamInBigPictureMode( IntPtr self ); - private FIsSteamInBigPictureMode _IsSteamInBigPictureMode; + private static extern bool _IsSteamInBigPictureMode( IntPtr self ); #endregion internal bool IsSteamInBigPictureMode() @@ -354,9 +315,8 @@ internal bool IsSteamInBigPictureMode() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FStartVRDashboard( IntPtr self ); - private FStartVRDashboard _StartVRDashboard; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_StartVRDashboard")] + private static extern void _StartVRDashboard( IntPtr self ); #endregion internal void StartVRDashboard() @@ -365,10 +325,9 @@ internal void StartVRDashboard() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_IsVRHeadsetStreamingEnabled")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FIsVRHeadsetStreamingEnabled( IntPtr self ); - private FIsVRHeadsetStreamingEnabled _IsVRHeadsetStreamingEnabled; + private static extern bool _IsVRHeadsetStreamingEnabled( IntPtr self ); #endregion internal bool IsVRHeadsetStreamingEnabled() @@ -378,9 +337,8 @@ internal bool IsVRHeadsetStreamingEnabled() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FSetVRHeadsetStreamingEnabled( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bEnabled ); - private FSetVRHeadsetStreamingEnabled _SetVRHeadsetStreamingEnabled; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled")] + private static extern void _SetVRHeadsetStreamingEnabled( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bEnabled ); #endregion internal void SetVRHeadsetStreamingEnabled( [MarshalAs( UnmanagedType.U1 )] bool bEnabled ) diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamVideo.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamVideo.cs index 518a5a2..1b5d16f 100644 --- a/Facepunch.Steamworks/Generated/Interfaces/ISteamVideo.cs +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamVideo.cs @@ -9,8 +9,6 @@ namespace Steamworks { internal class ISteamVideo : SteamInterface { - public override string InterfaceName => "STEAMVIDEO_INTERFACE_V002"; - public override void InitInternals() { } @@ -21,9 +19,8 @@ internal override void Shutdown() } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FGetVideoURL( IntPtr self, AppId unVideoAppID ); - private FGetVideoURL _GetVideoURL; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamVideo_GetVideoURL")] + private static extern void _GetVideoURL( IntPtr self, AppId unVideoAppID ); #endregion internal void GetVideoURL( AppId unVideoAppID ) @@ -32,10 +29,9 @@ internal void GetVideoURL( AppId unVideoAppID ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamVideo_IsBroadcasting")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FIsBroadcasting( IntPtr self, ref int pnNumViewers ); - private FIsBroadcasting _IsBroadcasting; + private static extern bool _IsBroadcasting( IntPtr self, ref int pnNumViewers ); #endregion internal bool IsBroadcasting( ref int pnNumViewers ) @@ -45,9 +41,8 @@ internal bool IsBroadcasting( ref int pnNumViewers ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] - private delegate void FGetOPFSettings( IntPtr self, AppId unVideoAppID ); - private FGetOPFSettings _GetOPFSettings; + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamVideo_GetOPFSettings")] + private static extern void _GetOPFSettings( IntPtr self, AppId unVideoAppID ); #endregion internal void GetOPFSettings( AppId unVideoAppID ) @@ -56,10 +51,9 @@ internal void GetOPFSettings( AppId unVideoAppID ) } #region FunctionMeta - [UnmanagedFunctionPointer( Platform.MemberConvention )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamVideo_GetOPFStringForApp")] [return: MarshalAs( UnmanagedType.I1 )] - private delegate bool FGetOPFStringForApp( IntPtr self, AppId unVideoAppID, IntPtr pchBuffer, ref int pnBufferSize ); - private FGetOPFStringForApp _GetOPFStringForApp; + private static extern bool _GetOPFStringForApp( IntPtr self, AppId unVideoAppID, IntPtr pchBuffer, ref int pnBufferSize ); #endregion internal bool GetOPFStringForApp( AppId unVideoAppID, out string pchBuffer, ref int pnBufferSize ) diff --git a/Facepunch.Steamworks/Generated/SteamStructs.cs b/Facepunch.Steamworks/Generated/SteamStructs.cs index 66839d8..f44e8ba 100644 --- a/Facepunch.Steamworks/Generated/SteamStructs.cs +++ b/Facepunch.Steamworks/Generated/SteamStructs.cs @@ -20,15 +20,17 @@ internal struct CallbackMsg_t } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct SteamServerConnectFailure_t + internal struct SteamServerConnectFailure_t : ICallbackData { internal Result Result; // m_eResult enum EResult [MarshalAs(UnmanagedType.I1)] internal bool StillRetrying; // m_bStillRetrying _Bool #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamServerConnectFailure_t) ); - internal static SteamServerConnectFailure_t Fill( IntPtr p ) => ((SteamServerConnectFailure_t)(SteamServerConnectFailure_t) Marshal.PtrToStructure( p, typeof(SteamServerConnectFailure_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamServerConnectFailure_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUser + 2; + internal static SteamServerConnectFailure_t Fill( IntPtr p ) => ((SteamServerConnectFailure_t)Marshal.PtrToStructure( p, typeof(SteamServerConnectFailure_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -38,51 +40,28 @@ public static void Install( Action action, bool ser { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUser + 2, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUser + 2, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUser + 2, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUser + 2, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUser + 2, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct SteamServersDisconnected_t + internal struct SteamServersDisconnected_t : ICallbackData { internal Result Result; // m_eResult enum EResult #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamServersDisconnected_t) ); - internal static SteamServersDisconnected_t Fill( IntPtr p ) => ((SteamServersDisconnected_t)(SteamServersDisconnected_t) Marshal.PtrToStructure( p, typeof(SteamServersDisconnected_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamServersDisconnected_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUser + 3; + internal static SteamServersDisconnected_t Fill( IntPtr p ) => ((SteamServersDisconnected_t)Marshal.PtrToStructure( p, typeof(SteamServersDisconnected_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -92,45 +71,20 @@ public static void Install( Action action, bool serv { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUser + 3, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUser + 3, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUser + 3, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUser + 3, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUser + 3, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct ClientGameServerDeny_t + internal struct ClientGameServerDeny_t : ICallbackData { internal uint AppID; // m_uAppID uint32 internal uint GameServerIP; // m_unGameServerIP uint32 @@ -139,8 +93,10 @@ internal struct ClientGameServerDeny_t internal uint Reason; // m_uReason uint32 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ClientGameServerDeny_t) ); - internal static ClientGameServerDeny_t Fill( IntPtr p ) => ((ClientGameServerDeny_t)(ClientGameServerDeny_t) Marshal.PtrToStructure( p, typeof(ClientGameServerDeny_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ClientGameServerDeny_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUser + 13; + internal static ClientGameServerDeny_t Fill( IntPtr p ) => ((ClientGameServerDeny_t)Marshal.PtrToStructure( p, typeof(ClientGameServerDeny_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -150,53 +106,30 @@ public static void Install( Action action, bool server = { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUser + 13, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUser + 13, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUser + 13, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUser + 13, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUser + 13, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct ValidateAuthTicketResponse_t + internal struct ValidateAuthTicketResponse_t : ICallbackData { internal ulong SteamID; // m_SteamID class CSteamID internal AuthResponse AuthSessionResponse; // m_eAuthSessionResponse enum EAuthSessionResponse internal ulong OwnerSteamID; // m_OwnerSteamID class CSteamID #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ValidateAuthTicketResponse_t) ); - internal static ValidateAuthTicketResponse_t Fill( IntPtr p ) => ((ValidateAuthTicketResponse_t)(ValidateAuthTicketResponse_t) Marshal.PtrToStructure( p, typeof(ValidateAuthTicketResponse_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ValidateAuthTicketResponse_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUser + 43; + internal static ValidateAuthTicketResponse_t Fill( IntPtr p ) => ((ValidateAuthTicketResponse_t)Marshal.PtrToStructure( p, typeof(ValidateAuthTicketResponse_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -206,53 +139,30 @@ public static void Install( Action action, bool se { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUser + 43, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUser + 43, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUser + 43, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUser + 43, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUser + 43, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct MicroTxnAuthorizationResponse_t + internal struct MicroTxnAuthorizationResponse_t : ICallbackData { internal uint AppID; // m_unAppID uint32 internal ulong OrderID; // m_ulOrderID uint64 internal byte Authorized; // m_bAuthorized uint8 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MicroTxnAuthorizationResponse_t) ); - internal static MicroTxnAuthorizationResponse_t Fill( IntPtr p ) => ((MicroTxnAuthorizationResponse_t)(MicroTxnAuthorizationResponse_t) Marshal.PtrToStructure( p, typeof(MicroTxnAuthorizationResponse_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MicroTxnAuthorizationResponse_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUser + 52; + internal static MicroTxnAuthorizationResponse_t Fill( IntPtr p ) => ((MicroTxnAuthorizationResponse_t)Marshal.PtrToStructure( p, typeof(MicroTxnAuthorizationResponse_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -262,51 +172,28 @@ public static void Install( Action action, bool { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUser + 52, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUser + 52, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUser + 52, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUser + 52, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUser + 52, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct EncryptedAppTicketResponse_t + internal struct EncryptedAppTicketResponse_t : ICallbackData { internal Result Result; // m_eResult enum EResult #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(EncryptedAppTicketResponse_t) ); - internal static EncryptedAppTicketResponse_t Fill( IntPtr p ) => ((EncryptedAppTicketResponse_t)(EncryptedAppTicketResponse_t) Marshal.PtrToStructure( p, typeof(EncryptedAppTicketResponse_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(EncryptedAppTicketResponse_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUser + 54; + internal static EncryptedAppTicketResponse_t Fill( IntPtr p ) => ((EncryptedAppTicketResponse_t)Marshal.PtrToStructure( p, typeof(EncryptedAppTicketResponse_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -316,52 +203,29 @@ public static void Install( Action action, bool se { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUser + 54, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUser + 54, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUser + 54, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUser + 54, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUser + 54, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct GetAuthSessionTicketResponse_t + internal struct GetAuthSessionTicketResponse_t : ICallbackData { internal uint AuthTicket; // m_hAuthTicket HAuthTicket internal Result Result; // m_eResult enum EResult #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GetAuthSessionTicketResponse_t) ); - internal static GetAuthSessionTicketResponse_t Fill( IntPtr p ) => ((GetAuthSessionTicketResponse_t)(GetAuthSessionTicketResponse_t) Marshal.PtrToStructure( p, typeof(GetAuthSessionTicketResponse_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GetAuthSessionTicketResponse_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUser + 63; + internal static GetAuthSessionTicketResponse_t Fill( IntPtr p ) => ((GetAuthSessionTicketResponse_t)Marshal.PtrToStructure( p, typeof(GetAuthSessionTicketResponse_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -371,53 +235,30 @@ public static void Install( Action action, bool { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUser + 63, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUser + 63, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUser + 63, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUser + 63, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUser + 63, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct GameWebCallback_t + internal struct GameWebCallback_t : ICallbackData { internal string URLUTF8() => System.Text.Encoding.UTF8.GetString( URL, 0, System.Array.IndexOf( URL, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] // byte[] m_szURL internal byte[] URL; // m_szURL char [256] #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameWebCallback_t) ); - internal static GameWebCallback_t Fill( IntPtr p ) => ((GameWebCallback_t)(GameWebCallback_t) Marshal.PtrToStructure( p, typeof(GameWebCallback_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameWebCallback_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUser + 64; + internal static GameWebCallback_t Fill( IntPtr p ) => ((GameWebCallback_t)Marshal.PtrToStructure( p, typeof(GameWebCallback_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -427,53 +268,30 @@ public static void Install( Action action, bool server = fals { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUser + 64, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUser + 64, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUser + 64, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUser + 64, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUser + 64, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct StoreAuthURLResponse_t + internal struct StoreAuthURLResponse_t : ICallbackData { internal string URLUTF8() => System.Text.Encoding.UTF8.GetString( URL, 0, System.Array.IndexOf( URL, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] // byte[] m_szURL internal byte[] URL; // m_szURL char [512] #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(StoreAuthURLResponse_t) ); - internal static StoreAuthURLResponse_t Fill( IntPtr p ) => ((StoreAuthURLResponse_t)(StoreAuthURLResponse_t) Marshal.PtrToStructure( p, typeof(StoreAuthURLResponse_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(StoreAuthURLResponse_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUser + 65; + internal static StoreAuthURLResponse_t Fill( IntPtr p ) => ((StoreAuthURLResponse_t)Marshal.PtrToStructure( p, typeof(StoreAuthURLResponse_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -483,45 +301,20 @@ public static void Install( Action action, bool server = { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUser + 65, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUser + 65, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUser + 65, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUser + 65, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUser + 65, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct MarketEligibilityResponse_t + internal struct MarketEligibilityResponse_t : ICallbackData { [MarshalAs(UnmanagedType.I1)] internal bool Allowed; // m_bAllowed _Bool @@ -531,8 +324,10 @@ internal struct MarketEligibilityResponse_t internal int CdayNewDeviceCooldown; // m_cdayNewDeviceCooldown int #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MarketEligibilityResponse_t) ); - internal static MarketEligibilityResponse_t Fill( IntPtr p ) => ((MarketEligibilityResponse_t)(MarketEligibilityResponse_t) Marshal.PtrToStructure( p, typeof(MarketEligibilityResponse_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MarketEligibilityResponse_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUser + 66; + internal static MarketEligibilityResponse_t Fill( IntPtr p ) => ((MarketEligibilityResponse_t)Marshal.PtrToStructure( p, typeof(MarketEligibilityResponse_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -542,40 +337,15 @@ public static void Install( Action action, bool ser { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUser + 66, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUser + 66, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUser + 66, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUser + 66, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUser + 66, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } @@ -605,14 +375,16 @@ internal struct FriendSessionStateInfo_t } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct FriendStateChange_t + internal struct FriendStateChange_t : ICallbackData { internal ulong SteamID; // m_ulSteamID uint64 internal int ChangeFlags; // m_nChangeFlags int #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendStateChange_t) ); - internal static FriendStateChange_t Fill( IntPtr p ) => ((FriendStateChange_t)(FriendStateChange_t) Marshal.PtrToStructure( p, typeof(FriendStateChange_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendStateChange_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamFriends + 4; + internal static FriendStateChange_t Fill( IntPtr p ) => ((FriendStateChange_t)Marshal.PtrToStructure( p, typeof(FriendStateChange_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -622,51 +394,28 @@ public static void Install( Action action, bool server = fa { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 4, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamFriends + 4, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 4, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamFriends + 4, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 4, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct GameOverlayActivated_t + internal struct GameOverlayActivated_t : ICallbackData { internal byte Active; // m_bActive uint8 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameOverlayActivated_t) ); - internal static GameOverlayActivated_t Fill( IntPtr p ) => ((GameOverlayActivated_t)(GameOverlayActivated_t) Marshal.PtrToStructure( p, typeof(GameOverlayActivated_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameOverlayActivated_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamFriends + 31; + internal static GameOverlayActivated_t Fill( IntPtr p ) => ((GameOverlayActivated_t)Marshal.PtrToStructure( p, typeof(GameOverlayActivated_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -676,45 +425,20 @@ public static void Install( Action action, bool server = { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 31, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamFriends + 31, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 31, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamFriends + 31, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 31, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct GameServerChangeRequested_t + internal struct GameServerChangeRequested_t : ICallbackData { internal string ServerUTF8() => System.Text.Encoding.UTF8.GetString( Server, 0, System.Array.IndexOf( Server, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] // byte[] m_rgchServer @@ -724,8 +448,10 @@ internal struct GameServerChangeRequested_t internal byte[] Password; // m_rgchPassword char [64] #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameServerChangeRequested_t) ); - internal static GameServerChangeRequested_t Fill( IntPtr p ) => ((GameServerChangeRequested_t)(GameServerChangeRequested_t) Marshal.PtrToStructure( p, typeof(GameServerChangeRequested_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameServerChangeRequested_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamFriends + 32; + internal static GameServerChangeRequested_t Fill( IntPtr p ) => ((GameServerChangeRequested_t)Marshal.PtrToStructure( p, typeof(GameServerChangeRequested_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -735,52 +461,29 @@ public static void Install( Action action, bool ser { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 32, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamFriends + 32, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 32, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamFriends + 32, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 32, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct GameLobbyJoinRequested_t + internal struct GameLobbyJoinRequested_t : ICallbackData { internal ulong SteamIDLobby; // m_steamIDLobby class CSteamID internal ulong SteamIDFriend; // m_steamIDFriend class CSteamID #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameLobbyJoinRequested_t) ); - internal static GameLobbyJoinRequested_t Fill( IntPtr p ) => ((GameLobbyJoinRequested_t)(GameLobbyJoinRequested_t) Marshal.PtrToStructure( p, typeof(GameLobbyJoinRequested_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameLobbyJoinRequested_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamFriends + 33; + internal static GameLobbyJoinRequested_t Fill( IntPtr p ) => ((GameLobbyJoinRequested_t)Marshal.PtrToStructure( p, typeof(GameLobbyJoinRequested_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -790,45 +493,20 @@ public static void Install( Action action, bool server { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 33, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamFriends + 33, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 33, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamFriends + 33, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 33, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct AvatarImageLoaded_t + internal struct AvatarImageLoaded_t : ICallbackData { internal ulong SteamID; // m_steamID class CSteamID internal int Image; // m_iImage int @@ -836,8 +514,10 @@ internal struct AvatarImageLoaded_t internal int Tall; // m_iTall int #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(AvatarImageLoaded_t) ); - internal static AvatarImageLoaded_t Fill( IntPtr p ) => ((AvatarImageLoaded_t)(AvatarImageLoaded_t) Marshal.PtrToStructure( p, typeof(AvatarImageLoaded_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(AvatarImageLoaded_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamFriends + 34; + internal static AvatarImageLoaded_t Fill( IntPtr p ) => ((AvatarImageLoaded_t)Marshal.PtrToStructure( p, typeof(AvatarImageLoaded_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -847,53 +527,30 @@ public static void Install( Action action, bool server = fa { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 34, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamFriends + 34, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 34, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamFriends + 34, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 34, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct ClanOfficerListResponse_t + internal struct ClanOfficerListResponse_t : ICallbackData { internal ulong SteamIDClan; // m_steamIDClan class CSteamID internal int COfficers; // m_cOfficers int internal byte Success; // m_bSuccess uint8 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ClanOfficerListResponse_t) ); - internal static ClanOfficerListResponse_t Fill( IntPtr p ) => ((ClanOfficerListResponse_t)(ClanOfficerListResponse_t) Marshal.PtrToStructure( p, typeof(ClanOfficerListResponse_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ClanOfficerListResponse_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamFriends + 35; + internal static ClanOfficerListResponse_t Fill( IntPtr p ) => ((ClanOfficerListResponse_t)Marshal.PtrToStructure( p, typeof(ClanOfficerListResponse_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -903,52 +560,29 @@ public static void Install( Action action, bool serve { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 35, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamFriends + 35, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 35, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamFriends + 35, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 35, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct FriendRichPresenceUpdate_t + internal struct FriendRichPresenceUpdate_t : ICallbackData { internal ulong SteamIDFriend; // m_steamIDFriend class CSteamID internal AppId AppID; // m_nAppID AppId_t #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendRichPresenceUpdate_t) ); - internal static FriendRichPresenceUpdate_t Fill( IntPtr p ) => ((FriendRichPresenceUpdate_t)(FriendRichPresenceUpdate_t) Marshal.PtrToStructure( p, typeof(FriendRichPresenceUpdate_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendRichPresenceUpdate_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamFriends + 36; + internal static FriendRichPresenceUpdate_t Fill( IntPtr p ) => ((FriendRichPresenceUpdate_t)Marshal.PtrToStructure( p, typeof(FriendRichPresenceUpdate_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -958,45 +592,20 @@ public static void Install( Action action, bool serv { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 36, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamFriends + 36, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 36, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamFriends + 36, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 36, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct GameRichPresenceJoinRequested_t + internal struct GameRichPresenceJoinRequested_t : ICallbackData { internal ulong SteamIDFriend; // m_steamIDFriend class CSteamID internal string ConnectUTF8() => System.Text.Encoding.UTF8.GetString( Connect, 0, System.Array.IndexOf( Connect, 0 ) ); @@ -1004,8 +613,10 @@ internal struct GameRichPresenceJoinRequested_t internal byte[] Connect; // m_rgchConnect char [256] #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameRichPresenceJoinRequested_t) ); - internal static GameRichPresenceJoinRequested_t Fill( IntPtr p ) => ((GameRichPresenceJoinRequested_t)(GameRichPresenceJoinRequested_t) Marshal.PtrToStructure( p, typeof(GameRichPresenceJoinRequested_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameRichPresenceJoinRequested_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamFriends + 37; + internal static GameRichPresenceJoinRequested_t Fill( IntPtr p ) => ((GameRichPresenceJoinRequested_t)Marshal.PtrToStructure( p, typeof(GameRichPresenceJoinRequested_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -1015,53 +626,30 @@ public static void Install( Action action, bool { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 37, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamFriends + 37, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 37, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamFriends + 37, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 37, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct GameConnectedClanChatMsg_t + internal struct GameConnectedClanChatMsg_t : ICallbackData { internal ulong SteamIDClanChat; // m_steamIDClanChat class CSteamID internal ulong SteamIDUser; // m_steamIDUser class CSteamID internal int MessageID; // m_iMessageID int #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameConnectedClanChatMsg_t) ); - internal static GameConnectedClanChatMsg_t Fill( IntPtr p ) => ((GameConnectedClanChatMsg_t)(GameConnectedClanChatMsg_t) Marshal.PtrToStructure( p, typeof(GameConnectedClanChatMsg_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameConnectedClanChatMsg_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamFriends + 38; + internal static GameConnectedClanChatMsg_t Fill( IntPtr p ) => ((GameConnectedClanChatMsg_t)Marshal.PtrToStructure( p, typeof(GameConnectedClanChatMsg_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -1071,52 +659,29 @@ public static void Install( Action action, bool serv { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 38, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamFriends + 38, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 38, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamFriends + 38, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 38, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct GameConnectedChatJoin_t + internal struct GameConnectedChatJoin_t : ICallbackData { internal ulong SteamIDClanChat; // m_steamIDClanChat class CSteamID internal ulong SteamIDUser; // m_steamIDUser class CSteamID #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameConnectedChatJoin_t) ); - internal static GameConnectedChatJoin_t Fill( IntPtr p ) => ((GameConnectedChatJoin_t)(GameConnectedChatJoin_t) Marshal.PtrToStructure( p, typeof(GameConnectedChatJoin_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameConnectedChatJoin_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamFriends + 39; + internal static GameConnectedChatJoin_t Fill( IntPtr p ) => ((GameConnectedChatJoin_t)Marshal.PtrToStructure( p, typeof(GameConnectedChatJoin_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -1126,45 +691,20 @@ public static void Install( Action action, bool server { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 39, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamFriends + 39, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 39, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamFriends + 39, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 39, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct GameConnectedChatLeave_t + internal struct GameConnectedChatLeave_t : ICallbackData { internal ulong SteamIDClanChat; // m_steamIDClanChat class CSteamID internal ulong SteamIDUser; // m_steamIDUser class CSteamID @@ -1174,8 +714,10 @@ internal struct GameConnectedChatLeave_t internal bool Dropped; // m_bDropped _Bool #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameConnectedChatLeave_t) ); - internal static GameConnectedChatLeave_t Fill( IntPtr p ) => ((GameConnectedChatLeave_t)(GameConnectedChatLeave_t) Marshal.PtrToStructure( p, typeof(GameConnectedChatLeave_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameConnectedChatLeave_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamFriends + 40; + internal static GameConnectedChatLeave_t Fill( IntPtr p ) => ((GameConnectedChatLeave_t)Marshal.PtrToStructure( p, typeof(GameConnectedChatLeave_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -1185,52 +727,29 @@ public static void Install( Action action, bool server { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 40, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamFriends + 40, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 40, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamFriends + 40, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 40, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct DownloadClanActivityCountsResult_t + internal struct DownloadClanActivityCountsResult_t : ICallbackData { [MarshalAs(UnmanagedType.I1)] internal bool Success; // m_bSuccess _Bool #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(DownloadClanActivityCountsResult_t) ); - internal static DownloadClanActivityCountsResult_t Fill( IntPtr p ) => ((DownloadClanActivityCountsResult_t)(DownloadClanActivityCountsResult_t) Marshal.PtrToStructure( p, typeof(DownloadClanActivityCountsResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(DownloadClanActivityCountsResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamFriends + 41; + internal static DownloadClanActivityCountsResult_t Fill( IntPtr p ) => ((DownloadClanActivityCountsResult_t)Marshal.PtrToStructure( p, typeof(DownloadClanActivityCountsResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -1240,52 +759,29 @@ public static void Install( Action action, b { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 41, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamFriends + 41, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 41, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamFriends + 41, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 41, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct JoinClanChatRoomCompletionResult_t + internal struct JoinClanChatRoomCompletionResult_t : ICallbackData { internal ulong SteamIDClanChat; // m_steamIDClanChat class CSteamID internal RoomEnter ChatRoomEnterResponse; // m_eChatRoomEnterResponse enum EChatRoomEnterResponse #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(JoinClanChatRoomCompletionResult_t) ); - internal static JoinClanChatRoomCompletionResult_t Fill( IntPtr p ) => ((JoinClanChatRoomCompletionResult_t)(JoinClanChatRoomCompletionResult_t) Marshal.PtrToStructure( p, typeof(JoinClanChatRoomCompletionResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(JoinClanChatRoomCompletionResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamFriends + 42; + internal static JoinClanChatRoomCompletionResult_t Fill( IntPtr p ) => ((JoinClanChatRoomCompletionResult_t)Marshal.PtrToStructure( p, typeof(JoinClanChatRoomCompletionResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -1295,52 +791,29 @@ public static void Install( Action action, b { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 42, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamFriends + 42, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 42, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamFriends + 42, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 42, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct GameConnectedFriendChatMsg_t + internal struct GameConnectedFriendChatMsg_t : ICallbackData { internal ulong SteamIDUser; // m_steamIDUser class CSteamID internal int MessageID; // m_iMessageID int #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameConnectedFriendChatMsg_t) ); - internal static GameConnectedFriendChatMsg_t Fill( IntPtr p ) => ((GameConnectedFriendChatMsg_t)(GameConnectedFriendChatMsg_t) Marshal.PtrToStructure( p, typeof(GameConnectedFriendChatMsg_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameConnectedFriendChatMsg_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamFriends + 43; + internal static GameConnectedFriendChatMsg_t Fill( IntPtr p ) => ((GameConnectedFriendChatMsg_t)Marshal.PtrToStructure( p, typeof(GameConnectedFriendChatMsg_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -1350,53 +823,30 @@ public static void Install( Action action, bool se { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 43, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamFriends + 43, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 43, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamFriends + 43, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 43, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct FriendsGetFollowerCount_t + internal struct FriendsGetFollowerCount_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal ulong SteamID; // m_steamID class CSteamID internal int Count; // m_nCount int #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendsGetFollowerCount_t) ); - internal static FriendsGetFollowerCount_t Fill( IntPtr p ) => ((FriendsGetFollowerCount_t)(FriendsGetFollowerCount_t) Marshal.PtrToStructure( p, typeof(FriendsGetFollowerCount_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendsGetFollowerCount_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamFriends + 44; + internal static FriendsGetFollowerCount_t Fill( IntPtr p ) => ((FriendsGetFollowerCount_t)Marshal.PtrToStructure( p, typeof(FriendsGetFollowerCount_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -1406,45 +856,20 @@ public static void Install( Action action, bool serve { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 44, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamFriends + 44, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 44, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamFriends + 44, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 44, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct FriendsIsFollowing_t + internal struct FriendsIsFollowing_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal ulong SteamID; // m_steamID class CSteamID @@ -1452,8 +877,10 @@ internal struct FriendsIsFollowing_t internal bool IsFollowing; // m_bIsFollowing _Bool #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendsIsFollowing_t) ); - internal static FriendsIsFollowing_t Fill( IntPtr p ) => ((FriendsIsFollowing_t)(FriendsIsFollowing_t) Marshal.PtrToStructure( p, typeof(FriendsIsFollowing_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendsIsFollowing_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamFriends + 45; + internal static FriendsIsFollowing_t Fill( IntPtr p ) => ((FriendsIsFollowing_t)Marshal.PtrToStructure( p, typeof(FriendsIsFollowing_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -1463,45 +890,20 @@ public static void Install( Action action, bool server = f { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 45, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamFriends + 45, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 45, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamFriends + 45, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 45, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct FriendsEnumerateFollowingList_t + internal struct FriendsEnumerateFollowingList_t : ICallbackData { internal Result Result; // m_eResult enum EResult [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] @@ -1510,8 +912,10 @@ internal struct FriendsEnumerateFollowingList_t internal int TotalResultCount; // m_nTotalResultCount int32 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendsEnumerateFollowingList_t) ); - internal static FriendsEnumerateFollowingList_t Fill( IntPtr p ) => ((FriendsEnumerateFollowingList_t)(FriendsEnumerateFollowingList_t) Marshal.PtrToStructure( p, typeof(FriendsEnumerateFollowingList_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendsEnumerateFollowingList_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamFriends + 46; + internal static FriendsEnumerateFollowingList_t Fill( IntPtr p ) => ((FriendsEnumerateFollowingList_t)Marshal.PtrToStructure( p, typeof(FriendsEnumerateFollowingList_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -1521,45 +925,20 @@ public static void Install( Action action, bool { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 46, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamFriends + 46, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 46, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamFriends + 46, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 46, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct SetPersonaNameResponse_t + internal struct SetPersonaNameResponse_t : ICallbackData { [MarshalAs(UnmanagedType.I1)] internal bool Success; // m_bSuccess _Bool @@ -1568,8 +947,10 @@ internal struct SetPersonaNameResponse_t internal Result Result; // m_result enum EResult #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SetPersonaNameResponse_t) ); - internal static SetPersonaNameResponse_t Fill( IntPtr p ) => ((SetPersonaNameResponse_t)(SetPersonaNameResponse_t) Marshal.PtrToStructure( p, typeof(SetPersonaNameResponse_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SetPersonaNameResponse_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamFriends + 47; + internal static SetPersonaNameResponse_t Fill( IntPtr p ) => ((SetPersonaNameResponse_t)Marshal.PtrToStructure( p, typeof(SetPersonaNameResponse_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -1579,51 +960,28 @@ public static void Install( Action action, bool server { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 47, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamFriends + 47, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 47, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamFriends + 47, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 47, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct LowBatteryPower_t + internal struct LowBatteryPower_t : ICallbackData { internal byte MinutesBatteryLeft; // m_nMinutesBatteryLeft uint8 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LowBatteryPower_t) ); - internal static LowBatteryPower_t Fill( IntPtr p ) => ((LowBatteryPower_t)(LowBatteryPower_t) Marshal.PtrToStructure( p, typeof(LowBatteryPower_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LowBatteryPower_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUtils + 2; + internal static LowBatteryPower_t Fill( IntPtr p ) => ((LowBatteryPower_t)Marshal.PtrToStructure( p, typeof(LowBatteryPower_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -1633,53 +991,30 @@ public static void Install( Action action, bool server = fals { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUtils + 2, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUtils + 2, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUtils + 2, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUtils + 2, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUtils + 2, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct SteamAPICallCompleted_t + internal struct SteamAPICallCompleted_t : ICallbackData { internal ulong AsyncCall; // m_hAsyncCall SteamAPICall_t internal int Callback; // m_iCallback int internal uint ParamCount; // m_cubParam uint32 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamAPICallCompleted_t) ); - internal static SteamAPICallCompleted_t Fill( IntPtr p ) => ((SteamAPICallCompleted_t)(SteamAPICallCompleted_t) Marshal.PtrToStructure( p, typeof(SteamAPICallCompleted_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamAPICallCompleted_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUtils + 3; + internal static SteamAPICallCompleted_t Fill( IntPtr p ) => ((SteamAPICallCompleted_t)Marshal.PtrToStructure( p, typeof(SteamAPICallCompleted_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -1689,51 +1024,28 @@ public static void Install( Action action, bool server { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUtils + 3, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUtils + 3, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUtils + 3, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUtils + 3, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUtils + 3, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct CheckFileSignature_t + internal struct CheckFileSignature_t : ICallbackData { internal CheckFileSignature CheckFileSignature; // m_eCheckFileSignature enum ECheckFileSignature #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(CheckFileSignature_t) ); - internal static CheckFileSignature_t Fill( IntPtr p ) => ((CheckFileSignature_t)(CheckFileSignature_t) Marshal.PtrToStructure( p, typeof(CheckFileSignature_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(CheckFileSignature_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUtils + 5; + internal static CheckFileSignature_t Fill( IntPtr p ) => ((CheckFileSignature_t)Marshal.PtrToStructure( p, typeof(CheckFileSignature_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -1743,53 +1055,30 @@ public static void Install( Action action, bool server = f { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUtils + 5, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUtils + 5, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUtils + 5, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUtils + 5, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUtils + 5, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct GamepadTextInputDismissed_t + internal struct GamepadTextInputDismissed_t : ICallbackData { [MarshalAs(UnmanagedType.I1)] internal bool Submitted; // m_bSubmitted _Bool internal uint SubmittedText; // m_unSubmittedText uint32 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GamepadTextInputDismissed_t) ); - internal static GamepadTextInputDismissed_t Fill( IntPtr p ) => ((GamepadTextInputDismissed_t)(GamepadTextInputDismissed_t) Marshal.PtrToStructure( p, typeof(GamepadTextInputDismissed_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GamepadTextInputDismissed_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUtils + 14; + internal static GamepadTextInputDismissed_t Fill( IntPtr p ) => ((GamepadTextInputDismissed_t)Marshal.PtrToStructure( p, typeof(GamepadTextInputDismissed_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -1799,40 +1088,15 @@ public static void Install( Action action, bool ser { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUtils + 14, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUtils + 14, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUtils + 14, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUtils + 14, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUtils + 14, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } @@ -1901,7 +1165,7 @@ internal struct SteamPartyBeaconLocation_t } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct FavoritesListChanged_t + internal struct FavoritesListChanged_t : ICallbackData { internal uint IP; // m_nIP uint32 internal uint QueryPort; // m_nQueryPort uint32 @@ -1913,8 +1177,10 @@ internal struct FavoritesListChanged_t internal uint AccountId; // m_unAccountId AccountID_t #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FavoritesListChanged_t) ); - internal static FavoritesListChanged_t Fill( IntPtr p ) => ((FavoritesListChanged_t)(FavoritesListChanged_t) Marshal.PtrToStructure( p, typeof(FavoritesListChanged_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FavoritesListChanged_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamMatchmaking + 2; + internal static FavoritesListChanged_t Fill( IntPtr p ) => ((FavoritesListChanged_t)Marshal.PtrToStructure( p, typeof(FavoritesListChanged_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -1924,53 +1190,30 @@ public static void Install( Action action, bool server = { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMatchmaking + 2, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamMatchmaking + 2, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMatchmaking + 2, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamMatchmaking + 2, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMatchmaking + 2, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct LobbyInvite_t + internal struct LobbyInvite_t : ICallbackData { internal ulong SteamIDUser; // m_ulSteamIDUser uint64 internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 internal ulong GameID; // m_ulGameID uint64 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyInvite_t) ); - internal static LobbyInvite_t Fill( IntPtr p ) => ((LobbyInvite_t)(LobbyInvite_t) Marshal.PtrToStructure( p, typeof(LobbyInvite_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyInvite_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamMatchmaking + 3; + internal static LobbyInvite_t Fill( IntPtr p ) => ((LobbyInvite_t)Marshal.PtrToStructure( p, typeof(LobbyInvite_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -1980,45 +1223,20 @@ public static void Install( Action action, bool server = false ) { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMatchmaking + 3, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamMatchmaking + 3, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMatchmaking + 3, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamMatchmaking + 3, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMatchmaking + 3, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct LobbyEnter_t + internal struct LobbyEnter_t : ICallbackData { internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 internal uint GfChatPermissions; // m_rgfChatPermissions uint32 @@ -2027,8 +1245,10 @@ internal struct LobbyEnter_t internal uint EChatRoomEnterResponse; // m_EChatRoomEnterResponse uint32 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyEnter_t) ); - internal static LobbyEnter_t Fill( IntPtr p ) => ((LobbyEnter_t)(LobbyEnter_t) Marshal.PtrToStructure( p, typeof(LobbyEnter_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyEnter_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamMatchmaking + 4; + internal static LobbyEnter_t Fill( IntPtr p ) => ((LobbyEnter_t)Marshal.PtrToStructure( p, typeof(LobbyEnter_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -2038,53 +1258,30 @@ public static void Install( Action action, bool server = false ) { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMatchmaking + 4, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamMatchmaking + 4, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMatchmaking + 4, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamMatchmaking + 4, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMatchmaking + 4, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct LobbyDataUpdate_t + internal struct LobbyDataUpdate_t : ICallbackData { internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 internal ulong SteamIDMember; // m_ulSteamIDMember uint64 internal byte Success; // m_bSuccess uint8 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyDataUpdate_t) ); - internal static LobbyDataUpdate_t Fill( IntPtr p ) => ((LobbyDataUpdate_t)(LobbyDataUpdate_t) Marshal.PtrToStructure( p, typeof(LobbyDataUpdate_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyDataUpdate_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamMatchmaking + 5; + internal static LobbyDataUpdate_t Fill( IntPtr p ) => ((LobbyDataUpdate_t)Marshal.PtrToStructure( p, typeof(LobbyDataUpdate_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -2094,45 +1291,20 @@ public static void Install( Action action, bool server = fals { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMatchmaking + 5, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamMatchmaking + 5, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMatchmaking + 5, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamMatchmaking + 5, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMatchmaking + 5, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct LobbyChatUpdate_t + internal struct LobbyChatUpdate_t : ICallbackData { internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 internal ulong SteamIDUserChanged; // m_ulSteamIDUserChanged uint64 @@ -2140,8 +1312,10 @@ internal struct LobbyChatUpdate_t internal uint GfChatMemberStateChange; // m_rgfChatMemberStateChange uint32 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyChatUpdate_t) ); - internal static LobbyChatUpdate_t Fill( IntPtr p ) => ((LobbyChatUpdate_t)(LobbyChatUpdate_t) Marshal.PtrToStructure( p, typeof(LobbyChatUpdate_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyChatUpdate_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamMatchmaking + 6; + internal static LobbyChatUpdate_t Fill( IntPtr p ) => ((LobbyChatUpdate_t)Marshal.PtrToStructure( p, typeof(LobbyChatUpdate_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -2151,45 +1325,20 @@ public static void Install( Action action, bool server = fals { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMatchmaking + 6, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamMatchmaking + 6, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMatchmaking + 6, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamMatchmaking + 6, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMatchmaking + 6, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct LobbyChatMsg_t + internal struct LobbyChatMsg_t : ICallbackData { internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 internal ulong SteamIDUser; // m_ulSteamIDUser uint64 @@ -2197,8 +1346,10 @@ internal struct LobbyChatMsg_t internal uint ChatID; // m_iChatID uint32 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyChatMsg_t) ); - internal static LobbyChatMsg_t Fill( IntPtr p ) => ((LobbyChatMsg_t)(LobbyChatMsg_t) Marshal.PtrToStructure( p, typeof(LobbyChatMsg_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyChatMsg_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamMatchmaking + 7; + internal static LobbyChatMsg_t Fill( IntPtr p ) => ((LobbyChatMsg_t)Marshal.PtrToStructure( p, typeof(LobbyChatMsg_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -2208,45 +1359,20 @@ public static void Install( Action action, bool server = false ) { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMatchmaking + 7, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamMatchmaking + 7, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMatchmaking + 7, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamMatchmaking + 7, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMatchmaking + 7, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct LobbyGameCreated_t + internal struct LobbyGameCreated_t : ICallbackData { internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 internal ulong SteamIDGameServer; // m_ulSteamIDGameServer uint64 @@ -2254,8 +1380,10 @@ internal struct LobbyGameCreated_t internal ushort Port; // m_usPort uint16 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyGameCreated_t) ); - internal static LobbyGameCreated_t Fill( IntPtr p ) => ((LobbyGameCreated_t)(LobbyGameCreated_t) Marshal.PtrToStructure( p, typeof(LobbyGameCreated_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyGameCreated_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamMatchmaking + 9; + internal static LobbyGameCreated_t Fill( IntPtr p ) => ((LobbyGameCreated_t)Marshal.PtrToStructure( p, typeof(LobbyGameCreated_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -2265,51 +1393,28 @@ public static void Install( Action action, bool server = fal { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMatchmaking + 9, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamMatchmaking + 9, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMatchmaking + 9, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamMatchmaking + 9, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMatchmaking + 9, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct LobbyMatchList_t + internal struct LobbyMatchList_t : ICallbackData { internal uint LobbiesMatching; // m_nLobbiesMatching uint32 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyMatchList_t) ); - internal static LobbyMatchList_t Fill( IntPtr p ) => ((LobbyMatchList_t)(LobbyMatchList_t) Marshal.PtrToStructure( p, typeof(LobbyMatchList_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyMatchList_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamMatchmaking + 10; + internal static LobbyMatchList_t Fill( IntPtr p ) => ((LobbyMatchList_t)Marshal.PtrToStructure( p, typeof(LobbyMatchList_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -2319,53 +1424,30 @@ public static void Install( Action action, bool server = false { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMatchmaking + 10, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamMatchmaking + 10, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMatchmaking + 10, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamMatchmaking + 10, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMatchmaking + 10, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct LobbyKicked_t + internal struct LobbyKicked_t : ICallbackData { internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 internal ulong SteamIDAdmin; // m_ulSteamIDAdmin uint64 internal byte KickedDueToDisconnect; // m_bKickedDueToDisconnect uint8 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyKicked_t) ); - internal static LobbyKicked_t Fill( IntPtr p ) => ((LobbyKicked_t)(LobbyKicked_t) Marshal.PtrToStructure( p, typeof(LobbyKicked_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyKicked_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamMatchmaking + 12; + internal static LobbyKicked_t Fill( IntPtr p ) => ((LobbyKicked_t)Marshal.PtrToStructure( p, typeof(LobbyKicked_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -2375,52 +1457,29 @@ public static void Install( Action action, bool server = false ) { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMatchmaking + 12, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamMatchmaking + 12, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMatchmaking + 12, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamMatchmaking + 12, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMatchmaking + 12, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct LobbyCreated_t + internal struct LobbyCreated_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyCreated_t) ); - internal static LobbyCreated_t Fill( IntPtr p ) => ((LobbyCreated_t)(LobbyCreated_t) Marshal.PtrToStructure( p, typeof(LobbyCreated_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyCreated_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamMatchmaking + 13; + internal static LobbyCreated_t Fill( IntPtr p ) => ((LobbyCreated_t)Marshal.PtrToStructure( p, typeof(LobbyCreated_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -2430,53 +1489,30 @@ public static void Install( Action action, bool server = false ) { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMatchmaking + 13, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamMatchmaking + 13, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMatchmaking + 13, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamMatchmaking + 13, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMatchmaking + 13, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct PSNGameBootInviteResult_t + internal struct PSNGameBootInviteResult_t : ICallbackData { [MarshalAs(UnmanagedType.I1)] internal bool GameBootInviteExists; // m_bGameBootInviteExists _Bool internal ulong SteamIDLobby; // m_steamIDLobby class CSteamID #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(PSNGameBootInviteResult_t) ); - internal static PSNGameBootInviteResult_t Fill( IntPtr p ) => ((PSNGameBootInviteResult_t)(PSNGameBootInviteResult_t) Marshal.PtrToStructure( p, typeof(PSNGameBootInviteResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(PSNGameBootInviteResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamMatchmaking + 15; + internal static PSNGameBootInviteResult_t Fill( IntPtr p ) => ((PSNGameBootInviteResult_t)Marshal.PtrToStructure( p, typeof(PSNGameBootInviteResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -2486,51 +1522,28 @@ public static void Install( Action action, bool serve { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMatchmaking + 15, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamMatchmaking + 15, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMatchmaking + 15, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamMatchmaking + 15, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMatchmaking + 15, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct FavoritesListAccountsUpdated_t + internal struct FavoritesListAccountsUpdated_t : ICallbackData { internal Result Result; // m_eResult enum EResult #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FavoritesListAccountsUpdated_t) ); - internal static FavoritesListAccountsUpdated_t Fill( IntPtr p ) => ((FavoritesListAccountsUpdated_t)(FavoritesListAccountsUpdated_t) Marshal.PtrToStructure( p, typeof(FavoritesListAccountsUpdated_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FavoritesListAccountsUpdated_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamMatchmaking + 16; + internal static FavoritesListAccountsUpdated_t Fill( IntPtr p ) => ((FavoritesListAccountsUpdated_t)Marshal.PtrToStructure( p, typeof(FavoritesListAccountsUpdated_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -2540,45 +1553,20 @@ public static void Install( Action action, bool { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMatchmaking + 16, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamMatchmaking + 16, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMatchmaking + 16, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamMatchmaking + 16, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMatchmaking + 16, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct SearchForGameProgressCallback_t + internal struct SearchForGameProgressCallback_t : ICallbackData { internal ulong LSearchID; // m_ullSearchID uint64 internal Result Result; // m_eResult enum EResult @@ -2588,8 +1576,10 @@ internal struct SearchForGameProgressCallback_t internal int CPlayersSearching; // m_cPlayersSearching int32 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SearchForGameProgressCallback_t) ); - internal static SearchForGameProgressCallback_t Fill( IntPtr p ) => ((SearchForGameProgressCallback_t)(SearchForGameProgressCallback_t) Marshal.PtrToStructure( p, typeof(SearchForGameProgressCallback_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SearchForGameProgressCallback_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamGameSearch + 1; + internal static SearchForGameProgressCallback_t Fill( IntPtr p ) => ((SearchForGameProgressCallback_t)Marshal.PtrToStructure( p, typeof(SearchForGameProgressCallback_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -2599,45 +1589,20 @@ public static void Install( Action action, bool { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameSearch + 1, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamGameSearch + 1, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameSearch + 1, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamGameSearch + 1, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameSearch + 1, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct SearchForGameResultCallback_t + internal struct SearchForGameResultCallback_t : ICallbackData { internal ulong LSearchID; // m_ullSearchID uint64 internal Result Result; // m_eResult enum EResult @@ -2648,8 +1613,10 @@ internal struct SearchForGameResultCallback_t internal bool FinalCallback; // m_bFinalCallback _Bool #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SearchForGameResultCallback_t) ); - internal static SearchForGameResultCallback_t Fill( IntPtr p ) => ((SearchForGameResultCallback_t)(SearchForGameResultCallback_t) Marshal.PtrToStructure( p, typeof(SearchForGameResultCallback_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SearchForGameResultCallback_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamGameSearch + 2; + internal static SearchForGameResultCallback_t Fill( IntPtr p ) => ((SearchForGameResultCallback_t)Marshal.PtrToStructure( p, typeof(SearchForGameResultCallback_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -2659,52 +1626,29 @@ public static void Install( Action action, bool s { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameSearch + 2, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamGameSearch + 2, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameSearch + 2, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamGameSearch + 2, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameSearch + 2, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RequestPlayersForGameProgressCallback_t + internal struct RequestPlayersForGameProgressCallback_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal ulong LSearchID; // m_ullSearchID uint64 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RequestPlayersForGameProgressCallback_t) ); - internal static RequestPlayersForGameProgressCallback_t Fill( IntPtr p ) => ((RequestPlayersForGameProgressCallback_t)(RequestPlayersForGameProgressCallback_t) Marshal.PtrToStructure( p, typeof(RequestPlayersForGameProgressCallback_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RequestPlayersForGameProgressCallback_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamGameSearch + 11; + internal static RequestPlayersForGameProgressCallback_t Fill( IntPtr p ) => ((RequestPlayersForGameProgressCallback_t)Marshal.PtrToStructure( p, typeof(RequestPlayersForGameProgressCallback_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -2714,45 +1658,20 @@ public static void Install( Action acti { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameSearch + 11, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamGameSearch + 11, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameSearch + 11, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamGameSearch + 11, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameSearch + 11, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct RequestPlayersForGameResultCallback_t + internal struct RequestPlayersForGameResultCallback_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal ulong LSearchID; // m_ullSearchID uint64 @@ -2766,8 +1685,10 @@ internal struct RequestPlayersForGameResultCallback_t internal ulong LUniqueGameID; // m_ullUniqueGameID uint64 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RequestPlayersForGameResultCallback_t) ); - internal static RequestPlayersForGameResultCallback_t Fill( IntPtr p ) => ((RequestPlayersForGameResultCallback_t)(RequestPlayersForGameResultCallback_t) Marshal.PtrToStructure( p, typeof(RequestPlayersForGameResultCallback_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RequestPlayersForGameResultCallback_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamGameSearch + 12; + internal static RequestPlayersForGameResultCallback_t Fill( IntPtr p ) => ((RequestPlayersForGameResultCallback_t)Marshal.PtrToStructure( p, typeof(RequestPlayersForGameResultCallback_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -2777,53 +1698,30 @@ public static void Install( Action action { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameSearch + 12, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamGameSearch + 12, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameSearch + 12, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamGameSearch + 12, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameSearch + 12, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RequestPlayersForGameFinalResultCallback_t + internal struct RequestPlayersForGameFinalResultCallback_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal ulong LSearchID; // m_ullSearchID uint64 internal ulong LUniqueGameID; // m_ullUniqueGameID uint64 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RequestPlayersForGameFinalResultCallback_t) ); - internal static RequestPlayersForGameFinalResultCallback_t Fill( IntPtr p ) => ((RequestPlayersForGameFinalResultCallback_t)(RequestPlayersForGameFinalResultCallback_t) Marshal.PtrToStructure( p, typeof(RequestPlayersForGameFinalResultCallback_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RequestPlayersForGameFinalResultCallback_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamGameSearch + 13; + internal static RequestPlayersForGameFinalResultCallback_t Fill( IntPtr p ) => ((RequestPlayersForGameFinalResultCallback_t)Marshal.PtrToStructure( p, typeof(RequestPlayersForGameFinalResultCallback_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -2833,53 +1731,30 @@ public static void Install( Action a { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameSearch + 13, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamGameSearch + 13, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameSearch + 13, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamGameSearch + 13, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameSearch + 13, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct SubmitPlayerResultResultCallback_t + internal struct SubmitPlayerResultResultCallback_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal ulong UllUniqueGameID; // ullUniqueGameID uint64 internal ulong SteamIDPlayer; // steamIDPlayer class CSteamID #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SubmitPlayerResultResultCallback_t) ); - internal static SubmitPlayerResultResultCallback_t Fill( IntPtr p ) => ((SubmitPlayerResultResultCallback_t)(SubmitPlayerResultResultCallback_t) Marshal.PtrToStructure( p, typeof(SubmitPlayerResultResultCallback_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SubmitPlayerResultResultCallback_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamGameSearch + 14; + internal static SubmitPlayerResultResultCallback_t Fill( IntPtr p ) => ((SubmitPlayerResultResultCallback_t)Marshal.PtrToStructure( p, typeof(SubmitPlayerResultResultCallback_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -2889,52 +1764,29 @@ public static void Install( Action action, b { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameSearch + 14, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamGameSearch + 14, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameSearch + 14, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamGameSearch + 14, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameSearch + 14, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct EndGameResultCallback_t + internal struct EndGameResultCallback_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal ulong UllUniqueGameID; // ullUniqueGameID uint64 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(EndGameResultCallback_t) ); - internal static EndGameResultCallback_t Fill( IntPtr p ) => ((EndGameResultCallback_t)(EndGameResultCallback_t) Marshal.PtrToStructure( p, typeof(EndGameResultCallback_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(EndGameResultCallback_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamGameSearch + 15; + internal static EndGameResultCallback_t Fill( IntPtr p ) => ((EndGameResultCallback_t)Marshal.PtrToStructure( p, typeof(EndGameResultCallback_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -2944,45 +1796,20 @@ public static void Install( Action action, bool server { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameSearch + 15, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamGameSearch + 15, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameSearch + 15, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamGameSearch + 15, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameSearch + 15, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct JoinPartyCallback_t + internal struct JoinPartyCallback_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal ulong BeaconID; // m_ulBeaconID PartyBeaconID_t @@ -2992,8 +1819,10 @@ internal struct JoinPartyCallback_t internal byte[] ConnectString; // m_rgchConnectString char [256] #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(JoinPartyCallback_t) ); - internal static JoinPartyCallback_t Fill( IntPtr p ) => ((JoinPartyCallback_t)(JoinPartyCallback_t) Marshal.PtrToStructure( p, typeof(JoinPartyCallback_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(JoinPartyCallback_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamParties + 1; + internal static JoinPartyCallback_t Fill( IntPtr p ) => ((JoinPartyCallback_t)Marshal.PtrToStructure( p, typeof(JoinPartyCallback_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -3003,52 +1832,29 @@ public static void Install( Action action, bool server = fa { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamParties + 1, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamParties + 1, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamParties + 1, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamParties + 1, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamParties + 1, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct CreateBeaconCallback_t + internal struct CreateBeaconCallback_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal ulong BeaconID; // m_ulBeaconID PartyBeaconID_t #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(CreateBeaconCallback_t) ); - internal static CreateBeaconCallback_t Fill( IntPtr p ) => ((CreateBeaconCallback_t)(CreateBeaconCallback_t) Marshal.PtrToStructure( p, typeof(CreateBeaconCallback_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(CreateBeaconCallback_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamParties + 2; + internal static CreateBeaconCallback_t Fill( IntPtr p ) => ((CreateBeaconCallback_t)Marshal.PtrToStructure( p, typeof(CreateBeaconCallback_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -3058,52 +1864,29 @@ public static void Install( Action action, bool server = { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamParties + 2, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamParties + 2, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamParties + 2, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamParties + 2, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamParties + 2, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct ReservationNotificationCallback_t + internal struct ReservationNotificationCallback_t : ICallbackData { internal ulong BeaconID; // m_ulBeaconID PartyBeaconID_t internal ulong SteamIDJoiner; // m_steamIDJoiner class CSteamID #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ReservationNotificationCallback_t) ); - internal static ReservationNotificationCallback_t Fill( IntPtr p ) => ((ReservationNotificationCallback_t)(ReservationNotificationCallback_t) Marshal.PtrToStructure( p, typeof(ReservationNotificationCallback_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ReservationNotificationCallback_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamParties + 3; + internal static ReservationNotificationCallback_t Fill( IntPtr p ) => ((ReservationNotificationCallback_t)Marshal.PtrToStructure( p, typeof(ReservationNotificationCallback_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -3113,51 +1896,28 @@ public static void Install( Action action, bo { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamParties + 3, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamParties + 3, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamParties + 3, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamParties + 3, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamParties + 3, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct ChangeNumOpenSlotsCallback_t + internal struct ChangeNumOpenSlotsCallback_t : ICallbackData { internal Result Result; // m_eResult enum EResult #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ChangeNumOpenSlotsCallback_t) ); - internal static ChangeNumOpenSlotsCallback_t Fill( IntPtr p ) => ((ChangeNumOpenSlotsCallback_t)(ChangeNumOpenSlotsCallback_t) Marshal.PtrToStructure( p, typeof(ChangeNumOpenSlotsCallback_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ChangeNumOpenSlotsCallback_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamParties + 4; + internal static ChangeNumOpenSlotsCallback_t Fill( IntPtr p ) => ((ChangeNumOpenSlotsCallback_t)Marshal.PtrToStructure( p, typeof(ChangeNumOpenSlotsCallback_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -3167,40 +1927,15 @@ public static void Install( Action action, bool se { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamParties + 4, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamParties + 4, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamParties + 4, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamParties + 4, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamParties + 4, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } @@ -3216,15 +1951,17 @@ internal struct SteamParamStringArray_t } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoteStorageAppSyncedClient_t + internal struct RemoteStorageAppSyncedClient_t : ICallbackData { internal AppId AppID; // m_nAppID AppId_t internal Result Result; // m_eResult enum EResult internal int NumDownloads; // m_unNumDownloads int #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageAppSyncedClient_t) ); - internal static RemoteStorageAppSyncedClient_t Fill( IntPtr p ) => ((RemoteStorageAppSyncedClient_t)(RemoteStorageAppSyncedClient_t) Marshal.PtrToStructure( p, typeof(RemoteStorageAppSyncedClient_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageAppSyncedClient_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientRemoteStorage + 1; + internal static RemoteStorageAppSyncedClient_t Fill( IntPtr p ) => ((RemoteStorageAppSyncedClient_t)Marshal.PtrToStructure( p, typeof(RemoteStorageAppSyncedClient_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -3234,53 +1971,30 @@ public static void Install( Action action, bool { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 1, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientRemoteStorage + 1, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 1, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientRemoteStorage + 1, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 1, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoteStorageAppSyncedServer_t + internal struct RemoteStorageAppSyncedServer_t : ICallbackData { internal AppId AppID; // m_nAppID AppId_t internal Result Result; // m_eResult enum EResult internal int NumUploads; // m_unNumUploads int #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageAppSyncedServer_t) ); - internal static RemoteStorageAppSyncedServer_t Fill( IntPtr p ) => ((RemoteStorageAppSyncedServer_t)(RemoteStorageAppSyncedServer_t) Marshal.PtrToStructure( p, typeof(RemoteStorageAppSyncedServer_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageAppSyncedServer_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientRemoteStorage + 2; + internal static RemoteStorageAppSyncedServer_t Fill( IntPtr p ) => ((RemoteStorageAppSyncedServer_t)Marshal.PtrToStructure( p, typeof(RemoteStorageAppSyncedServer_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -3290,45 +2004,20 @@ public static void Install( Action action, bool { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 2, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientRemoteStorage + 2, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 2, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientRemoteStorage + 2, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 2, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoteStorageAppSyncProgress_t + internal struct RemoteStorageAppSyncProgress_t : ICallbackData { internal string CurrentFileUTF8() => System.Text.Encoding.UTF8.GetString( CurrentFile, 0, System.Array.IndexOf( CurrentFile, 0 ) ); [MarshalAs(UnmanagedType.ByValArray, SizeConst = 260)] // byte[] m_rgchCurrentFile @@ -3340,8 +2029,10 @@ internal struct RemoteStorageAppSyncProgress_t internal bool Uploading; // m_bUploading _Bool #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageAppSyncProgress_t) ); - internal static RemoteStorageAppSyncProgress_t Fill( IntPtr p ) => ((RemoteStorageAppSyncProgress_t)(RemoteStorageAppSyncProgress_t) Marshal.PtrToStructure( p, typeof(RemoteStorageAppSyncProgress_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageAppSyncProgress_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientRemoteStorage + 3; + internal static RemoteStorageAppSyncProgress_t Fill( IntPtr p ) => ((RemoteStorageAppSyncProgress_t)Marshal.PtrToStructure( p, typeof(RemoteStorageAppSyncProgress_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -3351,52 +2042,29 @@ public static void Install( Action action, bool { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 3, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientRemoteStorage + 3, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 3, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientRemoteStorage + 3, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 3, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoteStorageAppSyncStatusCheck_t + internal struct RemoteStorageAppSyncStatusCheck_t : ICallbackData { internal AppId AppID; // m_nAppID AppId_t internal Result Result; // m_eResult enum EResult #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageAppSyncStatusCheck_t) ); - internal static RemoteStorageAppSyncStatusCheck_t Fill( IntPtr p ) => ((RemoteStorageAppSyncStatusCheck_t)(RemoteStorageAppSyncStatusCheck_t) Marshal.PtrToStructure( p, typeof(RemoteStorageAppSyncStatusCheck_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageAppSyncStatusCheck_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientRemoteStorage + 5; + internal static RemoteStorageAppSyncStatusCheck_t Fill( IntPtr p ) => ((RemoteStorageAppSyncStatusCheck_t)Marshal.PtrToStructure( p, typeof(RemoteStorageAppSyncStatusCheck_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -3406,45 +2074,20 @@ public static void Install( Action action, bo { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 5, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientRemoteStorage + 5, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 5, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientRemoteStorage + 5, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 5, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoteStorageFileShareResult_t + internal struct RemoteStorageFileShareResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal ulong File; // m_hFile UGCHandle_t @@ -3453,8 +2096,10 @@ internal struct RemoteStorageFileShareResult_t internal byte[] Filename; // m_rgchFilename char [260] #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageFileShareResult_t) ); - internal static RemoteStorageFileShareResult_t Fill( IntPtr p ) => ((RemoteStorageFileShareResult_t)(RemoteStorageFileShareResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageFileShareResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageFileShareResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientRemoteStorage + 7; + internal static RemoteStorageFileShareResult_t Fill( IntPtr p ) => ((RemoteStorageFileShareResult_t)Marshal.PtrToStructure( p, typeof(RemoteStorageFileShareResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -3464,45 +2109,20 @@ public static void Install( Action action, bool { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 7, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientRemoteStorage + 7, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 7, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientRemoteStorage + 7, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 7, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoteStoragePublishFileResult_t + internal struct RemoteStoragePublishFileResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t @@ -3510,8 +2130,10 @@ internal struct RemoteStoragePublishFileResult_t internal bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishFileResult_t) ); - internal static RemoteStoragePublishFileResult_t Fill( IntPtr p ) => ((RemoteStoragePublishFileResult_t)(RemoteStoragePublishFileResult_t) Marshal.PtrToStructure( p, typeof(RemoteStoragePublishFileResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishFileResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientRemoteStorage + 9; + internal static RemoteStoragePublishFileResult_t Fill( IntPtr p ) => ((RemoteStoragePublishFileResult_t)Marshal.PtrToStructure( p, typeof(RemoteStoragePublishFileResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -3521,52 +2143,29 @@ public static void Install( Action action, boo { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 9, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientRemoteStorage + 9, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 9, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientRemoteStorage + 9, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 9, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoteStorageDeletePublishedFileResult_t + internal struct RemoteStorageDeletePublishedFileResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageDeletePublishedFileResult_t) ); - internal static RemoteStorageDeletePublishedFileResult_t Fill( IntPtr p ) => ((RemoteStorageDeletePublishedFileResult_t)(RemoteStorageDeletePublishedFileResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageDeletePublishedFileResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageDeletePublishedFileResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientRemoteStorage + 11; + internal static RemoteStorageDeletePublishedFileResult_t Fill( IntPtr p ) => ((RemoteStorageDeletePublishedFileResult_t)Marshal.PtrToStructure( p, typeof(RemoteStorageDeletePublishedFileResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -3576,45 +2175,20 @@ public static void Install( Action act { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 11, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientRemoteStorage + 11, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 11, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientRemoteStorage + 11, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 11, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoteStorageEnumerateUserPublishedFilesResult_t + internal struct RemoteStorageEnumerateUserPublishedFilesResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal int ResultsReturned; // m_nResultsReturned int32 @@ -3623,8 +2197,10 @@ internal struct RemoteStorageEnumerateUserPublishedFilesResult_t internal PublishedFileId[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageEnumerateUserPublishedFilesResult_t) ); - internal static RemoteStorageEnumerateUserPublishedFilesResult_t Fill( IntPtr p ) => ((RemoteStorageEnumerateUserPublishedFilesResult_t)(RemoteStorageEnumerateUserPublishedFilesResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageEnumerateUserPublishedFilesResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageEnumerateUserPublishedFilesResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientRemoteStorage + 12; + internal static RemoteStorageEnumerateUserPublishedFilesResult_t Fill( IntPtr p ) => ((RemoteStorageEnumerateUserPublishedFilesResult_t)Marshal.PtrToStructure( p, typeof(RemoteStorageEnumerateUserPublishedFilesResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -3634,52 +2210,29 @@ public static void Install( Action GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 12, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoteStorageSubscribePublishedFileResult_t + internal struct RemoteStorageSubscribePublishedFileResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageSubscribePublishedFileResult_t) ); - internal static RemoteStorageSubscribePublishedFileResult_t Fill( IntPtr p ) => ((RemoteStorageSubscribePublishedFileResult_t)(RemoteStorageSubscribePublishedFileResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageSubscribePublishedFileResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageSubscribePublishedFileResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientRemoteStorage + 13; + internal static RemoteStorageSubscribePublishedFileResult_t Fill( IntPtr p ) => ((RemoteStorageSubscribePublishedFileResult_t)Marshal.PtrToStructure( p, typeof(RemoteStorageSubscribePublishedFileResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -3689,45 +2242,20 @@ public static void Install( Action { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 13, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientRemoteStorage + 13, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 13, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientRemoteStorage + 13, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 13, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoteStorageEnumerateUserSubscribedFilesResult_t + internal struct RemoteStorageEnumerateUserSubscribedFilesResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal int ResultsReturned; // m_nResultsReturned int32 @@ -3738,8 +2266,10 @@ internal struct RemoteStorageEnumerateUserSubscribedFilesResult_t internal uint[] GRTimeSubscribed; // m_rgRTimeSubscribed uint32 [50] #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageEnumerateUserSubscribedFilesResult_t) ); - internal static RemoteStorageEnumerateUserSubscribedFilesResult_t Fill( IntPtr p ) => ((RemoteStorageEnumerateUserSubscribedFilesResult_t)(RemoteStorageEnumerateUserSubscribedFilesResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageEnumerateUserSubscribedFilesResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageEnumerateUserSubscribedFilesResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientRemoteStorage + 14; + internal static RemoteStorageEnumerateUserSubscribedFilesResult_t Fill( IntPtr p ) => ((RemoteStorageEnumerateUserSubscribedFilesResult_t)Marshal.PtrToStructure( p, typeof(RemoteStorageEnumerateUserSubscribedFilesResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -3749,52 +2279,29 @@ public static void Install( Action GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 14, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoteStorageUnsubscribePublishedFileResult_t + internal struct RemoteStorageUnsubscribePublishedFileResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageUnsubscribePublishedFileResult_t) ); - internal static RemoteStorageUnsubscribePublishedFileResult_t Fill( IntPtr p ) => ((RemoteStorageUnsubscribePublishedFileResult_t)(RemoteStorageUnsubscribePublishedFileResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageUnsubscribePublishedFileResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageUnsubscribePublishedFileResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientRemoteStorage + 15; + internal static RemoteStorageUnsubscribePublishedFileResult_t Fill( IntPtr p ) => ((RemoteStorageUnsubscribePublishedFileResult_t)Marshal.PtrToStructure( p, typeof(RemoteStorageUnsubscribePublishedFileResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -3804,45 +2311,20 @@ public static void Install( Action GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 15, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoteStorageUpdatePublishedFileResult_t + internal struct RemoteStorageUpdatePublishedFileResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t @@ -3850,8 +2332,10 @@ internal struct RemoteStorageUpdatePublishedFileResult_t internal bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageUpdatePublishedFileResult_t) ); - internal static RemoteStorageUpdatePublishedFileResult_t Fill( IntPtr p ) => ((RemoteStorageUpdatePublishedFileResult_t)(RemoteStorageUpdatePublishedFileResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageUpdatePublishedFileResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageUpdatePublishedFileResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientRemoteStorage + 16; + internal static RemoteStorageUpdatePublishedFileResult_t Fill( IntPtr p ) => ((RemoteStorageUpdatePublishedFileResult_t)Marshal.PtrToStructure( p, typeof(RemoteStorageUpdatePublishedFileResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -3861,45 +2345,20 @@ public static void Install( Action act { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 16, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientRemoteStorage + 16, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 16, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientRemoteStorage + 16, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 16, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoteStorageDownloadUGCResult_t + internal struct RemoteStorageDownloadUGCResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal ulong File; // m_hFile UGCHandle_t @@ -3911,8 +2370,10 @@ internal struct RemoteStorageDownloadUGCResult_t internal ulong SteamIDOwner; // m_ulSteamIDOwner uint64 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageDownloadUGCResult_t) ); - internal static RemoteStorageDownloadUGCResult_t Fill( IntPtr p ) => ((RemoteStorageDownloadUGCResult_t)(RemoteStorageDownloadUGCResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageDownloadUGCResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageDownloadUGCResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientRemoteStorage + 17; + internal static RemoteStorageDownloadUGCResult_t Fill( IntPtr p ) => ((RemoteStorageDownloadUGCResult_t)Marshal.PtrToStructure( p, typeof(RemoteStorageDownloadUGCResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -3922,45 +2383,20 @@ public static void Install( Action action, boo { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 17, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientRemoteStorage + 17, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 17, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientRemoteStorage + 17, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 17, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoteStorageGetPublishedFileDetailsResult_t + internal struct RemoteStorageGetPublishedFileDetailsResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t @@ -3998,8 +2434,10 @@ internal struct RemoteStorageGetPublishedFileDetailsResult_t internal bool AcceptedForUse; // m_bAcceptedForUse _Bool #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageGetPublishedFileDetailsResult_t) ); - internal static RemoteStorageGetPublishedFileDetailsResult_t Fill( IntPtr p ) => ((RemoteStorageGetPublishedFileDetailsResult_t)(RemoteStorageGetPublishedFileDetailsResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageGetPublishedFileDetailsResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageGetPublishedFileDetailsResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientRemoteStorage + 18; + internal static RemoteStorageGetPublishedFileDetailsResult_t Fill( IntPtr p ) => ((RemoteStorageGetPublishedFileDetailsResult_t)Marshal.PtrToStructure( p, typeof(RemoteStorageGetPublishedFileDetailsResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -4009,45 +2447,20 @@ public static void Install( Action { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 18, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientRemoteStorage + 18, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 18, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientRemoteStorage + 18, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 18, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoteStorageEnumerateWorkshopFilesResult_t + internal struct RemoteStorageEnumerateWorkshopFilesResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal int ResultsReturned; // m_nResultsReturned int32 @@ -4060,8 +2473,10 @@ internal struct RemoteStorageEnumerateWorkshopFilesResult_t internal uint StartIndex; // m_unStartIndex uint32 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageEnumerateWorkshopFilesResult_t) ); - internal static RemoteStorageEnumerateWorkshopFilesResult_t Fill( IntPtr p ) => ((RemoteStorageEnumerateWorkshopFilesResult_t)(RemoteStorageEnumerateWorkshopFilesResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageEnumerateWorkshopFilesResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageEnumerateWorkshopFilesResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientRemoteStorage + 19; + internal static RemoteStorageEnumerateWorkshopFilesResult_t Fill( IntPtr p ) => ((RemoteStorageEnumerateWorkshopFilesResult_t)Marshal.PtrToStructure( p, typeof(RemoteStorageEnumerateWorkshopFilesResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -4071,45 +2486,20 @@ public static void Install( Action { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 19, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientRemoteStorage + 19, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 19, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientRemoteStorage + 19, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 19, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoteStorageGetPublishedItemVoteDetailsResult_t + internal struct RemoteStorageGetPublishedItemVoteDetailsResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal PublishedFileId PublishedFileId; // m_unPublishedFileId PublishedFileId_t @@ -4119,8 +2509,10 @@ internal struct RemoteStorageGetPublishedItemVoteDetailsResult_t internal float FScore; // m_fScore float #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageGetPublishedItemVoteDetailsResult_t) ); - internal static RemoteStorageGetPublishedItemVoteDetailsResult_t Fill( IntPtr p ) => ((RemoteStorageGetPublishedItemVoteDetailsResult_t)(RemoteStorageGetPublishedItemVoteDetailsResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageGetPublishedItemVoteDetailsResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageGetPublishedItemVoteDetailsResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientRemoteStorage + 20; + internal static RemoteStorageGetPublishedItemVoteDetailsResult_t Fill( IntPtr p ) => ((RemoteStorageGetPublishedItemVoteDetailsResult_t)Marshal.PtrToStructure( p, typeof(RemoteStorageGetPublishedItemVoteDetailsResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -4130,52 +2522,29 @@ public static void Install( Action GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 20, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoteStoragePublishedFileSubscribed_t + internal struct RemoteStoragePublishedFileSubscribed_t : ICallbackData { internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t internal AppId AppID; // m_nAppID AppId_t #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishedFileSubscribed_t) ); - internal static RemoteStoragePublishedFileSubscribed_t Fill( IntPtr p ) => ((RemoteStoragePublishedFileSubscribed_t)(RemoteStoragePublishedFileSubscribed_t) Marshal.PtrToStructure( p, typeof(RemoteStoragePublishedFileSubscribed_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishedFileSubscribed_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientRemoteStorage + 21; + internal static RemoteStoragePublishedFileSubscribed_t Fill( IntPtr p ) => ((RemoteStoragePublishedFileSubscribed_t)Marshal.PtrToStructure( p, typeof(RemoteStoragePublishedFileSubscribed_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -4185,52 +2554,29 @@ public static void Install( Action actio { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 21, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientRemoteStorage + 21, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 21, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientRemoteStorage + 21, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 21, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoteStoragePublishedFileUnsubscribed_t + internal struct RemoteStoragePublishedFileUnsubscribed_t : ICallbackData { internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t internal AppId AppID; // m_nAppID AppId_t #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishedFileUnsubscribed_t) ); - internal static RemoteStoragePublishedFileUnsubscribed_t Fill( IntPtr p ) => ((RemoteStoragePublishedFileUnsubscribed_t)(RemoteStoragePublishedFileUnsubscribed_t) Marshal.PtrToStructure( p, typeof(RemoteStoragePublishedFileUnsubscribed_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishedFileUnsubscribed_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientRemoteStorage + 22; + internal static RemoteStoragePublishedFileUnsubscribed_t Fill( IntPtr p ) => ((RemoteStoragePublishedFileUnsubscribed_t)Marshal.PtrToStructure( p, typeof(RemoteStoragePublishedFileUnsubscribed_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -4240,52 +2586,29 @@ public static void Install( Action act { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 22, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientRemoteStorage + 22, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 22, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientRemoteStorage + 22, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 22, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoteStoragePublishedFileDeleted_t + internal struct RemoteStoragePublishedFileDeleted_t : ICallbackData { internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t internal AppId AppID; // m_nAppID AppId_t #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishedFileDeleted_t) ); - internal static RemoteStoragePublishedFileDeleted_t Fill( IntPtr p ) => ((RemoteStoragePublishedFileDeleted_t)(RemoteStoragePublishedFileDeleted_t) Marshal.PtrToStructure( p, typeof(RemoteStoragePublishedFileDeleted_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishedFileDeleted_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientRemoteStorage + 23; + internal static RemoteStoragePublishedFileDeleted_t Fill( IntPtr p ) => ((RemoteStoragePublishedFileDeleted_t)Marshal.PtrToStructure( p, typeof(RemoteStoragePublishedFileDeleted_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -4295,52 +2618,29 @@ public static void Install( Action action, { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 23, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientRemoteStorage + 23, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 23, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientRemoteStorage + 23, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 23, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoteStorageUpdateUserPublishedItemVoteResult_t + internal struct RemoteStorageUpdateUserPublishedItemVoteResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageUpdateUserPublishedItemVoteResult_t) ); - internal static RemoteStorageUpdateUserPublishedItemVoteResult_t Fill( IntPtr p ) => ((RemoteStorageUpdateUserPublishedItemVoteResult_t)(RemoteStorageUpdateUserPublishedItemVoteResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageUpdateUserPublishedItemVoteResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageUpdateUserPublishedItemVoteResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientRemoteStorage + 24; + internal static RemoteStorageUpdateUserPublishedItemVoteResult_t Fill( IntPtr p ) => ((RemoteStorageUpdateUserPublishedItemVoteResult_t)Marshal.PtrToStructure( p, typeof(RemoteStorageUpdateUserPublishedItemVoteResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -4350,53 +2650,30 @@ public static void Install( Action GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 24, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoteStorageUserVoteDetails_t + internal struct RemoteStorageUserVoteDetails_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t internal WorkshopVote Vote; // m_eVote enum EWorkshopVote #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageUserVoteDetails_t) ); - internal static RemoteStorageUserVoteDetails_t Fill( IntPtr p ) => ((RemoteStorageUserVoteDetails_t)(RemoteStorageUserVoteDetails_t) Marshal.PtrToStructure( p, typeof(RemoteStorageUserVoteDetails_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageUserVoteDetails_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientRemoteStorage + 25; + internal static RemoteStorageUserVoteDetails_t Fill( IntPtr p ) => ((RemoteStorageUserVoteDetails_t)Marshal.PtrToStructure( p, typeof(RemoteStorageUserVoteDetails_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -4406,45 +2683,20 @@ public static void Install( Action action, bool { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 25, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientRemoteStorage + 25, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 25, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientRemoteStorage + 25, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 25, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoteStorageEnumerateUserSharedWorkshopFilesResult_t + internal struct RemoteStorageEnumerateUserSharedWorkshopFilesResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal int ResultsReturned; // m_nResultsReturned int32 @@ -4453,8 +2705,10 @@ internal struct RemoteStorageEnumerateUserSharedWorkshopFilesResult_t internal PublishedFileId[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageEnumerateUserSharedWorkshopFilesResult_t) ); - internal static RemoteStorageEnumerateUserSharedWorkshopFilesResult_t Fill( IntPtr p ) => ((RemoteStorageEnumerateUserSharedWorkshopFilesResult_t)(RemoteStorageEnumerateUserSharedWorkshopFilesResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageEnumerateUserSharedWorkshopFilesResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageEnumerateUserSharedWorkshopFilesResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientRemoteStorage + 26; + internal static RemoteStorageEnumerateUserSharedWorkshopFilesResult_t Fill( IntPtr p ) => ((RemoteStorageEnumerateUserSharedWorkshopFilesResult_t)Marshal.PtrToStructure( p, typeof(RemoteStorageEnumerateUserSharedWorkshopFilesResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -4464,53 +2718,30 @@ public static void Install( Action GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 26, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoteStorageSetUserPublishedFileActionResult_t + internal struct RemoteStorageSetUserPublishedFileActionResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t internal WorkshopFileAction Action; // m_eAction enum EWorkshopFileAction #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageSetUserPublishedFileActionResult_t) ); - internal static RemoteStorageSetUserPublishedFileActionResult_t Fill( IntPtr p ) => ((RemoteStorageSetUserPublishedFileActionResult_t)(RemoteStorageSetUserPublishedFileActionResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageSetUserPublishedFileActionResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageSetUserPublishedFileActionResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientRemoteStorage + 27; + internal static RemoteStorageSetUserPublishedFileActionResult_t Fill( IntPtr p ) => ((RemoteStorageSetUserPublishedFileActionResult_t)Marshal.PtrToStructure( p, typeof(RemoteStorageSetUserPublishedFileActionResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -4520,45 +2751,20 @@ public static void Install( Action GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 27, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoteStorageEnumeratePublishedFilesByUserActionResult_t + internal struct RemoteStorageEnumeratePublishedFilesByUserActionResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal WorkshopFileAction Action; // m_eAction enum EWorkshopFileAction @@ -4570,8 +2776,10 @@ internal struct RemoteStorageEnumeratePublishedFilesByUserActionResult_t internal uint[] GRTimeUpdated; // m_rgRTimeUpdated uint32 [50] #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageEnumeratePublishedFilesByUserActionResult_t) ); - internal static RemoteStorageEnumeratePublishedFilesByUserActionResult_t Fill( IntPtr p ) => ((RemoteStorageEnumeratePublishedFilesByUserActionResult_t)(RemoteStorageEnumeratePublishedFilesByUserActionResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageEnumeratePublishedFilesByUserActionResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageEnumeratePublishedFilesByUserActionResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientRemoteStorage + 28; + internal static RemoteStorageEnumeratePublishedFilesByUserActionResult_t Fill( IntPtr p ) => ((RemoteStorageEnumeratePublishedFilesByUserActionResult_t)Marshal.PtrToStructure( p, typeof(RemoteStorageEnumeratePublishedFilesByUserActionResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -4581,53 +2789,30 @@ public static void Install( Action GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 28, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoteStoragePublishFileProgress_t + internal struct RemoteStoragePublishFileProgress_t : ICallbackData { internal double DPercentFile; // m_dPercentFile double [MarshalAs(UnmanagedType.I1)] internal bool Preview; // m_bPreview _Bool #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishFileProgress_t) ); - internal static RemoteStoragePublishFileProgress_t Fill( IntPtr p ) => ((RemoteStoragePublishFileProgress_t)(RemoteStoragePublishFileProgress_t) Marshal.PtrToStructure( p, typeof(RemoteStoragePublishFileProgress_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishFileProgress_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientRemoteStorage + 29; + internal static RemoteStoragePublishFileProgress_t Fill( IntPtr p ) => ((RemoteStoragePublishFileProgress_t)Marshal.PtrToStructure( p, typeof(RemoteStoragePublishFileProgress_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -4637,53 +2822,30 @@ public static void Install( Action action, b { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 29, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientRemoteStorage + 29, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 29, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientRemoteStorage + 29, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 29, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoteStoragePublishedFileUpdated_t + internal struct RemoteStoragePublishedFileUpdated_t : ICallbackData { internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t internal AppId AppID; // m_nAppID AppId_t internal ulong Unused; // m_ulUnused uint64 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishedFileUpdated_t) ); - internal static RemoteStoragePublishedFileUpdated_t Fill( IntPtr p ) => ((RemoteStoragePublishedFileUpdated_t)(RemoteStoragePublishedFileUpdated_t) Marshal.PtrToStructure( p, typeof(RemoteStoragePublishedFileUpdated_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishedFileUpdated_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientRemoteStorage + 30; + internal static RemoteStoragePublishedFileUpdated_t Fill( IntPtr p ) => ((RemoteStoragePublishedFileUpdated_t)Marshal.PtrToStructure( p, typeof(RemoteStoragePublishedFileUpdated_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -4693,51 +2855,28 @@ public static void Install( Action action, { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 30, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientRemoteStorage + 30, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 30, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientRemoteStorage + 30, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 30, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoteStorageFileWriteAsyncComplete_t + internal struct RemoteStorageFileWriteAsyncComplete_t : ICallbackData { internal Result Result; // m_eResult enum EResult #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageFileWriteAsyncComplete_t) ); - internal static RemoteStorageFileWriteAsyncComplete_t Fill( IntPtr p ) => ((RemoteStorageFileWriteAsyncComplete_t)(RemoteStorageFileWriteAsyncComplete_t) Marshal.PtrToStructure( p, typeof(RemoteStorageFileWriteAsyncComplete_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageFileWriteAsyncComplete_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientRemoteStorage + 31; + internal static RemoteStorageFileWriteAsyncComplete_t Fill( IntPtr p ) => ((RemoteStorageFileWriteAsyncComplete_t)Marshal.PtrToStructure( p, typeof(RemoteStorageFileWriteAsyncComplete_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -4747,45 +2886,20 @@ public static void Install( Action action { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 31, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientRemoteStorage + 31, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 31, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientRemoteStorage + 31, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 31, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoteStorageFileReadAsyncComplete_t + internal struct RemoteStorageFileReadAsyncComplete_t : ICallbackData { internal ulong FileReadAsync; // m_hFileReadAsync SteamAPICall_t internal Result Result; // m_eResult enum EResult @@ -4793,8 +2907,10 @@ internal struct RemoteStorageFileReadAsyncComplete_t internal uint Read; // m_cubRead uint32 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageFileReadAsyncComplete_t) ); - internal static RemoteStorageFileReadAsyncComplete_t Fill( IntPtr p ) => ((RemoteStorageFileReadAsyncComplete_t)(RemoteStorageFileReadAsyncComplete_t) Marshal.PtrToStructure( p, typeof(RemoteStorageFileReadAsyncComplete_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageFileReadAsyncComplete_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientRemoteStorage + 32; + internal static RemoteStorageFileReadAsyncComplete_t Fill( IntPtr p ) => ((RemoteStorageFileReadAsyncComplete_t)Marshal.PtrToStructure( p, typeof(RemoteStorageFileReadAsyncComplete_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -4804,40 +2920,15 @@ public static void Install( Action action, { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 32, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientRemoteStorage + 32, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 32, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientRemoteStorage + 32, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 32, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } @@ -4856,15 +2947,17 @@ internal struct LeaderboardEntry_t } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct UserStatsReceived_t + internal struct UserStatsReceived_t : ICallbackData { internal ulong GameID; // m_nGameID uint64 internal Result Result; // m_eResult enum EResult internal ulong SteamIDUser; // m_steamIDUser class CSteamID #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserStatsReceived_t) ); - internal static UserStatsReceived_t Fill( IntPtr p ) => ((UserStatsReceived_t)(UserStatsReceived_t) Marshal.PtrToStructure( p, typeof(UserStatsReceived_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserStatsReceived_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUserStats + 1; + internal static UserStatsReceived_t Fill( IntPtr p ) => ((UserStatsReceived_t)Marshal.PtrToStructure( p, typeof(UserStatsReceived_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -4874,52 +2967,29 @@ public static void Install( Action action, bool server = fa { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUserStats + 1, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUserStats + 1, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUserStats + 1, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUserStats + 1, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUserStats + 1, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct UserStatsStored_t + internal struct UserStatsStored_t : ICallbackData { internal ulong GameID; // m_nGameID uint64 internal Result Result; // m_eResult enum EResult #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserStatsStored_t) ); - internal static UserStatsStored_t Fill( IntPtr p ) => ((UserStatsStored_t)(UserStatsStored_t) Marshal.PtrToStructure( p, typeof(UserStatsStored_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserStatsStored_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUserStats + 2; + internal static UserStatsStored_t Fill( IntPtr p ) => ((UserStatsStored_t)Marshal.PtrToStructure( p, typeof(UserStatsStored_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -4929,45 +2999,20 @@ public static void Install( Action action, bool server = fals { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUserStats + 2, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUserStats + 2, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUserStats + 2, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUserStats + 2, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUserStats + 2, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct UserAchievementStored_t + internal struct UserAchievementStored_t : ICallbackData { internal ulong GameID; // m_nGameID uint64 [MarshalAs(UnmanagedType.I1)] @@ -4979,8 +3024,10 @@ internal struct UserAchievementStored_t internal uint MaxProgress; // m_nMaxProgress uint32 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserAchievementStored_t) ); - internal static UserAchievementStored_t Fill( IntPtr p ) => ((UserAchievementStored_t)(UserAchievementStored_t) Marshal.PtrToStructure( p, typeof(UserAchievementStored_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserAchievementStored_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUserStats + 3; + internal static UserAchievementStored_t Fill( IntPtr p ) => ((UserAchievementStored_t)Marshal.PtrToStructure( p, typeof(UserAchievementStored_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -4990,52 +3037,29 @@ public static void Install( Action action, bool server { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUserStats + 3, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUserStats + 3, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUserStats + 3, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUserStats + 3, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUserStats + 3, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct LeaderboardFindResult_t + internal struct LeaderboardFindResult_t : ICallbackData { internal ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t internal byte LeaderboardFound; // m_bLeaderboardFound uint8 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LeaderboardFindResult_t) ); - internal static LeaderboardFindResult_t Fill( IntPtr p ) => ((LeaderboardFindResult_t)(LeaderboardFindResult_t) Marshal.PtrToStructure( p, typeof(LeaderboardFindResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LeaderboardFindResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUserStats + 4; + internal static LeaderboardFindResult_t Fill( IntPtr p ) => ((LeaderboardFindResult_t)Marshal.PtrToStructure( p, typeof(LeaderboardFindResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -5045,53 +3069,30 @@ public static void Install( Action action, bool server { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUserStats + 4, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUserStats + 4, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUserStats + 4, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUserStats + 4, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUserStats + 4, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct LeaderboardScoresDownloaded_t + internal struct LeaderboardScoresDownloaded_t : ICallbackData { internal ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t internal ulong SteamLeaderboardEntries; // m_hSteamLeaderboardEntries SteamLeaderboardEntries_t internal int CEntryCount; // m_cEntryCount int #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LeaderboardScoresDownloaded_t) ); - internal static LeaderboardScoresDownloaded_t Fill( IntPtr p ) => ((LeaderboardScoresDownloaded_t)(LeaderboardScoresDownloaded_t) Marshal.PtrToStructure( p, typeof(LeaderboardScoresDownloaded_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LeaderboardScoresDownloaded_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUserStats + 5; + internal static LeaderboardScoresDownloaded_t Fill( IntPtr p ) => ((LeaderboardScoresDownloaded_t)Marshal.PtrToStructure( p, typeof(LeaderboardScoresDownloaded_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -5101,45 +3102,20 @@ public static void Install( Action action, bool s { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUserStats + 5, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUserStats + 5, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUserStats + 5, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUserStats + 5, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUserStats + 5, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct LeaderboardScoreUploaded_t + internal struct LeaderboardScoreUploaded_t : ICallbackData { internal byte Success; // m_bSuccess uint8 internal ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t @@ -5149,8 +3125,10 @@ internal struct LeaderboardScoreUploaded_t internal int GlobalRankPrevious; // m_nGlobalRankPrevious int #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LeaderboardScoreUploaded_t) ); - internal static LeaderboardScoreUploaded_t Fill( IntPtr p ) => ((LeaderboardScoreUploaded_t)(LeaderboardScoreUploaded_t) Marshal.PtrToStructure( p, typeof(LeaderboardScoreUploaded_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LeaderboardScoreUploaded_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUserStats + 6; + internal static LeaderboardScoreUploaded_t Fill( IntPtr p ) => ((LeaderboardScoreUploaded_t)Marshal.PtrToStructure( p, typeof(LeaderboardScoreUploaded_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -5160,52 +3138,29 @@ public static void Install( Action action, bool serv { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUserStats + 6, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUserStats + 6, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUserStats + 6, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUserStats + 6, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUserStats + 6, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct NumberOfCurrentPlayers_t + internal struct NumberOfCurrentPlayers_t : ICallbackData { internal byte Success; // m_bSuccess uint8 internal int CPlayers; // m_cPlayers int32 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(NumberOfCurrentPlayers_t) ); - internal static NumberOfCurrentPlayers_t Fill( IntPtr p ) => ((NumberOfCurrentPlayers_t)(NumberOfCurrentPlayers_t) Marshal.PtrToStructure( p, typeof(NumberOfCurrentPlayers_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(NumberOfCurrentPlayers_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUserStats + 7; + internal static NumberOfCurrentPlayers_t Fill( IntPtr p ) => ((NumberOfCurrentPlayers_t)Marshal.PtrToStructure( p, typeof(NumberOfCurrentPlayers_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -5215,51 +3170,28 @@ public static void Install( Action action, bool server { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUserStats + 7, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUserStats + 7, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUserStats + 7, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUserStats + 7, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUserStats + 7, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct UserStatsUnloaded_t + internal struct UserStatsUnloaded_t : ICallbackData { internal ulong SteamIDUser; // m_steamIDUser class CSteamID #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserStatsUnloaded_t) ); - internal static UserStatsUnloaded_t Fill( IntPtr p ) => ((UserStatsUnloaded_t)(UserStatsUnloaded_t) Marshal.PtrToStructure( p, typeof(UserStatsUnloaded_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserStatsUnloaded_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUserStats + 8; + internal static UserStatsUnloaded_t Fill( IntPtr p ) => ((UserStatsUnloaded_t)Marshal.PtrToStructure( p, typeof(UserStatsUnloaded_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -5269,45 +3201,20 @@ public static void Install( Action action, bool server = fa { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUserStats + 8, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUserStats + 8, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUserStats + 8, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUserStats + 8, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUserStats + 8, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct UserAchievementIconFetched_t + internal struct UserAchievementIconFetched_t : ICallbackData { internal GameId GameID; // m_nGameID class CGameID internal string AchievementNameUTF8() => System.Text.Encoding.UTF8.GetString( AchievementName, 0, System.Array.IndexOf( AchievementName, 0 ) ); @@ -5318,8 +3225,10 @@ internal struct UserAchievementIconFetched_t internal int IconHandle; // m_nIconHandle int #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserAchievementIconFetched_t) ); - internal static UserAchievementIconFetched_t Fill( IntPtr p ) => ((UserAchievementIconFetched_t)(UserAchievementIconFetched_t) Marshal.PtrToStructure( p, typeof(UserAchievementIconFetched_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserAchievementIconFetched_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUserStats + 9; + internal static UserAchievementIconFetched_t Fill( IntPtr p ) => ((UserAchievementIconFetched_t)Marshal.PtrToStructure( p, typeof(UserAchievementIconFetched_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -5329,52 +3238,29 @@ public static void Install( Action action, bool se { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUserStats + 9, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUserStats + 9, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUserStats + 9, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUserStats + 9, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUserStats + 9, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct GlobalAchievementPercentagesReady_t + internal struct GlobalAchievementPercentagesReady_t : ICallbackData { internal ulong GameID; // m_nGameID uint64 internal Result Result; // m_eResult enum EResult #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GlobalAchievementPercentagesReady_t) ); - internal static GlobalAchievementPercentagesReady_t Fill( IntPtr p ) => ((GlobalAchievementPercentagesReady_t)(GlobalAchievementPercentagesReady_t) Marshal.PtrToStructure( p, typeof(GlobalAchievementPercentagesReady_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GlobalAchievementPercentagesReady_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUserStats + 10; + internal static GlobalAchievementPercentagesReady_t Fill( IntPtr p ) => ((GlobalAchievementPercentagesReady_t)Marshal.PtrToStructure( p, typeof(GlobalAchievementPercentagesReady_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -5384,52 +3270,29 @@ public static void Install( Action action, { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUserStats + 10, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUserStats + 10, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUserStats + 10, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUserStats + 10, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUserStats + 10, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct LeaderboardUGCSet_t + internal struct LeaderboardUGCSet_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LeaderboardUGCSet_t) ); - internal static LeaderboardUGCSet_t Fill( IntPtr p ) => ((LeaderboardUGCSet_t)(LeaderboardUGCSet_t) Marshal.PtrToStructure( p, typeof(LeaderboardUGCSet_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LeaderboardUGCSet_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUserStats + 11; + internal static LeaderboardUGCSet_t Fill( IntPtr p ) => ((LeaderboardUGCSet_t)Marshal.PtrToStructure( p, typeof(LeaderboardUGCSet_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -5439,53 +3302,30 @@ public static void Install( Action action, bool server = fa { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUserStats + 11, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUserStats + 11, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUserStats + 11, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUserStats + 11, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUserStats + 11, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct PS3TrophiesInstalled_t + internal struct PS3TrophiesInstalled_t : ICallbackData { internal ulong GameID; // m_nGameID uint64 internal Result Result; // m_eResult enum EResult internal ulong RequiredDiskSpace; // m_ulRequiredDiskSpace uint64 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(PS3TrophiesInstalled_t) ); - internal static PS3TrophiesInstalled_t Fill( IntPtr p ) => ((PS3TrophiesInstalled_t)(PS3TrophiesInstalled_t) Marshal.PtrToStructure( p, typeof(PS3TrophiesInstalled_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(PS3TrophiesInstalled_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUserStats + 12; + internal static PS3TrophiesInstalled_t Fill( IntPtr p ) => ((PS3TrophiesInstalled_t)Marshal.PtrToStructure( p, typeof(PS3TrophiesInstalled_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -5495,52 +3335,29 @@ public static void Install( Action action, bool server = { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUserStats + 12, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUserStats + 12, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUserStats + 12, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUserStats + 12, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUserStats + 12, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct GlobalStatsReceived_t + internal struct GlobalStatsReceived_t : ICallbackData { internal ulong GameID; // m_nGameID uint64 internal Result Result; // m_eResult enum EResult #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GlobalStatsReceived_t) ); - internal static GlobalStatsReceived_t Fill( IntPtr p ) => ((GlobalStatsReceived_t)(GlobalStatsReceived_t) Marshal.PtrToStructure( p, typeof(GlobalStatsReceived_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GlobalStatsReceived_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUserStats + 12; + internal static GlobalStatsReceived_t Fill( IntPtr p ) => ((GlobalStatsReceived_t)Marshal.PtrToStructure( p, typeof(GlobalStatsReceived_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -5550,51 +3367,28 @@ public static void Install( Action action, bool server = { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUserStats + 12, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUserStats + 12, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUserStats + 12, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUserStats + 12, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUserStats + 12, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct DlcInstalled_t + internal struct DlcInstalled_t : ICallbackData { internal AppId AppID; // m_nAppID AppId_t #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(DlcInstalled_t) ); - internal static DlcInstalled_t Fill( IntPtr p ) => ((DlcInstalled_t)(DlcInstalled_t) Marshal.PtrToStructure( p, typeof(DlcInstalled_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(DlcInstalled_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamApps + 5; + internal static DlcInstalled_t Fill( IntPtr p ) => ((DlcInstalled_t)Marshal.PtrToStructure( p, typeof(DlcInstalled_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -5604,52 +3398,29 @@ public static void Install( Action action, bool server = false ) { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamApps + 5, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamApps + 5, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamApps + 5, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamApps + 5, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamApps + 5, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RegisterActivationCodeResponse_t + internal struct RegisterActivationCodeResponse_t : ICallbackData { internal RegisterActivationCodeResult Result; // m_eResult enum ERegisterActivationCodeResult internal uint PackageRegistered; // m_unPackageRegistered uint32 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RegisterActivationCodeResponse_t) ); - internal static RegisterActivationCodeResponse_t Fill( IntPtr p ) => ((RegisterActivationCodeResponse_t)(RegisterActivationCodeResponse_t) Marshal.PtrToStructure( p, typeof(RegisterActivationCodeResponse_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RegisterActivationCodeResponse_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamApps + 8; + internal static RegisterActivationCodeResponse_t Fill( IntPtr p ) => ((RegisterActivationCodeResponse_t)Marshal.PtrToStructure( p, typeof(RegisterActivationCodeResponse_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -5659,45 +3430,20 @@ public static void Install( Action action, boo { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamApps + 8, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamApps + 8, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamApps + 8, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamApps + 8, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamApps + 8, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct AppProofOfPurchaseKeyResponse_t + internal struct AppProofOfPurchaseKeyResponse_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal uint AppID; // m_nAppID uint32 @@ -5707,8 +3453,10 @@ internal struct AppProofOfPurchaseKeyResponse_t internal byte[] Key; // m_rgchKey char [240] #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(AppProofOfPurchaseKeyResponse_t) ); - internal static AppProofOfPurchaseKeyResponse_t Fill( IntPtr p ) => ((AppProofOfPurchaseKeyResponse_t)(AppProofOfPurchaseKeyResponse_t) Marshal.PtrToStructure( p, typeof(AppProofOfPurchaseKeyResponse_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(AppProofOfPurchaseKeyResponse_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamApps + 21; + internal static AppProofOfPurchaseKeyResponse_t Fill( IntPtr p ) => ((AppProofOfPurchaseKeyResponse_t)Marshal.PtrToStructure( p, typeof(AppProofOfPurchaseKeyResponse_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -5718,45 +3466,20 @@ public static void Install( Action action, bool { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamApps + 21, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamApps + 21, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamApps + 21, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamApps + 21, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamApps + 21, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct FileDetailsResult_t + internal struct FileDetailsResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal ulong FileSize; // m_ulFileSize uint64 @@ -5765,8 +3488,10 @@ internal struct FileDetailsResult_t internal uint Flags; // m_unFlags uint32 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FileDetailsResult_t) ); - internal static FileDetailsResult_t Fill( IntPtr p ) => ((FileDetailsResult_t)(FileDetailsResult_t) Marshal.PtrToStructure( p, typeof(FileDetailsResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FileDetailsResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamApps + 23; + internal static FileDetailsResult_t Fill( IntPtr p ) => ((FileDetailsResult_t)Marshal.PtrToStructure( p, typeof(FileDetailsResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -5776,40 +3501,15 @@ public static void Install( Action action, bool server = fa { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamApps + 23, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamApps + 23, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamApps + 23, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamApps + 23, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamApps + 23, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } @@ -5831,13 +3531,15 @@ internal struct P2PSessionState_t } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct P2PSessionRequest_t + internal struct P2PSessionRequest_t : ICallbackData { internal ulong SteamIDRemote; // m_steamIDRemote class CSteamID #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(P2PSessionRequest_t) ); - internal static P2PSessionRequest_t Fill( IntPtr p ) => ((P2PSessionRequest_t)(P2PSessionRequest_t) Marshal.PtrToStructure( p, typeof(P2PSessionRequest_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(P2PSessionRequest_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamNetworking + 2; + internal static P2PSessionRequest_t Fill( IntPtr p ) => ((P2PSessionRequest_t)Marshal.PtrToStructure( p, typeof(P2PSessionRequest_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -5847,52 +3549,29 @@ public static void Install( Action action, bool server = fa { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamNetworking + 2, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamNetworking + 2, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamNetworking + 2, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamNetworking + 2, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamNetworking + 2, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct P2PSessionConnectFail_t + internal struct P2PSessionConnectFail_t : ICallbackData { internal ulong SteamIDRemote; // m_steamIDRemote class CSteamID internal byte P2PSessionError; // m_eP2PSessionError uint8 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(P2PSessionConnectFail_t) ); - internal static P2PSessionConnectFail_t Fill( IntPtr p ) => ((P2PSessionConnectFail_t)(P2PSessionConnectFail_t) Marshal.PtrToStructure( p, typeof(P2PSessionConnectFail_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(P2PSessionConnectFail_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamNetworking + 3; + internal static P2PSessionConnectFail_t Fill( IntPtr p ) => ((P2PSessionConnectFail_t)Marshal.PtrToStructure( p, typeof(P2PSessionConnectFail_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -5902,45 +3581,20 @@ public static void Install( Action action, bool server { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamNetworking + 3, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamNetworking + 3, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamNetworking + 3, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamNetworking + 3, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamNetworking + 3, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct SocketStatusCallback_t + internal struct SocketStatusCallback_t : ICallbackData { internal uint Socket; // m_hSocket SNetSocket_t internal uint ListenSocket; // m_hListenSocket SNetListenSocket_t @@ -5948,8 +3602,10 @@ internal struct SocketStatusCallback_t internal int SNetSocketState; // m_eSNetSocketState int #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SocketStatusCallback_t) ); - internal static SocketStatusCallback_t Fill( IntPtr p ) => ((SocketStatusCallback_t)(SocketStatusCallback_t) Marshal.PtrToStructure( p, typeof(SocketStatusCallback_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SocketStatusCallback_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamNetworking + 1; + internal static SocketStatusCallback_t Fill( IntPtr p ) => ((SocketStatusCallback_t)Marshal.PtrToStructure( p, typeof(SocketStatusCallback_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -5959,52 +3615,29 @@ public static void Install( Action action, bool server = { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamNetworking + 1, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamNetworking + 1, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamNetworking + 1, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamNetworking + 1, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamNetworking + 1, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct ScreenshotReady_t + internal struct ScreenshotReady_t : ICallbackData { internal uint Local; // m_hLocal ScreenshotHandle internal Result Result; // m_eResult enum EResult #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ScreenshotReady_t) ); - internal static ScreenshotReady_t Fill( IntPtr p ) => ((ScreenshotReady_t)(ScreenshotReady_t) Marshal.PtrToStructure( p, typeof(ScreenshotReady_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ScreenshotReady_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamScreenshots + 1; + internal static ScreenshotReady_t Fill( IntPtr p ) => ((ScreenshotReady_t)Marshal.PtrToStructure( p, typeof(ScreenshotReady_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -6014,51 +3647,28 @@ public static void Install( Action action, bool server = fals { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamScreenshots + 1, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamScreenshots + 1, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamScreenshots + 1, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamScreenshots + 1, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamScreenshots + 1, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct VolumeHasChanged_t + internal struct VolumeHasChanged_t : ICallbackData { internal float NewVolume; // m_flNewVolume float #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(VolumeHasChanged_t) ); - internal static VolumeHasChanged_t Fill( IntPtr p ) => ((VolumeHasChanged_t)(VolumeHasChanged_t) Marshal.PtrToStructure( p, typeof(VolumeHasChanged_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(VolumeHasChanged_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamMusic + 2; + internal static VolumeHasChanged_t Fill( IntPtr p ) => ((VolumeHasChanged_t)Marshal.PtrToStructure( p, typeof(VolumeHasChanged_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -6068,52 +3678,29 @@ public static void Install( Action action, bool server = fal { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMusic + 2, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamMusic + 2, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMusic + 2, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamMusic + 2, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMusic + 2, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct MusicPlayerWantsShuffled_t + internal struct MusicPlayerWantsShuffled_t : ICallbackData { [MarshalAs(UnmanagedType.I1)] internal bool Shuffled; // m_bShuffled _Bool #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerWantsShuffled_t) ); - internal static MusicPlayerWantsShuffled_t Fill( IntPtr p ) => ((MusicPlayerWantsShuffled_t)(MusicPlayerWantsShuffled_t) Marshal.PtrToStructure( p, typeof(MusicPlayerWantsShuffled_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerWantsShuffled_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamMusicRemote + 9; + internal static MusicPlayerWantsShuffled_t Fill( IntPtr p ) => ((MusicPlayerWantsShuffled_t)Marshal.PtrToStructure( p, typeof(MusicPlayerWantsShuffled_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -6123,52 +3710,29 @@ public static void Install( Action action, bool serv { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMusicRemote + 9, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamMusicRemote + 9, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMusicRemote + 9, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamMusicRemote + 9, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMusicRemote + 9, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct MusicPlayerWantsLooped_t + internal struct MusicPlayerWantsLooped_t : ICallbackData { [MarshalAs(UnmanagedType.I1)] internal bool Looped; // m_bLooped _Bool #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerWantsLooped_t) ); - internal static MusicPlayerWantsLooped_t Fill( IntPtr p ) => ((MusicPlayerWantsLooped_t)(MusicPlayerWantsLooped_t) Marshal.PtrToStructure( p, typeof(MusicPlayerWantsLooped_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerWantsLooped_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamMusicRemote + 10; + internal static MusicPlayerWantsLooped_t Fill( IntPtr p ) => ((MusicPlayerWantsLooped_t)Marshal.PtrToStructure( p, typeof(MusicPlayerWantsLooped_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -6178,51 +3742,28 @@ public static void Install( Action action, bool server { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMusicRemote + 10, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamMusicRemote + 10, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMusicRemote + 10, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamMusicRemote + 10, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMusicRemote + 10, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct MusicPlayerWantsVolume_t + internal struct MusicPlayerWantsVolume_t : ICallbackData { internal float NewVolume; // m_flNewVolume float #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerWantsVolume_t) ); - internal static MusicPlayerWantsVolume_t Fill( IntPtr p ) => ((MusicPlayerWantsVolume_t)(MusicPlayerWantsVolume_t) Marshal.PtrToStructure( p, typeof(MusicPlayerWantsVolume_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerWantsVolume_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamMusic + 11; + internal static MusicPlayerWantsVolume_t Fill( IntPtr p ) => ((MusicPlayerWantsVolume_t)Marshal.PtrToStructure( p, typeof(MusicPlayerWantsVolume_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -6232,51 +3773,28 @@ public static void Install( Action action, bool server { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMusic + 11, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamMusic + 11, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMusic + 11, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamMusic + 11, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMusic + 11, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct MusicPlayerSelectsQueueEntry_t + internal struct MusicPlayerSelectsQueueEntry_t : ICallbackData { internal int NID; // nID int #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerSelectsQueueEntry_t) ); - internal static MusicPlayerSelectsQueueEntry_t Fill( IntPtr p ) => ((MusicPlayerSelectsQueueEntry_t)(MusicPlayerSelectsQueueEntry_t) Marshal.PtrToStructure( p, typeof(MusicPlayerSelectsQueueEntry_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerSelectsQueueEntry_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamMusic + 12; + internal static MusicPlayerSelectsQueueEntry_t Fill( IntPtr p ) => ((MusicPlayerSelectsQueueEntry_t)Marshal.PtrToStructure( p, typeof(MusicPlayerSelectsQueueEntry_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -6286,51 +3804,28 @@ public static void Install( Action action, bool { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMusic + 12, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamMusic + 12, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMusic + 12, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamMusic + 12, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMusic + 12, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct MusicPlayerSelectsPlaylistEntry_t + internal struct MusicPlayerSelectsPlaylistEntry_t : ICallbackData { internal int NID; // nID int #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerSelectsPlaylistEntry_t) ); - internal static MusicPlayerSelectsPlaylistEntry_t Fill( IntPtr p ) => ((MusicPlayerSelectsPlaylistEntry_t)(MusicPlayerSelectsPlaylistEntry_t) Marshal.PtrToStructure( p, typeof(MusicPlayerSelectsPlaylistEntry_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerSelectsPlaylistEntry_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamMusic + 13; + internal static MusicPlayerSelectsPlaylistEntry_t Fill( IntPtr p ) => ((MusicPlayerSelectsPlaylistEntry_t)Marshal.PtrToStructure( p, typeof(MusicPlayerSelectsPlaylistEntry_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -6340,51 +3835,28 @@ public static void Install( Action action, bo { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMusic + 13, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamMusic + 13, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMusic + 13, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamMusic + 13, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMusic + 13, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct MusicPlayerWantsPlayingRepeatStatus_t + internal struct MusicPlayerWantsPlayingRepeatStatus_t : ICallbackData { internal int PlayingRepeatStatus; // m_nPlayingRepeatStatus int #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerWantsPlayingRepeatStatus_t) ); - internal static MusicPlayerWantsPlayingRepeatStatus_t Fill( IntPtr p ) => ((MusicPlayerWantsPlayingRepeatStatus_t)(MusicPlayerWantsPlayingRepeatStatus_t) Marshal.PtrToStructure( p, typeof(MusicPlayerWantsPlayingRepeatStatus_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerWantsPlayingRepeatStatus_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamMusicRemote + 14; + internal static MusicPlayerWantsPlayingRepeatStatus_t Fill( IntPtr p ) => ((MusicPlayerWantsPlayingRepeatStatus_t)Marshal.PtrToStructure( p, typeof(MusicPlayerWantsPlayingRepeatStatus_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -6394,45 +3866,20 @@ public static void Install( Action action { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMusicRemote + 14, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamMusicRemote + 14, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMusicRemote + 14, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamMusicRemote + 14, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMusicRemote + 14, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct HTTPRequestCompleted_t + internal struct HTTPRequestCompleted_t : ICallbackData { internal uint Request; // m_hRequest HTTPRequestHandle internal ulong ContextValue; // m_ulContextValue uint64 @@ -6442,8 +3889,10 @@ internal struct HTTPRequestCompleted_t internal uint BodySize; // m_unBodySize uint32 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTTPRequestCompleted_t) ); - internal static HTTPRequestCompleted_t Fill( IntPtr p ) => ((HTTPRequestCompleted_t)(HTTPRequestCompleted_t) Marshal.PtrToStructure( p, typeof(HTTPRequestCompleted_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTTPRequestCompleted_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientHTTP + 1; + internal static HTTPRequestCompleted_t Fill( IntPtr p ) => ((HTTPRequestCompleted_t)Marshal.PtrToStructure( p, typeof(HTTPRequestCompleted_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -6453,52 +3902,29 @@ public static void Install( Action action, bool server = { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientHTTP + 1, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientHTTP + 1, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientHTTP + 1, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientHTTP + 1, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientHTTP + 1, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct HTTPRequestHeadersReceived_t + internal struct HTTPRequestHeadersReceived_t : ICallbackData { internal uint Request; // m_hRequest HTTPRequestHandle internal ulong ContextValue; // m_ulContextValue uint64 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTTPRequestHeadersReceived_t) ); - internal static HTTPRequestHeadersReceived_t Fill( IntPtr p ) => ((HTTPRequestHeadersReceived_t)(HTTPRequestHeadersReceived_t) Marshal.PtrToStructure( p, typeof(HTTPRequestHeadersReceived_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTTPRequestHeadersReceived_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientHTTP + 2; + internal static HTTPRequestHeadersReceived_t Fill( IntPtr p ) => ((HTTPRequestHeadersReceived_t)Marshal.PtrToStructure( p, typeof(HTTPRequestHeadersReceived_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -6508,45 +3934,20 @@ public static void Install( Action action, bool se { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientHTTP + 2, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientHTTP + 2, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientHTTP + 2, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientHTTP + 2, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientHTTP + 2, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct HTTPRequestDataReceived_t + internal struct HTTPRequestDataReceived_t : ICallbackData { internal uint Request; // m_hRequest HTTPRequestHandle internal ulong ContextValue; // m_ulContextValue uint64 @@ -6554,8 +3955,10 @@ internal struct HTTPRequestDataReceived_t internal uint CBytesReceived; // m_cBytesReceived uint32 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTTPRequestDataReceived_t) ); - internal static HTTPRequestDataReceived_t Fill( IntPtr p ) => ((HTTPRequestDataReceived_t)(HTTPRequestDataReceived_t) Marshal.PtrToStructure( p, typeof(HTTPRequestDataReceived_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTTPRequestDataReceived_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientHTTP + 3; + internal static HTTPRequestDataReceived_t Fill( IntPtr p ) => ((HTTPRequestDataReceived_t)Marshal.PtrToStructure( p, typeof(HTTPRequestDataReceived_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -6565,40 +3968,15 @@ public static void Install( Action action, bool serve { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientHTTP + 3, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientHTTP + 3, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientHTTP + 3, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientHTTP + 3, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientHTTP + 3, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } @@ -6651,7 +4029,7 @@ internal struct SteamUGCDetails_t } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct SteamUGCQueryCompleted_t + internal struct SteamUGCQueryCompleted_t : ICallbackData { internal ulong Handle; // m_handle UGCQueryHandle_t internal Result Result; // m_eResult enum EResult @@ -6664,8 +4042,10 @@ internal struct SteamUGCQueryCompleted_t internal byte[] NextCursor; // m_rgchNextCursor char [256] #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamUGCQueryCompleted_t) ); - internal static SteamUGCQueryCompleted_t Fill( IntPtr p ) => ((SteamUGCQueryCompleted_t)(SteamUGCQueryCompleted_t) Marshal.PtrToStructure( p, typeof(SteamUGCQueryCompleted_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamUGCQueryCompleted_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientUGC + 1; + internal static SteamUGCQueryCompleted_t Fill( IntPtr p ) => ((SteamUGCQueryCompleted_t)Marshal.PtrToStructure( p, typeof(SteamUGCQueryCompleted_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -6675,53 +4055,30 @@ public static void Install( Action action, bool server { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 1, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientUGC + 1, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 1, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientUGC + 1, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 1, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct SteamUGCRequestUGCDetailsResult_t + internal struct SteamUGCRequestUGCDetailsResult_t : ICallbackData { internal SteamUGCDetails_t Details; // m_details struct SteamUGCDetails_t [MarshalAs(UnmanagedType.I1)] internal bool CachedData; // m_bCachedData _Bool #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamUGCRequestUGCDetailsResult_t) ); - internal static SteamUGCRequestUGCDetailsResult_t Fill( IntPtr p ) => ((SteamUGCRequestUGCDetailsResult_t)(SteamUGCRequestUGCDetailsResult_t) Marshal.PtrToStructure( p, typeof(SteamUGCRequestUGCDetailsResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamUGCRequestUGCDetailsResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientUGC + 2; + internal static SteamUGCRequestUGCDetailsResult_t Fill( IntPtr p ) => ((SteamUGCRequestUGCDetailsResult_t)Marshal.PtrToStructure( p, typeof(SteamUGCRequestUGCDetailsResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -6731,45 +4088,20 @@ public static void Install( Action action, bo { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 2, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientUGC + 2, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 2, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientUGC + 2, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 2, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct CreateItemResult_t + internal struct CreateItemResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t @@ -6777,8 +4109,10 @@ internal struct CreateItemResult_t internal bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(CreateItemResult_t) ); - internal static CreateItemResult_t Fill( IntPtr p ) => ((CreateItemResult_t)(CreateItemResult_t) Marshal.PtrToStructure( p, typeof(CreateItemResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(CreateItemResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientUGC + 3; + internal static CreateItemResult_t Fill( IntPtr p ) => ((CreateItemResult_t)Marshal.PtrToStructure( p, typeof(CreateItemResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -6788,45 +4122,20 @@ public static void Install( Action action, bool server = fal { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 3, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientUGC + 3, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 3, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientUGC + 3, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 3, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct SubmitItemUpdateResult_t + internal struct SubmitItemUpdateResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult [MarshalAs(UnmanagedType.I1)] @@ -6834,8 +4143,10 @@ internal struct SubmitItemUpdateResult_t internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SubmitItemUpdateResult_t) ); - internal static SubmitItemUpdateResult_t Fill( IntPtr p ) => ((SubmitItemUpdateResult_t)(SubmitItemUpdateResult_t) Marshal.PtrToStructure( p, typeof(SubmitItemUpdateResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SubmitItemUpdateResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientUGC + 4; + internal static SubmitItemUpdateResult_t Fill( IntPtr p ) => ((SubmitItemUpdateResult_t)Marshal.PtrToStructure( p, typeof(SubmitItemUpdateResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -6845,53 +4156,30 @@ public static void Install( Action action, bool server { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 4, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientUGC + 4, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 4, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientUGC + 4, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 4, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct DownloadItemResult_t + internal struct DownloadItemResult_t : ICallbackData { internal AppId AppID; // m_unAppID AppId_t internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t internal Result Result; // m_eResult enum EResult #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(DownloadItemResult_t) ); - internal static DownloadItemResult_t Fill( IntPtr p ) => ((DownloadItemResult_t)(DownloadItemResult_t) Marshal.PtrToStructure( p, typeof(DownloadItemResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(DownloadItemResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientUGC + 6; + internal static DownloadItemResult_t Fill( IntPtr p ) => ((DownloadItemResult_t)Marshal.PtrToStructure( p, typeof(DownloadItemResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -6901,45 +4189,20 @@ public static void Install( Action action, bool server = f { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 6, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientUGC + 6, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 6, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientUGC + 6, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 6, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct UserFavoriteItemsListChanged_t + internal struct UserFavoriteItemsListChanged_t : ICallbackData { internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t internal Result Result; // m_eResult enum EResult @@ -6947,8 +4210,10 @@ internal struct UserFavoriteItemsListChanged_t internal bool WasAddRequest; // m_bWasAddRequest _Bool #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserFavoriteItemsListChanged_t) ); - internal static UserFavoriteItemsListChanged_t Fill( IntPtr p ) => ((UserFavoriteItemsListChanged_t)(UserFavoriteItemsListChanged_t) Marshal.PtrToStructure( p, typeof(UserFavoriteItemsListChanged_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserFavoriteItemsListChanged_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientUGC + 7; + internal static UserFavoriteItemsListChanged_t Fill( IntPtr p ) => ((UserFavoriteItemsListChanged_t)Marshal.PtrToStructure( p, typeof(UserFavoriteItemsListChanged_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -6958,45 +4223,20 @@ public static void Install( Action action, bool { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 7, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientUGC + 7, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 7, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientUGC + 7, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 7, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct SetUserItemVoteResult_t + internal struct SetUserItemVoteResult_t : ICallbackData { internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t internal Result Result; // m_eResult enum EResult @@ -7004,8 +4244,10 @@ internal struct SetUserItemVoteResult_t internal bool VoteUp; // m_bVoteUp _Bool #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SetUserItemVoteResult_t) ); - internal static SetUserItemVoteResult_t Fill( IntPtr p ) => ((SetUserItemVoteResult_t)(SetUserItemVoteResult_t) Marshal.PtrToStructure( p, typeof(SetUserItemVoteResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SetUserItemVoteResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientUGC + 8; + internal static SetUserItemVoteResult_t Fill( IntPtr p ) => ((SetUserItemVoteResult_t)Marshal.PtrToStructure( p, typeof(SetUserItemVoteResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -7015,45 +4257,20 @@ public static void Install( Action action, bool server { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 8, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientUGC + 8, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 8, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientUGC + 8, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 8, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct GetUserItemVoteResult_t + internal struct GetUserItemVoteResult_t : ICallbackData { internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t internal Result Result; // m_eResult enum EResult @@ -7065,8 +4282,10 @@ internal struct GetUserItemVoteResult_t internal bool VoteSkipped; // m_bVoteSkipped _Bool #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GetUserItemVoteResult_t) ); - internal static GetUserItemVoteResult_t Fill( IntPtr p ) => ((GetUserItemVoteResult_t)(GetUserItemVoteResult_t) Marshal.PtrToStructure( p, typeof(GetUserItemVoteResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GetUserItemVoteResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientUGC + 9; + internal static GetUserItemVoteResult_t Fill( IntPtr p ) => ((GetUserItemVoteResult_t)Marshal.PtrToStructure( p, typeof(GetUserItemVoteResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -7076,51 +4295,28 @@ public static void Install( Action action, bool server { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 9, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientUGC + 9, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 9, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientUGC + 9, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 9, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct StartPlaytimeTrackingResult_t + internal struct StartPlaytimeTrackingResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(StartPlaytimeTrackingResult_t) ); - internal static StartPlaytimeTrackingResult_t Fill( IntPtr p ) => ((StartPlaytimeTrackingResult_t)(StartPlaytimeTrackingResult_t) Marshal.PtrToStructure( p, typeof(StartPlaytimeTrackingResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(StartPlaytimeTrackingResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientUGC + 10; + internal static StartPlaytimeTrackingResult_t Fill( IntPtr p ) => ((StartPlaytimeTrackingResult_t)Marshal.PtrToStructure( p, typeof(StartPlaytimeTrackingResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -7130,51 +4326,28 @@ public static void Install( Action action, bool s { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 10, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientUGC + 10, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 10, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientUGC + 10, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 10, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct StopPlaytimeTrackingResult_t + internal struct StopPlaytimeTrackingResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(StopPlaytimeTrackingResult_t) ); - internal static StopPlaytimeTrackingResult_t Fill( IntPtr p ) => ((StopPlaytimeTrackingResult_t)(StopPlaytimeTrackingResult_t) Marshal.PtrToStructure( p, typeof(StopPlaytimeTrackingResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(StopPlaytimeTrackingResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientUGC + 11; + internal static StopPlaytimeTrackingResult_t Fill( IntPtr p ) => ((StopPlaytimeTrackingResult_t)Marshal.PtrToStructure( p, typeof(StopPlaytimeTrackingResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -7184,53 +4357,30 @@ public static void Install( Action action, bool se { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 11, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientUGC + 11, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 11, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientUGC + 11, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 11, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct AddUGCDependencyResult_t + internal struct AddUGCDependencyResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t internal PublishedFileId ChildPublishedFileId; // m_nChildPublishedFileId PublishedFileId_t #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(AddUGCDependencyResult_t) ); - internal static AddUGCDependencyResult_t Fill( IntPtr p ) => ((AddUGCDependencyResult_t)(AddUGCDependencyResult_t) Marshal.PtrToStructure( p, typeof(AddUGCDependencyResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(AddUGCDependencyResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientUGC + 12; + internal static AddUGCDependencyResult_t Fill( IntPtr p ) => ((AddUGCDependencyResult_t)Marshal.PtrToStructure( p, typeof(AddUGCDependencyResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -7240,53 +4390,30 @@ public static void Install( Action action, bool server { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 12, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientUGC + 12, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 12, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientUGC + 12, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 12, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoveUGCDependencyResult_t + internal struct RemoveUGCDependencyResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t internal PublishedFileId ChildPublishedFileId; // m_nChildPublishedFileId PublishedFileId_t #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoveUGCDependencyResult_t) ); - internal static RemoveUGCDependencyResult_t Fill( IntPtr p ) => ((RemoveUGCDependencyResult_t)(RemoveUGCDependencyResult_t) Marshal.PtrToStructure( p, typeof(RemoveUGCDependencyResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoveUGCDependencyResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientUGC + 13; + internal static RemoveUGCDependencyResult_t Fill( IntPtr p ) => ((RemoveUGCDependencyResult_t)Marshal.PtrToStructure( p, typeof(RemoveUGCDependencyResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -7296,53 +4423,30 @@ public static void Install( Action action, bool ser { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 13, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientUGC + 13, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 13, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientUGC + 13, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 13, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct AddAppDependencyResult_t + internal struct AddAppDependencyResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t internal AppId AppID; // m_nAppID AppId_t #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(AddAppDependencyResult_t) ); - internal static AddAppDependencyResult_t Fill( IntPtr p ) => ((AddAppDependencyResult_t)(AddAppDependencyResult_t) Marshal.PtrToStructure( p, typeof(AddAppDependencyResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(AddAppDependencyResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientUGC + 14; + internal static AddAppDependencyResult_t Fill( IntPtr p ) => ((AddAppDependencyResult_t)Marshal.PtrToStructure( p, typeof(AddAppDependencyResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -7352,53 +4456,30 @@ public static void Install( Action action, bool server { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 14, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientUGC + 14, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 14, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientUGC + 14, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 14, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct RemoveAppDependencyResult_t + internal struct RemoveAppDependencyResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t internal AppId AppID; // m_nAppID AppId_t #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoveAppDependencyResult_t) ); - internal static RemoveAppDependencyResult_t Fill( IntPtr p ) => ((RemoveAppDependencyResult_t)(RemoveAppDependencyResult_t) Marshal.PtrToStructure( p, typeof(RemoveAppDependencyResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoveAppDependencyResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientUGC + 15; + internal static RemoveAppDependencyResult_t Fill( IntPtr p ) => ((RemoveAppDependencyResult_t)Marshal.PtrToStructure( p, typeof(RemoveAppDependencyResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -7408,45 +4489,20 @@ public static void Install( Action action, bool ser { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 15, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientUGC + 15, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 15, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientUGC + 15, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 15, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct GetAppDependenciesResult_t + internal struct GetAppDependenciesResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t @@ -7456,8 +4512,10 @@ internal struct GetAppDependenciesResult_t internal uint TotalNumAppDependencies; // m_nTotalNumAppDependencies uint32 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GetAppDependenciesResult_t) ); - internal static GetAppDependenciesResult_t Fill( IntPtr p ) => ((GetAppDependenciesResult_t)(GetAppDependenciesResult_t) Marshal.PtrToStructure( p, typeof(GetAppDependenciesResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GetAppDependenciesResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientUGC + 16; + internal static GetAppDependenciesResult_t Fill( IntPtr p ) => ((GetAppDependenciesResult_t)Marshal.PtrToStructure( p, typeof(GetAppDependenciesResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -7467,52 +4525,29 @@ public static void Install( Action action, bool serv { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 16, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientUGC + 16, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 16, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientUGC + 16, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 16, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct DeleteItemResult_t + internal struct DeleteItemResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(DeleteItemResult_t) ); - internal static DeleteItemResult_t Fill( IntPtr p ) => ((DeleteItemResult_t)(DeleteItemResult_t) Marshal.PtrToStructure( p, typeof(DeleteItemResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(DeleteItemResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientUGC + 17; + internal static DeleteItemResult_t Fill( IntPtr p ) => ((DeleteItemResult_t)Marshal.PtrToStructure( p, typeof(DeleteItemResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -7522,51 +4557,28 @@ public static void Install( Action action, bool server = fal { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 17, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientUGC + 17, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 17, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientUGC + 17, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 17, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct SteamAppInstalled_t + internal struct SteamAppInstalled_t : ICallbackData { internal AppId AppID; // m_nAppID AppId_t #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamAppInstalled_t) ); - internal static SteamAppInstalled_t Fill( IntPtr p ) => ((SteamAppInstalled_t)(SteamAppInstalled_t) Marshal.PtrToStructure( p, typeof(SteamAppInstalled_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamAppInstalled_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamAppList + 1; + internal static SteamAppInstalled_t Fill( IntPtr p ) => ((SteamAppInstalled_t)Marshal.PtrToStructure( p, typeof(SteamAppInstalled_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -7576,51 +4588,28 @@ public static void Install( Action action, bool server = fa { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamAppList + 1, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamAppList + 1, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamAppList + 1, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamAppList + 1, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamAppList + 1, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct SteamAppUninstalled_t + internal struct SteamAppUninstalled_t : ICallbackData { internal AppId AppID; // m_nAppID AppId_t #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamAppUninstalled_t) ); - internal static SteamAppUninstalled_t Fill( IntPtr p ) => ((SteamAppUninstalled_t)(SteamAppUninstalled_t) Marshal.PtrToStructure( p, typeof(SteamAppUninstalled_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamAppUninstalled_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamAppList + 2; + internal static SteamAppUninstalled_t Fill( IntPtr p ) => ((SteamAppUninstalled_t)Marshal.PtrToStructure( p, typeof(SteamAppUninstalled_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -7630,51 +4619,28 @@ public static void Install( Action action, bool server = { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamAppList + 2, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamAppList + 2, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamAppList + 2, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamAppList + 2, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamAppList + 2, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct HTML_BrowserReady_t + internal struct HTML_BrowserReady_t : ICallbackData { internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_BrowserReady_t) ); - internal static HTML_BrowserReady_t Fill( IntPtr p ) => ((HTML_BrowserReady_t)(HTML_BrowserReady_t) Marshal.PtrToStructure( p, typeof(HTML_BrowserReady_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_BrowserReady_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamHTMLSurface + 1; + internal static HTML_BrowserReady_t Fill( IntPtr p ) => ((HTML_BrowserReady_t)Marshal.PtrToStructure( p, typeof(HTML_BrowserReady_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -7684,40 +4650,15 @@ public static void Install( Action action, bool server = fa { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 1, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamHTMLSurface + 1, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 1, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamHTMLSurface + 1, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 1, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } @@ -7768,7 +4709,7 @@ internal struct HTML_CloseBrowser_t } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct HTML_URLChanged_t + internal struct HTML_URLChanged_t : ICallbackData { internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser internal string PchURL; // pchURL const char * @@ -7780,8 +4721,10 @@ internal struct HTML_URLChanged_t internal bool BNewNavigation; // bNewNavigation _Bool #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_URLChanged_t) ); - internal static HTML_URLChanged_t Fill( IntPtr p ) => ((HTML_URLChanged_t)(HTML_URLChanged_t) Marshal.PtrToStructure( p, typeof(HTML_URLChanged_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_URLChanged_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamHTMLSurface + 5; + internal static HTML_URLChanged_t Fill( IntPtr p ) => ((HTML_URLChanged_t)Marshal.PtrToStructure( p, typeof(HTML_URLChanged_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -7791,53 +4734,30 @@ public static void Install( Action action, bool server = fals { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 5, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamHTMLSurface + 5, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 5, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamHTMLSurface + 5, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 5, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct HTML_FinishedRequest_t + internal struct HTML_FinishedRequest_t : ICallbackData { internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser internal string PchURL; // pchURL const char * internal string PchPageTitle; // pchPageTitle const char * #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_FinishedRequest_t) ); - internal static HTML_FinishedRequest_t Fill( IntPtr p ) => ((HTML_FinishedRequest_t)(HTML_FinishedRequest_t) Marshal.PtrToStructure( p, typeof(HTML_FinishedRequest_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_FinishedRequest_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamHTMLSurface + 6; + internal static HTML_FinishedRequest_t Fill( IntPtr p ) => ((HTML_FinishedRequest_t)Marshal.PtrToStructure( p, typeof(HTML_FinishedRequest_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -7847,52 +4767,29 @@ public static void Install( Action action, bool server = { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 6, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamHTMLSurface + 6, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 6, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamHTMLSurface + 6, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 6, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct HTML_OpenLinkInNewTab_t + internal struct HTML_OpenLinkInNewTab_t : ICallbackData { internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser internal string PchURL; // pchURL const char * #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_OpenLinkInNewTab_t) ); - internal static HTML_OpenLinkInNewTab_t Fill( IntPtr p ) => ((HTML_OpenLinkInNewTab_t)(HTML_OpenLinkInNewTab_t) Marshal.PtrToStructure( p, typeof(HTML_OpenLinkInNewTab_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_OpenLinkInNewTab_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamHTMLSurface + 7; + internal static HTML_OpenLinkInNewTab_t Fill( IntPtr p ) => ((HTML_OpenLinkInNewTab_t)Marshal.PtrToStructure( p, typeof(HTML_OpenLinkInNewTab_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -7902,52 +4799,29 @@ public static void Install( Action action, bool server { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 7, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamHTMLSurface + 7, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 7, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamHTMLSurface + 7, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 7, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct HTML_ChangedTitle_t + internal struct HTML_ChangedTitle_t : ICallbackData { internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser internal string PchTitle; // pchTitle const char * #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_ChangedTitle_t) ); - internal static HTML_ChangedTitle_t Fill( IntPtr p ) => ((HTML_ChangedTitle_t)(HTML_ChangedTitle_t) Marshal.PtrToStructure( p, typeof(HTML_ChangedTitle_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_ChangedTitle_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamHTMLSurface + 8; + internal static HTML_ChangedTitle_t Fill( IntPtr p ) => ((HTML_ChangedTitle_t)Marshal.PtrToStructure( p, typeof(HTML_ChangedTitle_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -7957,53 +4831,30 @@ public static void Install( Action action, bool server = fa { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 8, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamHTMLSurface + 8, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 8, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamHTMLSurface + 8, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 8, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct HTML_SearchResults_t + internal struct HTML_SearchResults_t : ICallbackData { internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser internal uint UnResults; // unResults uint32 internal uint UnCurrentMatch; // unCurrentMatch uint32 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_SearchResults_t) ); - internal static HTML_SearchResults_t Fill( IntPtr p ) => ((HTML_SearchResults_t)(HTML_SearchResults_t) Marshal.PtrToStructure( p, typeof(HTML_SearchResults_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_SearchResults_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamHTMLSurface + 9; + internal static HTML_SearchResults_t Fill( IntPtr p ) => ((HTML_SearchResults_t)Marshal.PtrToStructure( p, typeof(HTML_SearchResults_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -8013,45 +4864,20 @@ public static void Install( Action action, bool server = f { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 9, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamHTMLSurface + 9, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 9, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamHTMLSurface + 9, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 9, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct HTML_CanGoBackAndForward_t + internal struct HTML_CanGoBackAndForward_t : ICallbackData { internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser [MarshalAs(UnmanagedType.I1)] @@ -8060,8 +4886,10 @@ internal struct HTML_CanGoBackAndForward_t internal bool BCanGoForward; // bCanGoForward _Bool #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_CanGoBackAndForward_t) ); - internal static HTML_CanGoBackAndForward_t Fill( IntPtr p ) => ((HTML_CanGoBackAndForward_t)(HTML_CanGoBackAndForward_t) Marshal.PtrToStructure( p, typeof(HTML_CanGoBackAndForward_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_CanGoBackAndForward_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamHTMLSurface + 10; + internal static HTML_CanGoBackAndForward_t Fill( IntPtr p ) => ((HTML_CanGoBackAndForward_t)Marshal.PtrToStructure( p, typeof(HTML_CanGoBackAndForward_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -8071,45 +4899,20 @@ public static void Install( Action action, bool serv { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 10, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamHTMLSurface + 10, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 10, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamHTMLSurface + 10, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 10, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct HTML_HorizontalScroll_t + internal struct HTML_HorizontalScroll_t : ICallbackData { internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser internal uint UnScrollMax; // unScrollMax uint32 @@ -8120,8 +4923,10 @@ internal struct HTML_HorizontalScroll_t internal uint UnPageSize; // unPageSize uint32 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_HorizontalScroll_t) ); - internal static HTML_HorizontalScroll_t Fill( IntPtr p ) => ((HTML_HorizontalScroll_t)(HTML_HorizontalScroll_t) Marshal.PtrToStructure( p, typeof(HTML_HorizontalScroll_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_HorizontalScroll_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamHTMLSurface + 11; + internal static HTML_HorizontalScroll_t Fill( IntPtr p ) => ((HTML_HorizontalScroll_t)Marshal.PtrToStructure( p, typeof(HTML_HorizontalScroll_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -8131,45 +4936,20 @@ public static void Install( Action action, bool server { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 11, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamHTMLSurface + 11, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 11, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamHTMLSurface + 11, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 11, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct HTML_VerticalScroll_t + internal struct HTML_VerticalScroll_t : ICallbackData { internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser internal uint UnScrollMax; // unScrollMax uint32 @@ -8180,8 +4960,10 @@ internal struct HTML_VerticalScroll_t internal uint UnPageSize; // unPageSize uint32 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_VerticalScroll_t) ); - internal static HTML_VerticalScroll_t Fill( IntPtr p ) => ((HTML_VerticalScroll_t)(HTML_VerticalScroll_t) Marshal.PtrToStructure( p, typeof(HTML_VerticalScroll_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_VerticalScroll_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamHTMLSurface + 12; + internal static HTML_VerticalScroll_t Fill( IntPtr p ) => ((HTML_VerticalScroll_t)Marshal.PtrToStructure( p, typeof(HTML_VerticalScroll_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -8191,45 +4973,20 @@ public static void Install( Action action, bool server = { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 12, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamHTMLSurface + 12, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 12, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamHTMLSurface + 12, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 12, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct HTML_LinkAtPosition_t + internal struct HTML_LinkAtPosition_t : ICallbackData { internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser internal uint X; // x uint32 @@ -8241,8 +4998,10 @@ internal struct HTML_LinkAtPosition_t internal bool BLiveLink; // bLiveLink _Bool #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_LinkAtPosition_t) ); - internal static HTML_LinkAtPosition_t Fill( IntPtr p ) => ((HTML_LinkAtPosition_t)(HTML_LinkAtPosition_t) Marshal.PtrToStructure( p, typeof(HTML_LinkAtPosition_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_LinkAtPosition_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamHTMLSurface + 13; + internal static HTML_LinkAtPosition_t Fill( IntPtr p ) => ((HTML_LinkAtPosition_t)Marshal.PtrToStructure( p, typeof(HTML_LinkAtPosition_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -8252,52 +5011,29 @@ public static void Install( Action action, bool server = { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 13, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamHTMLSurface + 13, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 13, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamHTMLSurface + 13, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 13, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct HTML_JSAlert_t + internal struct HTML_JSAlert_t : ICallbackData { internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser internal string PchMessage; // pchMessage const char * #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_JSAlert_t) ); - internal static HTML_JSAlert_t Fill( IntPtr p ) => ((HTML_JSAlert_t)(HTML_JSAlert_t) Marshal.PtrToStructure( p, typeof(HTML_JSAlert_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_JSAlert_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamHTMLSurface + 14; + internal static HTML_JSAlert_t Fill( IntPtr p ) => ((HTML_JSAlert_t)Marshal.PtrToStructure( p, typeof(HTML_JSAlert_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -8307,52 +5043,29 @@ public static void Install( Action action, bool server = false ) { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 14, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamHTMLSurface + 14, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 14, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamHTMLSurface + 14, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 14, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct HTML_JSConfirm_t + internal struct HTML_JSConfirm_t : ICallbackData { internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser internal string PchMessage; // pchMessage const char * #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_JSConfirm_t) ); - internal static HTML_JSConfirm_t Fill( IntPtr p ) => ((HTML_JSConfirm_t)(HTML_JSConfirm_t) Marshal.PtrToStructure( p, typeof(HTML_JSConfirm_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_JSConfirm_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamHTMLSurface + 15; + internal static HTML_JSConfirm_t Fill( IntPtr p ) => ((HTML_JSConfirm_t)Marshal.PtrToStructure( p, typeof(HTML_JSConfirm_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -8362,53 +5075,30 @@ public static void Install( Action action, bool server = false { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 15, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamHTMLSurface + 15, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 15, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamHTMLSurface + 15, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 15, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct HTML_FileOpenDialog_t + internal struct HTML_FileOpenDialog_t : ICallbackData { internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser internal string PchTitle; // pchTitle const char * internal string PchInitialFile; // pchInitialFile const char * #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_FileOpenDialog_t) ); - internal static HTML_FileOpenDialog_t Fill( IntPtr p ) => ((HTML_FileOpenDialog_t)(HTML_FileOpenDialog_t) Marshal.PtrToStructure( p, typeof(HTML_FileOpenDialog_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_FileOpenDialog_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamHTMLSurface + 16; + internal static HTML_FileOpenDialog_t Fill( IntPtr p ) => ((HTML_FileOpenDialog_t)Marshal.PtrToStructure( p, typeof(HTML_FileOpenDialog_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -8418,45 +5108,20 @@ public static void Install( Action action, bool server = { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 16, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamHTMLSurface + 16, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 16, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamHTMLSurface + 16, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 16, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct HTML_NewWindow_t + internal struct HTML_NewWindow_t : ICallbackData { internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser internal string PchURL; // pchURL const char * @@ -8467,8 +5132,10 @@ internal struct HTML_NewWindow_t internal uint UnNewWindow_BrowserHandle_IGNORE; // unNewWindow_BrowserHandle_IGNORE HHTMLBrowser #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_NewWindow_t) ); - internal static HTML_NewWindow_t Fill( IntPtr p ) => ((HTML_NewWindow_t)(HTML_NewWindow_t) Marshal.PtrToStructure( p, typeof(HTML_NewWindow_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_NewWindow_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamHTMLSurface + 21; + internal static HTML_NewWindow_t Fill( IntPtr p ) => ((HTML_NewWindow_t)Marshal.PtrToStructure( p, typeof(HTML_NewWindow_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -8478,52 +5145,29 @@ public static void Install( Action action, bool server = false { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 21, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamHTMLSurface + 21, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 21, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamHTMLSurface + 21, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 21, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct HTML_SetCursor_t + internal struct HTML_SetCursor_t : ICallbackData { internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser internal uint EMouseCursor; // eMouseCursor uint32 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_SetCursor_t) ); - internal static HTML_SetCursor_t Fill( IntPtr p ) => ((HTML_SetCursor_t)(HTML_SetCursor_t) Marshal.PtrToStructure( p, typeof(HTML_SetCursor_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_SetCursor_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamHTMLSurface + 22; + internal static HTML_SetCursor_t Fill( IntPtr p ) => ((HTML_SetCursor_t)Marshal.PtrToStructure( p, typeof(HTML_SetCursor_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -8533,52 +5177,29 @@ public static void Install( Action action, bool server = false { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 22, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamHTMLSurface + 22, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 22, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamHTMLSurface + 22, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 22, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct HTML_StatusText_t + internal struct HTML_StatusText_t : ICallbackData { internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser internal string PchMsg; // pchMsg const char * #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_StatusText_t) ); - internal static HTML_StatusText_t Fill( IntPtr p ) => ((HTML_StatusText_t)(HTML_StatusText_t) Marshal.PtrToStructure( p, typeof(HTML_StatusText_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_StatusText_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamHTMLSurface + 23; + internal static HTML_StatusText_t Fill( IntPtr p ) => ((HTML_StatusText_t)Marshal.PtrToStructure( p, typeof(HTML_StatusText_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -8588,52 +5209,29 @@ public static void Install( Action action, bool server = fals { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 23, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamHTMLSurface + 23, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 23, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamHTMLSurface + 23, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 23, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct HTML_ShowToolTip_t + internal struct HTML_ShowToolTip_t : ICallbackData { internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser internal string PchMsg; // pchMsg const char * #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_ShowToolTip_t) ); - internal static HTML_ShowToolTip_t Fill( IntPtr p ) => ((HTML_ShowToolTip_t)(HTML_ShowToolTip_t) Marshal.PtrToStructure( p, typeof(HTML_ShowToolTip_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_ShowToolTip_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamHTMLSurface + 24; + internal static HTML_ShowToolTip_t Fill( IntPtr p ) => ((HTML_ShowToolTip_t)Marshal.PtrToStructure( p, typeof(HTML_ShowToolTip_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -8643,52 +5241,29 @@ public static void Install( Action action, bool server = fal { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 24, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamHTMLSurface + 24, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 24, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamHTMLSurface + 24, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 24, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct HTML_UpdateToolTip_t + internal struct HTML_UpdateToolTip_t : ICallbackData { internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser internal string PchMsg; // pchMsg const char * #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_UpdateToolTip_t) ); - internal static HTML_UpdateToolTip_t Fill( IntPtr p ) => ((HTML_UpdateToolTip_t)(HTML_UpdateToolTip_t) Marshal.PtrToStructure( p, typeof(HTML_UpdateToolTip_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_UpdateToolTip_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamHTMLSurface + 25; + internal static HTML_UpdateToolTip_t Fill( IntPtr p ) => ((HTML_UpdateToolTip_t)Marshal.PtrToStructure( p, typeof(HTML_UpdateToolTip_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -8698,51 +5273,28 @@ public static void Install( Action action, bool server = f { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 25, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamHTMLSurface + 25, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 25, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamHTMLSurface + 25, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 25, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct HTML_HideToolTip_t + internal struct HTML_HideToolTip_t : ICallbackData { internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_HideToolTip_t) ); - internal static HTML_HideToolTip_t Fill( IntPtr p ) => ((HTML_HideToolTip_t)(HTML_HideToolTip_t) Marshal.PtrToStructure( p, typeof(HTML_HideToolTip_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_HideToolTip_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamHTMLSurface + 26; + internal static HTML_HideToolTip_t Fill( IntPtr p ) => ((HTML_HideToolTip_t)Marshal.PtrToStructure( p, typeof(HTML_HideToolTip_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -8752,52 +5304,29 @@ public static void Install( Action action, bool server = fal { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 26, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamHTMLSurface + 26, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 26, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamHTMLSurface + 26, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 26, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct HTML_BrowserRestarted_t + internal struct HTML_BrowserRestarted_t : ICallbackData { internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser internal uint UnOldBrowserHandle; // unOldBrowserHandle HHTMLBrowser #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_BrowserRestarted_t) ); - internal static HTML_BrowserRestarted_t Fill( IntPtr p ) => ((HTML_BrowserRestarted_t)(HTML_BrowserRestarted_t) Marshal.PtrToStructure( p, typeof(HTML_BrowserRestarted_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_BrowserRestarted_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamHTMLSurface + 27; + internal static HTML_BrowserRestarted_t Fill( IntPtr p ) => ((HTML_BrowserRestarted_t)Marshal.PtrToStructure( p, typeof(HTML_BrowserRestarted_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -8807,40 +5336,15 @@ public static void Install( Action action, bool server { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 27, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamHTMLSurface + 27, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 27, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamHTMLSurface + 27, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 27, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } @@ -8858,14 +5362,16 @@ internal struct SteamItemDetails_t } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct SteamInventoryResultReady_t + internal struct SteamInventoryResultReady_t : ICallbackData { internal int Handle; // m_handle SteamInventoryResult_t internal Result Result; // m_result enum EResult #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryResultReady_t) ); - internal static SteamInventoryResultReady_t Fill( IntPtr p ) => ((SteamInventoryResultReady_t)(SteamInventoryResultReady_t) Marshal.PtrToStructure( p, typeof(SteamInventoryResultReady_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryResultReady_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientInventory + 0; + internal static SteamInventoryResultReady_t Fill( IntPtr p ) => ((SteamInventoryResultReady_t)Marshal.PtrToStructure( p, typeof(SteamInventoryResultReady_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -8875,51 +5381,28 @@ public static void Install( Action action, bool ser { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientInventory + 0, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientInventory + 0, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientInventory + 0, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientInventory + 0, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientInventory + 0, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct SteamInventoryFullUpdate_t + internal struct SteamInventoryFullUpdate_t : ICallbackData { internal int Handle; // m_handle SteamInventoryResult_t #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryFullUpdate_t) ); - internal static SteamInventoryFullUpdate_t Fill( IntPtr p ) => ((SteamInventoryFullUpdate_t)(SteamInventoryFullUpdate_t) Marshal.PtrToStructure( p, typeof(SteamInventoryFullUpdate_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryFullUpdate_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientInventory + 1; + internal static SteamInventoryFullUpdate_t Fill( IntPtr p ) => ((SteamInventoryFullUpdate_t)Marshal.PtrToStructure( p, typeof(SteamInventoryFullUpdate_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -8929,45 +5412,20 @@ public static void Install( Action action, bool serv { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientInventory + 1, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientInventory + 1, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientInventory + 1, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientInventory + 1, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientInventory + 1, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct SteamInventoryEligiblePromoItemDefIDs_t + internal struct SteamInventoryEligiblePromoItemDefIDs_t : ICallbackData { internal Result Result; // m_result enum EResult internal ulong SteamID; // m_steamID class CSteamID @@ -8976,8 +5434,10 @@ internal struct SteamInventoryEligiblePromoItemDefIDs_t internal bool CachedData; // m_bCachedData _Bool #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryEligiblePromoItemDefIDs_t) ); - internal static SteamInventoryEligiblePromoItemDefIDs_t Fill( IntPtr p ) => ((SteamInventoryEligiblePromoItemDefIDs_t)(SteamInventoryEligiblePromoItemDefIDs_t) Marshal.PtrToStructure( p, typeof(SteamInventoryEligiblePromoItemDefIDs_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryEligiblePromoItemDefIDs_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientInventory + 3; + internal static SteamInventoryEligiblePromoItemDefIDs_t Fill( IntPtr p ) => ((SteamInventoryEligiblePromoItemDefIDs_t)Marshal.PtrToStructure( p, typeof(SteamInventoryEligiblePromoItemDefIDs_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -8987,53 +5447,30 @@ public static void Install( Action acti { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientInventory + 3, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientInventory + 3, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientInventory + 3, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientInventory + 3, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientInventory + 3, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct SteamInventoryStartPurchaseResult_t + internal struct SteamInventoryStartPurchaseResult_t : ICallbackData { internal Result Result; // m_result enum EResult internal ulong OrderID; // m_ulOrderID uint64 internal ulong TransID; // m_ulTransID uint64 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryStartPurchaseResult_t) ); - internal static SteamInventoryStartPurchaseResult_t Fill( IntPtr p ) => ((SteamInventoryStartPurchaseResult_t)(SteamInventoryStartPurchaseResult_t) Marshal.PtrToStructure( p, typeof(SteamInventoryStartPurchaseResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryStartPurchaseResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientInventory + 4; + internal static SteamInventoryStartPurchaseResult_t Fill( IntPtr p ) => ((SteamInventoryStartPurchaseResult_t)Marshal.PtrToStructure( p, typeof(SteamInventoryStartPurchaseResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -9043,45 +5480,20 @@ public static void Install( Action action, { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientInventory + 4, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientInventory + 4, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientInventory + 4, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientInventory + 4, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientInventory + 4, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct SteamInventoryRequestPricesResult_t + internal struct SteamInventoryRequestPricesResult_t : ICallbackData { internal Result Result; // m_result enum EResult internal string CurrencyUTF8() => System.Text.Encoding.UTF8.GetString( Currency, 0, System.Array.IndexOf( Currency, 0 ) ); @@ -9089,8 +5501,10 @@ internal struct SteamInventoryRequestPricesResult_t internal byte[] Currency; // m_rgchCurrency char [4] #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryRequestPricesResult_t) ); - internal static SteamInventoryRequestPricesResult_t Fill( IntPtr p ) => ((SteamInventoryRequestPricesResult_t)(SteamInventoryRequestPricesResult_t) Marshal.PtrToStructure( p, typeof(SteamInventoryRequestPricesResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryRequestPricesResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientInventory + 5; + internal static SteamInventoryRequestPricesResult_t Fill( IntPtr p ) => ((SteamInventoryRequestPricesResult_t)Marshal.PtrToStructure( p, typeof(SteamInventoryRequestPricesResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -9100,51 +5514,28 @@ public static void Install( Action action, { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientInventory + 5, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientInventory + 5, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientInventory + 5, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientInventory + 5, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientInventory + 5, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct BroadcastUploadStop_t + internal struct BroadcastUploadStop_t : ICallbackData { internal BroadcastUploadResult Result; // m_eResult enum EBroadcastUploadResult #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(BroadcastUploadStop_t) ); - internal static BroadcastUploadStop_t Fill( IntPtr p ) => ((BroadcastUploadStop_t)(BroadcastUploadStop_t) Marshal.PtrToStructure( p, typeof(BroadcastUploadStop_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(BroadcastUploadStop_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientVideo + 5; + internal static BroadcastUploadStop_t Fill( IntPtr p ) => ((BroadcastUploadStop_t)Marshal.PtrToStructure( p, typeof(BroadcastUploadStop_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -9154,45 +5545,20 @@ public static void Install( Action action, bool server = { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientVideo + 5, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientVideo + 5, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientVideo + 5, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientVideo + 5, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientVideo + 5, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct GetVideoURLResult_t + internal struct GetVideoURLResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal AppId VideoAppID; // m_unVideoAppID AppId_t @@ -9201,8 +5567,10 @@ internal struct GetVideoURLResult_t internal byte[] URL; // m_rgchURL char [256] #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GetVideoURLResult_t) ); - internal static GetVideoURLResult_t Fill( IntPtr p ) => ((GetVideoURLResult_t)(GetVideoURLResult_t) Marshal.PtrToStructure( p, typeof(GetVideoURLResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GetVideoURLResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientVideo + 11; + internal static GetVideoURLResult_t Fill( IntPtr p ) => ((GetVideoURLResult_t)Marshal.PtrToStructure( p, typeof(GetVideoURLResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -9212,52 +5580,29 @@ public static void Install( Action action, bool server = fa { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientVideo + 11, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientVideo + 11, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientVideo + 11, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientVideo + 11, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientVideo + 11, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct GetOPFSettingsResult_t + internal struct GetOPFSettingsResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal AppId VideoAppID; // m_unVideoAppID AppId_t #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GetOPFSettingsResult_t) ); - internal static GetOPFSettingsResult_t Fill( IntPtr p ) => ((GetOPFSettingsResult_t)(GetOPFSettingsResult_t) Marshal.PtrToStructure( p, typeof(GetOPFSettingsResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GetOPFSettingsResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientVideo + 24; + internal static GetOPFSettingsResult_t Fill( IntPtr p ) => ((GetOPFSettingsResult_t)Marshal.PtrToStructure( p, typeof(GetOPFSettingsResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -9267,52 +5612,29 @@ public static void Install( Action action, bool server = { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientVideo + 24, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientVideo + 24, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientVideo + 24, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientVideo + 24, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientVideo + 24, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct GSClientApprove_t + internal struct GSClientApprove_t : ICallbackData { internal ulong SteamID; // m_SteamID class CSteamID internal ulong OwnerSteamID; // m_OwnerSteamID class CSteamID #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientApprove_t) ); - internal static GSClientApprove_t Fill( IntPtr p ) => ((GSClientApprove_t)(GSClientApprove_t) Marshal.PtrToStructure( p, typeof(GSClientApprove_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientApprove_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamGameServer + 1; + internal static GSClientApprove_t Fill( IntPtr p ) => ((GSClientApprove_t)Marshal.PtrToStructure( p, typeof(GSClientApprove_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -9322,45 +5644,20 @@ public static void Install( Action action, bool server = fals { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameServer + 1, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamGameServer + 1, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameServer + 1, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamGameServer + 1, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameServer + 1, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct GSClientDeny_t + internal struct GSClientDeny_t : ICallbackData { internal ulong SteamID; // m_SteamID class CSteamID internal DenyReason DenyReason; // m_eDenyReason enum EDenyReason @@ -9369,8 +5666,10 @@ internal struct GSClientDeny_t internal byte[] OptionalText; // m_rgchOptionalText char [128] #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientDeny_t) ); - internal static GSClientDeny_t Fill( IntPtr p ) => ((GSClientDeny_t)(GSClientDeny_t) Marshal.PtrToStructure( p, typeof(GSClientDeny_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientDeny_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamGameServer + 2; + internal static GSClientDeny_t Fill( IntPtr p ) => ((GSClientDeny_t)Marshal.PtrToStructure( p, typeof(GSClientDeny_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -9380,52 +5679,29 @@ public static void Install( Action action, bool server = false ) { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameServer + 2, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamGameServer + 2, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameServer + 2, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamGameServer + 2, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameServer + 2, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct GSClientKick_t + internal struct GSClientKick_t : ICallbackData { internal ulong SteamID; // m_SteamID class CSteamID internal DenyReason DenyReason; // m_eDenyReason enum EDenyReason #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientKick_t) ); - internal static GSClientKick_t Fill( IntPtr p ) => ((GSClientKick_t)(GSClientKick_t) Marshal.PtrToStructure( p, typeof(GSClientKick_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientKick_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamGameServer + 3; + internal static GSClientKick_t Fill( IntPtr p ) => ((GSClientKick_t)Marshal.PtrToStructure( p, typeof(GSClientKick_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -9435,45 +5711,20 @@ public static void Install( Action action, bool server = false ) { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameServer + 3, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamGameServer + 3, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameServer + 3, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamGameServer + 3, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameServer + 3, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct GSClientAchievementStatus_t + internal struct GSClientAchievementStatus_t : ICallbackData { internal ulong SteamID; // m_SteamID uint64 internal string PchAchievementUTF8() => System.Text.Encoding.UTF8.GetString( PchAchievement, 0, System.Array.IndexOf( PchAchievement, 0 ) ); @@ -9483,8 +5734,10 @@ internal struct GSClientAchievementStatus_t internal bool Unlocked; // m_bUnlocked _Bool #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientAchievementStatus_t) ); - internal static GSClientAchievementStatus_t Fill( IntPtr p ) => ((GSClientAchievementStatus_t)(GSClientAchievementStatus_t) Marshal.PtrToStructure( p, typeof(GSClientAchievementStatus_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientAchievementStatus_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamGameServer + 6; + internal static GSClientAchievementStatus_t Fill( IntPtr p ) => ((GSClientAchievementStatus_t)Marshal.PtrToStructure( p, typeof(GSClientAchievementStatus_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -9494,51 +5747,28 @@ public static void Install( Action action, bool ser { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameServer + 6, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamGameServer + 6, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameServer + 6, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamGameServer + 6, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameServer + 6, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct GSPolicyResponse_t + internal struct GSPolicyResponse_t : ICallbackData { internal byte Secure; // m_bSecure uint8 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSPolicyResponse_t) ); - internal static GSPolicyResponse_t Fill( IntPtr p ) => ((GSPolicyResponse_t)(GSPolicyResponse_t) Marshal.PtrToStructure( p, typeof(GSPolicyResponse_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSPolicyResponse_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUser + 15; + internal static GSPolicyResponse_t Fill( IntPtr p ) => ((GSPolicyResponse_t)Marshal.PtrToStructure( p, typeof(GSPolicyResponse_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -9548,45 +5778,20 @@ public static void Install( Action action, bool server = fal { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUser + 15, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUser + 15, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUser + 15, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUser + 15, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUser + 15, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct GSGameplayStats_t + internal struct GSGameplayStats_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal int Rank; // m_nRank int32 @@ -9594,8 +5799,10 @@ internal struct GSGameplayStats_t internal uint TotalMinutesPlayed; // m_unTotalMinutesPlayed uint32 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSGameplayStats_t) ); - internal static GSGameplayStats_t Fill( IntPtr p ) => ((GSGameplayStats_t)(GSGameplayStats_t) Marshal.PtrToStructure( p, typeof(GSGameplayStats_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSGameplayStats_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamGameServer + 7; + internal static GSGameplayStats_t Fill( IntPtr p ) => ((GSGameplayStats_t)Marshal.PtrToStructure( p, typeof(GSGameplayStats_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -9605,45 +5812,20 @@ public static void Install( Action action, bool server = fals { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameServer + 7, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamGameServer + 7, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameServer + 7, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamGameServer + 7, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameServer + 7, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct GSClientGroupStatus_t + internal struct GSClientGroupStatus_t : ICallbackData { internal ulong SteamIDUser; // m_SteamIDUser class CSteamID internal ulong SteamIDGroup; // m_SteamIDGroup class CSteamID @@ -9653,8 +5835,10 @@ internal struct GSClientGroupStatus_t internal bool Officer; // m_bOfficer _Bool #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientGroupStatus_t) ); - internal static GSClientGroupStatus_t Fill( IntPtr p ) => ((GSClientGroupStatus_t)(GSClientGroupStatus_t) Marshal.PtrToStructure( p, typeof(GSClientGroupStatus_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientGroupStatus_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamGameServer + 8; + internal static GSClientGroupStatus_t Fill( IntPtr p ) => ((GSClientGroupStatus_t)Marshal.PtrToStructure( p, typeof(GSClientGroupStatus_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -9664,45 +5848,20 @@ public static void Install( Action action, bool server = { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameServer + 8, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamGameServer + 8, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameServer + 8, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamGameServer + 8, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameServer + 8, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct GSReputation_t + internal struct GSReputation_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal uint ReputationScore; // m_unReputationScore uint32 @@ -9714,8 +5873,10 @@ internal struct GSReputation_t internal uint BanExpires; // m_unBanExpires uint32 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSReputation_t) ); - internal static GSReputation_t Fill( IntPtr p ) => ((GSReputation_t)(GSReputation_t) Marshal.PtrToStructure( p, typeof(GSReputation_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSReputation_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamGameServer + 9; + internal static GSReputation_t Fill( IntPtr p ) => ((GSReputation_t)Marshal.PtrToStructure( p, typeof(GSReputation_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -9725,51 +5886,28 @@ public static void Install( Action action, bool server = false ) { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameServer + 9, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamGameServer + 9, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameServer + 9, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamGameServer + 9, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameServer + 9, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct AssociateWithClanResult_t + internal struct AssociateWithClanResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(AssociateWithClanResult_t) ); - internal static AssociateWithClanResult_t Fill( IntPtr p ) => ((AssociateWithClanResult_t)(AssociateWithClanResult_t) Marshal.PtrToStructure( p, typeof(AssociateWithClanResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(AssociateWithClanResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamGameServer + 10; + internal static AssociateWithClanResult_t Fill( IntPtr p ) => ((AssociateWithClanResult_t)Marshal.PtrToStructure( p, typeof(AssociateWithClanResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -9779,45 +5917,20 @@ public static void Install( Action action, bool serve { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameServer + 10, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamGameServer + 10, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameServer + 10, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamGameServer + 10, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameServer + 10, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct ComputeNewPlayerCompatibilityResult_t + internal struct ComputeNewPlayerCompatibilityResult_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal int CPlayersThatDontLikeCandidate; // m_cPlayersThatDontLikeCandidate int @@ -9826,8 +5939,10 @@ internal struct ComputeNewPlayerCompatibilityResult_t internal ulong SteamIDCandidate; // m_SteamIDCandidate class CSteamID #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ComputeNewPlayerCompatibilityResult_t) ); - internal static ComputeNewPlayerCompatibilityResult_t Fill( IntPtr p ) => ((ComputeNewPlayerCompatibilityResult_t)(ComputeNewPlayerCompatibilityResult_t) Marshal.PtrToStructure( p, typeof(ComputeNewPlayerCompatibilityResult_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ComputeNewPlayerCompatibilityResult_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamGameServer + 11; + internal static ComputeNewPlayerCompatibilityResult_t Fill( IntPtr p ) => ((ComputeNewPlayerCompatibilityResult_t)Marshal.PtrToStructure( p, typeof(ComputeNewPlayerCompatibilityResult_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -9837,52 +5952,29 @@ public static void Install( Action action { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameServer + 11, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamGameServer + 11, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameServer + 11, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamGameServer + 11, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameServer + 11, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct GSStatsReceived_t + internal struct GSStatsReceived_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal ulong SteamIDUser; // m_steamIDUser class CSteamID #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSStatsReceived_t) ); - internal static GSStatsReceived_t Fill( IntPtr p ) => ((GSStatsReceived_t)(GSStatsReceived_t) Marshal.PtrToStructure( p, typeof(GSStatsReceived_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSStatsReceived_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamGameServerStats + 0; + internal static GSStatsReceived_t Fill( IntPtr p ) => ((GSStatsReceived_t)Marshal.PtrToStructure( p, typeof(GSStatsReceived_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -9892,52 +5984,29 @@ public static void Install( Action action, bool server = fals { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameServerStats + 0, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamGameServerStats + 0, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameServerStats + 0, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamGameServerStats + 0, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameServerStats + 0, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct GSStatsStored_t + internal struct GSStatsStored_t : ICallbackData { internal Result Result; // m_eResult enum EResult internal ulong SteamIDUser; // m_steamIDUser class CSteamID #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSStatsStored_t) ); - internal static GSStatsStored_t Fill( IntPtr p ) => ((GSStatsStored_t)(GSStatsStored_t) Marshal.PtrToStructure( p, typeof(GSStatsStored_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSStatsStored_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamGameServerStats + 1; + internal static GSStatsStored_t Fill( IntPtr p ) => ((GSStatsStored_t)Marshal.PtrToStructure( p, typeof(GSStatsStored_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -9947,51 +6016,28 @@ public static void Install( Action action, bool server = false { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameServerStats + 1, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamGameServerStats + 1, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameServerStats + 1, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamGameServerStats + 1, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameServerStats + 1, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] - internal struct GSStatsUnloaded_t + internal struct GSStatsUnloaded_t : ICallbackData { internal ulong SteamIDUser; // m_steamIDUser class CSteamID #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSStatsUnloaded_t) ); - internal static GSStatsUnloaded_t Fill( IntPtr p ) => ((GSStatsUnloaded_t)(GSStatsUnloaded_t) Marshal.PtrToStructure( p, typeof(GSStatsUnloaded_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSStatsUnloaded_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUserStats + 8; + internal static GSStatsUnloaded_t Fill( IntPtr p ) => ((GSStatsUnloaded_t)Marshal.PtrToStructure( p, typeof(GSStatsUnloaded_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -10001,50 +6047,27 @@ public static void Install( Action action, bool server = fals { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUserStats + 8, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUserStats + 8, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUserStats + 8, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUserStats + 8, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUserStats + 8, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct AvailableBeaconLocationsUpdated_t + internal struct AvailableBeaconLocationsUpdated_t : ICallbackData { #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(AvailableBeaconLocationsUpdated_t) ); - internal static AvailableBeaconLocationsUpdated_t Fill( IntPtr p ) => ((AvailableBeaconLocationsUpdated_t)(AvailableBeaconLocationsUpdated_t) Marshal.PtrToStructure( p, typeof(AvailableBeaconLocationsUpdated_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(AvailableBeaconLocationsUpdated_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamParties + 5; + internal static AvailableBeaconLocationsUpdated_t Fill( IntPtr p ) => ((AvailableBeaconLocationsUpdated_t)Marshal.PtrToStructure( p, typeof(AvailableBeaconLocationsUpdated_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -10054,50 +6077,27 @@ public static void Install( Action action, bo { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamParties + 5, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamParties + 5, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamParties + 5, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamParties + 5, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamParties + 5, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct ActiveBeaconsUpdated_t + internal struct ActiveBeaconsUpdated_t : ICallbackData { #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ActiveBeaconsUpdated_t) ); - internal static ActiveBeaconsUpdated_t Fill( IntPtr p ) => ((ActiveBeaconsUpdated_t)(ActiveBeaconsUpdated_t) Marshal.PtrToStructure( p, typeof(ActiveBeaconsUpdated_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ActiveBeaconsUpdated_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamParties + 6; + internal static ActiveBeaconsUpdated_t Fill( IntPtr p ) => ((ActiveBeaconsUpdated_t)Marshal.PtrToStructure( p, typeof(ActiveBeaconsUpdated_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -10107,50 +6107,27 @@ public static void Install( Action action, bool server = { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamParties + 6, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamParties + 6, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamParties + 6, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamParties + 6, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamParties + 6, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct PlaybackStatusHasChanged_t + internal struct PlaybackStatusHasChanged_t : ICallbackData { #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(PlaybackStatusHasChanged_t) ); - internal static PlaybackStatusHasChanged_t Fill( IntPtr p ) => ((PlaybackStatusHasChanged_t)(PlaybackStatusHasChanged_t) Marshal.PtrToStructure( p, typeof(PlaybackStatusHasChanged_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(PlaybackStatusHasChanged_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamMusic + 1; + internal static PlaybackStatusHasChanged_t Fill( IntPtr p ) => ((PlaybackStatusHasChanged_t)Marshal.PtrToStructure( p, typeof(PlaybackStatusHasChanged_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -10160,50 +6137,27 @@ public static void Install( Action action, bool serv { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMusic + 1, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamMusic + 1, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMusic + 1, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamMusic + 1, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMusic + 1, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct BroadcastUploadStart_t + internal struct BroadcastUploadStart_t : ICallbackData { #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(BroadcastUploadStart_t) ); - internal static BroadcastUploadStart_t Fill( IntPtr p ) => ((BroadcastUploadStart_t)(BroadcastUploadStart_t) Marshal.PtrToStructure( p, typeof(BroadcastUploadStart_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(BroadcastUploadStart_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientVideo + 4; + internal static BroadcastUploadStart_t Fill( IntPtr p ) => ((BroadcastUploadStart_t)Marshal.PtrToStructure( p, typeof(BroadcastUploadStart_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -10213,50 +6167,27 @@ public static void Install( Action action, bool server = { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientVideo + 4, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientVideo + 4, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientVideo + 4, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientVideo + 4, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientVideo + 4, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct NewUrlLaunchParameters_t + internal struct NewUrlLaunchParameters_t : ICallbackData { #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(NewUrlLaunchParameters_t) ); - internal static NewUrlLaunchParameters_t Fill( IntPtr p ) => ((NewUrlLaunchParameters_t)(NewUrlLaunchParameters_t) Marshal.PtrToStructure( p, typeof(NewUrlLaunchParameters_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(NewUrlLaunchParameters_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamApps + 14; + internal static NewUrlLaunchParameters_t Fill( IntPtr p ) => ((NewUrlLaunchParameters_t)Marshal.PtrToStructure( p, typeof(NewUrlLaunchParameters_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -10266,52 +6197,29 @@ public static void Install( Action action, bool server { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamApps + 14, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamApps + 14, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamApps + 14, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamApps + 14, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamApps + 14, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct ItemInstalled_t + internal struct ItemInstalled_t : ICallbackData { internal AppId AppID; // m_unAppID AppId_t internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ItemInstalled_t) ); - internal static ItemInstalled_t Fill( IntPtr p ) => ((ItemInstalled_t)(ItemInstalled_t) Marshal.PtrToStructure( p, typeof(ItemInstalled_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ItemInstalled_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientUGC + 5; + internal static ItemInstalled_t Fill( IntPtr p ) => ((ItemInstalled_t)Marshal.PtrToStructure( p, typeof(ItemInstalled_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -10321,53 +6229,30 @@ public static void Install( Action action, bool server = false { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 5, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientUGC + 5, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 5, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientUGC + 5, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 5, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct SteamNetConnectionStatusChangedCallback_t + internal struct SteamNetConnectionStatusChangedCallback_t : ICallbackData { internal Connection Conn; // m_hConn HSteamNetConnection internal ConnectionInfo Nfo; // m_info SteamNetConnectionInfo_t internal ConnectionState OldState; // m_eOldState ESteamNetworkingConnectionState #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamNetConnectionStatusChangedCallback_t) ); - internal static SteamNetConnectionStatusChangedCallback_t Fill( IntPtr p ) => ((SteamNetConnectionStatusChangedCallback_t)(SteamNetConnectionStatusChangedCallback_t) Marshal.PtrToStructure( p, typeof(SteamNetConnectionStatusChangedCallback_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamNetConnectionStatusChangedCallback_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamNetworkingSockets + 1; + internal static SteamNetConnectionStatusChangedCallback_t Fill( IntPtr p ) => ((SteamNetConnectionStatusChangedCallback_t)Marshal.PtrToStructure( p, typeof(SteamNetConnectionStatusChangedCallback_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -10377,50 +6262,27 @@ public static void Install( Action ac { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamNetworkingSockets + 1, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamNetworkingSockets + 1, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamNetworkingSockets + 1, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamNetworkingSockets + 1, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamNetworkingSockets + 1, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct SteamInventoryDefinitionUpdate_t + internal struct SteamInventoryDefinitionUpdate_t : ICallbackData { #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryDefinitionUpdate_t) ); - internal static SteamInventoryDefinitionUpdate_t Fill( IntPtr p ) => ((SteamInventoryDefinitionUpdate_t)(SteamInventoryDefinitionUpdate_t) Marshal.PtrToStructure( p, typeof(SteamInventoryDefinitionUpdate_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryDefinitionUpdate_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.ClientInventory + 2; + internal static SteamInventoryDefinitionUpdate_t Fill( IntPtr p ) => ((SteamInventoryDefinitionUpdate_t)Marshal.PtrToStructure( p, typeof(SteamInventoryDefinitionUpdate_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -10430,50 +6292,27 @@ public static void Install( Action action, boo { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientInventory + 2, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.ClientInventory + 2, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientInventory + 2, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.ClientInventory + 2, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientInventory + 2, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct SteamParentalSettingsChanged_t + internal struct SteamParentalSettingsChanged_t : ICallbackData { #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamParentalSettingsChanged_t) ); - internal static SteamParentalSettingsChanged_t Fill( IntPtr p ) => ((SteamParentalSettingsChanged_t)(SteamParentalSettingsChanged_t) Marshal.PtrToStructure( p, typeof(SteamParentalSettingsChanged_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamParentalSettingsChanged_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamParentalSettings + 1; + internal static SteamParentalSettingsChanged_t Fill( IntPtr p ) => ((SteamParentalSettingsChanged_t)Marshal.PtrToStructure( p, typeof(SteamParentalSettingsChanged_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -10483,50 +6322,27 @@ public static void Install( Action action, bool { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamParentalSettings + 1, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamParentalSettings + 1, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamParentalSettings + 1, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamParentalSettings + 1, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamParentalSettings + 1, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct SteamServersConnected_t + internal struct SteamServersConnected_t : ICallbackData { #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamServersConnected_t) ); - internal static SteamServersConnected_t Fill( IntPtr p ) => ((SteamServersConnected_t)(SteamServersConnected_t) Marshal.PtrToStructure( p, typeof(SteamServersConnected_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamServersConnected_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUser + 1; + internal static SteamServersConnected_t Fill( IntPtr p ) => ((SteamServersConnected_t)Marshal.PtrToStructure( p, typeof(SteamServersConnected_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -10536,40 +6352,15 @@ public static void Install( Action action, bool server { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUser + 1, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUser + 1, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUser + 1, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUser + 1, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUser + 1, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } @@ -10583,13 +6374,15 @@ internal struct NewLaunchQueryParameters_t } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct GCMessageAvailable_t + internal struct GCMessageAvailable_t : ICallbackData { internal uint MessageSize; // m_nMessageSize uint32 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GCMessageAvailable_t) ); - internal static GCMessageAvailable_t Fill( IntPtr p ) => ((GCMessageAvailable_t)(GCMessageAvailable_t) Marshal.PtrToStructure( p, typeof(GCMessageAvailable_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GCMessageAvailable_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamGameCoordinator + 1; + internal static GCMessageAvailable_t Fill( IntPtr p ) => ((GCMessageAvailable_t)Marshal.PtrToStructure( p, typeof(GCMessageAvailable_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -10599,50 +6392,27 @@ public static void Install( Action action, bool server = f { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameCoordinator + 1, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamGameCoordinator + 1, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameCoordinator + 1, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamGameCoordinator + 1, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameCoordinator + 1, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct GCMessageFailed_t + internal struct GCMessageFailed_t : ICallbackData { #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GCMessageFailed_t) ); - internal static GCMessageFailed_t Fill( IntPtr p ) => ((GCMessageFailed_t)(GCMessageFailed_t) Marshal.PtrToStructure( p, typeof(GCMessageFailed_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GCMessageFailed_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamGameCoordinator + 2; + internal static GCMessageFailed_t Fill( IntPtr p ) => ((GCMessageFailed_t)Marshal.PtrToStructure( p, typeof(GCMessageFailed_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -10652,50 +6422,27 @@ public static void Install( Action action, bool server = fals { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameCoordinator + 2, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamGameCoordinator + 2, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameCoordinator + 2, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamGameCoordinator + 2, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameCoordinator + 2, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct ScreenshotRequested_t + internal struct ScreenshotRequested_t : ICallbackData { #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ScreenshotRequested_t) ); - internal static ScreenshotRequested_t Fill( IntPtr p ) => ((ScreenshotRequested_t)(ScreenshotRequested_t) Marshal.PtrToStructure( p, typeof(ScreenshotRequested_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ScreenshotRequested_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamScreenshots + 2; + internal static ScreenshotRequested_t Fill( IntPtr p ) => ((ScreenshotRequested_t)Marshal.PtrToStructure( p, typeof(ScreenshotRequested_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -10705,50 +6452,27 @@ public static void Install( Action action, bool server = { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamScreenshots + 2, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamScreenshots + 2, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamScreenshots + 2, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamScreenshots + 2, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamScreenshots + 2, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct LicensesUpdated_t + internal struct LicensesUpdated_t : ICallbackData { #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LicensesUpdated_t) ); - internal static LicensesUpdated_t Fill( IntPtr p ) => ((LicensesUpdated_t)(LicensesUpdated_t) Marshal.PtrToStructure( p, typeof(LicensesUpdated_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LicensesUpdated_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUser + 25; + internal static LicensesUpdated_t Fill( IntPtr p ) => ((LicensesUpdated_t)Marshal.PtrToStructure( p, typeof(LicensesUpdated_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -10758,50 +6482,27 @@ public static void Install( Action action, bool server = fals { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUser + 25, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUser + 25, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUser + 25, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUser + 25, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUser + 25, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct SteamShutdown_t + internal struct SteamShutdown_t : ICallbackData { #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamShutdown_t) ); - internal static SteamShutdown_t Fill( IntPtr p ) => ((SteamShutdown_t)(SteamShutdown_t) Marshal.PtrToStructure( p, typeof(SteamShutdown_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamShutdown_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUtils + 4; + internal static SteamShutdown_t Fill( IntPtr p ) => ((SteamShutdown_t)Marshal.PtrToStructure( p, typeof(SteamShutdown_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -10811,50 +6512,27 @@ public static void Install( Action action, bool server = false { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUtils + 4, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUtils + 4, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUtils + 4, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUtils + 4, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUtils + 4, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct IPCountry_t + internal struct IPCountry_t : ICallbackData { #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(IPCountry_t) ); - internal static IPCountry_t Fill( IntPtr p ) => ((IPCountry_t)(IPCountry_t) Marshal.PtrToStructure( p, typeof(IPCountry_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(IPCountry_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUtils + 1; + internal static IPCountry_t Fill( IntPtr p ) => ((IPCountry_t)Marshal.PtrToStructure( p, typeof(IPCountry_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -10864,51 +6542,28 @@ public static void Install( Action action, bool server = false ) { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUtils + 1, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUtils + 1, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUtils + 1, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUtils + 1, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUtils + 1, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] - internal struct IPCFailure_t + internal struct IPCFailure_t : ICallbackData { internal byte FailureType; // m_eFailureType uint8 #region SteamCallback - internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(IPCFailure_t) ); - internal static IPCFailure_t Fill( IntPtr p ) => ((IPCFailure_t)(IPCFailure_t) Marshal.PtrToStructure( p, typeof(IPCFailure_t) ) ); + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(IPCFailure_t) ); + public int DataSize => _datasize; + public int CallbackId => CallbackIdentifiers.SteamUser + 17; + internal static IPCFailure_t Fill( IntPtr p ) => ((IPCFailure_t)Marshal.PtrToStructure( p, typeof(IPCFailure_t) ) ); static Action actionClient; [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); @@ -10918,40 +6573,15 @@ public static void Install( Action action, bool server = false ) { if ( server ) { - Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUser + 17, true ); + Event.Register( OnServer, _datasize, CallbackIdentifiers.SteamUser + 17, true ); actionServer = action; } else { - Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUser + 17, false ); + Event.Register( OnClient, _datasize, CallbackIdentifiers.SteamUser + 17, false ); actionClient = action; } } - public static async Task GetResultAsync( SteamAPICall_t handle ) - { - bool failed = false; - - while ( !SteamUtils.IsCallComplete( handle, out failed ) ) - { - await Task.Delay( 1 ); - if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; - } - if ( failed ) return null; - - var ptr = Marshal.AllocHGlobal( StructSize ); - - try - { - if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUser + 17, ref failed ) || failed ) - return null; - - return Fill( ptr ); - } - finally - { - Marshal.FreeHGlobal( ptr ); - } - } #endregion } diff --git a/Facepunch.Steamworks/SteamApps.cs b/Facepunch.Steamworks/SteamApps.cs index b01210f..54b57c5 100644 --- a/Facepunch.Steamworks/SteamApps.cs +++ b/Facepunch.Steamworks/SteamApps.cs @@ -251,7 +251,7 @@ public static DownloadProgress DlcDownloadProgress( AppId appid ) /// public static async Task GetFileDetailsAsync( string filename ) { - var r = await Internal.GetFileDetails( filename ); + var r = await Internal.GetFileDetails( filename ).GetAsync(); if ( !r.HasValue || r.Value.Result != Result.OK ) return null; diff --git a/Facepunch.Steamworks/SteamFriends.cs b/Facepunch.Steamworks/SteamFriends.cs index df21149..cd0ca45 100644 --- a/Facepunch.Steamworks/SteamFriends.cs +++ b/Facepunch.Steamworks/SteamFriends.cs @@ -300,13 +300,13 @@ public static bool ListenForFriendsMessages public static async Task IsFollowing(SteamId steamID) { - var r = await Internal.IsFollowing(steamID); + var r = await Internal.IsFollowing(steamID).GetAsync(); return r.Value.IsFollowing; } public static async Task GetFollowerCount(SteamId steamID) { - var r = await Internal.GetFollowerCount(steamID); + var r = await Internal.GetFollowerCount(steamID).GetAsync(); return r.Value.Count; } @@ -319,7 +319,7 @@ public static async Task GetFollowingList() do { - if ((result = await Internal.EnumerateFollowingList((uint)resultCount)) != null) + if ( (result = await Internal.EnumerateFollowingList((uint)resultCount).GetAsync()) != null) { resultCount += result.Value.ResultsReturned; diff --git a/Facepunch.Steamworks/SteamInput.cs b/Facepunch.Steamworks/SteamInput.cs index 5d897dc..ab83cfd 100644 --- a/Facepunch.Steamworks/SteamInput.cs +++ b/Facepunch.Steamworks/SteamInput.cs @@ -28,7 +28,7 @@ internal static void Shutdown() { if ( _internal != null && _internal.IsValid ) { - _internal.DoShutdown(); + _internal.Shutdown(); } _internal = null; @@ -36,7 +36,7 @@ internal static void Shutdown() internal static void InstallEvents() { - Internal.DoInit(); + Internal.Init(); Internal.RunFrame(); // None? diff --git a/Facepunch.Steamworks/SteamServerStats.cs b/Facepunch.Steamworks/SteamServerStats.cs index 239807a..e75ad17 100644 --- a/Facepunch.Steamworks/SteamServerStats.cs +++ b/Facepunch.Steamworks/SteamServerStats.cs @@ -47,7 +47,7 @@ public static async Task RequestUserStats( SteamId steamid ) /// public static bool SetInt( SteamId steamid, string name, int stat ) { - return Internal.SetUserStat1( steamid, name, stat ); + return Internal.SetUserStat( steamid, name, stat ); } /// @@ -56,7 +56,7 @@ public static bool SetInt( SteamId steamid, string name, int stat ) /// public static bool SetFloat( SteamId steamid, string name, float stat ) { - return Internal.SetUserStat2( steamid, name, stat ); + return Internal.SetUserStat( steamid, name, stat ); } /// diff --git a/Facepunch.Steamworks/Structs/InventoryItem.cs b/Facepunch.Steamworks/Structs/InventoryItem.cs index c9e21cc..27c76a5 100644 --- a/Facepunch.Steamworks/Structs/InventoryItem.cs +++ b/Facepunch.Steamworks/Structs/InventoryItem.cs @@ -130,17 +130,20 @@ public DateTime Acquired { if ( Properties == null ) return DateTime.UtcNow; - var str = Properties["acquired"]; + if ( Properties.TryGetValue( "acquired", out var str ) ) + { + var y = int.Parse( str.Substring( 0, 4 ) ); + var m = int.Parse( str.Substring( 4, 2 ) ); + var d = int.Parse( str.Substring( 6, 2 ) ); - var y = int.Parse( str.Substring( 0, 4 ) ); - var m = int.Parse( str.Substring( 4, 2 ) ); - var d = int.Parse( str.Substring( 6, 2 ) ); + var h = int.Parse( str.Substring( 9, 2 ) ); + var mn = int.Parse( str.Substring( 11, 2 ) ); + var s = int.Parse( str.Substring( 13, 2 ) ); - var h = int.Parse( str.Substring( 9, 2 ) ); - var mn = int.Parse( str.Substring( 11, 2 ) ); - var s = int.Parse( str.Substring( 13, 2 ) ); + return new DateTime( y, m, d, h, mn, s, DateTimeKind.Utc ); + } - return new DateTime( y, m, d, h, mn, s, DateTimeKind.Utc ); + return DateTime.UtcNow; } } @@ -153,7 +156,11 @@ public string Origin get { if ( Properties == null ) return null; - return Properties["origin"]; + + if ( Properties.TryGetValue( "origin", out var str ) ) + return str; + + return null; } } diff --git a/Facepunch.Steamworks/Structs/Leaderboard.cs b/Facepunch.Steamworks/Structs/Leaderboard.cs index 2010a33..ca71dd2 100644 --- a/Facepunch.Steamworks/Structs/Leaderboard.cs +++ b/Facepunch.Steamworks/Structs/Leaderboard.cs @@ -28,7 +28,7 @@ public struct Leaderboard { if ( details == null ) details = noDetails; - var r = await SteamUserStats.Internal.UploadLeaderboardScore( Id, LeaderboardUploadScoreMethod.ForceUpdate, score, details, details.Length ); + var r = await SteamUserStats.Internal.UploadLeaderboardScore( Id, LeaderboardUploadScoreMethod.ForceUpdate, score, details, details.Length ).GetAsync(); if ( !r.HasValue ) return null; return LeaderboardUpdate.From( r.Value ); @@ -41,7 +41,7 @@ public struct Leaderboard { if ( details == null ) details = noDetails; - var r = await SteamUserStats.Internal.UploadLeaderboardScore( Id, LeaderboardUploadScoreMethod.KeepBest, score, details, details.Length ); + var r = await SteamUserStats.Internal.UploadLeaderboardScore( Id, LeaderboardUploadScoreMethod.KeepBest, score, details, details.Length ).GetAsync(); if ( !r.HasValue ) return null; return LeaderboardUpdate.From( r.Value ); @@ -52,7 +52,7 @@ public struct Leaderboard /// public async Task AttachUgc( Ugc file ) { - var r = await SteamUserStats.Internal.AttachLeaderboardUGC( Id, file.Handle ); + var r = await SteamUserStats.Internal.AttachLeaderboardUGC( Id, file.Handle ).GetAsync(); if ( !r.HasValue ) return Result.Fail; return r.Value.Result; @@ -65,7 +65,7 @@ public async Task GetScoresAsync( int count, int offset = 1 { if ( offset <= 0 ) throw new System.ArgumentException( "Should be 1+", nameof( offset ) ); - var r = await SteamUserStats.Internal.DownloadLeaderboardEntries( Id, LeaderboardDataRequest.Global, offset, offset + count ); + var r = await SteamUserStats.Internal.DownloadLeaderboardEntries( Id, LeaderboardDataRequest.Global, offset, offset + count ).GetAsync(); if ( !r.HasValue ) return null; @@ -80,7 +80,7 @@ public async Task GetScoresAsync( int count, int offset = 1 /// public async Task GetScoresAroundUserAsync( int start = -10, int end = 10 ) { - var r = await SteamUserStats.Internal.DownloadLeaderboardEntries( Id, LeaderboardDataRequest.GlobalAroundUser, start, end ); + var r = await SteamUserStats.Internal.DownloadLeaderboardEntries( Id, LeaderboardDataRequest.GlobalAroundUser, start, end ).GetAsync(); if ( !r.HasValue ) return null; @@ -92,7 +92,7 @@ public async Task GetScoresAroundUserAsync( int start = -10, /// public async Task GetScoresFromFriendsAsync() { - var r = await SteamUserStats.Internal.DownloadLeaderboardEntries( Id, LeaderboardDataRequest.Friends, 0, 0 ); + var r = await SteamUserStats.Internal.DownloadLeaderboardEntries( Id, LeaderboardDataRequest.Friends, 0, 0 ).GetAsync(); if ( !r.HasValue ) return null; diff --git a/Generator/Cleanup.cs b/Generator/Cleanup.cs index fd0ccd2..cb5eb06 100644 --- a/Generator/Cleanup.cs +++ b/Generator/Cleanup.cs @@ -10,6 +10,9 @@ public static class Cleanup { public static string ConvertType( string type ) { + type = type.Replace( "class ", "" ); + type = type.Replace( "struct ", "" ); + type = type.Replace( "CSteamID", "SteamId" ); type = type.Replace( "CGameID", "GameId" ); type = type.Replace( "PersonaState", "FriendState" ); diff --git a/Generator/CodeParser/CodeParser.Class.cs b/Generator/CodeParser/CodeParser.Class.cs deleted file mode 100644 index bcb72d7..0000000 --- a/Generator/CodeParser/CodeParser.Class.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text.RegularExpressions; - -namespace Generator -{ - partial class CodeParser - { - public class Class - { - public string Name; - public string InterfaceString; - - public class Function - { - public string Name; - public string DuplicateName; - public Dictionary Arguments = new Dictionary(); - - public string ReturnType; - public string CallResult; - } - - public List Functions = new List(); - - internal Function AddFunction( string funcName, string returnType, string args ) - { - if ( funcName == "Init" ) funcName = "DoInit"; - if ( funcName == "Shutdown" ) funcName = "DoShutdown"; - - var f = new Function - { - Name = funcName, - ReturnType = returnType - }; - - args = Regex.Replace( args, "", "" ); - - foreach ( var arg in args.Split( new[] { ',' }, StringSplitOptions.RemoveEmptyEntries ) ) - { - var m = Regex.Match( arg.Trim(), @"(.+?[ |\*|\&])?([a-zA-Z0-9_]+?)( = (.+?))?$" ); - - var t = m.Groups[1].Value.Trim(); - var n = m.Groups[2].Value.Trim(); - - t = Cleanup.ConvertType( t ); - - f.Arguments.Add( n, t ); - } - - Functions.Add( f ); - - return f; - } - - public void PostProcess() - { - var duplicateFunctions = Functions - .GroupBy( x => x.Name ) - .Where( x => x.Count() > 1 ); - - foreach ( var group in duplicateFunctions ) - { - var g = group.ToArray(); - for ( int i=0; i< g.Count(); i++ ) - { - g[i].DuplicateName = g[i].Name; - g[i].Name = $"{g[i].Name}{i+1}"; - } - } - } - } - - } -} diff --git a/Generator/CodeParser/ParseClasses.cs b/Generator/CodeParser/ParseClasses.cs deleted file mode 100644 index 5ebc6a7..0000000 --- a/Generator/CodeParser/ParseClasses.cs +++ /dev/null @@ -1,155 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; - -namespace Generator -{ - partial class CodeParser - { - public List Classes = new List(); - - public void ParseClasses() - { - var source = RemoveAnnotations( Content ); - - { - var r = new Regex( @"class ([a-zA-Z]+)[\r|\n]+{[\r|\n]((?s).*?)};" ); - var ma = r.Matches( source ); - - foreach ( Match m in ma ) - { - ProcessClass( m.Groups[0].Value.Trim(), m.Groups[1].Value.Trim(), m.Groups[2].Value.Trim() ); - //def.CallbackIds.Add( m.Groups[1].Value.Substring( 3 ).Replace( "Callbacks", "" ), int.Parse( m.Groups[2].Value ) ); - } - } - - Console.WriteLine( "OKay" ); - } - - public void ProcessClass( string fulldef, string classname, string inner ) - { - Console.WriteLine( $"Class: {classname} " ); - - var lines = inner.Split( new[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries ); - - var func = new Regex( @"virtual (.+[\t |\*])([a-z0-9A-Z]+?)\((.+?)?\) = 0 ?;$" ); - - var c = new Class(); - c.Name = classname; - - var interfaceMatch = Regex.Match( Content, $"#define {classname.ToUpper().Substring( 1 )}_INTERFACE_VERSION \"(.+?)\"" ); - if ( interfaceMatch.Success ) - { - c.InterfaceString = interfaceMatch.Groups[1].Value; - } - - var lastCallResult = ""; - - var partialLine = ""; - - var needsEndIf = false; - - foreach ( var linestr in lines ) - { - var line = linestr.Trim(); - - var commentPos = line.IndexOf( "//" ); - if ( commentPos > 0 ) - line = line.Substring( 0, commentPos-1 ).Trim(); - - if ( line.Trim().Length < 4 ) continue; - if ( line.Trim().StartsWith( "public:" ) ) continue; - if ( line.Trim().StartsWith( "//" ) ) continue; - - if ( line.Trim().StartsWith( "#ifdef _PS3" ) || line.Trim().StartsWith( "#if defined(_PS3)" ) ) - { - needsEndIf = true; - continue; - } - - if ( needsEndIf ) - { - needsEndIf = !line.Trim().StartsWith( "#endif" ); - continue; - } - - var callresult = Regex.Match( line, @"STEAM_CALL_RESULT\((.+?)\)" ); - if ( callresult.Success ) - { - partialLine = ""; - lastCallResult = callresult.Groups[1].Value.Trim(); - continue; - } - - if ( !string.IsNullOrEmpty( partialLine ) ) - { - partialLine += " " + line.Trim(); - - if ( !partialLine.Trim().EndsWith( ";" ) ) - continue; - - line = partialLine; - partialLine = ""; - } - - var f = func.Match( line ); - if ( f.Success ) - { - var returnType = f.Groups[1].Value.Trim(); - var funcName = f.Groups[2].Value.Trim(); - var args = f.Groups[3].Value.Trim(); - // Console.WriteLine( $"Function: {funcName} returns {returnType} with args {args}" ); - - if ( funcName == "RequestUGCDetails" ) lastCallResult = "SteamUGCRequestUGCDetailsResult_t"; - if ( funcName == "DownloadClanActivityCounts" ) lastCallResult = "DownloadClanActivityCountsResult_t"; - - if ( funcName.Contains( ' ' ) || funcName.Contains( '*' ) ) - throw new System.Exception( "Parsing Error!" ); - - var fnc = c.AddFunction( funcName, returnType, args ); - - fnc.CallResult = lastCallResult; - lastCallResult = null; - partialLine = ""; - } - else - { - if ( line.Trim().StartsWith( "virtual " ) ) - { - partialLine = line; - } - - Console.WriteLine( $"Unknown Line: {line}" ); - } - } - - c.PostProcess(); - - Classes.Add( c ); - } - - public string RemoveAnnotations( string str ) - { - str = Regex.Replace( str, @"STEAM_OUT_ARRAY_CALL\((.+?)\)", "" ); - str = Regex.Replace( str, @"STEAM_PRIVATE_API\((.+)\)", "$1" ); - str = Regex.Replace( str, @"STEAM_ARRAY_COUNT\((.+?)\) ", "" ); - str = Regex.Replace( str, @"STEAM_OUT_STRUCT\(\) ", "" ); - str = Regex.Replace( str, @"STEAM_OUT_STRUCT\((.+?)\) ", "" ); - str = Regex.Replace( str, @"STEAM_OUT_ARRAY_COUNT\((.+?)\)", "" ); - str = Regex.Replace( str, @"STEAM_ARRAY_COUNT_D\((.+?)\)", "" ); - str = Regex.Replace( str, @"STEAM_OUT_STRING_COUNT\((.+?)\)", "" ); - str = Regex.Replace( str, @"STEAM_OUT_STRING\(\) ", "" ); - str = Regex.Replace( str, @"STEAM_OUT_BUFFER_COUNT\((.+?)\) ", "" ); - str = Regex.Replace( str, @"STEAM_BUFFER_COUNT\((.+?)\) ", "" ); - str = Regex.Replace( str, @"STEAM_DESC\((.+?)\) ", "" ); - - - - return str; - } - - } -} diff --git a/Generator/CodeWriter/ClassVTable.cs b/Generator/CodeWriter/ClassVTable.cs index 85f13e6..74f79e6 100644 --- a/Generator/CodeWriter/ClassVTable.cs +++ b/Generator/CodeWriter/ClassVTable.cs @@ -10,8 +10,6 @@ public partial class CodeWriter { public void GenerateVTableClass( string className, string filename ) { - var clss = Parser.Classes.Single( x => x.Name == className ); - sb = new StringBuilder(); WriteLine( $"using System;" ); @@ -25,22 +23,23 @@ public void GenerateVTableClass( string className, string filename ) StartBlock( $"namespace Steamworks" ); { - StartBlock( $"internal class {clss.Name} : SteamInterface" ); + StartBlock( $"internal class {className} : SteamInterface" ); { - WriteLine( $"public override string InterfaceName => \"{clss.InterfaceString}\";" ); - WriteLine(); + //WriteLine( $"public override string InterfaceName => \"{clss.InterfaceString}\";" ); + //WriteLine(); - WriteFunctionPointerReader( clss ); + WriteFunctionPointerReader(); WriteLine(); - foreach ( var func in clss.Functions ) + var functions = def.methods.Where( x => x.ClassName == className ); + + foreach ( var func in functions ) { - if ( Cleanup.IsDeprecated( $"{clss.Name}.{func.Name}" ) ) + if ( Cleanup.IsDeprecated( $"{func.ClassName}.{func.Name}" ) ) continue; - - WriteFunction( clss, func ); + WriteFunction( func ); WriteLine(); } @@ -52,89 +51,10 @@ public void GenerateVTableClass( string className, string filename ) System.IO.File.WriteAllText( $"{filename}", sb.ToString() ); } - void WriteFunctionPointerReader( CodeParser.Class clss ) + void WriteFunctionPointerReader() { - // TODO - we'll probably have to do this PER platform - - int[] standardLocations = new int[clss.Functions.Count]; - int[] windowsLocations = new int[clss.Functions.Count]; - - for ( int i = 0; i < clss.Functions.Count; i++ ) - { - windowsLocations[i] = i * 8; - standardLocations[i] = i * 8; - } - - // - // MSVC switches the order in the vtable of overloaded functions - // I'm not going to try to try to work out how to order shit - // so lets just manually fix shit here - // - if ( clss.Name == "ISteamUserStats" ) - { - Swap( clss, "GetStat1", "GetStat2", windowsLocations ); - Swap( clss, "SetStat1", "SetStat2", windowsLocations ); - Swap( clss, "GetUserStat1", "GetUserStat2", windowsLocations ); - Swap( clss, "GetGlobalStat1", "GetGlobalStat2", windowsLocations ); - Swap( clss, "GetGlobalStatHistory1", "GetGlobalStatHistory2", windowsLocations ); - } - - if ( clss.Name == "ISteamGameServerStats" ) - { - Swap( clss, "GetUserStat1", "GetUserStat2", windowsLocations ); - Swap( clss, "SetUserStat1", "SetUserStat2", windowsLocations ); - } - - if ( clss.Name == "ISteamUGC" ) - { - Swap( clss, "CreateQueryAllUGCRequest1", "CreateQueryAllUGCRequest2", windowsLocations ); - } - - StartBlock( $"public override void InitInternals()" ); { - var different = new List(); - - /* - for ( int i = 0; i < clss.Functions.Count; i++ ) - { - var func = clss.Functions[i]; - - if ( Cleanup.IsDeprecated( $"{clss.Name}.{func.Name}" ) ) - { - WriteLine( $" // {func.Name} is deprecated" ); - } - else - { - if ( standardLocations[i] != windowsLocations[i] ) - { - different.Add( i ); - continue; - } - - //WriteLine( $"_{func.Name} = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( {standardLocations[i]} ) ) );" ); - } - } - - - if ( different.Count > 0 ) - { - WriteLine( "" ); - WriteLine( "#if PLATFORM_WIN" ); - foreach ( var i in different ) - { - var func = clss.Functions[i]; - WriteLine( $"_{func.Name} = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( {windowsLocations[i]} ) ) );" ); - } - WriteLine( "#else" ); - foreach ( var i in different ) - { - var func = clss.Functions[i]; - WriteLine( $"_{func.Name} = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( {standardLocations[i]} ) ) );" ); - } - WriteLine( "#endif" ); - }*/ - } EndBlock(); @@ -142,51 +62,21 @@ void WriteFunctionPointerReader( CodeParser.Class clss ) { WriteLine( $"base.Shutdown();" ); WriteLine( "" ); - - for ( int i = 0; i < clss.Functions.Count; i++ ) - { - var func = clss.Functions[i]; - var returnType = BaseType.Parse( func.ReturnType ); - var args = func.Arguments.Select( x => BaseType.Parse( x.Value, x.Key ) ).ToArray(); - var windowsSpecific = NeedsWindowsSpecificFunction( func, returnType, args ); - - if ( Cleanup.IsDeprecated( $"{clss.Name}.{func.Name}" ) ) - continue; - - //WriteLine( $"_{func.Name} = null;" ); - } } EndBlock(); } - private bool NeedsWindowsSpecificFunction( CodeParser.Class.Function func, BaseType returnType, BaseType[] args ) - { - if ( returnType.IsReturnedWeird ) return true; - if ( returnType.WindowsSpecific ) return true; - if ( args.Any( x => x.WindowsSpecific ) ) return true; - - return false; - } - - - private void Swap( CodeParser.Class clss, string v1, string v2, int[] locations ) - { - var a = clss.Functions.IndexOf( clss.Functions.Single( x => x.Name == v1 ) ); - var b = clss.Functions.IndexOf( clss.Functions.Single( x => x.Name == v2 ) ); - - var s = locations[a]; - locations[a] = locations[b]; - locations[b] = s; - } - - private void WriteFunction( CodeParser.Class clss, CodeParser.Class.Function func ) + private void WriteFunction( SteamApiDefinition.MethodDef func ) { var returnType = BaseType.Parse( func.ReturnType ); returnType.Func = func.Name; - var args = func.Arguments.Select( x => + if ( func.Params == null ) + func.Params = new SteamApiDefinition.MethodDef.ParamType[0]; + + var args = func.Params.Select( x => { - var bt = BaseType.Parse( x.Value, x.Key ); + var bt = BaseType.Parse( x.Type, x.Name ); bt.Func = func.Name; return bt; } ).ToArray(); @@ -212,8 +102,6 @@ private void WriteFunction( CodeParser.Class clss, CodeParser.Class.Function fun var argstr = string.Join( ", ", args.Where( x => !x.ShouldSkipAsArgument ).Select( x => x.AsArgument() ) ); ; var delegateargstr = string.Join( ", ", args.Select( x => x.AsNativeArgument() ) ); - var windowsSpecific = NeedsWindowsSpecificFunction( func, returnType, args ); - if ( returnType is SteamApiCallType sap ) { sap.CallResult = func.CallResult; @@ -223,26 +111,12 @@ private void WriteFunction( CodeParser.Class clss, CodeParser.Class.Function fun WriteLine( $"#region FunctionMeta" ); - WriteLine( $"[UnmanagedFunctionPointer( Platform.MemberConvention )]" ); - - if ( returnType.ReturnAttribute != null) + WriteLine( $"[DllImport( Platform.LibraryName, EntryPoint = \"SteamAPI_{func.ClassName}_{func.Name}\")]" ); + + if ( returnType.ReturnAttribute != null ) WriteLine( returnType.ReturnAttribute ); - if ( returnType.IsReturnedWeird ) - { - WriteLine( "#if PLATFORM_WIN" ); - WriteLine( $"private delegate void F{func.Name}( IntPtr self, ref {returnType.TypeName} retVal, {delegateargstr} );".Replace( " retVal, )", " retVal )" ) ); - WriteLine( "#else" ); - } - - WriteLine( $"private delegate {returnType.TypeNameFrom} F{func.Name}( IntPtr self, {delegateargstr} );".Replace( "( IntPtr self, )", "( IntPtr self )" ) ); - - if ( returnType.IsReturnedWeird ) - { - WriteLine( "#endif" ); - } - - WriteLine( $"private F{func.Name} _{func.Name};" ); + WriteLine( $"private static extern {returnType.TypeNameFrom} _{func.Name}( IntPtr self, {delegateargstr} );".Replace( "( IntPtr self, )", "( IntPtr self )" ) ); WriteLine(); WriteLine( $"#endregion" ); @@ -262,20 +136,6 @@ private void WriteFunction( CodeParser.Class clss, CodeParser.Class.Function fun } } - // - // The actual call - // - if ( returnType.IsReturnedWeird ) - { - WriteLine( "#if PLATFORM_WIN" ); - { - WriteLine( $"var retVal = default( {returnType.TypeName} );" ); - WriteLine( $"_{func.Name}( Self, ref retVal, {callargs} );".Replace( ", );", " );" ) ); - WriteLine( $"{returnType.Return( "retVal" )}" ); - } - WriteLine( "#else" ); - } - if ( returnType.IsVoid ) { WriteLine( $"_{func.Name}( Self, {callargs} );".Replace( "( Self, )", "( Self )" ) ); @@ -303,11 +163,6 @@ private void WriteFunction( CodeParser.Class clss, CodeParser.Class.Function fun { WriteLine( returnType.Return( "returnValue" ) ); } - - if ( returnType.IsReturnedWeird ) - { - WriteLine( "#endif" ); - } } EndBlock(); } diff --git a/Generator/CodeWriter/Struct.cs b/Generator/CodeWriter/Struct.cs index 69059f4..6306aff 100644 --- a/Generator/CodeWriter/Struct.cs +++ b/Generator/CodeWriter/Struct.cs @@ -56,12 +56,15 @@ void Structs() int defaultPack = c.IsPack4OnWindows ? 4 : 8; var isCallback = !string.IsNullOrEmpty( c.CallbackId ); + var iface = ""; + if ( isCallback ) + iface = " : ICallbackData"; - // - // Main struct - // - WriteLine( $"[StructLayout( LayoutKind.Sequential, Pack = Platform.{(c.IsPack4OnWindows?"StructPackSize": "StructPlatformPackSize")} )]" ); - StartBlock( $"{Cleanup.Expose( name )} struct {name}" ); + // + // Main struct + // + WriteLine( $"[StructLayout( LayoutKind.Sequential, Pack = Platform.{(c.IsPack4OnWindows?"StructPackSize": "StructPlatformPackSize")} )]" ); + StartBlock( $"{Cleanup.Expose( name )} struct {name}{iface}" ); { // // The fields @@ -74,8 +77,11 @@ void Structs() WriteLine( "#region SteamCallback" ); { - WriteLine( $"internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof({name}) );" ); - WriteLine( $"internal static {name} Fill( IntPtr p ) => (({name})({name}) Marshal.PtrToStructure( p, typeof({name}) ) );" ); + WriteLine( $"public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof({name}) );" ); + WriteLine( $"public int DataSize => _datasize;" ); + WriteLine( $"public int CallbackId => {c.CallbackId};" ); + + WriteLine( $"internal static {name} Fill( IntPtr p ) => (({name})Marshal.PtrToStructure( p, typeof({name}) ) );" ); WriteLine(); WriteLine( $"static Action<{name}> actionClient;" ); WriteLine( $"[MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) );" ); @@ -87,47 +93,18 @@ void Structs() { StartBlock( "if ( server )" ); { - WriteLine( $"Event.Register( OnServer, StructSize, {c.CallbackId}, true );" ); + WriteLine( $"Event.Register( OnServer, _datasize, {c.CallbackId}, true );" ); WriteLine( $"actionServer = action;" ); } Else(); { - WriteLine( $"Event.Register( OnClient, StructSize, {c.CallbackId}, false );" ); + WriteLine( $"Event.Register( OnClient, _datasize, {c.CallbackId}, false );" ); WriteLine( $"actionClient = action;" ); } EndBlock(); } EndBlock(); - - StartBlock( $"public static async Task<{name}?> GetResultAsync( SteamAPICall_t handle )" ); - { - WriteLine( $"bool failed = false;" ); - WriteLine(); - StartBlock( $"while ( !SteamUtils.IsCallComplete( handle, out failed ) )" ); - { - WriteLine( $"await Task.Delay( 1 );" ); - WriteLine( $"if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null;" ); - } - EndBlock(); - - WriteLine( $"if ( failed ) return null;" ); - WriteLine( $"" ); - WriteLine( $"var ptr = Marshal.AllocHGlobal( StructSize );" ); - WriteLine( $"" ); - WriteLine( $"try" ); - WriteLine( $"{{" ); - WriteLine( $" if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, {c.CallbackId}, ref failed ) || failed )" ); - WriteLine( $" return null;" ); - WriteLine( $"" ); - WriteLine( $" return Fill( ptr );" ); - WriteLine( $"}}" ); - WriteLine( $"finally" ); - WriteLine( $"{{" ); - WriteLine( $" Marshal.FreeHGlobal( ptr );" ); - WriteLine( $"}}" ); - } - EndBlock(); } WriteLine( "#endregion" ); } diff --git a/Generator/CodeWriter/Types/BaseType.cs b/Generator/CodeWriter/Types/BaseType.cs index 1e03c50..f017d1f 100644 --- a/Generator/CodeWriter/Types/BaseType.cs +++ b/Generator/CodeWriter/Types/BaseType.cs @@ -172,8 +172,8 @@ internal class SteamApiCallType : BaseType { public string CallResult; public override string TypeName => "SteamAPICall_t"; - public override string Return( string varname ) => $"return await {CallResult}.GetResultAsync( {varname} );"; - public override string ReturnType => $"async Task<{CallResult}?>"; + public override string Return( string varname ) => $"return new CallbackResult( {varname} );"; + public override string ReturnType => $"CallbackResult"; } internal class CSteamIdType : BaseType diff --git a/Generator/Generator.csproj b/Generator/Generator.csproj index 009fd46..70745ff 100644 --- a/Generator/Generator.csproj +++ b/Generator/Generator.csproj @@ -47,9 +47,7 @@ - - diff --git a/Generator/Program.cs b/Generator/Program.cs index 57f9790..3dad0c5 100644 --- a/Generator/Program.cs +++ b/Generator/Program.cs @@ -20,7 +20,6 @@ static void Main( string[] args ) var parser = new CodeParser( @"steam_sdk" ); - parser.ParseClasses(); parser.ExtendDefinition( def ); Definitions = def; diff --git a/Generator/steam_sdk/steam_api.json b/Generator/steam_sdk/steam_api.json index 163ad17..47c3c55 100644 --- a/Generator/steam_sdk/steam_api.json +++ b/Generator/steam_sdk/steam_api.json @@ -3392,15 +3392,21 @@ { "paramname": "pnChatting" ,"paramtype": "int *"} ] } -,{ +, + +{ "classname": "ISteamFriends", "methodname": "DownloadClanActivityCounts", "returntype": "SteamAPICall_t", - "params": [ -{ "paramname": "psteamIDClans" ,"array_count": "cClansToRequest" ,"paramtype": "class CSteamID *"}, -{ "paramname": "cClansToRequest" ,"paramtype": "int"} + "callbackdata": "DownloadClanActivityCountsResult_t", + "callbackid": 341, + "params": + [ + { "paramname": "psteamIDClans" ,"array_count": "cClansToRequest" ,"paramtype": "class CSteamID *"}, + { "paramname": "cClansToRequest" ,"paramtype": "int"} ] } + ,{ "classname": "ISteamFriends", "methodname": "GetFriendCountFromSource", @@ -5322,7 +5328,7 @@ } ,{ "classname": "ISteamUserStats", - "methodname": "GetStat", + "methodname": "GetStat0", "returntype": "bool", "params": [ { "paramname": "pchName" ,"paramtype": "const char *"}, @@ -5457,7 +5463,7 @@ } ,{ "classname": "ISteamUserStats", - "methodname": "GetUserStat", + "methodname": "GetUserStat0", "returntype": "bool", "params": [ { "paramname": "steamIDUser" ,"paramtype": "class CSteamID"}, @@ -5659,7 +5665,7 @@ } ,{ "classname": "ISteamUserStats", - "methodname": "GetGlobalStat", + "methodname": "GetGlobalStat0", "returntype": "bool", "params": [ { "paramname": "pchStatName" ,"paramtype": "const char *"}, @@ -5678,7 +5684,7 @@ } ,{ "classname": "ISteamUserStats", - "methodname": "GetGlobalStatHistory", + "methodname": "GetGlobalStatHistory0", "returntype": "int32", "params": [ { "paramname": "pchStatName" ,"paramtype": "const char *"}, @@ -7285,7 +7291,7 @@ } ,{ "classname": "ISteamUGC", - "methodname": "CreateQueryAllUGCRequest", + "methodname": "CreateQueryAllUGCRequest0", "returntype": "UGCQueryHandle_t", "params": [ { "paramname": "eQueryType" ,"paramtype": "EUGCQuery"}, @@ -8644,7 +8650,7 @@ } ,{ "classname": "ISteamInventory", - "methodname": "SetProperty", + "methodname": "SetProperty0", "returntype": "bool", "params": [ { "paramname": "handle" ,"paramtype": "SteamInventoryUpdateHandle_t"}, @@ -8655,7 +8661,7 @@ } ,{ "classname": "ISteamInventory", - "methodname": "SetProperty", + "methodname": "SetProperty1", "returntype": "bool", "params": [ { "paramname": "handle" ,"paramtype": "SteamInventoryUpdateHandle_t"}, @@ -8666,7 +8672,7 @@ } ,{ "classname": "ISteamInventory", - "methodname": "SetProperty", + "methodname": "SetProperty2", "returntype": "bool", "params": [ { "paramname": "handle" ,"paramtype": "SteamInventoryUpdateHandle_t"}, @@ -9119,7 +9125,7 @@ } ,{ "classname": "ISteamGameServerStats", - "methodname": "GetUserStat", + "methodname": "GetUserStat0", "returntype": "bool", "params": [ { "paramname": "steamIDUser" ,"paramtype": "class CSteamID"}, @@ -9149,7 +9155,7 @@ } ,{ "classname": "ISteamGameServerStats", - "methodname": "SetUserStat", + "methodname": "SetUserStat0", "returntype": "bool", "params": [ { "paramname": "steamIDUser" ,"paramtype": "class CSteamID"},