diff --git a/Facepunch.Steamworks/Callbacks/Callback.VTable.cs b/Facepunch.Steamworks/Callbacks/Callback.VTable.cs deleted file mode 100644 index af56e10..0000000 --- a/Facepunch.Steamworks/Callbacks/Callback.VTable.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Collections.Generic; -using Steamworks.Data; - -namespace Steamworks -{ - internal partial class Callback - { - internal static class VTable - { - [UnmanagedFunctionPointer( CallingConvention.ThisCall )] - public delegate void Run( IntPtr thisptr, IntPtr pvParam ); - - [UnmanagedFunctionPointer( CallingConvention.ThisCall )] - public delegate void RunCall( IntPtr thisptr, IntPtr pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall ); - - [UnmanagedFunctionPointer( CallingConvention.ThisCall )] - public delegate int GetCallbackSizeBytes( IntPtr thisptr ); - - internal static IntPtr GetVTable( Run run, RunCall runInfo, GetCallbackSizeBytes size, List allocations ) - { - allocations.Add( GCHandle.Alloc( run ) ); - allocations.Add( GCHandle.Alloc( runInfo ) ); - allocations.Add( GCHandle.Alloc( size ) ); - - var a = Marshal.GetFunctionPointerForDelegate( run ); - var b = Marshal.GetFunctionPointerForDelegate( runInfo ); - var c = Marshal.GetFunctionPointerForDelegate( size ); - - var vt = Marshal.AllocHGlobal( IntPtr.Size * 3 ); - - if ( Config.Os == OsType.Windows ) - { - Marshal.WriteIntPtr( vt, IntPtr.Size * 0, b ); - Marshal.WriteIntPtr( vt, IntPtr.Size * 1, a ); - Marshal.WriteIntPtr( vt, IntPtr.Size * 2, c ); - } - else - { - Marshal.WriteIntPtr( vt, IntPtr.Size * 0, a ); - Marshal.WriteIntPtr( vt, IntPtr.Size * 1, b ); - Marshal.WriteIntPtr( vt, IntPtr.Size * 2, c ); - } - - return vt; - } - } - }; -} diff --git a/Facepunch.Steamworks/Callbacks/Callback.cs b/Facepunch.Steamworks/Callbacks/Callback.cs index e0994db..a5cc3c9 100644 --- a/Facepunch.Steamworks/Callbacks/Callback.cs +++ b/Facepunch.Steamworks/Callbacks/Callback.cs @@ -1,13 +1,23 @@ using System; using System.Runtime.InteropServices; using System.Collections.Generic; +using Steamworks.Data; namespace Steamworks { [StructLayout( LayoutKind.Sequential )] internal partial class Callback { - internal enum Flags : byte + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + public delegate void Run( IntPtr thisptr, IntPtr pvParam ); + + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + public delegate void RunCall( IntPtr thisptr, IntPtr pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall ); + + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + public delegate int GetCallbackSizeBytes( IntPtr thisptr ); + + internal enum Flags : byte { Registered = 0x01, GameServer = 0x02 @@ -16,5 +26,18 @@ namespace Steamworks public IntPtr vTablePtr; public byte CallbackFlags; public int CallbackId; - }; + + // + // These are functions that are on CCallback but are never called + // We could just send a IntPtr.Zero but it's probably safer to throw a + // big apeshit message if steam changes its behaviour at some point + // + [MonoPInvokeCallback] + internal static void RunStub( IntPtr self, IntPtr param, bool failure, SteamAPICall_t call ) => + throw new System.Exception( "Something changed in the Steam API and now CCallbackBack is calling the CallResult function [Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall )]" ); + + [MonoPInvokeCallback] + internal static int SizeStub( IntPtr self ) => + throw new System.Exception( "Something changed in the Steam API and now CCallbackBack is calling the GetSize function [GetCallbackSizeBytes()]" ); + }; } diff --git a/Facepunch.Steamworks/Callbacks/Events.cs b/Facepunch.Steamworks/Callbacks/Events.cs index ebd7fc4..95b62e5 100644 --- a/Facepunch.Steamworks/Callbacks/Events.cs +++ b/Facepunch.Steamworks/Callbacks/Events.cs @@ -1,13 +1,14 @@ -using System; +using Steamworks.Data; +using System; using System.Collections.Generic; using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; -using Steamworks.Data; namespace Steamworks { - internal static class Events + // + // Created on registration of a callback + // + internal class Event : IDisposable { internal static List AllClient = new List(); internal static List AllServer = new List(); @@ -31,21 +32,75 @@ namespace Steamworks AllServer.Clear(); } - } - // - // Created on registration of a callback - // - internal class Event : IDisposable - { - Steamworks.ISteamCallback template; - public Action Action; + internal static void Register( Callback.Run func, int size, int callbackId, bool gameserver ) + { + var r = new Event(); + r.vTablePtr = BuildVTable( func, r.Allocations ); + + // + // Create the callback object + // + var cb = new Callback(); + cb.vTablePtr = r.vTablePtr; + cb.CallbackFlags = gameserver ? (byte)0x02 : (byte)0; + cb.CallbackId = callbackId; + + // + // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native + // + r.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); + + // + // Register the callback with Steam + // + SteamClient.RegisterCallback( r.PinnedCallback.AddrOfPinnedObject(), cb.CallbackId ); + + r.IsAllocated = true; + + if ( gameserver ) + Event.AllServer.Add( r ); + else + Event.AllClient.Add( r ); + } + + static IntPtr BuildVTable( Callback.Run run, List allocations ) + { + var RunStub = (Callback.RunCall)Callback.RunStub; + var SizeStub = (Callback.GetCallbackSizeBytes)Callback.SizeStub; + + allocations.Add( GCHandle.Alloc( run ) ); + allocations.Add( GCHandle.Alloc( RunStub ) ); + allocations.Add( GCHandle.Alloc( SizeStub ) ); + + var a = Marshal.GetFunctionPointerForDelegate( run ); + var b = Marshal.GetFunctionPointerForDelegate( RunStub ); + var c = Marshal.GetFunctionPointerForDelegate( SizeStub ); + + var vt = Marshal.AllocHGlobal( IntPtr.Size * 3 ); + + if ( Config.Os == OsType.Windows ) + { + Marshal.WriteIntPtr( vt, IntPtr.Size * 0, b ); + Marshal.WriteIntPtr( vt, IntPtr.Size * 1, a ); + Marshal.WriteIntPtr( vt, IntPtr.Size * 2, c ); + } + else + { + Marshal.WriteIntPtr( vt, IntPtr.Size * 0, a ); + Marshal.WriteIntPtr( vt, IntPtr.Size * 1, b ); + Marshal.WriteIntPtr( vt, IntPtr.Size * 2, c ); + } + + return vt; + } bool IsAllocated; List Allocations = new List(); internal IntPtr vTablePtr; internal GCHandle PinnedCallback; + public void Dispose() { if ( !IsAllocated ) return; @@ -78,62 +133,5 @@ namespace Steamworks Dispose(); } - public virtual bool IsValid { get { return true; } } - - internal static Event CreateEvent( Action onresult, bool gameserver = false ) where T: struct, Steamworks.ISteamCallback - { - var r = new Event(); - - r.Action = ( x ) => onresult( (T) x ); - - r.template = new T(); - r.vTablePtr = Callback.VTable.GetVTable( r.OnResult, RunStub, SizeStub, r.Allocations ); - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = r.vTablePtr; - cb.CallbackFlags = gameserver ? (byte)0x02 : (byte)0; - cb.CallbackId = r.template.GetCallbackId(); - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - r.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - SteamClient.RegisterCallback( r.PinnedCallback.AddrOfPinnedObject(), cb.CallbackId ); - - r.IsAllocated = true; - - if ( gameserver ) - Events.AllServer.Add( r ); - else - Events.AllClient.Add( r ); - - return r; - } - - [MonoPInvokeCallback] - internal void OnResult( IntPtr self, IntPtr param ) - { - var value = template.Fill( param ); - Action( value ); - } - - [MonoPInvokeCallback] - static void RunStub( IntPtr self, IntPtr param, bool failure, SteamAPICall_t call ) - { - throw new System.Exception( "Something changed in the Steam API and now CCallbackBack is calling the CallResult function [Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall )]" ); - } - - [MonoPInvokeCallback] - static int SizeStub( IntPtr self ) - { - throw new System.Exception( "Something changed in the Steam API and now CCallbackBack is calling the GetSize function [GetCallbackSizeBytes()]" ); - } } } \ No newline at end of file diff --git a/Facepunch.Steamworks/Generated/SteamStructs.cs b/Facepunch.Steamworks/Generated/SteamStructs.cs index c4c39a4..724899b 100644 --- a/Facepunch.Steamworks/Generated/SteamStructs.cs +++ b/Facepunch.Steamworks/Generated/SteamStructs.cs @@ -43,6 +43,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUser + 2; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(SteamServerConnectFailure_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((SteamServerConnectFailure_t)(SteamServerConnectFailure_t) Marshal.PtrToStructure( p, typeof(SteamServerConnectFailure_t) )) : ((SteamServerConnectFailure_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (SteamServerConnectFailure_t)default(SteamServerConnectFailure_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (SteamServerConnectFailure_t)default(SteamServerConnectFailure_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(SteamServerConnectFailure_t).GetStructSize(), CallbackIdentifiers.SteamUser + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(SteamServerConnectFailure_t).GetStructSize(), CallbackIdentifiers.SteamUser + 2, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -67,6 +84,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUser + 3; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(SteamServersDisconnected_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((SteamServersDisconnected_t)(SteamServersDisconnected_t) Marshal.PtrToStructure( p, typeof(SteamServersDisconnected_t) )) : ((SteamServersDisconnected_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (SteamServersDisconnected_t)default(SteamServersDisconnected_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (SteamServersDisconnected_t)default(SteamServersDisconnected_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(SteamServersDisconnected_t).GetStructSize(), CallbackIdentifiers.SteamUser + 3, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(SteamServersDisconnected_t).GetStructSize(), CallbackIdentifiers.SteamUser + 3, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -93,6 +127,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUser + 13; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(ClientGameServerDeny_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((ClientGameServerDeny_t)(ClientGameServerDeny_t) Marshal.PtrToStructure( p, typeof(ClientGameServerDeny_t) )) : ((ClientGameServerDeny_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (ClientGameServerDeny_t)default(ClientGameServerDeny_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (ClientGameServerDeny_t)default(ClientGameServerDeny_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(ClientGameServerDeny_t).GetStructSize(), CallbackIdentifiers.SteamUser + 13, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(ClientGameServerDeny_t).GetStructSize(), CallbackIdentifiers.SteamUser + 13, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -121,6 +172,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUser + 43; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(ValidateAuthTicketResponse_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((ValidateAuthTicketResponse_t)(ValidateAuthTicketResponse_t) Marshal.PtrToStructure( p, typeof(ValidateAuthTicketResponse_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (ValidateAuthTicketResponse_t)default(ValidateAuthTicketResponse_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (ValidateAuthTicketResponse_t)default(ValidateAuthTicketResponse_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(ValidateAuthTicketResponse_t).GetStructSize(), CallbackIdentifiers.SteamUser + 43, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(ValidateAuthTicketResponse_t).GetStructSize(), CallbackIdentifiers.SteamUser + 43, false ); + actionClient = action; + } + } #endregion } @@ -135,6 +203,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUser + 52; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(MicroTxnAuthorizationResponse_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((MicroTxnAuthorizationResponse_t)(MicroTxnAuthorizationResponse_t) Marshal.PtrToStructure( p, typeof(MicroTxnAuthorizationResponse_t) )) : ((MicroTxnAuthorizationResponse_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (MicroTxnAuthorizationResponse_t)default(MicroTxnAuthorizationResponse_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (MicroTxnAuthorizationResponse_t)default(MicroTxnAuthorizationResponse_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(MicroTxnAuthorizationResponse_t).GetStructSize(), CallbackIdentifiers.SteamUser + 52, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(MicroTxnAuthorizationResponse_t).GetStructSize(), CallbackIdentifiers.SteamUser + 52, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -159,6 +244,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUser + 54; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(EncryptedAppTicketResponse_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((EncryptedAppTicketResponse_t)(EncryptedAppTicketResponse_t) Marshal.PtrToStructure( p, typeof(EncryptedAppTicketResponse_t) )) : ((EncryptedAppTicketResponse_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (EncryptedAppTicketResponse_t)default(EncryptedAppTicketResponse_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (EncryptedAppTicketResponse_t)default(EncryptedAppTicketResponse_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(EncryptedAppTicketResponse_t).GetStructSize(), CallbackIdentifiers.SteamUser + 54, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(EncryptedAppTicketResponse_t).GetStructSize(), CallbackIdentifiers.SteamUser + 54, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -182,6 +284,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUser + 63; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(GetAuthSessionTicketResponse_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((GetAuthSessionTicketResponse_t)(GetAuthSessionTicketResponse_t) Marshal.PtrToStructure( p, typeof(GetAuthSessionTicketResponse_t) )) : ((GetAuthSessionTicketResponse_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GetAuthSessionTicketResponse_t)default(GetAuthSessionTicketResponse_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GetAuthSessionTicketResponse_t)default(GetAuthSessionTicketResponse_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GetAuthSessionTicketResponse_t).GetStructSize(), CallbackIdentifiers.SteamUser + 63, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GetAuthSessionTicketResponse_t).GetStructSize(), CallbackIdentifiers.SteamUser + 63, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -206,6 +325,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUser + 64; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(GameWebCallback_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((GameWebCallback_t)(GameWebCallback_t) Marshal.PtrToStructure( p, typeof(GameWebCallback_t) )) : ((GameWebCallback_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GameWebCallback_t)default(GameWebCallback_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GameWebCallback_t)default(GameWebCallback_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GameWebCallback_t).GetStructSize(), CallbackIdentifiers.SteamUser + 64, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GameWebCallback_t).GetStructSize(), CallbackIdentifiers.SteamUser + 64, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -230,6 +366,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUser + 65; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(StoreAuthURLResponse_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((StoreAuthURLResponse_t)(StoreAuthURLResponse_t) Marshal.PtrToStructure( p, typeof(StoreAuthURLResponse_t) )) : ((StoreAuthURLResponse_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (StoreAuthURLResponse_t)default(StoreAuthURLResponse_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (StoreAuthURLResponse_t)default(StoreAuthURLResponse_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(StoreAuthURLResponse_t).GetStructSize(), CallbackIdentifiers.SteamUser + 65, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(StoreAuthURLResponse_t).GetStructSize(), CallbackIdentifiers.SteamUser + 65, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -258,6 +411,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUser + 66; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(MarketEligibilityResponse_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((MarketEligibilityResponse_t)(MarketEligibilityResponse_t) Marshal.PtrToStructure( p, typeof(MarketEligibilityResponse_t) )) : ((MarketEligibilityResponse_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (MarketEligibilityResponse_t)default(MarketEligibilityResponse_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (MarketEligibilityResponse_t)default(MarketEligibilityResponse_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(MarketEligibilityResponse_t).GetStructSize(), CallbackIdentifiers.SteamUser + 66, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(MarketEligibilityResponse_t).GetStructSize(), CallbackIdentifiers.SteamUser + 66, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -324,6 +494,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamFriends + 4; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(FriendStateChange_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((FriendStateChange_t)(FriendStateChange_t) Marshal.PtrToStructure( p, typeof(FriendStateChange_t) )) : ((FriendStateChange_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (FriendStateChange_t)default(FriendStateChange_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (FriendStateChange_t)default(FriendStateChange_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(FriendStateChange_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 4, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(FriendStateChange_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 4, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -347,6 +534,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamFriends + 31; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(GameOverlayActivated_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((GameOverlayActivated_t)(GameOverlayActivated_t) Marshal.PtrToStructure( p, typeof(GameOverlayActivated_t) )) : ((GameOverlayActivated_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GameOverlayActivated_t)default(GameOverlayActivated_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GameOverlayActivated_t)default(GameOverlayActivated_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GameOverlayActivated_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 31, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GameOverlayActivated_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 31, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -372,6 +576,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamFriends + 32; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(GameServerChangeRequested_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((GameServerChangeRequested_t)(GameServerChangeRequested_t) Marshal.PtrToStructure( p, typeof(GameServerChangeRequested_t) )) : ((GameServerChangeRequested_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GameServerChangeRequested_t)default(GameServerChangeRequested_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GameServerChangeRequested_t)default(GameServerChangeRequested_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GameServerChangeRequested_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 32, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GameServerChangeRequested_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 32, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -398,6 +619,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamFriends + 33; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameLobbyJoinRequested_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((GameLobbyJoinRequested_t)(GameLobbyJoinRequested_t) Marshal.PtrToStructure( p, typeof(GameLobbyJoinRequested_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GameLobbyJoinRequested_t)default(GameLobbyJoinRequested_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GameLobbyJoinRequested_t)default(GameLobbyJoinRequested_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GameLobbyJoinRequested_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 33, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GameLobbyJoinRequested_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 33, false ); + actionClient = action; + } + } #endregion } @@ -413,6 +651,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamFriends + 34; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(AvatarImageLoaded_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((AvatarImageLoaded_t)(AvatarImageLoaded_t) Marshal.PtrToStructure( p, typeof(AvatarImageLoaded_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (AvatarImageLoaded_t)default(AvatarImageLoaded_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (AvatarImageLoaded_t)default(AvatarImageLoaded_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(AvatarImageLoaded_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 34, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(AvatarImageLoaded_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 34, false ); + actionClient = action; + } + } #endregion } @@ -427,6 +682,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamFriends + 35; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(ClanOfficerListResponse_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((ClanOfficerListResponse_t)(ClanOfficerListResponse_t) Marshal.PtrToStructure( p, typeof(ClanOfficerListResponse_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (ClanOfficerListResponse_t)default(ClanOfficerListResponse_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (ClanOfficerListResponse_t)default(ClanOfficerListResponse_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(ClanOfficerListResponse_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 35, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(ClanOfficerListResponse_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 35, false ); + actionClient = action; + } + } #endregion } @@ -440,6 +712,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamFriends + 36; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendRichPresenceUpdate_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((FriendRichPresenceUpdate_t)(FriendRichPresenceUpdate_t) Marshal.PtrToStructure( p, typeof(FriendRichPresenceUpdate_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (FriendRichPresenceUpdate_t)default(FriendRichPresenceUpdate_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (FriendRichPresenceUpdate_t)default(FriendRichPresenceUpdate_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(FriendRichPresenceUpdate_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 36, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(FriendRichPresenceUpdate_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 36, false ); + actionClient = action; + } + } #endregion } @@ -454,6 +743,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamFriends + 37; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameRichPresenceJoinRequested_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((GameRichPresenceJoinRequested_t)(GameRichPresenceJoinRequested_t) Marshal.PtrToStructure( p, typeof(GameRichPresenceJoinRequested_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GameRichPresenceJoinRequested_t)default(GameRichPresenceJoinRequested_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GameRichPresenceJoinRequested_t)default(GameRichPresenceJoinRequested_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GameRichPresenceJoinRequested_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 37, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GameRichPresenceJoinRequested_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 37, false ); + actionClient = action; + } + } #endregion } @@ -468,6 +774,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamFriends + 38; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameConnectedClanChatMsg_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((GameConnectedClanChatMsg_t)(GameConnectedClanChatMsg_t) Marshal.PtrToStructure( p, typeof(GameConnectedClanChatMsg_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GameConnectedClanChatMsg_t)default(GameConnectedClanChatMsg_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GameConnectedClanChatMsg_t)default(GameConnectedClanChatMsg_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GameConnectedClanChatMsg_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 38, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GameConnectedClanChatMsg_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 38, false ); + actionClient = action; + } + } #endregion } @@ -481,6 +804,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamFriends + 39; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameConnectedChatJoin_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((GameConnectedChatJoin_t)(GameConnectedChatJoin_t) Marshal.PtrToStructure( p, typeof(GameConnectedChatJoin_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GameConnectedChatJoin_t)default(GameConnectedChatJoin_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GameConnectedChatJoin_t)default(GameConnectedChatJoin_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GameConnectedChatJoin_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 39, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GameConnectedChatJoin_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 39, false ); + actionClient = action; + } + } #endregion } @@ -498,6 +838,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamFriends + 40; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameConnectedChatLeave_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((GameConnectedChatLeave_t)(GameConnectedChatLeave_t) Marshal.PtrToStructure( p, typeof(GameConnectedChatLeave_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GameConnectedChatLeave_t)default(GameConnectedChatLeave_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GameConnectedChatLeave_t)default(GameConnectedChatLeave_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GameConnectedChatLeave_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 40, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GameConnectedChatLeave_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 40, false ); + actionClient = action; + } + } #endregion } @@ -511,6 +868,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamFriends + 41; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(DownloadClanActivityCountsResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((DownloadClanActivityCountsResult_t)(DownloadClanActivityCountsResult_t) Marshal.PtrToStructure( p, typeof(DownloadClanActivityCountsResult_t) )) : ((DownloadClanActivityCountsResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (DownloadClanActivityCountsResult_t)default(DownloadClanActivityCountsResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (DownloadClanActivityCountsResult_t)default(DownloadClanActivityCountsResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(DownloadClanActivityCountsResult_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 41, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(DownloadClanActivityCountsResult_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 41, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -535,6 +909,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamFriends + 42; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(JoinClanChatRoomCompletionResult_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((JoinClanChatRoomCompletionResult_t)(JoinClanChatRoomCompletionResult_t) Marshal.PtrToStructure( p, typeof(JoinClanChatRoomCompletionResult_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (JoinClanChatRoomCompletionResult_t)default(JoinClanChatRoomCompletionResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (JoinClanChatRoomCompletionResult_t)default(JoinClanChatRoomCompletionResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(JoinClanChatRoomCompletionResult_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 42, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(JoinClanChatRoomCompletionResult_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 42, false ); + actionClient = action; + } + } #endregion } @@ -548,6 +939,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamFriends + 43; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameConnectedFriendChatMsg_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((GameConnectedFriendChatMsg_t)(GameConnectedFriendChatMsg_t) Marshal.PtrToStructure( p, typeof(GameConnectedFriendChatMsg_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GameConnectedFriendChatMsg_t)default(GameConnectedFriendChatMsg_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GameConnectedFriendChatMsg_t)default(GameConnectedFriendChatMsg_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GameConnectedFriendChatMsg_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 43, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GameConnectedFriendChatMsg_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 43, false ); + actionClient = action; + } + } #endregion } @@ -562,6 +970,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamFriends + 44; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendsGetFollowerCount_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((FriendsGetFollowerCount_t)(FriendsGetFollowerCount_t) Marshal.PtrToStructure( p, typeof(FriendsGetFollowerCount_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (FriendsGetFollowerCount_t)default(FriendsGetFollowerCount_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (FriendsGetFollowerCount_t)default(FriendsGetFollowerCount_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(FriendsGetFollowerCount_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 44, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(FriendsGetFollowerCount_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 44, false ); + actionClient = action; + } + } #endregion } @@ -577,6 +1002,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamFriends + 45; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendsIsFollowing_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((FriendsIsFollowing_t)(FriendsIsFollowing_t) Marshal.PtrToStructure( p, typeof(FriendsIsFollowing_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (FriendsIsFollowing_t)default(FriendsIsFollowing_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (FriendsIsFollowing_t)default(FriendsIsFollowing_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(FriendsIsFollowing_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 45, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(FriendsIsFollowing_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 45, false ); + actionClient = action; + } + } #endregion } @@ -593,6 +1035,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamFriends + 46; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendsEnumerateFollowingList_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((FriendsEnumerateFollowingList_t)(FriendsEnumerateFollowingList_t) Marshal.PtrToStructure( p, typeof(FriendsEnumerateFollowingList_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (FriendsEnumerateFollowingList_t)default(FriendsEnumerateFollowingList_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (FriendsEnumerateFollowingList_t)default(FriendsEnumerateFollowingList_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(FriendsEnumerateFollowingList_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 46, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(FriendsEnumerateFollowingList_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 46, false ); + actionClient = action; + } + } #endregion } @@ -609,6 +1068,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamFriends + 47; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(SetPersonaNameResponse_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((SetPersonaNameResponse_t)(SetPersonaNameResponse_t) Marshal.PtrToStructure( p, typeof(SetPersonaNameResponse_t) )) : ((SetPersonaNameResponse_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (SetPersonaNameResponse_t)default(SetPersonaNameResponse_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (SetPersonaNameResponse_t)default(SetPersonaNameResponse_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(SetPersonaNameResponse_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 47, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(SetPersonaNameResponse_t).GetStructSize(), CallbackIdentifiers.SteamFriends + 47, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -635,6 +1111,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUtils + 2; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(LowBatteryPower_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((LowBatteryPower_t)(LowBatteryPower_t) Marshal.PtrToStructure( p, typeof(LowBatteryPower_t) )) : ((LowBatteryPower_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (LowBatteryPower_t)default(LowBatteryPower_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (LowBatteryPower_t)default(LowBatteryPower_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(LowBatteryPower_t).GetStructSize(), CallbackIdentifiers.SteamUtils + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(LowBatteryPower_t).GetStructSize(), CallbackIdentifiers.SteamUtils + 2, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -659,6 +1152,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUtils + 3; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(SteamAPICallCompleted_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((SteamAPICallCompleted_t)(SteamAPICallCompleted_t) Marshal.PtrToStructure( p, typeof(SteamAPICallCompleted_t) )) : ((SteamAPICallCompleted_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (SteamAPICallCompleted_t)default(SteamAPICallCompleted_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (SteamAPICallCompleted_t)default(SteamAPICallCompleted_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(SteamAPICallCompleted_t).GetStructSize(), CallbackIdentifiers.SteamUtils + 3, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(SteamAPICallCompleted_t).GetStructSize(), CallbackIdentifiers.SteamUtils + 3, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -683,6 +1193,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUtils + 5; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(CheckFileSignature_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((CheckFileSignature_t)(CheckFileSignature_t) Marshal.PtrToStructure( p, typeof(CheckFileSignature_t) )) : ((CheckFileSignature_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (CheckFileSignature_t)default(CheckFileSignature_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (CheckFileSignature_t)default(CheckFileSignature_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(CheckFileSignature_t).GetStructSize(), CallbackIdentifiers.SteamUtils + 5, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(CheckFileSignature_t).GetStructSize(), CallbackIdentifiers.SteamUtils + 5, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -707,6 +1234,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUtils + 14; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(GamepadTextInputDismissed_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((GamepadTextInputDismissed_t)(GamepadTextInputDismissed_t) Marshal.PtrToStructure( p, typeof(GamepadTextInputDismissed_t) )) : ((GamepadTextInputDismissed_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GamepadTextInputDismissed_t)default(GamepadTextInputDismissed_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GamepadTextInputDismissed_t)default(GamepadTextInputDismissed_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GamepadTextInputDismissed_t).GetStructSize(), CallbackIdentifiers.SteamUtils + 14, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GamepadTextInputDismissed_t).GetStructSize(), CallbackIdentifiers.SteamUtils + 14, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -850,6 +1394,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamMatchmaking + 2; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(FavoritesListChanged_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((FavoritesListChanged_t)(FavoritesListChanged_t) Marshal.PtrToStructure( p, typeof(FavoritesListChanged_t) )) : ((FavoritesListChanged_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (FavoritesListChanged_t)default(FavoritesListChanged_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (FavoritesListChanged_t)default(FavoritesListChanged_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(FavoritesListChanged_t).GetStructSize(), CallbackIdentifiers.SteamMatchmaking + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(FavoritesListChanged_t).GetStructSize(), CallbackIdentifiers.SteamMatchmaking + 2, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -881,6 +1442,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamMatchmaking + 3; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(LobbyInvite_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((LobbyInvite_t)(LobbyInvite_t) Marshal.PtrToStructure( p, typeof(LobbyInvite_t) )) : ((LobbyInvite_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (LobbyInvite_t)default(LobbyInvite_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (LobbyInvite_t)default(LobbyInvite_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(LobbyInvite_t).GetStructSize(), CallbackIdentifiers.SteamMatchmaking + 3, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(LobbyInvite_t).GetStructSize(), CallbackIdentifiers.SteamMatchmaking + 3, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -909,6 +1487,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamMatchmaking + 4; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(LobbyEnter_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((LobbyEnter_t)(LobbyEnter_t) Marshal.PtrToStructure( p, typeof(LobbyEnter_t) )) : ((LobbyEnter_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (LobbyEnter_t)default(LobbyEnter_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (LobbyEnter_t)default(LobbyEnter_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(LobbyEnter_t).GetStructSize(), CallbackIdentifiers.SteamMatchmaking + 4, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(LobbyEnter_t).GetStructSize(), CallbackIdentifiers.SteamMatchmaking + 4, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -937,6 +1532,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamMatchmaking + 5; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(LobbyDataUpdate_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((LobbyDataUpdate_t)(LobbyDataUpdate_t) Marshal.PtrToStructure( p, typeof(LobbyDataUpdate_t) )) : ((LobbyDataUpdate_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (LobbyDataUpdate_t)default(LobbyDataUpdate_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (LobbyDataUpdate_t)default(LobbyDataUpdate_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(LobbyDataUpdate_t).GetStructSize(), CallbackIdentifiers.SteamMatchmaking + 5, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(LobbyDataUpdate_t).GetStructSize(), CallbackIdentifiers.SteamMatchmaking + 5, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -964,6 +1576,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamMatchmaking + 6; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(LobbyChatUpdate_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((LobbyChatUpdate_t)(LobbyChatUpdate_t) Marshal.PtrToStructure( p, typeof(LobbyChatUpdate_t) )) : ((LobbyChatUpdate_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (LobbyChatUpdate_t)default(LobbyChatUpdate_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (LobbyChatUpdate_t)default(LobbyChatUpdate_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(LobbyChatUpdate_t).GetStructSize(), CallbackIdentifiers.SteamMatchmaking + 6, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(LobbyChatUpdate_t).GetStructSize(), CallbackIdentifiers.SteamMatchmaking + 6, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -992,6 +1621,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamMatchmaking + 7; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(LobbyChatMsg_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((LobbyChatMsg_t)(LobbyChatMsg_t) Marshal.PtrToStructure( p, typeof(LobbyChatMsg_t) )) : ((LobbyChatMsg_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (LobbyChatMsg_t)default(LobbyChatMsg_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (LobbyChatMsg_t)default(LobbyChatMsg_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(LobbyChatMsg_t).GetStructSize(), CallbackIdentifiers.SteamMatchmaking + 7, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(LobbyChatMsg_t).GetStructSize(), CallbackIdentifiers.SteamMatchmaking + 7, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1020,6 +1666,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamMatchmaking + 9; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(LobbyGameCreated_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((LobbyGameCreated_t)(LobbyGameCreated_t) Marshal.PtrToStructure( p, typeof(LobbyGameCreated_t) )) : ((LobbyGameCreated_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (LobbyGameCreated_t)default(LobbyGameCreated_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (LobbyGameCreated_t)default(LobbyGameCreated_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(LobbyGameCreated_t).GetStructSize(), CallbackIdentifiers.SteamMatchmaking + 9, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(LobbyGameCreated_t).GetStructSize(), CallbackIdentifiers.SteamMatchmaking + 9, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1045,6 +1708,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamMatchmaking + 10; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(LobbyMatchList_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((LobbyMatchList_t)(LobbyMatchList_t) Marshal.PtrToStructure( p, typeof(LobbyMatchList_t) )) : ((LobbyMatchList_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (LobbyMatchList_t)default(LobbyMatchList_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (LobbyMatchList_t)default(LobbyMatchList_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(LobbyMatchList_t).GetStructSize(), CallbackIdentifiers.SteamMatchmaking + 10, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(LobbyMatchList_t).GetStructSize(), CallbackIdentifiers.SteamMatchmaking + 10, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1069,6 +1749,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamMatchmaking + 12; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(LobbyKicked_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((LobbyKicked_t)(LobbyKicked_t) Marshal.PtrToStructure( p, typeof(LobbyKicked_t) )) : ((LobbyKicked_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (LobbyKicked_t)default(LobbyKicked_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (LobbyKicked_t)default(LobbyKicked_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(LobbyKicked_t).GetStructSize(), CallbackIdentifiers.SteamMatchmaking + 12, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(LobbyKicked_t).GetStructSize(), CallbackIdentifiers.SteamMatchmaking + 12, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1094,6 +1791,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamMatchmaking + 13; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(LobbyCreated_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((LobbyCreated_t)(LobbyCreated_t) Marshal.PtrToStructure( p, typeof(LobbyCreated_t) )) : ((LobbyCreated_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (LobbyCreated_t)default(LobbyCreated_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (LobbyCreated_t)default(LobbyCreated_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(LobbyCreated_t).GetStructSize(), CallbackIdentifiers.SteamMatchmaking + 13, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(LobbyCreated_t).GetStructSize(), CallbackIdentifiers.SteamMatchmaking + 13, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1119,6 +1833,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamMatchmaking + 15; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(PSNGameBootInviteResult_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((PSNGameBootInviteResult_t)(PSNGameBootInviteResult_t) Marshal.PtrToStructure( p, typeof(PSNGameBootInviteResult_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (PSNGameBootInviteResult_t)default(PSNGameBootInviteResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (PSNGameBootInviteResult_t)default(PSNGameBootInviteResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(PSNGameBootInviteResult_t).GetStructSize(), CallbackIdentifiers.SteamMatchmaking + 15, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(PSNGameBootInviteResult_t).GetStructSize(), CallbackIdentifiers.SteamMatchmaking + 15, false ); + actionClient = action; + } + } #endregion } @@ -1131,6 +1862,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamMatchmaking + 16; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(FavoritesListAccountsUpdated_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((FavoritesListAccountsUpdated_t)(FavoritesListAccountsUpdated_t) Marshal.PtrToStructure( p, typeof(FavoritesListAccountsUpdated_t) )) : ((FavoritesListAccountsUpdated_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (FavoritesListAccountsUpdated_t)default(FavoritesListAccountsUpdated_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (FavoritesListAccountsUpdated_t)default(FavoritesListAccountsUpdated_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(FavoritesListAccountsUpdated_t).GetStructSize(), CallbackIdentifiers.SteamMatchmaking + 16, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(FavoritesListAccountsUpdated_t).GetStructSize(), CallbackIdentifiers.SteamMatchmaking + 16, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1158,6 +1906,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamGameSearch + 1; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(SearchForGameProgressCallback_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((SearchForGameProgressCallback_t)(SearchForGameProgressCallback_t) Marshal.PtrToStructure( p, typeof(SearchForGameProgressCallback_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (SearchForGameProgressCallback_t)default(SearchForGameProgressCallback_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (SearchForGameProgressCallback_t)default(SearchForGameProgressCallback_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(SearchForGameProgressCallback_t).GetStructSize(), CallbackIdentifiers.SteamGameSearch + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(SearchForGameProgressCallback_t).GetStructSize(), CallbackIdentifiers.SteamGameSearch + 1, false ); + actionClient = action; + } + } #endregion } @@ -1176,6 +1941,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamGameSearch + 2; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(SearchForGameResultCallback_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((SearchForGameResultCallback_t)(SearchForGameResultCallback_t) Marshal.PtrToStructure( p, typeof(SearchForGameResultCallback_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (SearchForGameResultCallback_t)default(SearchForGameResultCallback_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (SearchForGameResultCallback_t)default(SearchForGameResultCallback_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(SearchForGameResultCallback_t).GetStructSize(), CallbackIdentifiers.SteamGameSearch + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(SearchForGameResultCallback_t).GetStructSize(), CallbackIdentifiers.SteamGameSearch + 2, false ); + actionClient = action; + } + } #endregion } @@ -1189,6 +1971,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamGameSearch + 11; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RequestPlayersForGameProgressCallback_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RequestPlayersForGameProgressCallback_t)(RequestPlayersForGameProgressCallback_t) Marshal.PtrToStructure( p, typeof(RequestPlayersForGameProgressCallback_t) )) : ((RequestPlayersForGameProgressCallback_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RequestPlayersForGameProgressCallback_t)default(RequestPlayersForGameProgressCallback_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RequestPlayersForGameProgressCallback_t)default(RequestPlayersForGameProgressCallback_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RequestPlayersForGameProgressCallback_t).GetStructSize(), CallbackIdentifiers.SteamGameSearch + 11, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RequestPlayersForGameProgressCallback_t).GetStructSize(), CallbackIdentifiers.SteamGameSearch + 11, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1221,6 +2020,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamGameSearch + 12; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(RequestPlayersForGameResultCallback_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((RequestPlayersForGameResultCallback_t)(RequestPlayersForGameResultCallback_t) Marshal.PtrToStructure( p, typeof(RequestPlayersForGameResultCallback_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RequestPlayersForGameResultCallback_t)default(RequestPlayersForGameResultCallback_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RequestPlayersForGameResultCallback_t)default(RequestPlayersForGameResultCallback_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RequestPlayersForGameResultCallback_t).GetStructSize(), CallbackIdentifiers.SteamGameSearch + 12, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RequestPlayersForGameResultCallback_t).GetStructSize(), CallbackIdentifiers.SteamGameSearch + 12, false ); + actionClient = action; + } + } #endregion } @@ -1235,6 +2051,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamGameSearch + 13; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RequestPlayersForGameFinalResultCallback_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RequestPlayersForGameFinalResultCallback_t)(RequestPlayersForGameFinalResultCallback_t) Marshal.PtrToStructure( p, typeof(RequestPlayersForGameFinalResultCallback_t) )) : ((RequestPlayersForGameFinalResultCallback_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RequestPlayersForGameFinalResultCallback_t)default(RequestPlayersForGameFinalResultCallback_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RequestPlayersForGameFinalResultCallback_t)default(RequestPlayersForGameFinalResultCallback_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RequestPlayersForGameFinalResultCallback_t).GetStructSize(), CallbackIdentifiers.SteamGameSearch + 13, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RequestPlayersForGameFinalResultCallback_t).GetStructSize(), CallbackIdentifiers.SteamGameSearch + 13, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1261,6 +2094,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamGameSearch + 14; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(SubmitPlayerResultResultCallback_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((SubmitPlayerResultResultCallback_t)(SubmitPlayerResultResultCallback_t) Marshal.PtrToStructure( p, typeof(SubmitPlayerResultResultCallback_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (SubmitPlayerResultResultCallback_t)default(SubmitPlayerResultResultCallback_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (SubmitPlayerResultResultCallback_t)default(SubmitPlayerResultResultCallback_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(SubmitPlayerResultResultCallback_t).GetStructSize(), CallbackIdentifiers.SteamGameSearch + 14, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(SubmitPlayerResultResultCallback_t).GetStructSize(), CallbackIdentifiers.SteamGameSearch + 14, false ); + actionClient = action; + } + } #endregion } @@ -1274,6 +2124,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamGameSearch + 15; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(EndGameResultCallback_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((EndGameResultCallback_t)(EndGameResultCallback_t) Marshal.PtrToStructure( p, typeof(EndGameResultCallback_t) )) : ((EndGameResultCallback_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (EndGameResultCallback_t)default(EndGameResultCallback_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (EndGameResultCallback_t)default(EndGameResultCallback_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(EndGameResultCallback_t).GetStructSize(), CallbackIdentifiers.SteamGameSearch + 15, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(EndGameResultCallback_t).GetStructSize(), CallbackIdentifiers.SteamGameSearch + 15, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1301,6 +2168,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamParties + 1; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(JoinPartyCallback_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((JoinPartyCallback_t)(JoinPartyCallback_t) Marshal.PtrToStructure( p, typeof(JoinPartyCallback_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (JoinPartyCallback_t)default(JoinPartyCallback_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (JoinPartyCallback_t)default(JoinPartyCallback_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(JoinPartyCallback_t).GetStructSize(), CallbackIdentifiers.SteamParties + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(JoinPartyCallback_t).GetStructSize(), CallbackIdentifiers.SteamParties + 1, false ); + actionClient = action; + } + } #endregion } @@ -1314,6 +2198,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamParties + 2; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(CreateBeaconCallback_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((CreateBeaconCallback_t)(CreateBeaconCallback_t) Marshal.PtrToStructure( p, typeof(CreateBeaconCallback_t) )) : ((CreateBeaconCallback_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (CreateBeaconCallback_t)default(CreateBeaconCallback_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (CreateBeaconCallback_t)default(CreateBeaconCallback_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(CreateBeaconCallback_t).GetStructSize(), CallbackIdentifiers.SteamParties + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(CreateBeaconCallback_t).GetStructSize(), CallbackIdentifiers.SteamParties + 2, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1338,6 +2239,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamParties + 3; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(ReservationNotificationCallback_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((ReservationNotificationCallback_t)(ReservationNotificationCallback_t) Marshal.PtrToStructure( p, typeof(ReservationNotificationCallback_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (ReservationNotificationCallback_t)default(ReservationNotificationCallback_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (ReservationNotificationCallback_t)default(ReservationNotificationCallback_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(ReservationNotificationCallback_t).GetStructSize(), CallbackIdentifiers.SteamParties + 3, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(ReservationNotificationCallback_t).GetStructSize(), CallbackIdentifiers.SteamParties + 3, false ); + actionClient = action; + } + } #endregion } @@ -1350,6 +2268,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamParties + 4; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(ChangeNumOpenSlotsCallback_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((ChangeNumOpenSlotsCallback_t)(ChangeNumOpenSlotsCallback_t) Marshal.PtrToStructure( p, typeof(ChangeNumOpenSlotsCallback_t) )) : ((ChangeNumOpenSlotsCallback_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (ChangeNumOpenSlotsCallback_t)default(ChangeNumOpenSlotsCallback_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (ChangeNumOpenSlotsCallback_t)default(ChangeNumOpenSlotsCallback_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(ChangeNumOpenSlotsCallback_t).GetStructSize(), CallbackIdentifiers.SteamParties + 4, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(ChangeNumOpenSlotsCallback_t).GetStructSize(), CallbackIdentifiers.SteamParties + 4, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1397,6 +2332,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientRemoteStorage + 1; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoteStorageAppSyncedClient_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoteStorageAppSyncedClient_t)(RemoteStorageAppSyncedClient_t) Marshal.PtrToStructure( p, typeof(RemoteStorageAppSyncedClient_t) )) : ((RemoteStorageAppSyncedClient_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoteStorageAppSyncedClient_t)default(RemoteStorageAppSyncedClient_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoteStorageAppSyncedClient_t)default(RemoteStorageAppSyncedClient_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoteStorageAppSyncedClient_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoteStorageAppSyncedClient_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 1, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1423,6 +2375,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientRemoteStorage + 2; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoteStorageAppSyncedServer_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoteStorageAppSyncedServer_t)(RemoteStorageAppSyncedServer_t) Marshal.PtrToStructure( p, typeof(RemoteStorageAppSyncedServer_t) )) : ((RemoteStorageAppSyncedServer_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoteStorageAppSyncedServer_t)default(RemoteStorageAppSyncedServer_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoteStorageAppSyncedServer_t)default(RemoteStorageAppSyncedServer_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoteStorageAppSyncedServer_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoteStorageAppSyncedServer_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 2, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1453,6 +2422,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientRemoteStorage + 3; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoteStorageAppSyncProgress_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoteStorageAppSyncProgress_t)(RemoteStorageAppSyncProgress_t) Marshal.PtrToStructure( p, typeof(RemoteStorageAppSyncProgress_t) )) : ((RemoteStorageAppSyncProgress_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoteStorageAppSyncProgress_t)default(RemoteStorageAppSyncProgress_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoteStorageAppSyncProgress_t)default(RemoteStorageAppSyncProgress_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoteStorageAppSyncProgress_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 3, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoteStorageAppSyncProgress_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 3, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1482,6 +2468,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientRemoteStorage + 5; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoteStorageAppSyncStatusCheck_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoteStorageAppSyncStatusCheck_t)(RemoteStorageAppSyncStatusCheck_t) Marshal.PtrToStructure( p, typeof(RemoteStorageAppSyncStatusCheck_t) )) : ((RemoteStorageAppSyncStatusCheck_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoteStorageAppSyncStatusCheck_t)default(RemoteStorageAppSyncStatusCheck_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoteStorageAppSyncStatusCheck_t)default(RemoteStorageAppSyncStatusCheck_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoteStorageAppSyncStatusCheck_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 5, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoteStorageAppSyncStatusCheck_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 5, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1508,6 +2511,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientRemoteStorage + 7; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoteStorageFileShareResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoteStorageFileShareResult_t)(RemoteStorageFileShareResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageFileShareResult_t) )) : ((RemoteStorageFileShareResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoteStorageFileShareResult_t)default(RemoteStorageFileShareResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoteStorageFileShareResult_t)default(RemoteStorageFileShareResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoteStorageFileShareResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 7, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoteStorageFileShareResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 7, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1536,6 +2556,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientRemoteStorage + 9; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoteStoragePublishFileResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoteStoragePublishFileResult_t)(RemoteStoragePublishFileResult_t) Marshal.PtrToStructure( p, typeof(RemoteStoragePublishFileResult_t) )) : ((RemoteStoragePublishFileResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoteStoragePublishFileResult_t)default(RemoteStoragePublishFileResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoteStoragePublishFileResult_t)default(RemoteStoragePublishFileResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoteStoragePublishFileResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 9, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoteStoragePublishFileResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 9, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1562,6 +2599,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientRemoteStorage + 11; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoteStorageDeletePublishedFileResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoteStorageDeletePublishedFileResult_t)(RemoteStorageDeletePublishedFileResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageDeletePublishedFileResult_t) )) : ((RemoteStorageDeletePublishedFileResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoteStorageDeletePublishedFileResult_t)default(RemoteStorageDeletePublishedFileResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoteStorageDeletePublishedFileResult_t)default(RemoteStorageDeletePublishedFileResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoteStorageDeletePublishedFileResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 11, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoteStorageDeletePublishedFileResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 11, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1589,6 +2643,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientRemoteStorage + 12; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoteStorageEnumerateUserPublishedFilesResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoteStorageEnumerateUserPublishedFilesResult_t)(RemoteStorageEnumerateUserPublishedFilesResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageEnumerateUserPublishedFilesResult_t) )) : ((RemoteStorageEnumerateUserPublishedFilesResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoteStorageEnumerateUserPublishedFilesResult_t)default(RemoteStorageEnumerateUserPublishedFilesResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoteStorageEnumerateUserPublishedFilesResult_t)default(RemoteStorageEnumerateUserPublishedFilesResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoteStorageEnumerateUserPublishedFilesResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 12, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoteStorageEnumerateUserPublishedFilesResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 12, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1616,6 +2687,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientRemoteStorage + 13; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoteStorageSubscribePublishedFileResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoteStorageSubscribePublishedFileResult_t)(RemoteStorageSubscribePublishedFileResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageSubscribePublishedFileResult_t) )) : ((RemoteStorageSubscribePublishedFileResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoteStorageSubscribePublishedFileResult_t)default(RemoteStorageSubscribePublishedFileResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoteStorageSubscribePublishedFileResult_t)default(RemoteStorageSubscribePublishedFileResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoteStorageSubscribePublishedFileResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 13, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoteStorageSubscribePublishedFileResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 13, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1645,6 +2733,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientRemoteStorage + 14; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoteStorageEnumerateUserSubscribedFilesResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoteStorageEnumerateUserSubscribedFilesResult_t)(RemoteStorageEnumerateUserSubscribedFilesResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageEnumerateUserSubscribedFilesResult_t) )) : ((RemoteStorageEnumerateUserSubscribedFilesResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoteStorageEnumerateUserSubscribedFilesResult_t)default(RemoteStorageEnumerateUserSubscribedFilesResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoteStorageEnumerateUserSubscribedFilesResult_t)default(RemoteStorageEnumerateUserSubscribedFilesResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoteStorageEnumerateUserSubscribedFilesResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 14, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoteStorageEnumerateUserSubscribedFilesResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 14, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1674,6 +2779,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientRemoteStorage + 15; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoteStorageUnsubscribePublishedFileResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoteStorageUnsubscribePublishedFileResult_t)(RemoteStorageUnsubscribePublishedFileResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageUnsubscribePublishedFileResult_t) )) : ((RemoteStorageUnsubscribePublishedFileResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoteStorageUnsubscribePublishedFileResult_t)default(RemoteStorageUnsubscribePublishedFileResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoteStorageUnsubscribePublishedFileResult_t)default(RemoteStorageUnsubscribePublishedFileResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoteStorageUnsubscribePublishedFileResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 15, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoteStorageUnsubscribePublishedFileResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 15, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1700,6 +2822,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientRemoteStorage + 16; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoteStorageUpdatePublishedFileResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoteStorageUpdatePublishedFileResult_t)(RemoteStorageUpdatePublishedFileResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageUpdatePublishedFileResult_t) )) : ((RemoteStorageUpdatePublishedFileResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoteStorageUpdatePublishedFileResult_t)default(RemoteStorageUpdatePublishedFileResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoteStorageUpdatePublishedFileResult_t)default(RemoteStorageUpdatePublishedFileResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoteStorageUpdatePublishedFileResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 16, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoteStorageUpdatePublishedFileResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 16, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1731,6 +2870,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientRemoteStorage + 17; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoteStorageDownloadUGCResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoteStorageDownloadUGCResult_t)(RemoteStorageDownloadUGCResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageDownloadUGCResult_t) )) : ((RemoteStorageDownloadUGCResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoteStorageDownloadUGCResult_t)default(RemoteStorageDownloadUGCResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoteStorageDownloadUGCResult_t)default(RemoteStorageDownloadUGCResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoteStorageDownloadUGCResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 17, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoteStorageDownloadUGCResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 17, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1787,6 +2943,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientRemoteStorage + 18; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoteStorageGetPublishedFileDetailsResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoteStorageGetPublishedFileDetailsResult_t)(RemoteStorageGetPublishedFileDetailsResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageGetPublishedFileDetailsResult_t) )) : ((RemoteStorageGetPublishedFileDetailsResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoteStorageGetPublishedFileDetailsResult_t)default(RemoteStorageGetPublishedFileDetailsResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoteStorageGetPublishedFileDetailsResult_t)default(RemoteStorageGetPublishedFileDetailsResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoteStorageGetPublishedFileDetailsResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 18, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoteStorageGetPublishedFileDetailsResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 18, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1845,6 +3018,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientRemoteStorage + 19; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoteStorageEnumerateWorkshopFilesResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoteStorageEnumerateWorkshopFilesResult_t)(RemoteStorageEnumerateWorkshopFilesResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageEnumerateWorkshopFilesResult_t) )) : ((RemoteStorageEnumerateWorkshopFilesResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoteStorageEnumerateWorkshopFilesResult_t)default(RemoteStorageEnumerateWorkshopFilesResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoteStorageEnumerateWorkshopFilesResult_t)default(RemoteStorageEnumerateWorkshopFilesResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoteStorageEnumerateWorkshopFilesResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 19, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoteStorageEnumerateWorkshopFilesResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 19, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1880,6 +3070,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientRemoteStorage + 20; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoteStorageGetPublishedItemVoteDetailsResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoteStorageGetPublishedItemVoteDetailsResult_t)(RemoteStorageGetPublishedItemVoteDetailsResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageGetPublishedItemVoteDetailsResult_t) )) : ((RemoteStorageGetPublishedItemVoteDetailsResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoteStorageGetPublishedItemVoteDetailsResult_t)default(RemoteStorageGetPublishedItemVoteDetailsResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoteStorageGetPublishedItemVoteDetailsResult_t)default(RemoteStorageGetPublishedItemVoteDetailsResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoteStorageGetPublishedItemVoteDetailsResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 20, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoteStorageGetPublishedItemVoteDetailsResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 20, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1908,6 +3115,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientRemoteStorage + 21; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoteStoragePublishedFileSubscribed_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoteStoragePublishedFileSubscribed_t)(RemoteStoragePublishedFileSubscribed_t) Marshal.PtrToStructure( p, typeof(RemoteStoragePublishedFileSubscribed_t) )) : ((RemoteStoragePublishedFileSubscribed_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoteStoragePublishedFileSubscribed_t)default(RemoteStoragePublishedFileSubscribed_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoteStoragePublishedFileSubscribed_t)default(RemoteStoragePublishedFileSubscribed_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoteStoragePublishedFileSubscribed_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 21, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoteStoragePublishedFileSubscribed_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 21, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1932,6 +3156,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientRemoteStorage + 22; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoteStoragePublishedFileUnsubscribed_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoteStoragePublishedFileUnsubscribed_t)(RemoteStoragePublishedFileUnsubscribed_t) Marshal.PtrToStructure( p, typeof(RemoteStoragePublishedFileUnsubscribed_t) )) : ((RemoteStoragePublishedFileUnsubscribed_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoteStoragePublishedFileUnsubscribed_t)default(RemoteStoragePublishedFileUnsubscribed_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoteStoragePublishedFileUnsubscribed_t)default(RemoteStoragePublishedFileUnsubscribed_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoteStoragePublishedFileUnsubscribed_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 22, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoteStoragePublishedFileUnsubscribed_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 22, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1956,6 +3197,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientRemoteStorage + 23; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoteStoragePublishedFileDeleted_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoteStoragePublishedFileDeleted_t)(RemoteStoragePublishedFileDeleted_t) Marshal.PtrToStructure( p, typeof(RemoteStoragePublishedFileDeleted_t) )) : ((RemoteStoragePublishedFileDeleted_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoteStoragePublishedFileDeleted_t)default(RemoteStoragePublishedFileDeleted_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoteStoragePublishedFileDeleted_t)default(RemoteStoragePublishedFileDeleted_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoteStoragePublishedFileDeleted_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 23, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoteStoragePublishedFileDeleted_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 23, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -1980,6 +3238,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientRemoteStorage + 24; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoteStorageUpdateUserPublishedItemVoteResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoteStorageUpdateUserPublishedItemVoteResult_t)(RemoteStorageUpdateUserPublishedItemVoteResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageUpdateUserPublishedItemVoteResult_t) )) : ((RemoteStorageUpdateUserPublishedItemVoteResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoteStorageUpdateUserPublishedItemVoteResult_t)default(RemoteStorageUpdateUserPublishedItemVoteResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoteStorageUpdateUserPublishedItemVoteResult_t)default(RemoteStorageUpdateUserPublishedItemVoteResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoteStorageUpdateUserPublishedItemVoteResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 24, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoteStorageUpdateUserPublishedItemVoteResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 24, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2005,6 +3280,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientRemoteStorage + 25; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoteStorageUserVoteDetails_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoteStorageUserVoteDetails_t)(RemoteStorageUserVoteDetails_t) Marshal.PtrToStructure( p, typeof(RemoteStorageUserVoteDetails_t) )) : ((RemoteStorageUserVoteDetails_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoteStorageUserVoteDetails_t)default(RemoteStorageUserVoteDetails_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoteStorageUserVoteDetails_t)default(RemoteStorageUserVoteDetails_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoteStorageUserVoteDetails_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 25, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoteStorageUserVoteDetails_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 25, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2033,6 +3325,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientRemoteStorage + 26; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoteStorageEnumerateUserSharedWorkshopFilesResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoteStorageEnumerateUserSharedWorkshopFilesResult_t)(RemoteStorageEnumerateUserSharedWorkshopFilesResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageEnumerateUserSharedWorkshopFilesResult_t) )) : ((RemoteStorageEnumerateUserSharedWorkshopFilesResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoteStorageEnumerateUserSharedWorkshopFilesResult_t)default(RemoteStorageEnumerateUserSharedWorkshopFilesResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoteStorageEnumerateUserSharedWorkshopFilesResult_t)default(RemoteStorageEnumerateUserSharedWorkshopFilesResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoteStorageEnumerateUserSharedWorkshopFilesResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 26, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoteStorageEnumerateUserSharedWorkshopFilesResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 26, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2061,6 +3370,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientRemoteStorage + 27; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoteStorageSetUserPublishedFileActionResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoteStorageSetUserPublishedFileActionResult_t)(RemoteStorageSetUserPublishedFileActionResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageSetUserPublishedFileActionResult_t) )) : ((RemoteStorageSetUserPublishedFileActionResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoteStorageSetUserPublishedFileActionResult_t)default(RemoteStorageSetUserPublishedFileActionResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoteStorageSetUserPublishedFileActionResult_t)default(RemoteStorageSetUserPublishedFileActionResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoteStorageSetUserPublishedFileActionResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 27, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoteStorageSetUserPublishedFileActionResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 27, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2092,6 +3418,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientRemoteStorage + 28; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoteStorageEnumeratePublishedFilesByUserActionResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoteStorageEnumeratePublishedFilesByUserActionResult_t)(RemoteStorageEnumeratePublishedFilesByUserActionResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageEnumeratePublishedFilesByUserActionResult_t) )) : ((RemoteStorageEnumeratePublishedFilesByUserActionResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoteStorageEnumeratePublishedFilesByUserActionResult_t)default(RemoteStorageEnumeratePublishedFilesByUserActionResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoteStorageEnumeratePublishedFilesByUserActionResult_t)default(RemoteStorageEnumeratePublishedFilesByUserActionResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoteStorageEnumeratePublishedFilesByUserActionResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 28, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoteStorageEnumeratePublishedFilesByUserActionResult_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 28, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2123,6 +3466,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientRemoteStorage + 29; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoteStoragePublishFileProgress_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoteStoragePublishFileProgress_t)(RemoteStoragePublishFileProgress_t) Marshal.PtrToStructure( p, typeof(RemoteStoragePublishFileProgress_t) )) : ((RemoteStoragePublishFileProgress_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoteStoragePublishFileProgress_t)default(RemoteStoragePublishFileProgress_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoteStoragePublishFileProgress_t)default(RemoteStoragePublishFileProgress_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoteStoragePublishFileProgress_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 29, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoteStoragePublishFileProgress_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 29, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2149,6 +3509,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientRemoteStorage + 30; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoteStoragePublishedFileUpdated_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoteStoragePublishedFileUpdated_t)(RemoteStoragePublishedFileUpdated_t) Marshal.PtrToStructure( p, typeof(RemoteStoragePublishedFileUpdated_t) )) : ((RemoteStoragePublishedFileUpdated_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoteStoragePublishedFileUpdated_t)default(RemoteStoragePublishedFileUpdated_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoteStoragePublishedFileUpdated_t)default(RemoteStoragePublishedFileUpdated_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoteStoragePublishedFileUpdated_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 30, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoteStoragePublishedFileUpdated_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 30, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2173,6 +3550,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientRemoteStorage + 31; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoteStorageFileWriteAsyncComplete_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoteStorageFileWriteAsyncComplete_t)(RemoteStorageFileWriteAsyncComplete_t) Marshal.PtrToStructure( p, typeof(RemoteStorageFileWriteAsyncComplete_t) )) : ((RemoteStorageFileWriteAsyncComplete_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoteStorageFileWriteAsyncComplete_t)default(RemoteStorageFileWriteAsyncComplete_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoteStorageFileWriteAsyncComplete_t)default(RemoteStorageFileWriteAsyncComplete_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoteStorageFileWriteAsyncComplete_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 31, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoteStorageFileWriteAsyncComplete_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 31, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2198,6 +3592,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientRemoteStorage + 32; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoteStorageFileReadAsyncComplete_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoteStorageFileReadAsyncComplete_t)(RemoteStorageFileReadAsyncComplete_t) Marshal.PtrToStructure( p, typeof(RemoteStorageFileReadAsyncComplete_t) )) : ((RemoteStorageFileReadAsyncComplete_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoteStorageFileReadAsyncComplete_t)default(RemoteStorageFileReadAsyncComplete_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoteStorageFileReadAsyncComplete_t)default(RemoteStorageFileReadAsyncComplete_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoteStorageFileReadAsyncComplete_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 32, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoteStorageFileReadAsyncComplete_t).GetStructSize(), CallbackIdentifiers.ClientRemoteStorage + 32, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2254,6 +3665,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUserStats + 1; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserStatsReceived_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((UserStatsReceived_t)(UserStatsReceived_t) Marshal.PtrToStructure( p, typeof(UserStatsReceived_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (UserStatsReceived_t)default(UserStatsReceived_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (UserStatsReceived_t)default(UserStatsReceived_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(UserStatsReceived_t).GetStructSize(), CallbackIdentifiers.SteamUserStats + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(UserStatsReceived_t).GetStructSize(), CallbackIdentifiers.SteamUserStats + 1, false ); + actionClient = action; + } + } #endregion } @@ -2267,6 +3695,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUserStats + 2; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(UserStatsStored_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((UserStatsStored_t)(UserStatsStored_t) Marshal.PtrToStructure( p, typeof(UserStatsStored_t) )) : ((UserStatsStored_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (UserStatsStored_t)default(UserStatsStored_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (UserStatsStored_t)default(UserStatsStored_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(UserStatsStored_t).GetStructSize(), CallbackIdentifiers.SteamUserStats + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(UserStatsStored_t).GetStructSize(), CallbackIdentifiers.SteamUserStats + 2, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2296,6 +3741,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUserStats + 3; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(UserAchievementStored_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((UserAchievementStored_t)(UserAchievementStored_t) Marshal.PtrToStructure( p, typeof(UserAchievementStored_t) )) : ((UserAchievementStored_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (UserAchievementStored_t)default(UserAchievementStored_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (UserAchievementStored_t)default(UserAchievementStored_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(UserAchievementStored_t).GetStructSize(), CallbackIdentifiers.SteamUserStats + 3, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(UserAchievementStored_t).GetStructSize(), CallbackIdentifiers.SteamUserStats + 3, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2325,6 +3787,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUserStats + 4; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(LeaderboardFindResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((LeaderboardFindResult_t)(LeaderboardFindResult_t) Marshal.PtrToStructure( p, typeof(LeaderboardFindResult_t) )) : ((LeaderboardFindResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (LeaderboardFindResult_t)default(LeaderboardFindResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (LeaderboardFindResult_t)default(LeaderboardFindResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(LeaderboardFindResult_t).GetStructSize(), CallbackIdentifiers.SteamUserStats + 4, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(LeaderboardFindResult_t).GetStructSize(), CallbackIdentifiers.SteamUserStats + 4, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2350,6 +3829,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUserStats + 5; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(LeaderboardScoresDownloaded_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((LeaderboardScoresDownloaded_t)(LeaderboardScoresDownloaded_t) Marshal.PtrToStructure( p, typeof(LeaderboardScoresDownloaded_t) )) : ((LeaderboardScoresDownloaded_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (LeaderboardScoresDownloaded_t)default(LeaderboardScoresDownloaded_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (LeaderboardScoresDownloaded_t)default(LeaderboardScoresDownloaded_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(LeaderboardScoresDownloaded_t).GetStructSize(), CallbackIdentifiers.SteamUserStats + 5, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(LeaderboardScoresDownloaded_t).GetStructSize(), CallbackIdentifiers.SteamUserStats + 5, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2379,6 +3875,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUserStats + 6; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(LeaderboardScoreUploaded_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((LeaderboardScoreUploaded_t)(LeaderboardScoreUploaded_t) Marshal.PtrToStructure( p, typeof(LeaderboardScoreUploaded_t) )) : ((LeaderboardScoreUploaded_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (LeaderboardScoreUploaded_t)default(LeaderboardScoreUploaded_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (LeaderboardScoreUploaded_t)default(LeaderboardScoreUploaded_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(LeaderboardScoreUploaded_t).GetStructSize(), CallbackIdentifiers.SteamUserStats + 6, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(LeaderboardScoreUploaded_t).GetStructSize(), CallbackIdentifiers.SteamUserStats + 6, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2407,6 +3920,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUserStats + 7; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(NumberOfCurrentPlayers_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((NumberOfCurrentPlayers_t)(NumberOfCurrentPlayers_t) Marshal.PtrToStructure( p, typeof(NumberOfCurrentPlayers_t) )) : ((NumberOfCurrentPlayers_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (NumberOfCurrentPlayers_t)default(NumberOfCurrentPlayers_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (NumberOfCurrentPlayers_t)default(NumberOfCurrentPlayers_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(NumberOfCurrentPlayers_t).GetStructSize(), CallbackIdentifiers.SteamUserStats + 7, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(NumberOfCurrentPlayers_t).GetStructSize(), CallbackIdentifiers.SteamUserStats + 7, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2430,6 +3960,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUserStats + 8; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserStatsUnloaded_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((UserStatsUnloaded_t)(UserStatsUnloaded_t) Marshal.PtrToStructure( p, typeof(UserStatsUnloaded_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (UserStatsUnloaded_t)default(UserStatsUnloaded_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (UserStatsUnloaded_t)default(UserStatsUnloaded_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(UserStatsUnloaded_t).GetStructSize(), CallbackIdentifiers.SteamUserStats + 8, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(UserStatsUnloaded_t).GetStructSize(), CallbackIdentifiers.SteamUserStats + 8, false ); + actionClient = action; + } + } #endregion } @@ -2447,6 +3994,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUserStats + 9; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(UserAchievementIconFetched_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((UserAchievementIconFetched_t)(UserAchievementIconFetched_t) Marshal.PtrToStructure( p, typeof(UserAchievementIconFetched_t) )) : ((UserAchievementIconFetched_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (UserAchievementIconFetched_t)default(UserAchievementIconFetched_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (UserAchievementIconFetched_t)default(UserAchievementIconFetched_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(UserAchievementIconFetched_t).GetStructSize(), CallbackIdentifiers.SteamUserStats + 9, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(UserAchievementIconFetched_t).GetStructSize(), CallbackIdentifiers.SteamUserStats + 9, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2475,6 +4039,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUserStats + 10; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(GlobalAchievementPercentagesReady_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((GlobalAchievementPercentagesReady_t)(GlobalAchievementPercentagesReady_t) Marshal.PtrToStructure( p, typeof(GlobalAchievementPercentagesReady_t) )) : ((GlobalAchievementPercentagesReady_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GlobalAchievementPercentagesReady_t)default(GlobalAchievementPercentagesReady_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GlobalAchievementPercentagesReady_t)default(GlobalAchievementPercentagesReady_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GlobalAchievementPercentagesReady_t).GetStructSize(), CallbackIdentifiers.SteamUserStats + 10, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GlobalAchievementPercentagesReady_t).GetStructSize(), CallbackIdentifiers.SteamUserStats + 10, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2499,6 +4080,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUserStats + 11; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(LeaderboardUGCSet_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((LeaderboardUGCSet_t)(LeaderboardUGCSet_t) Marshal.PtrToStructure( p, typeof(LeaderboardUGCSet_t) )) : ((LeaderboardUGCSet_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (LeaderboardUGCSet_t)default(LeaderboardUGCSet_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (LeaderboardUGCSet_t)default(LeaderboardUGCSet_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(LeaderboardUGCSet_t).GetStructSize(), CallbackIdentifiers.SteamUserStats + 11, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(LeaderboardUGCSet_t).GetStructSize(), CallbackIdentifiers.SteamUserStats + 11, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2524,6 +4122,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUserStats + 12; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(PS3TrophiesInstalled_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((PS3TrophiesInstalled_t)(PS3TrophiesInstalled_t) Marshal.PtrToStructure( p, typeof(PS3TrophiesInstalled_t) )) : ((PS3TrophiesInstalled_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (PS3TrophiesInstalled_t)default(PS3TrophiesInstalled_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (PS3TrophiesInstalled_t)default(PS3TrophiesInstalled_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(PS3TrophiesInstalled_t).GetStructSize(), CallbackIdentifiers.SteamUserStats + 12, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(PS3TrophiesInstalled_t).GetStructSize(), CallbackIdentifiers.SteamUserStats + 12, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2549,6 +4164,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUserStats + 12; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(GlobalStatsReceived_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((GlobalStatsReceived_t)(GlobalStatsReceived_t) Marshal.PtrToStructure( p, typeof(GlobalStatsReceived_t) )) : ((GlobalStatsReceived_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GlobalStatsReceived_t)default(GlobalStatsReceived_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GlobalStatsReceived_t)default(GlobalStatsReceived_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GlobalStatsReceived_t).GetStructSize(), CallbackIdentifiers.SteamUserStats + 12, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GlobalStatsReceived_t).GetStructSize(), CallbackIdentifiers.SteamUserStats + 12, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2572,6 +4204,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamApps + 5; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(DlcInstalled_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((DlcInstalled_t)(DlcInstalled_t) Marshal.PtrToStructure( p, typeof(DlcInstalled_t) )) : ((DlcInstalled_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (DlcInstalled_t)default(DlcInstalled_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (DlcInstalled_t)default(DlcInstalled_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(DlcInstalled_t).GetStructSize(), CallbackIdentifiers.SteamApps + 5, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(DlcInstalled_t).GetStructSize(), CallbackIdentifiers.SteamApps + 5, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2595,6 +4244,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamApps + 8; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RegisterActivationCodeResponse_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RegisterActivationCodeResponse_t)(RegisterActivationCodeResponse_t) Marshal.PtrToStructure( p, typeof(RegisterActivationCodeResponse_t) )) : ((RegisterActivationCodeResponse_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RegisterActivationCodeResponse_t)default(RegisterActivationCodeResponse_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RegisterActivationCodeResponse_t)default(RegisterActivationCodeResponse_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RegisterActivationCodeResponse_t).GetStructSize(), CallbackIdentifiers.SteamApps + 8, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RegisterActivationCodeResponse_t).GetStructSize(), CallbackIdentifiers.SteamApps + 8, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2622,6 +4288,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamApps + 21; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(AppProofOfPurchaseKeyResponse_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((AppProofOfPurchaseKeyResponse_t)(AppProofOfPurchaseKeyResponse_t) Marshal.PtrToStructure( p, typeof(AppProofOfPurchaseKeyResponse_t) )) : ((AppProofOfPurchaseKeyResponse_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (AppProofOfPurchaseKeyResponse_t)default(AppProofOfPurchaseKeyResponse_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (AppProofOfPurchaseKeyResponse_t)default(AppProofOfPurchaseKeyResponse_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(AppProofOfPurchaseKeyResponse_t).GetStructSize(), CallbackIdentifiers.SteamApps + 21, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(AppProofOfPurchaseKeyResponse_t).GetStructSize(), CallbackIdentifiers.SteamApps + 21, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2652,6 +4335,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamApps + 23; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(FileDetailsResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((FileDetailsResult_t)(FileDetailsResult_t) Marshal.PtrToStructure( p, typeof(FileDetailsResult_t) )) : ((FileDetailsResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (FileDetailsResult_t)default(FileDetailsResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (FileDetailsResult_t)default(FileDetailsResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(FileDetailsResult_t).GetStructSize(), CallbackIdentifiers.SteamApps + 23, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(FileDetailsResult_t).GetStructSize(), CallbackIdentifiers.SteamApps + 23, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2713,6 +4413,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamNetworking + 2; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(P2PSessionRequest_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((P2PSessionRequest_t)(P2PSessionRequest_t) Marshal.PtrToStructure( p, typeof(P2PSessionRequest_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (P2PSessionRequest_t)default(P2PSessionRequest_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (P2PSessionRequest_t)default(P2PSessionRequest_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(P2PSessionRequest_t).GetStructSize(), CallbackIdentifiers.SteamNetworking + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(P2PSessionRequest_t).GetStructSize(), CallbackIdentifiers.SteamNetworking + 2, false ); + actionClient = action; + } + } #endregion } @@ -2726,6 +4443,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamNetworking + 3; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(P2PSessionConnectFail_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((P2PSessionConnectFail_t)(P2PSessionConnectFail_t) Marshal.PtrToStructure( p, typeof(P2PSessionConnectFail_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (P2PSessionConnectFail_t)default(P2PSessionConnectFail_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (P2PSessionConnectFail_t)default(P2PSessionConnectFail_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(P2PSessionConnectFail_t).GetStructSize(), CallbackIdentifiers.SteamNetworking + 3, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(P2PSessionConnectFail_t).GetStructSize(), CallbackIdentifiers.SteamNetworking + 3, false ); + actionClient = action; + } + } #endregion } @@ -2741,6 +4475,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamNetworking + 1; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(SocketStatusCallback_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((SocketStatusCallback_t)(SocketStatusCallback_t) Marshal.PtrToStructure( p, typeof(SocketStatusCallback_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (SocketStatusCallback_t)default(SocketStatusCallback_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (SocketStatusCallback_t)default(SocketStatusCallback_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(SocketStatusCallback_t).GetStructSize(), CallbackIdentifiers.SteamNetworking + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(SocketStatusCallback_t).GetStructSize(), CallbackIdentifiers.SteamNetworking + 1, false ); + actionClient = action; + } + } #endregion } @@ -2754,6 +4505,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamScreenshots + 1; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(ScreenshotReady_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((ScreenshotReady_t)(ScreenshotReady_t) Marshal.PtrToStructure( p, typeof(ScreenshotReady_t) )) : ((ScreenshotReady_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (ScreenshotReady_t)default(ScreenshotReady_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (ScreenshotReady_t)default(ScreenshotReady_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(ScreenshotReady_t).GetStructSize(), CallbackIdentifiers.SteamScreenshots + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(ScreenshotReady_t).GetStructSize(), CallbackIdentifiers.SteamScreenshots + 1, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2777,6 +4545,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamMusic + 2; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(VolumeHasChanged_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((VolumeHasChanged_t)(VolumeHasChanged_t) Marshal.PtrToStructure( p, typeof(VolumeHasChanged_t) )) : ((VolumeHasChanged_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (VolumeHasChanged_t)default(VolumeHasChanged_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (VolumeHasChanged_t)default(VolumeHasChanged_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(VolumeHasChanged_t).GetStructSize(), CallbackIdentifiers.SteamMusic + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(VolumeHasChanged_t).GetStructSize(), CallbackIdentifiers.SteamMusic + 2, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2800,6 +4585,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamMusicRemote + 9; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(MusicPlayerWantsShuffled_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((MusicPlayerWantsShuffled_t)(MusicPlayerWantsShuffled_t) Marshal.PtrToStructure( p, typeof(MusicPlayerWantsShuffled_t) )) : ((MusicPlayerWantsShuffled_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (MusicPlayerWantsShuffled_t)default(MusicPlayerWantsShuffled_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (MusicPlayerWantsShuffled_t)default(MusicPlayerWantsShuffled_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(MusicPlayerWantsShuffled_t).GetStructSize(), CallbackIdentifiers.SteamMusicRemote + 9, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(MusicPlayerWantsShuffled_t).GetStructSize(), CallbackIdentifiers.SteamMusicRemote + 9, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2824,6 +4626,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamMusicRemote + 10; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(MusicPlayerWantsLooped_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((MusicPlayerWantsLooped_t)(MusicPlayerWantsLooped_t) Marshal.PtrToStructure( p, typeof(MusicPlayerWantsLooped_t) )) : ((MusicPlayerWantsLooped_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (MusicPlayerWantsLooped_t)default(MusicPlayerWantsLooped_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (MusicPlayerWantsLooped_t)default(MusicPlayerWantsLooped_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(MusicPlayerWantsLooped_t).GetStructSize(), CallbackIdentifiers.SteamMusicRemote + 10, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(MusicPlayerWantsLooped_t).GetStructSize(), CallbackIdentifiers.SteamMusicRemote + 10, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2847,6 +4666,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamMusic + 11; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(MusicPlayerWantsVolume_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((MusicPlayerWantsVolume_t)(MusicPlayerWantsVolume_t) Marshal.PtrToStructure( p, typeof(MusicPlayerWantsVolume_t) )) : ((MusicPlayerWantsVolume_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (MusicPlayerWantsVolume_t)default(MusicPlayerWantsVolume_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (MusicPlayerWantsVolume_t)default(MusicPlayerWantsVolume_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(MusicPlayerWantsVolume_t).GetStructSize(), CallbackIdentifiers.SteamMusic + 11, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(MusicPlayerWantsVolume_t).GetStructSize(), CallbackIdentifiers.SteamMusic + 11, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2869,6 +4705,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamMusic + 12; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(MusicPlayerSelectsQueueEntry_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((MusicPlayerSelectsQueueEntry_t)(MusicPlayerSelectsQueueEntry_t) Marshal.PtrToStructure( p, typeof(MusicPlayerSelectsQueueEntry_t) )) : ((MusicPlayerSelectsQueueEntry_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (MusicPlayerSelectsQueueEntry_t)default(MusicPlayerSelectsQueueEntry_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (MusicPlayerSelectsQueueEntry_t)default(MusicPlayerSelectsQueueEntry_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(MusicPlayerSelectsQueueEntry_t).GetStructSize(), CallbackIdentifiers.SteamMusic + 12, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(MusicPlayerSelectsQueueEntry_t).GetStructSize(), CallbackIdentifiers.SteamMusic + 12, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2891,6 +4744,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamMusic + 13; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(MusicPlayerSelectsPlaylistEntry_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((MusicPlayerSelectsPlaylistEntry_t)(MusicPlayerSelectsPlaylistEntry_t) Marshal.PtrToStructure( p, typeof(MusicPlayerSelectsPlaylistEntry_t) )) : ((MusicPlayerSelectsPlaylistEntry_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (MusicPlayerSelectsPlaylistEntry_t)default(MusicPlayerSelectsPlaylistEntry_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (MusicPlayerSelectsPlaylistEntry_t)default(MusicPlayerSelectsPlaylistEntry_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(MusicPlayerSelectsPlaylistEntry_t).GetStructSize(), CallbackIdentifiers.SteamMusic + 13, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(MusicPlayerSelectsPlaylistEntry_t).GetStructSize(), CallbackIdentifiers.SteamMusic + 13, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2913,6 +4783,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamMusicRemote + 14; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(MusicPlayerWantsPlayingRepeatStatus_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((MusicPlayerWantsPlayingRepeatStatus_t)(MusicPlayerWantsPlayingRepeatStatus_t) Marshal.PtrToStructure( p, typeof(MusicPlayerWantsPlayingRepeatStatus_t) )) : ((MusicPlayerWantsPlayingRepeatStatus_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (MusicPlayerWantsPlayingRepeatStatus_t)default(MusicPlayerWantsPlayingRepeatStatus_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (MusicPlayerWantsPlayingRepeatStatus_t)default(MusicPlayerWantsPlayingRepeatStatus_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(MusicPlayerWantsPlayingRepeatStatus_t).GetStructSize(), CallbackIdentifiers.SteamMusicRemote + 14, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(MusicPlayerWantsPlayingRepeatStatus_t).GetStructSize(), CallbackIdentifiers.SteamMusicRemote + 14, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2940,6 +4827,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientHTTP + 1; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(HTTPRequestCompleted_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((HTTPRequestCompleted_t)(HTTPRequestCompleted_t) Marshal.PtrToStructure( p, typeof(HTTPRequestCompleted_t) )) : ((HTTPRequestCompleted_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (HTTPRequestCompleted_t)default(HTTPRequestCompleted_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (HTTPRequestCompleted_t)default(HTTPRequestCompleted_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(HTTPRequestCompleted_t).GetStructSize(), CallbackIdentifiers.ClientHTTP + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(HTTPRequestCompleted_t).GetStructSize(), CallbackIdentifiers.ClientHTTP + 1, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2968,6 +4872,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientHTTP + 2; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(HTTPRequestHeadersReceived_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((HTTPRequestHeadersReceived_t)(HTTPRequestHeadersReceived_t) Marshal.PtrToStructure( p, typeof(HTTPRequestHeadersReceived_t) )) : ((HTTPRequestHeadersReceived_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (HTTPRequestHeadersReceived_t)default(HTTPRequestHeadersReceived_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (HTTPRequestHeadersReceived_t)default(HTTPRequestHeadersReceived_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(HTTPRequestHeadersReceived_t).GetStructSize(), CallbackIdentifiers.ClientHTTP + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(HTTPRequestHeadersReceived_t).GetStructSize(), CallbackIdentifiers.ClientHTTP + 2, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -2994,6 +4915,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientHTTP + 3; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(HTTPRequestDataReceived_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((HTTPRequestDataReceived_t)(HTTPRequestDataReceived_t) Marshal.PtrToStructure( p, typeof(HTTPRequestDataReceived_t) )) : ((HTTPRequestDataReceived_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (HTTPRequestDataReceived_t)default(HTTPRequestDataReceived_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (HTTPRequestDataReceived_t)default(HTTPRequestDataReceived_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(HTTPRequestDataReceived_t).GetStructSize(), CallbackIdentifiers.ClientHTTP + 3, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(HTTPRequestDataReceived_t).GetStructSize(), CallbackIdentifiers.ClientHTTP + 3, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3113,6 +5051,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientUGC + 1; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(SteamUGCQueryCompleted_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((SteamUGCQueryCompleted_t)(SteamUGCQueryCompleted_t) Marshal.PtrToStructure( p, typeof(SteamUGCQueryCompleted_t) )) : ((SteamUGCQueryCompleted_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (SteamUGCQueryCompleted_t)default(SteamUGCQueryCompleted_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (SteamUGCQueryCompleted_t)default(SteamUGCQueryCompleted_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(SteamUGCQueryCompleted_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(SteamUGCQueryCompleted_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 1, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3144,6 +5099,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientUGC + 2; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(SteamUGCRequestUGCDetailsResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((SteamUGCRequestUGCDetailsResult_t)(SteamUGCRequestUGCDetailsResult_t) Marshal.PtrToStructure( p, typeof(SteamUGCRequestUGCDetailsResult_t) )) : ((SteamUGCRequestUGCDetailsResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (SteamUGCRequestUGCDetailsResult_t)default(SteamUGCRequestUGCDetailsResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (SteamUGCRequestUGCDetailsResult_t)default(SteamUGCRequestUGCDetailsResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(SteamUGCRequestUGCDetailsResult_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(SteamUGCRequestUGCDetailsResult_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 2, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3171,6 +5143,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientUGC + 3; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(CreateItemResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((CreateItemResult_t)(CreateItemResult_t) Marshal.PtrToStructure( p, typeof(CreateItemResult_t) )) : ((CreateItemResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (CreateItemResult_t)default(CreateItemResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (CreateItemResult_t)default(CreateItemResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(CreateItemResult_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 3, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(CreateItemResult_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 3, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3199,6 +5188,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientUGC + 4; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(SubmitItemUpdateResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((SubmitItemUpdateResult_t)(SubmitItemUpdateResult_t) Marshal.PtrToStructure( p, typeof(SubmitItemUpdateResult_t) )) : ((SubmitItemUpdateResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (SubmitItemUpdateResult_t)default(SubmitItemUpdateResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (SubmitItemUpdateResult_t)default(SubmitItemUpdateResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(SubmitItemUpdateResult_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 4, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(SubmitItemUpdateResult_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 4, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3226,6 +5232,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientUGC + 6; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(DownloadItemResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((DownloadItemResult_t)(DownloadItemResult_t) Marshal.PtrToStructure( p, typeof(DownloadItemResult_t) )) : ((DownloadItemResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (DownloadItemResult_t)default(DownloadItemResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (DownloadItemResult_t)default(DownloadItemResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(DownloadItemResult_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 6, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(DownloadItemResult_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 6, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3253,6 +5276,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientUGC + 7; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(UserFavoriteItemsListChanged_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((UserFavoriteItemsListChanged_t)(UserFavoriteItemsListChanged_t) Marshal.PtrToStructure( p, typeof(UserFavoriteItemsListChanged_t) )) : ((UserFavoriteItemsListChanged_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (UserFavoriteItemsListChanged_t)default(UserFavoriteItemsListChanged_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (UserFavoriteItemsListChanged_t)default(UserFavoriteItemsListChanged_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(UserFavoriteItemsListChanged_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 7, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(UserFavoriteItemsListChanged_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 7, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3281,6 +5321,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientUGC + 8; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(SetUserItemVoteResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((SetUserItemVoteResult_t)(SetUserItemVoteResult_t) Marshal.PtrToStructure( p, typeof(SetUserItemVoteResult_t) )) : ((SetUserItemVoteResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (SetUserItemVoteResult_t)default(SetUserItemVoteResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (SetUserItemVoteResult_t)default(SetUserItemVoteResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(SetUserItemVoteResult_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 8, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(SetUserItemVoteResult_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 8, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3313,6 +5370,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientUGC + 9; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(GetUserItemVoteResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((GetUserItemVoteResult_t)(GetUserItemVoteResult_t) Marshal.PtrToStructure( p, typeof(GetUserItemVoteResult_t) )) : ((GetUserItemVoteResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GetUserItemVoteResult_t)default(GetUserItemVoteResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GetUserItemVoteResult_t)default(GetUserItemVoteResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GetUserItemVoteResult_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 9, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GetUserItemVoteResult_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 9, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3342,6 +5416,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientUGC + 10; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(StartPlaytimeTrackingResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((StartPlaytimeTrackingResult_t)(StartPlaytimeTrackingResult_t) Marshal.PtrToStructure( p, typeof(StartPlaytimeTrackingResult_t) )) : ((StartPlaytimeTrackingResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (StartPlaytimeTrackingResult_t)default(StartPlaytimeTrackingResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (StartPlaytimeTrackingResult_t)default(StartPlaytimeTrackingResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(StartPlaytimeTrackingResult_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 10, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(StartPlaytimeTrackingResult_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 10, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3364,6 +5455,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientUGC + 11; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(StopPlaytimeTrackingResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((StopPlaytimeTrackingResult_t)(StopPlaytimeTrackingResult_t) Marshal.PtrToStructure( p, typeof(StopPlaytimeTrackingResult_t) )) : ((StopPlaytimeTrackingResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (StopPlaytimeTrackingResult_t)default(StopPlaytimeTrackingResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (StopPlaytimeTrackingResult_t)default(StopPlaytimeTrackingResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(StopPlaytimeTrackingResult_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 11, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(StopPlaytimeTrackingResult_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 11, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3388,6 +5496,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientUGC + 12; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(AddUGCDependencyResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((AddUGCDependencyResult_t)(AddUGCDependencyResult_t) Marshal.PtrToStructure( p, typeof(AddUGCDependencyResult_t) )) : ((AddUGCDependencyResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (AddUGCDependencyResult_t)default(AddUGCDependencyResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (AddUGCDependencyResult_t)default(AddUGCDependencyResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(AddUGCDependencyResult_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 12, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(AddUGCDependencyResult_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 12, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3414,6 +5539,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientUGC + 13; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoveUGCDependencyResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoveUGCDependencyResult_t)(RemoveUGCDependencyResult_t) Marshal.PtrToStructure( p, typeof(RemoveUGCDependencyResult_t) )) : ((RemoveUGCDependencyResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoveUGCDependencyResult_t)default(RemoveUGCDependencyResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoveUGCDependencyResult_t)default(RemoveUGCDependencyResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoveUGCDependencyResult_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 13, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoveUGCDependencyResult_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 13, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3440,6 +5582,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientUGC + 14; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(AddAppDependencyResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((AddAppDependencyResult_t)(AddAppDependencyResult_t) Marshal.PtrToStructure( p, typeof(AddAppDependencyResult_t) )) : ((AddAppDependencyResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (AddAppDependencyResult_t)default(AddAppDependencyResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (AddAppDependencyResult_t)default(AddAppDependencyResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(AddAppDependencyResult_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 14, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(AddAppDependencyResult_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 14, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3466,6 +5625,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientUGC + 15; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(RemoveAppDependencyResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((RemoveAppDependencyResult_t)(RemoveAppDependencyResult_t) Marshal.PtrToStructure( p, typeof(RemoveAppDependencyResult_t) )) : ((RemoveAppDependencyResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (RemoveAppDependencyResult_t)default(RemoveAppDependencyResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (RemoveAppDependencyResult_t)default(RemoveAppDependencyResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(RemoveAppDependencyResult_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 15, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(RemoveAppDependencyResult_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 15, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3495,6 +5671,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientUGC + 16; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(GetAppDependenciesResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((GetAppDependenciesResult_t)(GetAppDependenciesResult_t) Marshal.PtrToStructure( p, typeof(GetAppDependenciesResult_t) )) : ((GetAppDependenciesResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GetAppDependenciesResult_t)default(GetAppDependenciesResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GetAppDependenciesResult_t)default(GetAppDependenciesResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GetAppDependenciesResult_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 16, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GetAppDependenciesResult_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 16, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3523,6 +5716,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientUGC + 17; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(DeleteItemResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((DeleteItemResult_t)(DeleteItemResult_t) Marshal.PtrToStructure( p, typeof(DeleteItemResult_t) )) : ((DeleteItemResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (DeleteItemResult_t)default(DeleteItemResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (DeleteItemResult_t)default(DeleteItemResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(DeleteItemResult_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 17, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(DeleteItemResult_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 17, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3546,6 +5756,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamAppList + 1; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(SteamAppInstalled_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((SteamAppInstalled_t)(SteamAppInstalled_t) Marshal.PtrToStructure( p, typeof(SteamAppInstalled_t) )) : ((SteamAppInstalled_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (SteamAppInstalled_t)default(SteamAppInstalled_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (SteamAppInstalled_t)default(SteamAppInstalled_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(SteamAppInstalled_t).GetStructSize(), CallbackIdentifiers.SteamAppList + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(SteamAppInstalled_t).GetStructSize(), CallbackIdentifiers.SteamAppList + 1, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3568,6 +5795,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamAppList + 2; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(SteamAppUninstalled_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((SteamAppUninstalled_t)(SteamAppUninstalled_t) Marshal.PtrToStructure( p, typeof(SteamAppUninstalled_t) )) : ((SteamAppUninstalled_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (SteamAppUninstalled_t)default(SteamAppUninstalled_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (SteamAppUninstalled_t)default(SteamAppUninstalled_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(SteamAppUninstalled_t).GetStructSize(), CallbackIdentifiers.SteamAppList + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(SteamAppUninstalled_t).GetStructSize(), CallbackIdentifiers.SteamAppList + 2, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3590,6 +5834,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamHTMLSurface + 1; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(HTML_BrowserReady_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((HTML_BrowserReady_t)(HTML_BrowserReady_t) Marshal.PtrToStructure( p, typeof(HTML_BrowserReady_t) )) : ((HTML_BrowserReady_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (HTML_BrowserReady_t)default(HTML_BrowserReady_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (HTML_BrowserReady_t)default(HTML_BrowserReady_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(HTML_BrowserReady_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(HTML_BrowserReady_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 1, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3714,6 +5975,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamHTMLSurface + 5; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(HTML_URLChanged_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((HTML_URLChanged_t)(HTML_URLChanged_t) Marshal.PtrToStructure( p, typeof(HTML_URLChanged_t) )) : ((HTML_URLChanged_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (HTML_URLChanged_t)default(HTML_URLChanged_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (HTML_URLChanged_t)default(HTML_URLChanged_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(HTML_URLChanged_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 5, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(HTML_URLChanged_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 5, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3745,6 +6023,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamHTMLSurface + 6; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(HTML_FinishedRequest_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((HTML_FinishedRequest_t)(HTML_FinishedRequest_t) Marshal.PtrToStructure( p, typeof(HTML_FinishedRequest_t) )) : ((HTML_FinishedRequest_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (HTML_FinishedRequest_t)default(HTML_FinishedRequest_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (HTML_FinishedRequest_t)default(HTML_FinishedRequest_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(HTML_FinishedRequest_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 6, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(HTML_FinishedRequest_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 6, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3770,6 +6065,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamHTMLSurface + 7; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(HTML_OpenLinkInNewTab_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((HTML_OpenLinkInNewTab_t)(HTML_OpenLinkInNewTab_t) Marshal.PtrToStructure( p, typeof(HTML_OpenLinkInNewTab_t) )) : ((HTML_OpenLinkInNewTab_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (HTML_OpenLinkInNewTab_t)default(HTML_OpenLinkInNewTab_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (HTML_OpenLinkInNewTab_t)default(HTML_OpenLinkInNewTab_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(HTML_OpenLinkInNewTab_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 7, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(HTML_OpenLinkInNewTab_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 7, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3794,6 +6106,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamHTMLSurface + 8; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(HTML_ChangedTitle_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((HTML_ChangedTitle_t)(HTML_ChangedTitle_t) Marshal.PtrToStructure( p, typeof(HTML_ChangedTitle_t) )) : ((HTML_ChangedTitle_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (HTML_ChangedTitle_t)default(HTML_ChangedTitle_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (HTML_ChangedTitle_t)default(HTML_ChangedTitle_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(HTML_ChangedTitle_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 8, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(HTML_ChangedTitle_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 8, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3819,6 +6148,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamHTMLSurface + 9; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(HTML_SearchResults_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((HTML_SearchResults_t)(HTML_SearchResults_t) Marshal.PtrToStructure( p, typeof(HTML_SearchResults_t) )) : ((HTML_SearchResults_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (HTML_SearchResults_t)default(HTML_SearchResults_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (HTML_SearchResults_t)default(HTML_SearchResults_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(HTML_SearchResults_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 9, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(HTML_SearchResults_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 9, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3847,6 +6193,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamHTMLSurface + 10; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(HTML_CanGoBackAndForward_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((HTML_CanGoBackAndForward_t)(HTML_CanGoBackAndForward_t) Marshal.PtrToStructure( p, typeof(HTML_CanGoBackAndForward_t) )) : ((HTML_CanGoBackAndForward_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (HTML_CanGoBackAndForward_t)default(HTML_CanGoBackAndForward_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (HTML_CanGoBackAndForward_t)default(HTML_CanGoBackAndForward_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(HTML_CanGoBackAndForward_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 10, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(HTML_CanGoBackAndForward_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 10, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3879,6 +6242,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamHTMLSurface + 11; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(HTML_HorizontalScroll_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((HTML_HorizontalScroll_t)(HTML_HorizontalScroll_t) Marshal.PtrToStructure( p, typeof(HTML_HorizontalScroll_t) )) : ((HTML_HorizontalScroll_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (HTML_HorizontalScroll_t)default(HTML_HorizontalScroll_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (HTML_HorizontalScroll_t)default(HTML_HorizontalScroll_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(HTML_HorizontalScroll_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 11, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(HTML_HorizontalScroll_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 11, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3913,6 +6293,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamHTMLSurface + 12; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(HTML_VerticalScroll_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((HTML_VerticalScroll_t)(HTML_VerticalScroll_t) Marshal.PtrToStructure( p, typeof(HTML_VerticalScroll_t) )) : ((HTML_VerticalScroll_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (HTML_VerticalScroll_t)default(HTML_VerticalScroll_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (HTML_VerticalScroll_t)default(HTML_VerticalScroll_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(HTML_VerticalScroll_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 12, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(HTML_VerticalScroll_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 12, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3948,6 +6345,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamHTMLSurface + 13; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(HTML_LinkAtPosition_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((HTML_LinkAtPosition_t)(HTML_LinkAtPosition_t) Marshal.PtrToStructure( p, typeof(HTML_LinkAtPosition_t) )) : ((HTML_LinkAtPosition_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (HTML_LinkAtPosition_t)default(HTML_LinkAtPosition_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (HTML_LinkAtPosition_t)default(HTML_LinkAtPosition_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(HTML_LinkAtPosition_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 13, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(HTML_LinkAtPosition_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 13, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -3978,6 +6392,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamHTMLSurface + 14; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(HTML_JSAlert_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((HTML_JSAlert_t)(HTML_JSAlert_t) Marshal.PtrToStructure( p, typeof(HTML_JSAlert_t) )) : ((HTML_JSAlert_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (HTML_JSAlert_t)default(HTML_JSAlert_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (HTML_JSAlert_t)default(HTML_JSAlert_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(HTML_JSAlert_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 14, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(HTML_JSAlert_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 14, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4002,6 +6433,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamHTMLSurface + 15; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(HTML_JSConfirm_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((HTML_JSConfirm_t)(HTML_JSConfirm_t) Marshal.PtrToStructure( p, typeof(HTML_JSConfirm_t) )) : ((HTML_JSConfirm_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (HTML_JSConfirm_t)default(HTML_JSConfirm_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (HTML_JSConfirm_t)default(HTML_JSConfirm_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(HTML_JSConfirm_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 15, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(HTML_JSConfirm_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 15, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4027,6 +6475,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamHTMLSurface + 16; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(HTML_FileOpenDialog_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((HTML_FileOpenDialog_t)(HTML_FileOpenDialog_t) Marshal.PtrToStructure( p, typeof(HTML_FileOpenDialog_t) )) : ((HTML_FileOpenDialog_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (HTML_FileOpenDialog_t)default(HTML_FileOpenDialog_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (HTML_FileOpenDialog_t)default(HTML_FileOpenDialog_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(HTML_FileOpenDialog_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 16, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(HTML_FileOpenDialog_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 16, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4057,6 +6522,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamHTMLSurface + 21; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(HTML_NewWindow_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((HTML_NewWindow_t)(HTML_NewWindow_t) Marshal.PtrToStructure( p, typeof(HTML_NewWindow_t) )) : ((HTML_NewWindow_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (HTML_NewWindow_t)default(HTML_NewWindow_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (HTML_NewWindow_t)default(HTML_NewWindow_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(HTML_NewWindow_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 21, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(HTML_NewWindow_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 21, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4086,6 +6568,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamHTMLSurface + 22; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(HTML_SetCursor_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((HTML_SetCursor_t)(HTML_SetCursor_t) Marshal.PtrToStructure( p, typeof(HTML_SetCursor_t) )) : ((HTML_SetCursor_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (HTML_SetCursor_t)default(HTML_SetCursor_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (HTML_SetCursor_t)default(HTML_SetCursor_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(HTML_SetCursor_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 22, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(HTML_SetCursor_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 22, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4110,6 +6609,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamHTMLSurface + 23; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(HTML_StatusText_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((HTML_StatusText_t)(HTML_StatusText_t) Marshal.PtrToStructure( p, typeof(HTML_StatusText_t) )) : ((HTML_StatusText_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (HTML_StatusText_t)default(HTML_StatusText_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (HTML_StatusText_t)default(HTML_StatusText_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(HTML_StatusText_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 23, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(HTML_StatusText_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 23, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4134,6 +6650,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamHTMLSurface + 24; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(HTML_ShowToolTip_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((HTML_ShowToolTip_t)(HTML_ShowToolTip_t) Marshal.PtrToStructure( p, typeof(HTML_ShowToolTip_t) )) : ((HTML_ShowToolTip_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (HTML_ShowToolTip_t)default(HTML_ShowToolTip_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (HTML_ShowToolTip_t)default(HTML_ShowToolTip_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(HTML_ShowToolTip_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 24, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(HTML_ShowToolTip_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 24, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4158,6 +6691,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamHTMLSurface + 25; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(HTML_UpdateToolTip_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((HTML_UpdateToolTip_t)(HTML_UpdateToolTip_t) Marshal.PtrToStructure( p, typeof(HTML_UpdateToolTip_t) )) : ((HTML_UpdateToolTip_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (HTML_UpdateToolTip_t)default(HTML_UpdateToolTip_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (HTML_UpdateToolTip_t)default(HTML_UpdateToolTip_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(HTML_UpdateToolTip_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 25, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(HTML_UpdateToolTip_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 25, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4181,6 +6731,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamHTMLSurface + 26; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(HTML_HideToolTip_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((HTML_HideToolTip_t)(HTML_HideToolTip_t) Marshal.PtrToStructure( p, typeof(HTML_HideToolTip_t) )) : ((HTML_HideToolTip_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (HTML_HideToolTip_t)default(HTML_HideToolTip_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (HTML_HideToolTip_t)default(HTML_HideToolTip_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(HTML_HideToolTip_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 26, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(HTML_HideToolTip_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 26, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4204,6 +6771,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamHTMLSurface + 27; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(HTML_BrowserRestarted_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((HTML_BrowserRestarted_t)(HTML_BrowserRestarted_t) Marshal.PtrToStructure( p, typeof(HTML_BrowserRestarted_t) )) : ((HTML_BrowserRestarted_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (HTML_BrowserRestarted_t)default(HTML_BrowserRestarted_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (HTML_BrowserRestarted_t)default(HTML_BrowserRestarted_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(HTML_BrowserRestarted_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 27, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(HTML_BrowserRestarted_t).GetStructSize(), CallbackIdentifiers.SteamHTMLSurface + 27, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4255,6 +6839,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientInventory + 0; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(SteamInventoryResultReady_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((SteamInventoryResultReady_t)(SteamInventoryResultReady_t) Marshal.PtrToStructure( p, typeof(SteamInventoryResultReady_t) )) : ((SteamInventoryResultReady_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (SteamInventoryResultReady_t)default(SteamInventoryResultReady_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (SteamInventoryResultReady_t)default(SteamInventoryResultReady_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(SteamInventoryResultReady_t).GetStructSize(), CallbackIdentifiers.ClientInventory + 0, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(SteamInventoryResultReady_t).GetStructSize(), CallbackIdentifiers.ClientInventory + 0, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4278,6 +6879,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientInventory + 1; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(SteamInventoryFullUpdate_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((SteamInventoryFullUpdate_t)(SteamInventoryFullUpdate_t) Marshal.PtrToStructure( p, typeof(SteamInventoryFullUpdate_t) )) : ((SteamInventoryFullUpdate_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (SteamInventoryFullUpdate_t)default(SteamInventoryFullUpdate_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (SteamInventoryFullUpdate_t)default(SteamInventoryFullUpdate_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(SteamInventoryFullUpdate_t).GetStructSize(), CallbackIdentifiers.ClientInventory + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(SteamInventoryFullUpdate_t).GetStructSize(), CallbackIdentifiers.ClientInventory + 1, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4304,6 +6922,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientInventory + 3; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryEligiblePromoItemDefIDs_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((SteamInventoryEligiblePromoItemDefIDs_t)(SteamInventoryEligiblePromoItemDefIDs_t) Marshal.PtrToStructure( p, typeof(SteamInventoryEligiblePromoItemDefIDs_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (SteamInventoryEligiblePromoItemDefIDs_t)default(SteamInventoryEligiblePromoItemDefIDs_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (SteamInventoryEligiblePromoItemDefIDs_t)default(SteamInventoryEligiblePromoItemDefIDs_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(SteamInventoryEligiblePromoItemDefIDs_t).GetStructSize(), CallbackIdentifiers.ClientInventory + 3, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(SteamInventoryEligiblePromoItemDefIDs_t).GetStructSize(), CallbackIdentifiers.ClientInventory + 3, false ); + actionClient = action; + } + } #endregion } @@ -4318,6 +6953,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientInventory + 4; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(SteamInventoryStartPurchaseResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((SteamInventoryStartPurchaseResult_t)(SteamInventoryStartPurchaseResult_t) Marshal.PtrToStructure( p, typeof(SteamInventoryStartPurchaseResult_t) )) : ((SteamInventoryStartPurchaseResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (SteamInventoryStartPurchaseResult_t)default(SteamInventoryStartPurchaseResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (SteamInventoryStartPurchaseResult_t)default(SteamInventoryStartPurchaseResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(SteamInventoryStartPurchaseResult_t).GetStructSize(), CallbackIdentifiers.ClientInventory + 4, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(SteamInventoryStartPurchaseResult_t).GetStructSize(), CallbackIdentifiers.ClientInventory + 4, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4344,6 +6996,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientInventory + 5; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(SteamInventoryRequestPricesResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((SteamInventoryRequestPricesResult_t)(SteamInventoryRequestPricesResult_t) Marshal.PtrToStructure( p, typeof(SteamInventoryRequestPricesResult_t) )) : ((SteamInventoryRequestPricesResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (SteamInventoryRequestPricesResult_t)default(SteamInventoryRequestPricesResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (SteamInventoryRequestPricesResult_t)default(SteamInventoryRequestPricesResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(SteamInventoryRequestPricesResult_t).GetStructSize(), CallbackIdentifiers.ClientInventory + 5, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(SteamInventoryRequestPricesResult_t).GetStructSize(), CallbackIdentifiers.ClientInventory + 5, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4368,6 +7037,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientVideo + 5; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(BroadcastUploadStop_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((BroadcastUploadStop_t)(BroadcastUploadStop_t) Marshal.PtrToStructure( p, typeof(BroadcastUploadStop_t) )) : ((BroadcastUploadStop_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (BroadcastUploadStop_t)default(BroadcastUploadStop_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (BroadcastUploadStop_t)default(BroadcastUploadStop_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(BroadcastUploadStop_t).GetStructSize(), CallbackIdentifiers.ClientVideo + 5, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(BroadcastUploadStop_t).GetStructSize(), CallbackIdentifiers.ClientVideo + 5, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4393,6 +7079,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientVideo + 11; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(GetVideoURLResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((GetVideoURLResult_t)(GetVideoURLResult_t) Marshal.PtrToStructure( p, typeof(GetVideoURLResult_t) )) : ((GetVideoURLResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GetVideoURLResult_t)default(GetVideoURLResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GetVideoURLResult_t)default(GetVideoURLResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GetVideoURLResult_t).GetStructSize(), CallbackIdentifiers.ClientVideo + 11, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GetVideoURLResult_t).GetStructSize(), CallbackIdentifiers.ClientVideo + 11, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4419,6 +7122,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientVideo + 24; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(GetOPFSettingsResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((GetOPFSettingsResult_t)(GetOPFSettingsResult_t) Marshal.PtrToStructure( p, typeof(GetOPFSettingsResult_t) )) : ((GetOPFSettingsResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GetOPFSettingsResult_t)default(GetOPFSettingsResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GetOPFSettingsResult_t)default(GetOPFSettingsResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GetOPFSettingsResult_t).GetStructSize(), CallbackIdentifiers.ClientVideo + 24, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GetOPFSettingsResult_t).GetStructSize(), CallbackIdentifiers.ClientVideo + 24, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4443,6 +7163,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamGameServer + 1; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientApprove_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((GSClientApprove_t)(GSClientApprove_t) Marshal.PtrToStructure( p, typeof(GSClientApprove_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GSClientApprove_t)default(GSClientApprove_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GSClientApprove_t)default(GSClientApprove_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GSClientApprove_t).GetStructSize(), CallbackIdentifiers.SteamGameServer + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GSClientApprove_t).GetStructSize(), CallbackIdentifiers.SteamGameServer + 1, false ); + actionClient = action; + } + } #endregion } @@ -4458,6 +7195,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamGameServer + 2; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientDeny_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((GSClientDeny_t)(GSClientDeny_t) Marshal.PtrToStructure( p, typeof(GSClientDeny_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GSClientDeny_t)default(GSClientDeny_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GSClientDeny_t)default(GSClientDeny_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GSClientDeny_t).GetStructSize(), CallbackIdentifiers.SteamGameServer + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GSClientDeny_t).GetStructSize(), CallbackIdentifiers.SteamGameServer + 2, false ); + actionClient = action; + } + } #endregion } @@ -4471,6 +7225,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamGameServer + 3; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientKick_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((GSClientKick_t)(GSClientKick_t) Marshal.PtrToStructure( p, typeof(GSClientKick_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GSClientKick_t)default(GSClientKick_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GSClientKick_t)default(GSClientKick_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GSClientKick_t).GetStructSize(), CallbackIdentifiers.SteamGameServer + 3, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GSClientKick_t).GetStructSize(), CallbackIdentifiers.SteamGameServer + 3, false ); + actionClient = action; + } + } #endregion } @@ -4487,6 +7258,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamGameServer + 6; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(GSClientAchievementStatus_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((GSClientAchievementStatus_t)(GSClientAchievementStatus_t) Marshal.PtrToStructure( p, typeof(GSClientAchievementStatus_t) )) : ((GSClientAchievementStatus_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GSClientAchievementStatus_t)default(GSClientAchievementStatus_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GSClientAchievementStatus_t)default(GSClientAchievementStatus_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GSClientAchievementStatus_t).GetStructSize(), CallbackIdentifiers.SteamGameServer + 6, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GSClientAchievementStatus_t).GetStructSize(), CallbackIdentifiers.SteamGameServer + 6, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4513,6 +7301,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUser + 15; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(GSPolicyResponse_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((GSPolicyResponse_t)(GSPolicyResponse_t) Marshal.PtrToStructure( p, typeof(GSPolicyResponse_t) )) : ((GSPolicyResponse_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GSPolicyResponse_t)default(GSPolicyResponse_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GSPolicyResponse_t)default(GSPolicyResponse_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GSPolicyResponse_t).GetStructSize(), CallbackIdentifiers.SteamUser + 15, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GSPolicyResponse_t).GetStructSize(), CallbackIdentifiers.SteamUser + 15, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4538,6 +7343,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamGameServer + 7; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(GSGameplayStats_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((GSGameplayStats_t)(GSGameplayStats_t) Marshal.PtrToStructure( p, typeof(GSGameplayStats_t) )) : ((GSGameplayStats_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GSGameplayStats_t)default(GSGameplayStats_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GSGameplayStats_t)default(GSGameplayStats_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GSGameplayStats_t).GetStructSize(), CallbackIdentifiers.SteamGameServer + 7, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GSGameplayStats_t).GetStructSize(), CallbackIdentifiers.SteamGameServer + 7, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4568,6 +7390,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamGameServer + 8; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientGroupStatus_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((GSClientGroupStatus_t)(GSClientGroupStatus_t) Marshal.PtrToStructure( p, typeof(GSClientGroupStatus_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GSClientGroupStatus_t)default(GSClientGroupStatus_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GSClientGroupStatus_t)default(GSClientGroupStatus_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GSClientGroupStatus_t).GetStructSize(), CallbackIdentifiers.SteamGameServer + 8, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GSClientGroupStatus_t).GetStructSize(), CallbackIdentifiers.SteamGameServer + 8, false ); + actionClient = action; + } + } #endregion } @@ -4587,6 +7426,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamGameServer + 9; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(GSReputation_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((GSReputation_t)(GSReputation_t) Marshal.PtrToStructure( p, typeof(GSReputation_t) )) : ((GSReputation_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GSReputation_t)default(GSReputation_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GSReputation_t)default(GSReputation_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GSReputation_t).GetStructSize(), CallbackIdentifiers.SteamGameServer + 9, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GSReputation_t).GetStructSize(), CallbackIdentifiers.SteamGameServer + 9, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4616,6 +7472,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamGameServer + 10; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(AssociateWithClanResult_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((AssociateWithClanResult_t)(AssociateWithClanResult_t) Marshal.PtrToStructure( p, typeof(AssociateWithClanResult_t) )) : ((AssociateWithClanResult_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (AssociateWithClanResult_t)default(AssociateWithClanResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (AssociateWithClanResult_t)default(AssociateWithClanResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(AssociateWithClanResult_t).GetStructSize(), CallbackIdentifiers.SteamGameServer + 10, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(AssociateWithClanResult_t).GetStructSize(), CallbackIdentifiers.SteamGameServer + 10, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4642,6 +7515,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamGameServer + 11; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(ComputeNewPlayerCompatibilityResult_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((ComputeNewPlayerCompatibilityResult_t)(ComputeNewPlayerCompatibilityResult_t) Marshal.PtrToStructure( p, typeof(ComputeNewPlayerCompatibilityResult_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (ComputeNewPlayerCompatibilityResult_t)default(ComputeNewPlayerCompatibilityResult_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (ComputeNewPlayerCompatibilityResult_t)default(ComputeNewPlayerCompatibilityResult_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(ComputeNewPlayerCompatibilityResult_t).GetStructSize(), CallbackIdentifiers.SteamGameServer + 11, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(ComputeNewPlayerCompatibilityResult_t).GetStructSize(), CallbackIdentifiers.SteamGameServer + 11, false ); + actionClient = action; + } + } #endregion } @@ -4655,6 +7545,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamGameServerStats + 0; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSStatsReceived_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((GSStatsReceived_t)(GSStatsReceived_t) Marshal.PtrToStructure( p, typeof(GSStatsReceived_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GSStatsReceived_t)default(GSStatsReceived_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GSStatsReceived_t)default(GSStatsReceived_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GSStatsReceived_t).GetStructSize(), CallbackIdentifiers.SteamGameServerStats + 0, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GSStatsReceived_t).GetStructSize(), CallbackIdentifiers.SteamGameServerStats + 0, false ); + actionClient = action; + } + } #endregion } @@ -4668,6 +7575,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamGameServerStats + 1; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSStatsStored_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((GSStatsStored_t)(GSStatsStored_t) Marshal.PtrToStructure( p, typeof(GSStatsStored_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GSStatsStored_t)default(GSStatsStored_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GSStatsStored_t)default(GSStatsStored_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GSStatsStored_t).GetStructSize(), CallbackIdentifiers.SteamGameServerStats + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GSStatsStored_t).GetStructSize(), CallbackIdentifiers.SteamGameServerStats + 1, false ); + actionClient = action; + } + } #endregion } @@ -4680,6 +7604,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUserStats + 8; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSStatsUnloaded_t) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => ((GSStatsUnloaded_t)(GSStatsUnloaded_t) Marshal.PtrToStructure( p, typeof(GSStatsUnloaded_t) ) ); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GSStatsUnloaded_t)default(GSStatsUnloaded_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GSStatsUnloaded_t)default(GSStatsUnloaded_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GSStatsUnloaded_t).GetStructSize(), CallbackIdentifiers.SteamUserStats + 8, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GSStatsUnloaded_t).GetStructSize(), CallbackIdentifiers.SteamUserStats + 8, false ); + actionClient = action; + } + } #endregion } @@ -4691,6 +7632,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamMusic + 1; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(PlaybackStatusHasChanged_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((PlaybackStatusHasChanged_t)(PlaybackStatusHasChanged_t) Marshal.PtrToStructure( p, typeof(PlaybackStatusHasChanged_t) )) : ((PlaybackStatusHasChanged_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (PlaybackStatusHasChanged_t)default(PlaybackStatusHasChanged_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (PlaybackStatusHasChanged_t)default(PlaybackStatusHasChanged_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(PlaybackStatusHasChanged_t).GetStructSize(), CallbackIdentifiers.SteamMusic + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(PlaybackStatusHasChanged_t).GetStructSize(), CallbackIdentifiers.SteamMusic + 1, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4711,6 +7669,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientVideo + 4; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(BroadcastUploadStart_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((BroadcastUploadStart_t)(BroadcastUploadStart_t) Marshal.PtrToStructure( p, typeof(BroadcastUploadStart_t) )) : ((BroadcastUploadStart_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (BroadcastUploadStart_t)default(BroadcastUploadStart_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (BroadcastUploadStart_t)default(BroadcastUploadStart_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(BroadcastUploadStart_t).GetStructSize(), CallbackIdentifiers.ClientVideo + 4, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(BroadcastUploadStart_t).GetStructSize(), CallbackIdentifiers.ClientVideo + 4, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4731,6 +7706,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamApps + 14; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(NewUrlLaunchParameters_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((NewUrlLaunchParameters_t)(NewUrlLaunchParameters_t) Marshal.PtrToStructure( p, typeof(NewUrlLaunchParameters_t) )) : ((NewUrlLaunchParameters_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (NewUrlLaunchParameters_t)default(NewUrlLaunchParameters_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (NewUrlLaunchParameters_t)default(NewUrlLaunchParameters_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(NewUrlLaunchParameters_t).GetStructSize(), CallbackIdentifiers.SteamApps + 14, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(NewUrlLaunchParameters_t).GetStructSize(), CallbackIdentifiers.SteamApps + 14, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4753,6 +7745,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientUGC + 5; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(ItemInstalled_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((ItemInstalled_t)(ItemInstalled_t) Marshal.PtrToStructure( p, typeof(ItemInstalled_t) )) : ((ItemInstalled_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (ItemInstalled_t)default(ItemInstalled_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (ItemInstalled_t)default(ItemInstalled_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(ItemInstalled_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 5, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(ItemInstalled_t).GetStructSize(), CallbackIdentifiers.ClientUGC + 5, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4870,6 +7879,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.ClientInventory + 2; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(SteamInventoryDefinitionUpdate_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((SteamInventoryDefinitionUpdate_t)(SteamInventoryDefinitionUpdate_t) Marshal.PtrToStructure( p, typeof(SteamInventoryDefinitionUpdate_t) )) : ((SteamInventoryDefinitionUpdate_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (SteamInventoryDefinitionUpdate_t)default(SteamInventoryDefinitionUpdate_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (SteamInventoryDefinitionUpdate_t)default(SteamInventoryDefinitionUpdate_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(SteamInventoryDefinitionUpdate_t).GetStructSize(), CallbackIdentifiers.ClientInventory + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(SteamInventoryDefinitionUpdate_t).GetStructSize(), CallbackIdentifiers.ClientInventory + 2, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4890,6 +7916,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamParentalSettings + 1; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(SteamParentalSettingsChanged_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((SteamParentalSettingsChanged_t)(SteamParentalSettingsChanged_t) Marshal.PtrToStructure( p, typeof(SteamParentalSettingsChanged_t) )) : ((SteamParentalSettingsChanged_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (SteamParentalSettingsChanged_t)default(SteamParentalSettingsChanged_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (SteamParentalSettingsChanged_t)default(SteamParentalSettingsChanged_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(SteamParentalSettingsChanged_t).GetStructSize(), CallbackIdentifiers.SteamParentalSettings + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(SteamParentalSettingsChanged_t).GetStructSize(), CallbackIdentifiers.SteamParentalSettings + 1, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4910,6 +7953,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUser + 1; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(SteamServersConnected_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((SteamServersConnected_t)(SteamServersConnected_t) Marshal.PtrToStructure( p, typeof(SteamServersConnected_t) )) : ((SteamServersConnected_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (SteamServersConnected_t)default(SteamServersConnected_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (SteamServersConnected_t)default(SteamServersConnected_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(SteamServersConnected_t).GetStructSize(), CallbackIdentifiers.SteamUser + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(SteamServersConnected_t).GetStructSize(), CallbackIdentifiers.SteamUser + 1, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4950,6 +8010,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamGameCoordinator + 1; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(GCMessageAvailable_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((GCMessageAvailable_t)(GCMessageAvailable_t) Marshal.PtrToStructure( p, typeof(GCMessageAvailable_t) )) : ((GCMessageAvailable_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GCMessageAvailable_t)default(GCMessageAvailable_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GCMessageAvailable_t)default(GCMessageAvailable_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GCMessageAvailable_t).GetStructSize(), CallbackIdentifiers.SteamGameCoordinator + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GCMessageAvailable_t).GetStructSize(), CallbackIdentifiers.SteamGameCoordinator + 1, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4971,6 +8048,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamGameCoordinator + 2; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(GCMessageFailed_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((GCMessageFailed_t)(GCMessageFailed_t) Marshal.PtrToStructure( p, typeof(GCMessageFailed_t) )) : ((GCMessageFailed_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (GCMessageFailed_t)default(GCMessageFailed_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (GCMessageFailed_t)default(GCMessageFailed_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(GCMessageFailed_t).GetStructSize(), CallbackIdentifiers.SteamGameCoordinator + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(GCMessageFailed_t).GetStructSize(), CallbackIdentifiers.SteamGameCoordinator + 2, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -4991,6 +8085,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamScreenshots + 2; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(ScreenshotRequested_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((ScreenshotRequested_t)(ScreenshotRequested_t) Marshal.PtrToStructure( p, typeof(ScreenshotRequested_t) )) : ((ScreenshotRequested_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (ScreenshotRequested_t)default(ScreenshotRequested_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (ScreenshotRequested_t)default(ScreenshotRequested_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(ScreenshotRequested_t).GetStructSize(), CallbackIdentifiers.SteamScreenshots + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(ScreenshotRequested_t).GetStructSize(), CallbackIdentifiers.SteamScreenshots + 2, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -5011,6 +8122,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUser + 25; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(LicensesUpdated_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((LicensesUpdated_t)(LicensesUpdated_t) Marshal.PtrToStructure( p, typeof(LicensesUpdated_t) )) : ((LicensesUpdated_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (LicensesUpdated_t)default(LicensesUpdated_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (LicensesUpdated_t)default(LicensesUpdated_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(LicensesUpdated_t).GetStructSize(), CallbackIdentifiers.SteamUser + 25, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(LicensesUpdated_t).GetStructSize(), CallbackIdentifiers.SteamUser + 25, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -5031,6 +8159,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUtils + 4; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(SteamShutdown_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((SteamShutdown_t)(SteamShutdown_t) Marshal.PtrToStructure( p, typeof(SteamShutdown_t) )) : ((SteamShutdown_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (SteamShutdown_t)default(SteamShutdown_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (SteamShutdown_t)default(SteamShutdown_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(SteamShutdown_t).GetStructSize(), CallbackIdentifiers.SteamUtils + 4, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(SteamShutdown_t).GetStructSize(), CallbackIdentifiers.SteamUtils + 4, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -5051,6 +8196,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUtils + 1; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(IPCountry_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((IPCountry_t)(IPCountry_t) Marshal.PtrToStructure( p, typeof(IPCountry_t) )) : ((IPCountry_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (IPCountry_t)default(IPCountry_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (IPCountry_t)default(IPCountry_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(IPCountry_t).GetStructSize(), CallbackIdentifiers.SteamUtils + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(IPCountry_t).GetStructSize(), CallbackIdentifiers.SteamUtils + 1, false ); + actionClient = action; + } + } #endregion #region Packed Versions @@ -5072,6 +8234,23 @@ namespace Steamworks.Data public int GetCallbackId() => CallbackIdentifiers.SteamUser + 17; public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(IPCFailure_t) : typeof(Pack8) ); public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? ((IPCFailure_t)(IPCFailure_t) Marshal.PtrToStructure( p, typeof(IPCFailure_t) )) : ((IPCFailure_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( (IPCFailure_t)default(IPCFailure_t).Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( (IPCFailure_t)default(IPCFailure_t).Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, default(IPCFailure_t).GetStructSize(), CallbackIdentifiers.SteamUser + 17, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, default(IPCFailure_t).GetStructSize(), CallbackIdentifiers.SteamUser + 17, false ); + actionClient = action; + } + } #endregion #region Packed Versions diff --git a/Facepunch.Steamworks/SteamApps.cs b/Facepunch.Steamworks/SteamApps.cs index fdb95e4..d90594b 100644 --- a/Facepunch.Steamworks/SteamApps.cs +++ b/Facepunch.Steamworks/SteamApps.cs @@ -32,8 +32,8 @@ namespace Steamworks internal static void InstallEvents() { - Event.CreateEvent( x => OnDlcInstalled?.Invoke( x.AppID ) ); - Event.CreateEvent( x => OnNewLaunchParameters?.Invoke() ); + DlcInstalled_t.Install( x => OnDlcInstalled?.Invoke( x.AppID ) ); + NewUrlLaunchParameters_t.Install( x => OnNewLaunchParameters?.Invoke() ); } /// diff --git a/Facepunch.Steamworks/SteamClient.cs b/Facepunch.Steamworks/SteamClient.cs index c7f5450..550eb71 100644 --- a/Facepunch.Steamworks/SteamClient.cs +++ b/Facepunch.Steamworks/SteamClient.cs @@ -64,7 +64,7 @@ namespace Steamworks public static void Shutdown() { - Events.DisposeAllClient(); + Event.DisposeAllClient(); initialized = false; diff --git a/Facepunch.Steamworks/SteamFriends.cs b/Facepunch.Steamworks/SteamFriends.cs index dd38f2e..7cc416c 100644 --- a/Facepunch.Steamworks/SteamFriends.cs +++ b/Facepunch.Steamworks/SteamFriends.cs @@ -36,13 +36,13 @@ namespace Steamworks internal static void InstallEvents() { - Event.CreateEvent( x => OnPersonaStateChange?.Invoke( new Friend( x.SteamID ) ) ); - Event.CreateEvent( x => OnGameRichPresenceJoinRequested?.Invoke( new Friend( x.SteamIDFriend), x.Connect ) ); - Event.CreateEvent( OnFriendChatMessage ); - Event.CreateEvent( x => OnGameOverlayActivated?.Invoke() ); - Event.CreateEvent( x => OnGameServerChangeRequested?.Invoke( x.Server, x.Password ) ); - Event.CreateEvent( x => OnGameLobbyJoinRequested?.Invoke( x.SteamIDLobby, x.SteamIDFriend ) ); - Event.CreateEvent( x => OnFriendRichPresenceUpdate?.Invoke( new Friend( x.SteamIDFriend ) ) ); + FriendStateChange_t.Install( x => OnPersonaStateChange?.Invoke( new Friend( x.SteamID ) ) ); + GameRichPresenceJoinRequested_t.Install( x => OnGameRichPresenceJoinRequested?.Invoke( new Friend( x.SteamIDFriend), x.Connect ) ); + GameConnectedFriendChatMsg_t.Install( OnFriendChatMessage ); + GameOverlayActivated_t.Install( x => OnGameOverlayActivated?.Invoke() ); + GameServerChangeRequested_t.Install( x => OnGameServerChangeRequested?.Invoke( x.Server, x.Password ) ); + GameLobbyJoinRequested_t.Install( x => OnGameLobbyJoinRequested?.Invoke( x.SteamIDLobby, x.SteamIDFriend ) ); + FriendRichPresenceUpdate_t.Install( x => OnFriendRichPresenceUpdate?.Invoke( new Friend( x.SteamIDFriend ) ) ); } /// diff --git a/Facepunch.Steamworks/SteamInventory.cs b/Facepunch.Steamworks/SteamInventory.cs index ef6fb8a..78c9120 100644 --- a/Facepunch.Steamworks/SteamInventory.cs +++ b/Facepunch.Steamworks/SteamInventory.cs @@ -32,8 +32,8 @@ namespace Steamworks internal static void InstallEvents() { - Event.CreateEvent( x => OnInventoryUpdated?.Invoke( x.Handle ) ); - Event.CreateEvent( x => DefinitionsUpdated() ); + SteamInventoryFullUpdate_t.Install( x => OnInventoryUpdated?.Invoke( x.Handle ) ); + SteamInventoryDefinitionUpdate_t.Install( x => DefinitionsUpdated() ); } public static event Action OnInventoryUpdated; diff --git a/Facepunch.Steamworks/SteamMusic.cs b/Facepunch.Steamworks/SteamMusic.cs index 1ac1ada..2a33eb9 100644 --- a/Facepunch.Steamworks/SteamMusic.cs +++ b/Facepunch.Steamworks/SteamMusic.cs @@ -30,8 +30,8 @@ namespace Steamworks internal static void InstallEvents() { - Event.CreateEvent( x => OnPlaybackChanged?.Invoke() ); - Event.CreateEvent( x => OnVolumeChanged?.Invoke( x.NewVolume ) ); + PlaybackStatusHasChanged_t.Install( x => OnPlaybackChanged?.Invoke() ); + VolumeHasChanged_t.Install( x => OnVolumeChanged?.Invoke( x.NewVolume ) ); } /// diff --git a/Facepunch.Steamworks/SteamParental.cs b/Facepunch.Steamworks/SteamParental.cs index 3ee3dbd..1d0c512 100644 --- a/Facepunch.Steamworks/SteamParental.cs +++ b/Facepunch.Steamworks/SteamParental.cs @@ -30,7 +30,7 @@ namespace Steamworks internal static void InstallEvents() { - Event.CreateEvent( x => OnSettingsChanged?.Invoke() ); + SteamParentalSettingsChanged_t.Install( x => OnSettingsChanged?.Invoke() ); } /// diff --git a/Facepunch.Steamworks/SteamScreenshots.cs b/Facepunch.Steamworks/SteamScreenshots.cs index 394c100..441fa0e 100644 --- a/Facepunch.Steamworks/SteamScreenshots.cs +++ b/Facepunch.Steamworks/SteamScreenshots.cs @@ -30,8 +30,8 @@ namespace Steamworks internal static void InstallEvents() { - Event.CreateEvent( x => OnScreenshotRequested?.Invoke() ); - Event.CreateEvent( x => + ScreenshotRequested_t.Install( x => OnScreenshotRequested?.Invoke() ); + ScreenshotReady_t.Install( x => { if ( x.Result != Result.OK ) OnScreenshotFailed?.Invoke( x.Result ); diff --git a/Facepunch.Steamworks/SteamServer.cs b/Facepunch.Steamworks/SteamServer.cs index e2ffec7..04b4d53 100644 --- a/Facepunch.Steamworks/SteamServer.cs +++ b/Facepunch.Steamworks/SteamServer.cs @@ -30,7 +30,7 @@ namespace Steamworks internal static void InstallEvents() { - Event.CreateEvent( x => OnValidateAuthTicketResponse?.Invoke( x.SteamID, x.OwnerSteamID, x.AuthSessionResponse ), true ); + ValidateAuthTicketResponse_t.Install( x => OnValidateAuthTicketResponse?.Invoke( x.SteamID, x.OwnerSteamID, x.AuthSessionResponse ), true ); SteamServerInventory.InstallEvents(); } @@ -78,7 +78,7 @@ namespace Steamworks public static void Shutdown() { - Events.DisposeAllServer(); + Event.DisposeAllServer(); initialized = false; diff --git a/Facepunch.Steamworks/SteamServerInventory.cs b/Facepunch.Steamworks/SteamServerInventory.cs index ebd2d49..464998e 100644 --- a/Facepunch.Steamworks/SteamServerInventory.cs +++ b/Facepunch.Steamworks/SteamServerInventory.cs @@ -29,7 +29,7 @@ namespace Steamworks internal static void InstallEvents() { - Event.CreateEvent( x => DefinitionsUpdated(), true ); + SteamInventoryDefinitionUpdate_t.Install( x => DefinitionsUpdated(), true ); } public static event Action OnDefinitionsUpdated; diff --git a/Facepunch.Steamworks/SteamUser.cs b/Facepunch.Steamworks/SteamUser.cs index 62e6f74..6e4bcd2 100644 --- a/Facepunch.Steamworks/SteamUser.cs +++ b/Facepunch.Steamworks/SteamUser.cs @@ -40,14 +40,14 @@ namespace Steamworks internal static void InstallEvents() { - Event.CreateEvent( x => OnSteamServersConnected?.Invoke() ); - Event.CreateEvent( x => OnSteamServerConnectFailure?.Invoke() ); - Event.CreateEvent( x => OnSteamServersDisconnected?.Invoke() ); - Event.CreateEvent( x => OnClientGameServerDeny?.Invoke() ); - Event.CreateEvent( x => OnLicensesUpdated?.Invoke() ); - Event.CreateEvent( x => OnValidateAuthTicketResponse?.Invoke( x.SteamID, x.OwnerSteamID, x.AuthSessionResponse ) ); - Event.CreateEvent( x => OnMicroTxnAuthorizationResponse?.Invoke( x.AppID, x.OrderID, x.Authorized != 0 ) ); - Event.CreateEvent( x => OnGameWebCallback?.Invoke( x.URL ) ); + SteamServersConnected_t.Install( x => OnSteamServersConnected?.Invoke() ); + SteamServerConnectFailure_t.Install( x => OnSteamServerConnectFailure?.Invoke() ); + SteamServersDisconnected_t.Install( x => OnSteamServersDisconnected?.Invoke() ); + ClientGameServerDeny_t.Install( x => OnClientGameServerDeny?.Invoke() ); + LicensesUpdated_t.Install( x => OnLicensesUpdated?.Invoke() ); + ValidateAuthTicketResponse_t.Install( x => OnValidateAuthTicketResponse?.Invoke( x.SteamID, x.OwnerSteamID, x.AuthSessionResponse ) ); + MicroTxnAuthorizationResponse_t.Install( x => OnMicroTxnAuthorizationResponse?.Invoke( x.AppID, x.OrderID, x.Authorized != 0 ) ); + GameWebCallback_t.Install( x => OnGameWebCallback?.Invoke( x.URL ) ); } /// diff --git a/Facepunch.Steamworks/SteamUserStats.cs b/Facepunch.Steamworks/SteamUserStats.cs index 505986b..e7f1884 100644 --- a/Facepunch.Steamworks/SteamUserStats.cs +++ b/Facepunch.Steamworks/SteamUserStats.cs @@ -32,7 +32,7 @@ namespace Steamworks internal static void InstallEvents() { - Event.CreateEvent( x => + UserStatsReceived_t.Install( x => { if ( x.SteamIDUser == SteamClient.SteamId ) StatsRecieved = true; @@ -40,9 +40,9 @@ namespace Steamworks OnUserStatsReceived?.Invoke( x.SteamIDUser, x.Result ); } ); - Event.CreateEvent( x => OnUserStatsStored?.Invoke( x.Result ) ); - Event.CreateEvent( x => OnAchievementProgress?.Invoke( x.AchievementName, (int) x.CurProgress, (int)x.MaxProgress ) ); - Event.CreateEvent( x => OnUserStatsUnloaded?.Invoke( x.SteamIDUser ) ); + UserStatsStored_t.Install( x => OnUserStatsStored?.Invoke( x.Result ) ); + UserAchievementStored_t.Install( x => OnAchievementProgress?.Invoke( x.AchievementName, (int) x.CurProgress, (int)x.MaxProgress ) ); + UserStatsUnloaded_t.Install( x => OnUserStatsUnloaded?.Invoke( x.SteamIDUser ) ); } /// diff --git a/Facepunch.Steamworks/SteamUtils.cs b/Facepunch.Steamworks/SteamUtils.cs index 3b591fc..367e5a7 100644 --- a/Facepunch.Steamworks/SteamUtils.cs +++ b/Facepunch.Steamworks/SteamUtils.cs @@ -31,10 +31,10 @@ namespace Steamworks internal static void InstallEvents() { - Event.CreateEvent( x => OnIpCountryChanged?.Invoke() ); - Event.CreateEvent( x => OnLowBatteryPower?.Invoke( x.MinutesBatteryLeft ) ); - Event.CreateEvent( x => OnSteamShutdown?.Invoke() ); - Event.CreateEvent( x => OnGamepadTextInputDismissed?.Invoke( x.Submitted ) ); + IPCountry_t.Install( x => OnIpCountryChanged?.Invoke() ); + LowBatteryPower_t.Install( x => OnLowBatteryPower?.Invoke( x.MinutesBatteryLeft ) ); + SteamShutdown_t.Install( x => OnSteamShutdown?.Invoke() ); + GamepadTextInputDismissed_t.Install( x => OnGamepadTextInputDismissed?.Invoke( x.Submitted ) ); } /// diff --git a/Facepunch.Steamworks/SteamVideo.cs b/Facepunch.Steamworks/SteamVideo.cs index 05cce60..e0c65d3 100644 --- a/Facepunch.Steamworks/SteamVideo.cs +++ b/Facepunch.Steamworks/SteamVideo.cs @@ -31,8 +31,8 @@ namespace Steamworks internal static void InstallEvents() { - Event.CreateEvent( x => OnBroadcastStarted?.Invoke() ); - Event.CreateEvent( x => OnBroadcastStopped?.Invoke( x.Result ) ); + BroadcastUploadStart_t.Install( x => OnBroadcastStarted?.Invoke() ); + BroadcastUploadStop_t.Install( x => OnBroadcastStopped?.Invoke( x.Result ) ); } public static event Action OnBroadcastStarted; diff --git a/Generator/CodeWriter/Struct.cs b/Generator/CodeWriter/Struct.cs index 2f17b34..6886901 100644 --- a/Generator/CodeWriter/Struct.cs +++ b/Generator/CodeWriter/Struct.cs @@ -53,8 +53,6 @@ namespace Generator if ( name.Contains( "::" ) ) continue; - - int defaultPack = 8; if ( c.Fields.Any( x => x.Type.Contains( "CSteamID" ) ) && !ForceLargePackStructs.Contains( c.Name ) ) @@ -90,6 +88,29 @@ namespace Generator WriteLine( $"public int GetStructSize() => System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof({name}) : typeof(Pack8) );" ); WriteLine( $"public Steamworks.ISteamCallback Fill( IntPtr p ) => Config.PackSmall ? (({name})({name}) Marshal.PtrToStructure( p, typeof({name}) )) : (({name})(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) ));" ); } + + WriteLine( $"static Action<{name}> actionClient;" ); + WriteLine( $"[MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( ({name})default({name}).Fill( pvParam ) );" ); + + WriteLine( $"static Action<{name}> actionServer;" ); + WriteLine( $"[MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( ({name})default({name}).Fill( pvParam ) );" ); + + StartBlock( $"public static void Install( Action<{name}> action, bool server = false )" ); + { + StartBlock( "if ( server )" ); + { + WriteLine( $"Event.Register( OnServer, default({name}).GetStructSize(), {c.CallbackId}, true );" ); + WriteLine( $"actionServer = action;" ); + } + Else(); + { + WriteLine( $"Event.Register( OnClient, default({name}).GetStructSize(), {c.CallbackId}, false );" ); + WriteLine( $"actionClient = action;" ); + } + EndBlock(); + + } + EndBlock(); } WriteLine( "#endregion" ); }