diff --git a/Facepunch.Steamworks/Generated/SteamStructs.cs b/Facepunch.Steamworks/Generated/SteamStructs.cs index 1e1839e..f9606a2 100644 --- a/Facepunch.Steamworks/Generated/SteamStructs.cs +++ b/Facepunch.Steamworks/Generated/SteamStructs.cs @@ -11762,6 +11762,128 @@ namespace Steamworks.Data #endregion } + [StructLayout( LayoutKind.Sequential, Pack = 4 )] + internal struct AvailableBeaconLocationsUpdated_t + { + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(AvailableBeaconLocationsUpdated_t) : typeof(Pack8) ); + internal static AvailableBeaconLocationsUpdated_t Fill( IntPtr p ) => Config.PackSmall ? ((AvailableBeaconLocationsUpdated_t)(AvailableBeaconLocationsUpdated_t) Marshal.PtrToStructure( p, typeof(AvailableBeaconLocationsUpdated_t) )) : ((AvailableBeaconLocationsUpdated_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamParties + 5, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamParties + 5, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamParties + 5, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + #region Packed Versions + + [StructLayout( LayoutKind.Sequential, Pack = 8 )] + public struct Pack8 + { + + public static implicit operator AvailableBeaconLocationsUpdated_t ( AvailableBeaconLocationsUpdated_t.Pack8 d ) => new AvailableBeaconLocationsUpdated_t{ }; + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = 4 )] + internal struct ActiveBeaconsUpdated_t + { + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( Config.PackSmall ? typeof(ActiveBeaconsUpdated_t) : typeof(Pack8) ); + internal static ActiveBeaconsUpdated_t Fill( IntPtr p ) => Config.PackSmall ? ((ActiveBeaconsUpdated_t)(ActiveBeaconsUpdated_t) Marshal.PtrToStructure( p, typeof(ActiveBeaconsUpdated_t) )) : ((ActiveBeaconsUpdated_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) )); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamParties + 6, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamParties + 6, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamParties + 6, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + #region Packed Versions + + [StructLayout( LayoutKind.Sequential, Pack = 8 )] + public struct Pack8 + { + + public static implicit operator ActiveBeaconsUpdated_t ( ActiveBeaconsUpdated_t.Pack8 d ) => new ActiveBeaconsUpdated_t{ }; + } + #endregion + } + [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct PlaybackStatusHasChanged_t { diff --git a/Generator/steam_api_missing.json b/Generator/steam_api_missing.json index cbb1b1e..12babf9 100644 --- a/Generator/steam_api_missing.json +++ b/Generator/steam_api_missing.json @@ -3,10 +3,20 @@ - { - "struct": "PlaybackStatusHasChanged_t", - "fields": [ ] - }, + { + "struct": "AvailableBeaconLocationsUpdated_t", + "fields": [ ] + }, + + { + "struct": "ActiveBeaconsUpdated_t", + "fields": [ ] + }, + + { + "struct": "PlaybackStatusHasChanged_t", + "fields": [ ] + }, { "struct": "BroadcastUploadStart_t",