diff --git a/BoneSync.sln b/BoneSync.sln index 41c0a72..f46951f 100644 --- a/BoneSync.sln +++ b/BoneSync.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 17.9.34616.47 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BoneSync", "BoneSync\BoneSync.csproj", "{C33921DC-5778-4EEC-A2D0-E0AE522CC701}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Facepunch.Steamworks.Win64", "BoneSync\Facepunch.Steamworks\Facepunch.Steamworks.Win64.csproj", "{0289F09E-D594-46A9-96A7-B0F31F5D97B0}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,6 +17,10 @@ Global {C33921DC-5778-4EEC-A2D0-E0AE522CC701}.Debug|Any CPU.Build.0 = Debug|Any CPU {C33921DC-5778-4EEC-A2D0-E0AE522CC701}.Release|Any CPU.ActiveCfg = Release|Any CPU {C33921DC-5778-4EEC-A2D0-E0AE522CC701}.Release|Any CPU.Build.0 = Release|Any CPU + {0289F09E-D594-46A9-96A7-B0F31F5D97B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0289F09E-D594-46A9-96A7-B0F31F5D97B0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0289F09E-D594-46A9-96A7-B0F31F5D97B0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0289F09E-D594-46A9-96A7-B0F31F5D97B0}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/BoneSync/BoneSync.csproj b/BoneSync/BoneSync.csproj index fc83336..9107957 100644 --- a/BoneSync/BoneSync.csproj +++ b/BoneSync/BoneSync.csproj @@ -47,6 +47,7 @@ + @@ -54,6 +55,12 @@ + + + {0289f09e-d594-46a9-96a7-b0f31f5d97b0} + Facepunch.Steamworks.Win64 + + COPY "$(TargetPath)" "C:\Program Files (x86)\Steam\steamapps\common\BONEWORKS\BONEWORKS\Mods" diff --git a/BoneSync/Facepunch.Steamworks/Callbacks/CallResult.cs b/BoneSync/Facepunch.Steamworks/Callbacks/CallResult.cs new file mode 100644 index 0000000..ac9574e --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Callbacks/CallResult.cs @@ -0,0 +1,95 @@ +using Facepunch.Steamworks.Data; +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Threading; +using System.Threading.Tasks; + +namespace Facepunch.Steamworks +{ + /// + /// An awaitable version of a SteamAPICall_t + /// + internal struct CallResult : INotifyCompletion where T : struct, ICallbackData + { + SteamAPICall_t call; + ISteamUtils utils; + bool server; + + public CallResult( SteamAPICall_t call, bool server ) + { + this.call = call; + this.server = server; + + utils = (server ? SteamUtils.InterfaceServer : SteamUtils.InterfaceClient) as ISteamUtils; + + if ( utils == null ) + utils = SteamUtils.Interface as ISteamUtils; + } + + /// + /// This gets called if IsComplete returned false on the first call. + /// The Action "continues" the async call. We pass it to the Dispatch + /// to be called when the callback returns. + /// + public void OnCompleted( Action continuation ) + { + Dispatch.OnCallComplete( call, continuation, server ); + } + + /// + /// Gets the result. This is called internally by the async shit. + /// + public T? GetResult() + { + bool failed = false; + if ( !utils.IsAPICallCompleted( call, ref failed ) || failed ) + return null; + + var t = default( T ); + var size = t.DataSize; + var ptr = Marshal.AllocHGlobal( size ); + + try + { + if ( !utils.GetAPICallResult( call, ptr, size, (int)t.CallbackType, ref failed ) || failed ) + { + Dispatch.OnDebugCallback?.Invoke( t.CallbackType, "!GetAPICallResult or failed", server ); + return null; + } + + Dispatch.OnDebugCallback?.Invoke( t.CallbackType, Dispatch.CallbackToString( t.CallbackType, ptr, size ), server ); + + return ((T)Marshal.PtrToStructure( ptr, typeof( T ) )); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + + /// + /// Return true if complete or failed + /// + public bool IsCompleted + { + get + { + bool failed = false; + if ( utils.IsAPICallCompleted( call, ref failed ) || failed ) + return true; + + return false; + } + } + + /// + /// This is what makes this struct awaitable + /// + internal CallResult GetAwaiter() + { + return this; + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Callbacks/ICallbackData.cs b/BoneSync/Facepunch.Steamworks/Callbacks/ICallbackData.cs new file mode 100644 index 0000000..349df00 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Callbacks/ICallbackData.cs @@ -0,0 +1,17 @@ +using Facepunch.Steamworks.Data; +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Threading.Tasks; + +namespace Facepunch.Steamworks +{ + /// + /// Gives us a generic way to get the CallbackId of structs + /// + internal interface ICallbackData + { + CallbackType CallbackType { get; } + int DataSize { get; } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Classes/AuthTicket.cs b/BoneSync/Facepunch.Steamworks/Classes/AuthTicket.cs new file mode 100644 index 0000000..9336630 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Classes/AuthTicket.cs @@ -0,0 +1,30 @@ +using System; + +namespace Facepunch.Steamworks +{ + public class AuthTicket : IDisposable + { + public byte[] Data; + public uint Handle; + + /// + /// Cancels a ticket. + /// You should cancel your ticket when you close the game or leave a server. + /// + public void Cancel() + { + if ( Handle != 0 ) + { + SteamUser.Internal.CancelAuthTicket( Handle ); + } + + Handle = 0; + Data = null; + } + + public void Dispose() + { + Cancel(); + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Classes/Dispatch.cs b/BoneSync/Facepunch.Steamworks/Classes/Dispatch.cs new file mode 100644 index 0000000..ed9dd1f --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Classes/Dispatch.cs @@ -0,0 +1,333 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; +using System.Linq; + +namespace Facepunch.Steamworks +{ + /// + /// Responsible for all callback/callresult handling + /// + /// This manually pumps Steam's message queue and dispatches those + /// events to any waiting callbacks/callresults. + /// + public static class Dispatch + { + /// + /// If set then we'll call this function every time a callback is generated. + /// + /// This is SLOW!! - it's for debugging - don't keep it on all the time. If you want to access a specific + /// callback then please create an issue on github and I'll add it! + /// + /// Params are : [Callback Type] [Callback Contents] [server] + /// + /// + public static Action OnDebugCallback; + + /// + /// Called if an exception happens during a callback/callresult. + /// This is needed because the exception isn't always accessible when running + /// async.. and can fail silently. With this hooked you won't be stuck wondering + /// what happened. + /// + public static Action OnException; + + #region interop + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ManualDispatch_Init", CallingConvention = CallingConvention.Cdecl )] + internal static extern void SteamAPI_ManualDispatch_Init(); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ManualDispatch_RunFrame", CallingConvention = CallingConvention.Cdecl )] + internal static extern void SteamAPI_ManualDispatch_RunFrame( HSteamPipe pipe ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ManualDispatch_GetNextCallback", CallingConvention = CallingConvention.Cdecl )] + [return: MarshalAs( UnmanagedType.I1 )] + internal static extern bool SteamAPI_ManualDispatch_GetNextCallback( HSteamPipe pipe, [In, Out] ref CallbackMsg_t msg ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ManualDispatch_FreeLastCallback", CallingConvention = CallingConvention.Cdecl )] + [return: MarshalAs( UnmanagedType.I1 )] + internal static extern bool SteamAPI_ManualDispatch_FreeLastCallback( HSteamPipe pipe ); + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct CallbackMsg_t + { + public HSteamUser m_hSteamUser; // Specific user to whom this callback applies. + public CallbackType Type; // Callback identifier. (Corresponds to the k_iCallback enum in the callback structure.) + public IntPtr Data; // Points to the callback structure + public int DataSize; // Size of the data pointed to by m_pubParam + }; + + #endregion + + internal static HSteamPipe ClientPipe { get; set; } + internal static HSteamPipe ServerPipe { get; set; } + + /// + /// This gets called from Client/Server Init + /// It's important to switch to the manual dispatcher + /// + internal static void Init() + { + SteamAPI_ManualDispatch_Init(); + } + + /// + /// Make sure we don't call Frame in a callback - because that'll cause some issues for everyone. + /// + static bool runningFrame = false; + + /// + /// Calls RunFrame and processes events from this Steam Pipe + /// + internal static void Frame( HSteamPipe pipe ) + { + if ( runningFrame ) + return; + + try + { + runningFrame = true; + + SteamAPI_ManualDispatch_RunFrame( pipe ); + SteamNetworkingUtils.OutputDebugMessages(); + + CallbackMsg_t msg = default; + + while ( SteamAPI_ManualDispatch_GetNextCallback( pipe, ref msg ) ) + { + try + { + ProcessCallback( msg, pipe == ServerPipe ); + } + finally + { + SteamAPI_ManualDispatch_FreeLastCallback( pipe ); + } + } + } + catch ( System.Exception e ) + { + OnException?.Invoke( e ); + } + finally + { + runningFrame = false; + } + } + + /// + /// To be safe we don't call the continuation functions while iterating + /// the Callback list. This is maybe overly safe because the only way this + /// could be an issue is if the callback list is modified in the continuation + /// which would only happen if starting or shutting down in the callback. + /// + static List> actionsToCall = new List>(); + + /// + /// A callback is a general global message + /// + private static void ProcessCallback( CallbackMsg_t msg, bool isServer ) + { + OnDebugCallback?.Invoke( msg.Type, CallbackToString( msg.Type, msg.Data, msg.DataSize ), isServer ); + + // Is this a special callback telling us that the call result is ready? + if ( msg.Type == CallbackType.SteamAPICallCompleted ) + { + ProcessResult( msg ); + return; + } + + if ( Callbacks.TryGetValue( msg.Type, out var list ) ) + { + actionsToCall.Clear(); + + foreach ( var item in list ) + { + if ( item.server != isServer ) + continue; + + actionsToCall.Add( item.action ); + } + + foreach ( var action in actionsToCall ) + { + action( msg.Data ); + } + + actionsToCall.Clear(); + } + } + + /// + /// Given a callback, try to turn it into a string + /// + internal static string CallbackToString( CallbackType type, IntPtr data, int expectedsize ) + { + if ( !CallbackTypeFactory.All.TryGetValue( type, out var t ) ) + return $"[{type} not in sdk]"; + + var strct = data.ToType( t ); + if ( strct == null ) + return "[null]"; + + var str = ""; + + var fields = t.GetFields( System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic ); + + if ( fields.Length == 0 ) + return "[no fields]"; + + var columnSize = fields.Max( x => x.Name.Length ) + 1; + + if ( columnSize < 10 ) + columnSize = 10; + + foreach ( var field in fields ) + { + var spaces = (columnSize - field.Name.Length); + if ( spaces < 0 ) spaces = 0; + + str += $"{new String( ' ', spaces )}{field.Name}: {field.GetValue( strct )}\n"; + } + + return str.Trim( '\n' ); + } + + /// + /// A result is a reply to a specific command + /// + private static void ProcessResult( CallbackMsg_t msg ) + { + var result = msg.Data.ToType(); + + // + // Do we have an entry added via OnCallComplete + // + if ( !ResultCallbacks.TryGetValue( result.AsyncCall, out var callbackInfo ) ) + { + // + // This can happen if the callback result was immediately available + // so we just returned that without actually going through the callback + // dance. It's okay for this to fail. + // + + // + // But still let everyone know that this happened.. + // + OnDebugCallback?.Invoke( (CallbackType)result.Callback, $"[no callback waiting/required]", false ); + return; + } + + // Remove it before we do anything, incase the continuation throws exceptions + ResultCallbacks.Remove( result.AsyncCall ); + + // At this point whatever async routine called this + // continues running. + callbackInfo.continuation(); + } + + /// + /// Pumps the queue in an async loop so we don't + /// have to think about it. This has the advantage that + /// you can call .Wait() on async shit and it still works. + /// + internal static async void LoopClientAsync() + { + while ( ClientPipe != 0 ) + { + Frame( ClientPipe ); + await Task.Delay( 16 ); + } + } + + /// + /// Pumps the queue in an async loop so we don't + /// have to think about it. This has the advantage that + /// you can call .Wait() on async shit and it still works. + /// + internal static async void LoopServerAsync() + { + while ( ServerPipe != 0 ) + { + Frame( ServerPipe ); + await Task.Delay( 32 ); + } + } + + struct ResultCallback + { + public Action continuation; + public bool server; + } + + static Dictionary ResultCallbacks = new Dictionary(); + + /// + /// Watch for a steam api call + /// + internal static void OnCallComplete( SteamAPICall_t call, Action continuation, bool server ) where T : struct, ICallbackData + { + ResultCallbacks[call.Value] = new ResultCallback + { + continuation = continuation, + server = server + }; + } + + struct Callback + { + public Action action; + public bool server; + } + + static Dictionary> Callbacks = new Dictionary>(); + + /// + /// Install a global callback. The passed function will get called if it's all good. + /// + internal static void Install( Action p, bool server = false ) where T : ICallbackData + { + var t = default( T ); + var type = t.CallbackType; + + if ( !Callbacks.TryGetValue( type, out var list ) ) + { + list = new List(); + Callbacks[type] = list; + } + + list.Add( new Callback + { + action = x => p( x.ToType() ), + server = server + } ); + } + + internal static void ShutdownServer() + { + ServerPipe = 0; + + foreach ( var callback in Callbacks ) + { + Callbacks[callback.Key].RemoveAll( x => x.server ); + } + + ResultCallbacks = ResultCallbacks.Where( x => !x.Value.server ) + .ToDictionary( x => x.Key, x => x.Value ); + } + + internal static void ShutdownClient() + { + ClientPipe = 0; + + foreach ( var callback in Callbacks ) + { + Callbacks[callback.Key].RemoveAll( x => !x.server ); + } + + ResultCallbacks = ResultCallbacks.Where( x => x.Value.server ) + .ToDictionary( x => x.Key, x => x.Value ); + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Classes/SteamApi.cs b/BoneSync/Facepunch.Steamworks/Classes/SteamApi.cs new file mode 100644 index 0000000..af3ebe8 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Classes/SteamApi.cs @@ -0,0 +1,50 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal static class SteamAPI + { + internal static class Native + { + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_Init", CallingConvention = CallingConvention.Cdecl )] + [return: MarshalAs( UnmanagedType.I1 )] + public static extern bool SteamAPI_Init(); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_Shutdown", CallingConvention = CallingConvention.Cdecl )] + public static extern void SteamAPI_Shutdown(); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_GetHSteamPipe", CallingConvention = CallingConvention.Cdecl )] + public static extern HSteamPipe SteamAPI_GetHSteamPipe(); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_RestartAppIfNecessary", CallingConvention = CallingConvention.Cdecl )] + [return: MarshalAs( UnmanagedType.I1 )] + public static extern bool SteamAPI_RestartAppIfNecessary( uint unOwnAppID ); + + } + static internal bool Init() + { + return Native.SteamAPI_Init(); + } + + static internal void Shutdown() + { + Native.SteamAPI_Shutdown(); + } + + static internal HSteamPipe GetHSteamPipe() + { + return Native.SteamAPI_GetHSteamPipe(); + } + + static internal bool RestartAppIfNecessary( uint unOwnAppID ) + { + return Native.SteamAPI_RestartAppIfNecessary( unOwnAppID ); + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Classes/SteamGameServer.cs b/BoneSync/Facepunch.Steamworks/Classes/SteamGameServer.cs new file mode 100644 index 0000000..e0002e6 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Classes/SteamGameServer.cs @@ -0,0 +1,40 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal static class SteamGameServer + { + internal static class Native + { + [DllImport( Platform.LibraryName, EntryPoint = "SteamGameServer_RunCallbacks", CallingConvention = CallingConvention.Cdecl )] + public static extern void SteamGameServer_RunCallbacks(); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamGameServer_Shutdown", CallingConvention = CallingConvention.Cdecl )] + public static extern void SteamGameServer_Shutdown(); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamGameServer_GetHSteamPipe", CallingConvention = CallingConvention.Cdecl )] + public static extern HSteamPipe SteamGameServer_GetHSteamPipe(); + + } + static internal void RunCallbacks() + { + Native.SteamGameServer_RunCallbacks(); + } + + static internal void Shutdown() + { + Native.SteamGameServer_Shutdown(); + } + + static internal HSteamPipe GetHSteamPipe() + { + return Native.SteamGameServer_GetHSteamPipe(); + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Classes/SteamInternal.cs b/BoneSync/Facepunch.Steamworks/Classes/SteamInternal.cs new file mode 100644 index 0000000..0d76bbd --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Classes/SteamInternal.cs @@ -0,0 +1,24 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal static class SteamInternal + { + internal static class Native + { + [DllImport( Platform.LibraryName, EntryPoint = "SteamInternal_GameServer_Init", CallingConvention = CallingConvention.Cdecl )] + [return: MarshalAs( UnmanagedType.I1 )] + public static extern bool SteamInternal_GameServer_Init( uint unIP, ushort usPort, ushort usGamePort, ushort usQueryPort, int eServerMode, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersionString ); + } + + static internal bool GameServer_Init( uint unIP, ushort usPort, ushort usGamePort, ushort usQueryPort, int eServerMode, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersionString ) + { + return Native.SteamInternal_GameServer_Init( unIP, usPort, usGamePort, usQueryPort, eServerMode, pchVersionString ); + } + } +} diff --git a/BoneSync/Facepunch.Steamworks/Enum/LeaderboardDisplay.cs b/BoneSync/Facepunch.Steamworks/Enum/LeaderboardDisplay.cs new file mode 100644 index 0000000..69e39c8 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Enum/LeaderboardDisplay.cs @@ -0,0 +1,20 @@ +namespace Facepunch.Steamworks.Data +{ + public enum LeaderboardDisplay : int + { + /// + /// The score is just a simple numerical value + /// + Numeric = 1, + + /// + /// The score represents a time, in seconds + /// + TimeSeconds = 2, + + /// + /// The score represents a time, in milliseconds + /// + TimeMilliSeconds = 3, + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Enum/LeaderboardSort.cs b/BoneSync/Facepunch.Steamworks/Enum/LeaderboardSort.cs new file mode 100644 index 0000000..83d2156 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Enum/LeaderboardSort.cs @@ -0,0 +1,15 @@ +namespace Facepunch.Steamworks.Data +{ + public enum LeaderboardSort : int + { + /// + /// The top-score is the lowest number + /// + Ascending = 1, + + /// + /// The top-score is the highest number + /// + Descending = 2, + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Enum/SendType.cs b/BoneSync/Facepunch.Steamworks/Enum/SendType.cs new file mode 100644 index 0000000..9167940 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Enum/SendType.cs @@ -0,0 +1,42 @@ +using System; + +namespace Facepunch.Steamworks.Data +{ + [Flags] + public enum SendType : int + { + /// + /// Send the message unreliably. Can be lost. Messages *can* be larger than a + /// single MTU (UDP packet), but there is no retransmission, so if any piece + /// of the message is lost, the entire message will be dropped. + /// + /// The sending API does have some knowledge of the underlying connection, so + /// if there is no NAT-traversal accomplished or there is a recognized adjustment + /// happening on the connection, the packet will be batched until the connection + /// is open again. + /// + Unreliable = 0, + + /// + /// Disable Nagle's algorithm. + /// By default, Nagle's algorithm is applied to all outbound messages. This means + /// that the message will NOT be sent immediately, in case further messages are + /// sent soon after you send this, which can be grouped together. Any time there + /// is enough buffered data to fill a packet, the packets will be pushed out immediately, + /// but partially-full packets not be sent until the Nagle timer expires. + /// + NoNagle = 1 << 0, + + /// + /// If the message cannot be sent very soon (because the connection is still doing some initial + /// handshaking, route negotiations, etc), then just drop it. This is only applicable for unreliable + /// messages. Using this flag on reliable messages is invalid. + /// + NoDelay = 1 << 2, + + /// Reliable message send. Can send up to 0.5mb in a single message. + /// Does fragmentation/re-assembly of messages under the hood, as well as a sliding window for + /// efficient sends of large chunks of data. + Reliable = 1 << 3 + } +} diff --git a/BoneSync/Facepunch.Steamworks/Facepunch.Steamworks.Posix.csproj b/BoneSync/Facepunch.Steamworks/Facepunch.Steamworks.Posix.csproj new file mode 100644 index 0000000..0a0e3c5 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Facepunch.Steamworks.Posix.csproj @@ -0,0 +1,16 @@ + + + + Facepunch.Steamworks.Posix + $(DefineConstants);PLATFORM_POSIX + netstandard2.0;net46 + true + 7.1 + true + false + Steamworks + + + + + diff --git a/BoneSync/Facepunch.Steamworks/Facepunch.Steamworks.Win32.csproj b/BoneSync/Facepunch.Steamworks/Facepunch.Steamworks.Win32.csproj new file mode 100644 index 0000000..9304d2d --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Facepunch.Steamworks.Win32.csproj @@ -0,0 +1,37 @@ + + + + Facepunch.Steamworks.Win32 + $(DefineConstants);PLATFORM_WIN32;PLATFORM_WIN + netstandard2.0;net46 + true + 7.1 + true + true + Steamworks + + + + C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client + Garry Newman + Facepunch.Steamworks.win32 + Steamworks implementation with an emphasis on making things easy. For Windows x86. + https://github.com/Facepunch/Facepunch.Steamworks + Facepunch.Steamworks.jpg + facepunch;steam;unity;steamworks;valve + latest + MIT + https://github.com/Facepunch/Facepunch.Steamworks.git + git + + + + + Always + + + + + + + \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Facepunch.Steamworks.Win64.csproj b/BoneSync/Facepunch.Steamworks/Facepunch.Steamworks.Win64.csproj new file mode 100644 index 0000000..701650c --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Facepunch.Steamworks.Win64.csproj @@ -0,0 +1,50 @@ + + + + Facepunch.Steamworks.Win64 + $(DefineConstants);PLATFORM_WIN64;PLATFORM_WIN;PLATFORM_64 + netstandard2.0;net472 + true + 7.1 + true + true + Steamworks + + + + C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client + Garry Newman + Facepunch.Steamworks + Steamworks implementation with an emphasis on making things easy. For Windows x64. + https://github.com/Facepunch/Facepunch.Steamworks + Facepunch.Steamworks.jpg + facepunch;steam;unity;steamworks;valve + latest + MIT + https://github.com/Facepunch/Facepunch.Steamworks.git + git + + + + + Always + + + + + + + + + + + + + + + + + + + + diff --git a/BoneSync/Facepunch.Steamworks/Facepunch.Steamworks.jpg b/BoneSync/Facepunch.Steamworks/Facepunch.Steamworks.jpg new file mode 100644 index 0000000..b70822b Binary files /dev/null and b/BoneSync/Facepunch.Steamworks/Facepunch.Steamworks.jpg differ diff --git a/BoneSync/Facepunch.Steamworks/Facepunch.Steamworks.targets b/BoneSync/Facepunch.Steamworks/Facepunch.Steamworks.targets new file mode 100644 index 0000000..a6fcce2 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Facepunch.Steamworks.targets @@ -0,0 +1,37 @@ + + + + PackageReference + true + + + + 2.3.4 + 2.3.4 + + + + $(DefineConstants);TRACE;DEBUG + 1701;1702;1705;618;1591 + + + + $(DefineConstants);TRACE;RELEASE + 1701;1702;1705;618;1591 + + + + $(DefineConstants);NET_CORE + + + + full + true + + + + + + + + diff --git a/BoneSync/Facepunch.Steamworks/Generated/CustomEnums.cs b/BoneSync/Facepunch.Steamworks/Generated/CustomEnums.cs new file mode 100644 index 0000000..b5c2c59 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/CustomEnums.cs @@ -0,0 +1,426 @@ +using System; +using System.Runtime.InteropServices; +using System.Linq; +using Facepunch.Steamworks.Data; +using System.Threading.Tasks; + +namespace Facepunch.Steamworks +{ + public enum CallbackType + { + SteamServersConnected = 101, + SteamServerConnectFailure = 102, + SteamServersDisconnected = 103, + ClientGameServerDeny = 113, + GSPolicyResponse = 115, + IPCFailure = 117, + LicensesUpdated = 125, + ValidateAuthTicketResponse = 143, + MicroTxnAuthorizationResponse = 152, + EncryptedAppTicketResponse = 154, + GetAuthSessionTicketResponse = 163, + GameWebCallback = 164, + StoreAuthURLResponse = 165, + MarketEligibilityResponse = 166, + DurationControl = 167, + GSClientApprove = 201, + GSClientDeny = 202, + GSClientKick = 203, + GSClientAchievementStatus = 206, + GSGameplayStats = 207, + GSClientGroupStatus = 208, + GSReputation = 209, + AssociateWithClanResult = 210, + ComputeNewPlayerCompatibilityResult = 211, + PersonaStateChange = 304, + GameOverlayActivated = 331, + GameServerChangeRequested = 332, + GameLobbyJoinRequested = 333, + AvatarImageLoaded = 334, + ClanOfficerListResponse = 335, + FriendRichPresenceUpdate = 336, + GameRichPresenceJoinRequested = 337, + GameConnectedClanChatMsg = 338, + GameConnectedChatJoin = 339, + GameConnectedChatLeave = 340, + DownloadClanActivityCountsResult = 341, + JoinClanChatRoomCompletionResult = 342, + GameConnectedFriendChatMsg = 343, + FriendsGetFollowerCount = 344, + FriendsIsFollowing = 345, + FriendsEnumerateFollowingList = 346, + SetPersonaNameResponse = 347, + UnreadChatMessagesChanged = 348, + FavoritesListChanged = 502, + LobbyInvite = 503, + LobbyEnter = 504, + LobbyDataUpdate = 505, + LobbyChatUpdate = 506, + LobbyChatMsg = 507, + LobbyGameCreated = 509, + LobbyMatchList = 510, + LobbyKicked = 512, + LobbyCreated = 513, + PSNGameBootInviteResult = 515, + FavoritesListAccountsUpdated = 516, + IPCountry = 701, + LowBatteryPower = 702, + SteamAPICallCompleted = 703, + SteamShutdown = 704, + CheckFileSignature = 705, + GamepadTextInputDismissed = 714, + DlcInstalled = 1005, + RegisterActivationCodeResponse = 1008, + NewUrlLaunchParameters = 1014, + AppProofOfPurchaseKeyResponse = 1021, + FileDetailsResult = 1023, + UserStatsReceived = 1101, + UserStatsStored = 1102, + UserAchievementStored = 1103, + LeaderboardFindResult = 1104, + LeaderboardScoresDownloaded = 1105, + LeaderboardScoreUploaded = 1106, + NumberOfCurrentPlayers = 1107, + UserStatsUnloaded = 1108, + GSStatsUnloaded = 1108, + UserAchievementIconFetched = 1109, + GlobalAchievementPercentagesReady = 1110, + LeaderboardUGCSet = 1111, + // PS3TrophiesInstalled = 1112, + GlobalStatsReceived = 1112, + // SocketStatusCallback = 1201, + P2PSessionRequest = 1202, + P2PSessionConnectFail = 1203, + SteamNetConnectionStatusChangedCallback = 1221, + SteamNetAuthenticationStatus = 1222, + SteamRelayNetworkStatus = 1281, + RemoteStorageAppSyncedClient = 1301, + RemoteStorageAppSyncedServer = 1302, + RemoteStorageAppSyncProgress = 1303, + RemoteStorageAppSyncStatusCheck = 1305, + RemoteStorageFileShareResult = 1307, + RemoteStoragePublishFileResult = 1309, + RemoteStorageDeletePublishedFileResult = 1311, + RemoteStorageEnumerateUserPublishedFilesResult = 1312, + RemoteStorageSubscribePublishedFileResult = 1313, + RemoteStorageEnumerateUserSubscribedFilesResult = 1314, + RemoteStorageUnsubscribePublishedFileResult = 1315, + RemoteStorageUpdatePublishedFileResult = 1316, + RemoteStorageDownloadUGCResult = 1317, + RemoteStorageGetPublishedFileDetailsResult = 1318, + RemoteStorageEnumerateWorkshopFilesResult = 1319, + RemoteStorageGetPublishedItemVoteDetailsResult = 1320, + RemoteStoragePublishedFileSubscribed = 1321, + RemoteStoragePublishedFileUnsubscribed = 1322, + RemoteStoragePublishedFileDeleted = 1323, + RemoteStorageUpdateUserPublishedItemVoteResult = 1324, + RemoteStorageUserVoteDetails = 1325, + RemoteStorageEnumerateUserSharedWorkshopFilesResult = 1326, + RemoteStorageSetUserPublishedFileActionResult = 1327, + RemoteStorageEnumeratePublishedFilesByUserActionResult = 1328, + RemoteStoragePublishFileProgress = 1329, + RemoteStoragePublishedFileUpdated = 1330, + RemoteStorageFileWriteAsyncComplete = 1331, + RemoteStorageFileReadAsyncComplete = 1332, + GSStatsReceived = 1800, + GSStatsStored = 1801, + HTTPRequestCompleted = 2101, + HTTPRequestHeadersReceived = 2102, + HTTPRequestDataReceived = 2103, + ScreenshotReady = 2301, + ScreenshotRequested = 2302, + SteamUGCQueryCompleted = 3401, + SteamUGCRequestUGCDetailsResult = 3402, + CreateItemResult = 3403, + SubmitItemUpdateResult = 3404, + ItemInstalled = 3405, + DownloadItemResult = 3406, + UserFavoriteItemsListChanged = 3407, + SetUserItemVoteResult = 3408, + GetUserItemVoteResult = 3409, + StartPlaytimeTrackingResult = 3410, + StopPlaytimeTrackingResult = 3411, + AddUGCDependencyResult = 3412, + RemoveUGCDependencyResult = 3413, + AddAppDependencyResult = 3414, + RemoveAppDependencyResult = 3415, + GetAppDependenciesResult = 3416, + DeleteItemResult = 3417, + SteamAppInstalled = 3901, + SteamAppUninstalled = 3902, + PlaybackStatusHasChanged = 4001, + VolumeHasChanged = 4002, + MusicPlayerWantsVolume = 4011, + MusicPlayerSelectsQueueEntry = 4012, + MusicPlayerSelectsPlaylistEntry = 4013, + MusicPlayerRemoteWillActivate = 4101, + MusicPlayerRemoteWillDeactivate = 4102, + MusicPlayerRemoteToFront = 4103, + MusicPlayerWillQuit = 4104, + MusicPlayerWantsPlay = 4105, + MusicPlayerWantsPause = 4106, + MusicPlayerWantsPlayPrevious = 4107, + MusicPlayerWantsPlayNext = 4108, + MusicPlayerWantsShuffled = 4109, + MusicPlayerWantsLooped = 4110, + MusicPlayerWantsPlayingRepeatStatus = 4114, + HTML_BrowserReady = 4501, + HTML_NeedsPaint = 4502, + HTML_StartRequest = 4503, + HTML_CloseBrowser = 4504, + HTML_URLChanged = 4505, + HTML_FinishedRequest = 4506, + HTML_OpenLinkInNewTab = 4507, + HTML_ChangedTitle = 4508, + HTML_SearchResults = 4509, + HTML_CanGoBackAndForward = 4510, + HTML_HorizontalScroll = 4511, + HTML_VerticalScroll = 4512, + HTML_LinkAtPosition = 4513, + HTML_JSAlert = 4514, + HTML_JSConfirm = 4515, + HTML_FileOpenDialog = 4516, + HTML_NewWindow = 4521, + HTML_SetCursor = 4522, + HTML_StatusText = 4523, + HTML_ShowToolTip = 4524, + HTML_UpdateToolTip = 4525, + HTML_HideToolTip = 4526, + HTML_BrowserRestarted = 4527, + BroadcastUploadStart = 4604, + BroadcastUploadStop = 4605, + GetVideoURLResult = 4611, + GetOPFSettingsResult = 4624, + SteamInventoryResultReady = 4700, + SteamInventoryFullUpdate = 4701, + SteamInventoryDefinitionUpdate = 4702, + SteamInventoryEligiblePromoItemDefIDs = 4703, + SteamInventoryStartPurchaseResult = 4704, + SteamInventoryRequestPricesResult = 4705, + SteamParentalSettingsChanged = 5001, + SearchForGameProgressCallback = 5201, + SearchForGameResultCallback = 5202, + RequestPlayersForGameProgressCallback = 5211, + RequestPlayersForGameResultCallback = 5212, + RequestPlayersForGameFinalResultCallback = 5213, + SubmitPlayerResultResultCallback = 5214, + EndGameResultCallback = 5215, + JoinPartyCallback = 5301, + CreateBeaconCallback = 5302, + ReservationNotificationCallback = 5303, + ChangeNumOpenSlotsCallback = 5304, + AvailableBeaconLocationsUpdated = 5305, + ActiveBeaconsUpdated = 5306, + SteamRemotePlaySessionConnected = 5701, + SteamRemotePlaySessionDisconnected = 5702, + } + internal static partial class CallbackTypeFactory + { + internal static System.Collections.Generic.Dictionary All = new System.Collections.Generic.Dictionary + { + { CallbackType.SteamServersConnected, typeof( SteamServersConnected_t )}, + { CallbackType.SteamServerConnectFailure, typeof( SteamServerConnectFailure_t )}, + { CallbackType.SteamServersDisconnected, typeof( SteamServersDisconnected_t )}, + { CallbackType.ClientGameServerDeny, typeof( ClientGameServerDeny_t )}, + { CallbackType.GSPolicyResponse, typeof( GSPolicyResponse_t )}, + { CallbackType.IPCFailure, typeof( IPCFailure_t )}, + { CallbackType.LicensesUpdated, typeof( LicensesUpdated_t )}, + { CallbackType.ValidateAuthTicketResponse, typeof( ValidateAuthTicketResponse_t )}, + { CallbackType.MicroTxnAuthorizationResponse, typeof( MicroTxnAuthorizationResponse_t )}, + { CallbackType.EncryptedAppTicketResponse, typeof( EncryptedAppTicketResponse_t )}, + { CallbackType.GetAuthSessionTicketResponse, typeof( GetAuthSessionTicketResponse_t )}, + { CallbackType.GameWebCallback, typeof( GameWebCallback_t )}, + { CallbackType.StoreAuthURLResponse, typeof( StoreAuthURLResponse_t )}, + { CallbackType.MarketEligibilityResponse, typeof( MarketEligibilityResponse_t )}, + { CallbackType.DurationControl, typeof( DurationControl_t )}, + { CallbackType.GSClientApprove, typeof( GSClientApprove_t )}, + { CallbackType.GSClientDeny, typeof( GSClientDeny_t )}, + { CallbackType.GSClientKick, typeof( GSClientKick_t )}, + { CallbackType.GSClientAchievementStatus, typeof( GSClientAchievementStatus_t )}, + { CallbackType.GSGameplayStats, typeof( GSGameplayStats_t )}, + { CallbackType.GSClientGroupStatus, typeof( GSClientGroupStatus_t )}, + { CallbackType.GSReputation, typeof( GSReputation_t )}, + { CallbackType.AssociateWithClanResult, typeof( AssociateWithClanResult_t )}, + { CallbackType.ComputeNewPlayerCompatibilityResult, typeof( ComputeNewPlayerCompatibilityResult_t )}, + { CallbackType.PersonaStateChange, typeof( PersonaStateChange_t )}, + { CallbackType.GameOverlayActivated, typeof( GameOverlayActivated_t )}, + { CallbackType.GameServerChangeRequested, typeof( GameServerChangeRequested_t )}, + { CallbackType.GameLobbyJoinRequested, typeof( GameLobbyJoinRequested_t )}, + { CallbackType.AvatarImageLoaded, typeof( AvatarImageLoaded_t )}, + { CallbackType.ClanOfficerListResponse, typeof( ClanOfficerListResponse_t )}, + { CallbackType.FriendRichPresenceUpdate, typeof( FriendRichPresenceUpdate_t )}, + { CallbackType.GameRichPresenceJoinRequested, typeof( GameRichPresenceJoinRequested_t )}, + { CallbackType.GameConnectedClanChatMsg, typeof( GameConnectedClanChatMsg_t )}, + { CallbackType.GameConnectedChatJoin, typeof( GameConnectedChatJoin_t )}, + { CallbackType.GameConnectedChatLeave, typeof( GameConnectedChatLeave_t )}, + { CallbackType.DownloadClanActivityCountsResult, typeof( DownloadClanActivityCountsResult_t )}, + { CallbackType.JoinClanChatRoomCompletionResult, typeof( JoinClanChatRoomCompletionResult_t )}, + { CallbackType.GameConnectedFriendChatMsg, typeof( GameConnectedFriendChatMsg_t )}, + { CallbackType.FriendsGetFollowerCount, typeof( FriendsGetFollowerCount_t )}, + { CallbackType.FriendsIsFollowing, typeof( FriendsIsFollowing_t )}, + { CallbackType.FriendsEnumerateFollowingList, typeof( FriendsEnumerateFollowingList_t )}, + { CallbackType.SetPersonaNameResponse, typeof( SetPersonaNameResponse_t )}, + { CallbackType.UnreadChatMessagesChanged, typeof( UnreadChatMessagesChanged_t )}, + { CallbackType.FavoritesListChanged, typeof( FavoritesListChanged_t )}, + { CallbackType.LobbyInvite, typeof( LobbyInvite_t )}, + { CallbackType.LobbyEnter, typeof( LobbyEnter_t )}, + { CallbackType.LobbyDataUpdate, typeof( LobbyDataUpdate_t )}, + { CallbackType.LobbyChatUpdate, typeof( LobbyChatUpdate_t )}, + { CallbackType.LobbyChatMsg, typeof( LobbyChatMsg_t )}, + { CallbackType.LobbyGameCreated, typeof( LobbyGameCreated_t )}, + { CallbackType.LobbyMatchList, typeof( LobbyMatchList_t )}, + { CallbackType.LobbyKicked, typeof( LobbyKicked_t )}, + { CallbackType.LobbyCreated, typeof( LobbyCreated_t )}, + { CallbackType.PSNGameBootInviteResult, typeof( PSNGameBootInviteResult_t )}, + { CallbackType.FavoritesListAccountsUpdated, typeof( FavoritesListAccountsUpdated_t )}, + { CallbackType.IPCountry, typeof( IPCountry_t )}, + { CallbackType.LowBatteryPower, typeof( LowBatteryPower_t )}, + { CallbackType.SteamAPICallCompleted, typeof( SteamAPICallCompleted_t )}, + { CallbackType.SteamShutdown, typeof( SteamShutdown_t )}, + { CallbackType.CheckFileSignature, typeof( CheckFileSignature_t )}, + { CallbackType.GamepadTextInputDismissed, typeof( GamepadTextInputDismissed_t )}, + { CallbackType.DlcInstalled, typeof( DlcInstalled_t )}, + { CallbackType.RegisterActivationCodeResponse, typeof( RegisterActivationCodeResponse_t )}, + { CallbackType.NewUrlLaunchParameters, typeof( NewUrlLaunchParameters_t )}, + { CallbackType.AppProofOfPurchaseKeyResponse, typeof( AppProofOfPurchaseKeyResponse_t )}, + { CallbackType.FileDetailsResult, typeof( FileDetailsResult_t )}, + { CallbackType.UserStatsReceived, typeof( UserStatsReceived_t )}, + { CallbackType.UserStatsStored, typeof( UserStatsStored_t )}, + { CallbackType.UserAchievementStored, typeof( UserAchievementStored_t )}, + { CallbackType.LeaderboardFindResult, typeof( LeaderboardFindResult_t )}, + { CallbackType.LeaderboardScoresDownloaded, typeof( LeaderboardScoresDownloaded_t )}, + { CallbackType.LeaderboardScoreUploaded, typeof( LeaderboardScoreUploaded_t )}, + { CallbackType.NumberOfCurrentPlayers, typeof( NumberOfCurrentPlayers_t )}, + { CallbackType.UserStatsUnloaded, typeof( UserStatsUnloaded_t )}, + // { CallbackType.GSStatsUnloaded, typeof( GSStatsUnloaded_t )}, + { CallbackType.UserAchievementIconFetched, typeof( UserAchievementIconFetched_t )}, + { CallbackType.GlobalAchievementPercentagesReady, typeof( GlobalAchievementPercentagesReady_t )}, + { CallbackType.LeaderboardUGCSet, typeof( LeaderboardUGCSet_t )}, + { CallbackType.GlobalStatsReceived, typeof( GlobalStatsReceived_t )}, + { CallbackType.P2PSessionRequest, typeof( P2PSessionRequest_t )}, + { CallbackType.P2PSessionConnectFail, typeof( P2PSessionConnectFail_t )}, + { CallbackType.SteamNetConnectionStatusChangedCallback, typeof( SteamNetConnectionStatusChangedCallback_t )}, + { CallbackType.SteamNetAuthenticationStatus, typeof( SteamNetAuthenticationStatus_t )}, + { CallbackType.SteamRelayNetworkStatus, typeof( SteamRelayNetworkStatus_t )}, + { CallbackType.RemoteStorageAppSyncedClient, typeof( RemoteStorageAppSyncedClient_t )}, + { CallbackType.RemoteStorageAppSyncedServer, typeof( RemoteStorageAppSyncedServer_t )}, + { CallbackType.RemoteStorageAppSyncProgress, typeof( RemoteStorageAppSyncProgress_t )}, + { CallbackType.RemoteStorageAppSyncStatusCheck, typeof( RemoteStorageAppSyncStatusCheck_t )}, + { CallbackType.RemoteStorageFileShareResult, typeof( RemoteStorageFileShareResult_t )}, + { CallbackType.RemoteStoragePublishFileResult, typeof( RemoteStoragePublishFileResult_t )}, + { CallbackType.RemoteStorageDeletePublishedFileResult, typeof( RemoteStorageDeletePublishedFileResult_t )}, + { CallbackType.RemoteStorageEnumerateUserPublishedFilesResult, typeof( RemoteStorageEnumerateUserPublishedFilesResult_t )}, + { CallbackType.RemoteStorageSubscribePublishedFileResult, typeof( RemoteStorageSubscribePublishedFileResult_t )}, + { CallbackType.RemoteStorageEnumerateUserSubscribedFilesResult, typeof( RemoteStorageEnumerateUserSubscribedFilesResult_t )}, + { CallbackType.RemoteStorageUnsubscribePublishedFileResult, typeof( RemoteStorageUnsubscribePublishedFileResult_t )}, + { CallbackType.RemoteStorageUpdatePublishedFileResult, typeof( RemoteStorageUpdatePublishedFileResult_t )}, + { CallbackType.RemoteStorageDownloadUGCResult, typeof( RemoteStorageDownloadUGCResult_t )}, + { CallbackType.RemoteStorageGetPublishedFileDetailsResult, typeof( RemoteStorageGetPublishedFileDetailsResult_t )}, + { CallbackType.RemoteStorageEnumerateWorkshopFilesResult, typeof( RemoteStorageEnumerateWorkshopFilesResult_t )}, + { CallbackType.RemoteStorageGetPublishedItemVoteDetailsResult, typeof( RemoteStorageGetPublishedItemVoteDetailsResult_t )}, + { CallbackType.RemoteStoragePublishedFileSubscribed, typeof( RemoteStoragePublishedFileSubscribed_t )}, + { CallbackType.RemoteStoragePublishedFileUnsubscribed, typeof( RemoteStoragePublishedFileUnsubscribed_t )}, + { CallbackType.RemoteStoragePublishedFileDeleted, typeof( RemoteStoragePublishedFileDeleted_t )}, + { CallbackType.RemoteStorageUpdateUserPublishedItemVoteResult, typeof( RemoteStorageUpdateUserPublishedItemVoteResult_t )}, + { CallbackType.RemoteStorageUserVoteDetails, typeof( RemoteStorageUserVoteDetails_t )}, + { CallbackType.RemoteStorageEnumerateUserSharedWorkshopFilesResult, typeof( RemoteStorageEnumerateUserSharedWorkshopFilesResult_t )}, + { CallbackType.RemoteStorageSetUserPublishedFileActionResult, typeof( RemoteStorageSetUserPublishedFileActionResult_t )}, + { CallbackType.RemoteStorageEnumeratePublishedFilesByUserActionResult, typeof( RemoteStorageEnumeratePublishedFilesByUserActionResult_t )}, + { CallbackType.RemoteStoragePublishFileProgress, typeof( RemoteStoragePublishFileProgress_t )}, + { CallbackType.RemoteStoragePublishedFileUpdated, typeof( RemoteStoragePublishedFileUpdated_t )}, + { CallbackType.RemoteStorageFileWriteAsyncComplete, typeof( RemoteStorageFileWriteAsyncComplete_t )}, + { CallbackType.RemoteStorageFileReadAsyncComplete, typeof( RemoteStorageFileReadAsyncComplete_t )}, + { CallbackType.GSStatsReceived, typeof( GSStatsReceived_t )}, + { CallbackType.GSStatsStored, typeof( GSStatsStored_t )}, + { CallbackType.HTTPRequestCompleted, typeof( HTTPRequestCompleted_t )}, + { CallbackType.HTTPRequestHeadersReceived, typeof( HTTPRequestHeadersReceived_t )}, + { CallbackType.HTTPRequestDataReceived, typeof( HTTPRequestDataReceived_t )}, + { CallbackType.ScreenshotReady, typeof( ScreenshotReady_t )}, + { CallbackType.ScreenshotRequested, typeof( ScreenshotRequested_t )}, + { CallbackType.SteamUGCQueryCompleted, typeof( SteamUGCQueryCompleted_t )}, + { CallbackType.SteamUGCRequestUGCDetailsResult, typeof( SteamUGCRequestUGCDetailsResult_t )}, + { CallbackType.CreateItemResult, typeof( CreateItemResult_t )}, + { CallbackType.SubmitItemUpdateResult, typeof( SubmitItemUpdateResult_t )}, + { CallbackType.ItemInstalled, typeof( ItemInstalled_t )}, + { CallbackType.DownloadItemResult, typeof( DownloadItemResult_t )}, + { CallbackType.UserFavoriteItemsListChanged, typeof( UserFavoriteItemsListChanged_t )}, + { CallbackType.SetUserItemVoteResult, typeof( SetUserItemVoteResult_t )}, + { CallbackType.GetUserItemVoteResult, typeof( GetUserItemVoteResult_t )}, + { CallbackType.StartPlaytimeTrackingResult, typeof( StartPlaytimeTrackingResult_t )}, + { CallbackType.StopPlaytimeTrackingResult, typeof( StopPlaytimeTrackingResult_t )}, + { CallbackType.AddUGCDependencyResult, typeof( AddUGCDependencyResult_t )}, + { CallbackType.RemoveUGCDependencyResult, typeof( RemoveUGCDependencyResult_t )}, + { CallbackType.AddAppDependencyResult, typeof( AddAppDependencyResult_t )}, + { CallbackType.RemoveAppDependencyResult, typeof( RemoveAppDependencyResult_t )}, + { CallbackType.GetAppDependenciesResult, typeof( GetAppDependenciesResult_t )}, + { CallbackType.DeleteItemResult, typeof( DeleteItemResult_t )}, + { CallbackType.SteamAppInstalled, typeof( SteamAppInstalled_t )}, + { CallbackType.SteamAppUninstalled, typeof( SteamAppUninstalled_t )}, + { CallbackType.PlaybackStatusHasChanged, typeof( PlaybackStatusHasChanged_t )}, + { CallbackType.VolumeHasChanged, typeof( VolumeHasChanged_t )}, + { CallbackType.MusicPlayerWantsVolume, typeof( MusicPlayerWantsVolume_t )}, + { CallbackType.MusicPlayerSelectsQueueEntry, typeof( MusicPlayerSelectsQueueEntry_t )}, + { CallbackType.MusicPlayerSelectsPlaylistEntry, typeof( MusicPlayerSelectsPlaylistEntry_t )}, + { CallbackType.MusicPlayerRemoteWillActivate, typeof( MusicPlayerRemoteWillActivate_t )}, + { CallbackType.MusicPlayerRemoteWillDeactivate, typeof( MusicPlayerRemoteWillDeactivate_t )}, + { CallbackType.MusicPlayerRemoteToFront, typeof( MusicPlayerRemoteToFront_t )}, + { CallbackType.MusicPlayerWillQuit, typeof( MusicPlayerWillQuit_t )}, + { CallbackType.MusicPlayerWantsPlay, typeof( MusicPlayerWantsPlay_t )}, + { CallbackType.MusicPlayerWantsPause, typeof( MusicPlayerWantsPause_t )}, + { CallbackType.MusicPlayerWantsPlayPrevious, typeof( MusicPlayerWantsPlayPrevious_t )}, + { CallbackType.MusicPlayerWantsPlayNext, typeof( MusicPlayerWantsPlayNext_t )}, + { CallbackType.MusicPlayerWantsShuffled, typeof( MusicPlayerWantsShuffled_t )}, + { CallbackType.MusicPlayerWantsLooped, typeof( MusicPlayerWantsLooped_t )}, + { CallbackType.MusicPlayerWantsPlayingRepeatStatus, typeof( MusicPlayerWantsPlayingRepeatStatus_t )}, + { CallbackType.HTML_BrowserReady, typeof( HTML_BrowserReady_t )}, + { CallbackType.HTML_NeedsPaint, typeof( HTML_NeedsPaint_t )}, + { CallbackType.HTML_StartRequest, typeof( HTML_StartRequest_t )}, + { CallbackType.HTML_CloseBrowser, typeof( HTML_CloseBrowser_t )}, + { CallbackType.HTML_URLChanged, typeof( HTML_URLChanged_t )}, + { CallbackType.HTML_FinishedRequest, typeof( HTML_FinishedRequest_t )}, + { CallbackType.HTML_OpenLinkInNewTab, typeof( HTML_OpenLinkInNewTab_t )}, + { CallbackType.HTML_ChangedTitle, typeof( HTML_ChangedTitle_t )}, + { CallbackType.HTML_SearchResults, typeof( HTML_SearchResults_t )}, + { CallbackType.HTML_CanGoBackAndForward, typeof( HTML_CanGoBackAndForward_t )}, + { CallbackType.HTML_HorizontalScroll, typeof( HTML_HorizontalScroll_t )}, + { CallbackType.HTML_VerticalScroll, typeof( HTML_VerticalScroll_t )}, + { CallbackType.HTML_LinkAtPosition, typeof( HTML_LinkAtPosition_t )}, + { CallbackType.HTML_JSAlert, typeof( HTML_JSAlert_t )}, + { CallbackType.HTML_JSConfirm, typeof( HTML_JSConfirm_t )}, + { CallbackType.HTML_FileOpenDialog, typeof( HTML_FileOpenDialog_t )}, + { CallbackType.HTML_NewWindow, typeof( HTML_NewWindow_t )}, + { CallbackType.HTML_SetCursor, typeof( HTML_SetCursor_t )}, + { CallbackType.HTML_StatusText, typeof( HTML_StatusText_t )}, + { CallbackType.HTML_ShowToolTip, typeof( HTML_ShowToolTip_t )}, + { CallbackType.HTML_UpdateToolTip, typeof( HTML_UpdateToolTip_t )}, + { CallbackType.HTML_HideToolTip, typeof( HTML_HideToolTip_t )}, + { CallbackType.HTML_BrowserRestarted, typeof( HTML_BrowserRestarted_t )}, + { CallbackType.BroadcastUploadStart, typeof( BroadcastUploadStart_t )}, + { CallbackType.BroadcastUploadStop, typeof( BroadcastUploadStop_t )}, + { CallbackType.GetVideoURLResult, typeof( GetVideoURLResult_t )}, + { CallbackType.GetOPFSettingsResult, typeof( GetOPFSettingsResult_t )}, + { CallbackType.SteamInventoryResultReady, typeof( SteamInventoryResultReady_t )}, + { CallbackType.SteamInventoryFullUpdate, typeof( SteamInventoryFullUpdate_t )}, + { CallbackType.SteamInventoryDefinitionUpdate, typeof( SteamInventoryDefinitionUpdate_t )}, + { CallbackType.SteamInventoryEligiblePromoItemDefIDs, typeof( SteamInventoryEligiblePromoItemDefIDs_t )}, + { CallbackType.SteamInventoryStartPurchaseResult, typeof( SteamInventoryStartPurchaseResult_t )}, + { CallbackType.SteamInventoryRequestPricesResult, typeof( SteamInventoryRequestPricesResult_t )}, + { CallbackType.SteamParentalSettingsChanged, typeof( SteamParentalSettingsChanged_t )}, + { CallbackType.SearchForGameProgressCallback, typeof( SearchForGameProgressCallback_t )}, + { CallbackType.SearchForGameResultCallback, typeof( SearchForGameResultCallback_t )}, + { CallbackType.RequestPlayersForGameProgressCallback, typeof( RequestPlayersForGameProgressCallback_t )}, + { CallbackType.RequestPlayersForGameResultCallback, typeof( RequestPlayersForGameResultCallback_t )}, + { CallbackType.RequestPlayersForGameFinalResultCallback, typeof( RequestPlayersForGameFinalResultCallback_t )}, + { CallbackType.SubmitPlayerResultResultCallback, typeof( SubmitPlayerResultResultCallback_t )}, + { CallbackType.EndGameResultCallback, typeof( EndGameResultCallback_t )}, + { CallbackType.JoinPartyCallback, typeof( JoinPartyCallback_t )}, + { CallbackType.CreateBeaconCallback, typeof( CreateBeaconCallback_t )}, + { CallbackType.ReservationNotificationCallback, typeof( ReservationNotificationCallback_t )}, + { CallbackType.ChangeNumOpenSlotsCallback, typeof( ChangeNumOpenSlotsCallback_t )}, + { CallbackType.AvailableBeaconLocationsUpdated, typeof( AvailableBeaconLocationsUpdated_t )}, + { CallbackType.ActiveBeaconsUpdated, typeof( ActiveBeaconsUpdated_t )}, + { CallbackType.SteamRemotePlaySessionConnected, typeof( SteamRemotePlaySessionConnected_t )}, + { CallbackType.SteamRemotePlaySessionDisconnected, typeof( SteamRemotePlaySessionDisconnected_t )}, + }; + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamAppList.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamAppList.cs new file mode 100644 index 0000000..5309176 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamAppList.cs @@ -0,0 +1,83 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamAppList : SteamInterface + { + + internal ISteamAppList( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamAppList_v001", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamAppList_v001(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamAppList_v001(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamAppList_GetNumInstalledApps", CallingConvention = Platform.CC)] + private static extern uint _GetNumInstalledApps( IntPtr self ); + + #endregion + internal uint GetNumInstalledApps() + { + var returnValue = _GetNumInstalledApps( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamAppList_GetInstalledApps", CallingConvention = Platform.CC)] + private static extern uint _GetInstalledApps( IntPtr self, [In,Out] AppId[] pvecAppID, uint unMaxAppIDs ); + + #endregion + internal uint GetInstalledApps( [In,Out] AppId[] pvecAppID, uint unMaxAppIDs ) + { + var returnValue = _GetInstalledApps( Self, pvecAppID, unMaxAppIDs ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamAppList_GetAppName", CallingConvention = Platform.CC)] + private static extern int _GetAppName( IntPtr self, AppId nAppID, IntPtr pchName, int cchNameMax ); + + #endregion + internal int GetAppName( AppId nAppID, out string pchName ) + { + IntPtr mempchName = Helpers.TakeMemory(); + var returnValue = _GetAppName( Self, nAppID, mempchName, (1024 * 32) ); + pchName = Helpers.MemoryToString( mempchName ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamAppList_GetAppInstallDir", CallingConvention = Platform.CC)] + private static extern int _GetAppInstallDir( IntPtr self, AppId nAppID, IntPtr pchDirectory, int cchNameMax ); + + #endregion + internal int GetAppInstallDir( AppId nAppID, out string pchDirectory ) + { + IntPtr mempchDirectory = Helpers.TakeMemory(); + var returnValue = _GetAppInstallDir( Self, nAppID, mempchDirectory, (1024 * 32) ); + pchDirectory = Helpers.MemoryToString( mempchDirectory ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamAppList_GetAppBuildId", CallingConvention = Platform.CC)] + private static extern int _GetAppBuildId( IntPtr self, AppId nAppID ); + + #endregion + internal int GetAppBuildId( AppId nAppID ) + { + var returnValue = _GetAppBuildId( Self, nAppID ); + return returnValue; + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs new file mode 100644 index 0000000..7bb3c0a --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs @@ -0,0 +1,352 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamApps : SteamInterface + { + + internal ISteamApps( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamApps_v008", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamApps_v008(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamApps_v008(); + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamGameServerApps_v008", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamGameServerApps_v008(); + public override IntPtr GetServerInterfacePointer() => SteamAPI_SteamGameServerApps_v008(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_BIsSubscribed", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BIsSubscribed( IntPtr self ); + + #endregion + internal bool BIsSubscribed() + { + var returnValue = _BIsSubscribed( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_BIsLowViolence", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BIsLowViolence( IntPtr self ); + + #endregion + internal bool BIsLowViolence() + { + var returnValue = _BIsLowViolence( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_BIsCybercafe", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BIsCybercafe( IntPtr self ); + + #endregion + internal bool BIsCybercafe() + { + var returnValue = _BIsCybercafe( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_BIsVACBanned", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BIsVACBanned( IntPtr self ); + + #endregion + internal bool BIsVACBanned() + { + var returnValue = _BIsVACBanned( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_GetCurrentGameLanguage", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetCurrentGameLanguage( IntPtr self ); + + #endregion + internal string GetCurrentGameLanguage() + { + var returnValue = _GetCurrentGameLanguage( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_GetAvailableGameLanguages", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetAvailableGameLanguages( IntPtr self ); + + #endregion + internal string GetAvailableGameLanguages() + { + var returnValue = _GetAvailableGameLanguages( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_BIsSubscribedApp", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BIsSubscribedApp( IntPtr self, AppId appID ); + + #endregion + internal bool BIsSubscribedApp( AppId appID ) + { + var returnValue = _BIsSubscribedApp( Self, appID ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_BIsDlcInstalled", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BIsDlcInstalled( IntPtr self, AppId appID ); + + #endregion + internal bool BIsDlcInstalled( AppId appID ) + { + var returnValue = _BIsDlcInstalled( Self, appID ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_GetEarliestPurchaseUnixTime", CallingConvention = Platform.CC)] + private static extern uint _GetEarliestPurchaseUnixTime( IntPtr self, AppId nAppID ); + + #endregion + internal uint GetEarliestPurchaseUnixTime( AppId nAppID ) + { + var returnValue = _GetEarliestPurchaseUnixTime( Self, nAppID ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_BIsSubscribedFromFreeWeekend", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BIsSubscribedFromFreeWeekend( IntPtr self ); + + #endregion + internal bool BIsSubscribedFromFreeWeekend() + { + var returnValue = _BIsSubscribedFromFreeWeekend( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_GetDLCCount", CallingConvention = Platform.CC)] + private static extern int _GetDLCCount( IntPtr self ); + + #endregion + internal int GetDLCCount() + { + var returnValue = _GetDLCCount( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_BGetDLCDataByIndex", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BGetDLCDataByIndex( IntPtr self, int iDLC, ref AppId pAppID, [MarshalAs( UnmanagedType.U1 )] ref bool pbAvailable, IntPtr pchName, int cchNameBufferSize ); + + #endregion + internal bool BGetDLCDataByIndex( int iDLC, ref AppId pAppID, [MarshalAs( UnmanagedType.U1 )] ref bool pbAvailable, out string pchName ) + { + IntPtr mempchName = Helpers.TakeMemory(); + var returnValue = _BGetDLCDataByIndex( Self, iDLC, ref pAppID, ref pbAvailable, mempchName, (1024 * 32) ); + pchName = Helpers.MemoryToString( mempchName ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_InstallDLC", CallingConvention = Platform.CC)] + private static extern void _InstallDLC( IntPtr self, AppId nAppID ); + + #endregion + internal void InstallDLC( AppId nAppID ) + { + _InstallDLC( Self, nAppID ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_UninstallDLC", CallingConvention = Platform.CC)] + private static extern void _UninstallDLC( IntPtr self, AppId nAppID ); + + #endregion + internal void UninstallDLC( AppId nAppID ) + { + _UninstallDLC( Self, nAppID ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_RequestAppProofOfPurchaseKey", CallingConvention = Platform.CC)] + private static extern void _RequestAppProofOfPurchaseKey( IntPtr self, AppId nAppID ); + + #endregion + internal void RequestAppProofOfPurchaseKey( AppId nAppID ) + { + _RequestAppProofOfPurchaseKey( Self, nAppID ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_GetCurrentBetaName", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetCurrentBetaName( IntPtr self, IntPtr pchName, int cchNameBufferSize ); + + #endregion + internal bool GetCurrentBetaName( out string pchName ) + { + IntPtr mempchName = Helpers.TakeMemory(); + var returnValue = _GetCurrentBetaName( Self, mempchName, (1024 * 32) ); + pchName = Helpers.MemoryToString( mempchName ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_MarkContentCorrupt", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _MarkContentCorrupt( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bMissingFilesOnly ); + + #endregion + internal bool MarkContentCorrupt( [MarshalAs( UnmanagedType.U1 )] bool bMissingFilesOnly ) + { + var returnValue = _MarkContentCorrupt( Self, bMissingFilesOnly ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_GetInstalledDepots", CallingConvention = Platform.CC)] + private static extern uint _GetInstalledDepots( IntPtr self, AppId appID, [In,Out] DepotId_t[] pvecDepots, uint cMaxDepots ); + + #endregion + internal uint GetInstalledDepots( AppId appID, [In,Out] DepotId_t[] pvecDepots, uint cMaxDepots ) + { + var returnValue = _GetInstalledDepots( Self, appID, pvecDepots, cMaxDepots ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_GetAppInstallDir", CallingConvention = Platform.CC)] + private static extern uint _GetAppInstallDir( IntPtr self, AppId appID, IntPtr pchFolder, uint cchFolderBufferSize ); + + #endregion + internal uint GetAppInstallDir( AppId appID, out string pchFolder ) + { + IntPtr mempchFolder = Helpers.TakeMemory(); + var returnValue = _GetAppInstallDir( Self, appID, mempchFolder, (1024 * 32) ); + pchFolder = Helpers.MemoryToString( mempchFolder ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_BIsAppInstalled", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BIsAppInstalled( IntPtr self, AppId appID ); + + #endregion + internal bool BIsAppInstalled( AppId appID ) + { + var returnValue = _BIsAppInstalled( Self, appID ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_GetAppOwner", CallingConvention = Platform.CC)] + private static extern SteamId _GetAppOwner( IntPtr self ); + + #endregion + internal SteamId GetAppOwner() + { + var returnValue = _GetAppOwner( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_GetLaunchQueryParam", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetLaunchQueryParam( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); + + #endregion + internal string GetLaunchQueryParam( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) + { + var returnValue = _GetLaunchQueryParam( Self, pchKey ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_GetDlcDownloadProgress", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetDlcDownloadProgress( IntPtr self, AppId nAppID, ref ulong punBytesDownloaded, ref ulong punBytesTotal ); + + #endregion + internal bool GetDlcDownloadProgress( AppId nAppID, ref ulong punBytesDownloaded, ref ulong punBytesTotal ) + { + var returnValue = _GetDlcDownloadProgress( Self, nAppID, ref punBytesDownloaded, ref punBytesTotal ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_GetAppBuildId", CallingConvention = Platform.CC)] + private static extern int _GetAppBuildId( IntPtr self ); + + #endregion + internal int GetAppBuildId() + { + var returnValue = _GetAppBuildId( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_RequestAllProofOfPurchaseKeys", CallingConvention = Platform.CC)] + private static extern void _RequestAllProofOfPurchaseKeys( IntPtr self ); + + #endregion + internal void RequestAllProofOfPurchaseKeys() + { + _RequestAllProofOfPurchaseKeys( Self ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_GetFileDetails", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _GetFileDetails( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszFileName ); + + #endregion + internal CallResult GetFileDetails( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszFileName ) + { + var returnValue = _GetFileDetails( Self, pszFileName ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_GetLaunchCommandLine", CallingConvention = Platform.CC)] + private static extern int _GetLaunchCommandLine( IntPtr self, IntPtr pszCommandLine, int cubCommandLine ); + + #endregion + internal int GetLaunchCommandLine( out string pszCommandLine ) + { + IntPtr mempszCommandLine = Helpers.TakeMemory(); + var returnValue = _GetLaunchCommandLine( Self, mempszCommandLine, (1024 * 32) ); + pszCommandLine = Helpers.MemoryToString( mempszCommandLine ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamApps_BIsSubscribedFromFamilySharing", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BIsSubscribedFromFamilySharing( IntPtr self ); + + #endregion + internal bool BIsSubscribedFromFamilySharing() + { + var returnValue = _BIsSubscribedFromFamilySharing( Self ); + return returnValue; + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamClient.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamClient.cs new file mode 100644 index 0000000..316f83c --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamClient.cs @@ -0,0 +1,414 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamClient : SteamInterface + { + + internal ISteamClient( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_CreateSteamPipe", CallingConvention = Platform.CC)] + private static extern HSteamPipe _CreateSteamPipe( IntPtr self ); + + #endregion + internal HSteamPipe CreateSteamPipe() + { + var returnValue = _CreateSteamPipe( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_BReleaseSteamPipe", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BReleaseSteamPipe( IntPtr self, HSteamPipe hSteamPipe ); + + #endregion + internal bool BReleaseSteamPipe( HSteamPipe hSteamPipe ) + { + var returnValue = _BReleaseSteamPipe( Self, hSteamPipe ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_ConnectToGlobalUser", CallingConvention = Platform.CC)] + private static extern HSteamUser _ConnectToGlobalUser( IntPtr self, HSteamPipe hSteamPipe ); + + #endregion + internal HSteamUser ConnectToGlobalUser( HSteamPipe hSteamPipe ) + { + var returnValue = _ConnectToGlobalUser( Self, hSteamPipe ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_CreateLocalUser", CallingConvention = Platform.CC)] + private static extern HSteamUser _CreateLocalUser( IntPtr self, ref HSteamPipe phSteamPipe, AccountType eAccountType ); + + #endregion + internal HSteamUser CreateLocalUser( ref HSteamPipe phSteamPipe, AccountType eAccountType ) + { + var returnValue = _CreateLocalUser( Self, ref phSteamPipe, eAccountType ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_ReleaseUser", CallingConvention = Platform.CC)] + private static extern void _ReleaseUser( IntPtr self, HSteamPipe hSteamPipe, HSteamUser hUser ); + + #endregion + internal void ReleaseUser( HSteamPipe hSteamPipe, HSteamUser hUser ) + { + _ReleaseUser( Self, hSteamPipe, hUser ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamUser", CallingConvention = Platform.CC)] + private static extern IntPtr _GetISteamUser( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + + #endregion + internal IntPtr GetISteamUser( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + { + var returnValue = _GetISteamUser( Self, hSteamUser, hSteamPipe, pchVersion ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamGameServer", CallingConvention = Platform.CC)] + private static extern IntPtr _GetISteamGameServer( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + + #endregion + internal IntPtr GetISteamGameServer( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + { + var returnValue = _GetISteamGameServer( Self, hSteamUser, hSteamPipe, pchVersion ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_SetLocalIPBinding", CallingConvention = Platform.CC)] + private static extern void _SetLocalIPBinding( IntPtr self, ref SteamIPAddress unIP, ushort usPort ); + + #endregion + internal void SetLocalIPBinding( ref SteamIPAddress unIP, ushort usPort ) + { + _SetLocalIPBinding( Self, ref unIP, usPort ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamFriends", CallingConvention = Platform.CC)] + private static extern IntPtr _GetISteamFriends( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + + #endregion + internal IntPtr GetISteamFriends( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + { + var returnValue = _GetISteamFriends( Self, hSteamUser, hSteamPipe, pchVersion ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamUtils", CallingConvention = Platform.CC)] + private static extern IntPtr _GetISteamUtils( IntPtr self, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + + #endregion + internal IntPtr GetISteamUtils( HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + { + var returnValue = _GetISteamUtils( Self, hSteamPipe, pchVersion ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamMatchmaking", CallingConvention = Platform.CC)] + private static extern IntPtr _GetISteamMatchmaking( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + + #endregion + internal IntPtr GetISteamMatchmaking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + { + var returnValue = _GetISteamMatchmaking( Self, hSteamUser, hSteamPipe, pchVersion ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamMatchmakingServers", CallingConvention = Platform.CC)] + private static extern IntPtr _GetISteamMatchmakingServers( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + + #endregion + internal IntPtr GetISteamMatchmakingServers( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + { + var returnValue = _GetISteamMatchmakingServers( Self, hSteamUser, hSteamPipe, pchVersion ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamGenericInterface", CallingConvention = Platform.CC)] + private static extern IntPtr _GetISteamGenericInterface( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + + #endregion + internal IntPtr GetISteamGenericInterface( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + { + var returnValue = _GetISteamGenericInterface( Self, hSteamUser, hSteamPipe, pchVersion ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamUserStats", CallingConvention = Platform.CC)] + private static extern IntPtr _GetISteamUserStats( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + + #endregion + internal IntPtr GetISteamUserStats( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + { + var returnValue = _GetISteamUserStats( Self, hSteamUser, hSteamPipe, pchVersion ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamGameServerStats", CallingConvention = Platform.CC)] + private static extern IntPtr _GetISteamGameServerStats( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + + #endregion + internal IntPtr GetISteamGameServerStats( HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + { + var returnValue = _GetISteamGameServerStats( Self, hSteamuser, hSteamPipe, pchVersion ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamApps", CallingConvention = Platform.CC)] + private static extern IntPtr _GetISteamApps( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + + #endregion + internal IntPtr GetISteamApps( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + { + var returnValue = _GetISteamApps( Self, hSteamUser, hSteamPipe, pchVersion ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamNetworking", CallingConvention = Platform.CC)] + private static extern IntPtr _GetISteamNetworking( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + + #endregion + internal IntPtr GetISteamNetworking( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + { + var returnValue = _GetISteamNetworking( Self, hSteamUser, hSteamPipe, pchVersion ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamRemoteStorage", CallingConvention = Platform.CC)] + private static extern IntPtr _GetISteamRemoteStorage( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + + #endregion + internal IntPtr GetISteamRemoteStorage( HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + { + var returnValue = _GetISteamRemoteStorage( Self, hSteamuser, hSteamPipe, pchVersion ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamScreenshots", CallingConvention = Platform.CC)] + private static extern IntPtr _GetISteamScreenshots( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + + #endregion + internal IntPtr GetISteamScreenshots( HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + { + var returnValue = _GetISteamScreenshots( Self, hSteamuser, hSteamPipe, pchVersion ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamGameSearch", CallingConvention = Platform.CC)] + private static extern IntPtr _GetISteamGameSearch( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + + #endregion + internal IntPtr GetISteamGameSearch( HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + { + var returnValue = _GetISteamGameSearch( Self, hSteamuser, hSteamPipe, pchVersion ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetIPCCallCount", CallingConvention = Platform.CC)] + private static extern uint _GetIPCCallCount( IntPtr self ); + + #endregion + internal uint GetIPCCallCount() + { + var returnValue = _GetIPCCallCount( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_SetWarningMessageHook", CallingConvention = Platform.CC)] + private static extern void _SetWarningMessageHook( IntPtr self, IntPtr pFunction ); + + #endregion + internal void SetWarningMessageHook( IntPtr pFunction ) + { + _SetWarningMessageHook( Self, pFunction ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_BShutdownIfAllPipesClosed", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BShutdownIfAllPipesClosed( IntPtr self ); + + #endregion + internal bool BShutdownIfAllPipesClosed() + { + var returnValue = _BShutdownIfAllPipesClosed( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamHTTP", CallingConvention = Platform.CC)] + private static extern IntPtr _GetISteamHTTP( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + + #endregion + internal IntPtr GetISteamHTTP( HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + { + var returnValue = _GetISteamHTTP( Self, hSteamuser, hSteamPipe, pchVersion ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamController", CallingConvention = Platform.CC)] + private static extern IntPtr _GetISteamController( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + + #endregion + internal IntPtr GetISteamController( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + { + var returnValue = _GetISteamController( Self, hSteamUser, hSteamPipe, pchVersion ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamUGC", CallingConvention = Platform.CC)] + private static extern IntPtr _GetISteamUGC( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + + #endregion + internal IntPtr GetISteamUGC( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + { + var returnValue = _GetISteamUGC( Self, hSteamUser, hSteamPipe, pchVersion ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamAppList", CallingConvention = Platform.CC)] + private static extern IntPtr _GetISteamAppList( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + + #endregion + internal IntPtr GetISteamAppList( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + { + var returnValue = _GetISteamAppList( Self, hSteamUser, hSteamPipe, pchVersion ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamMusic", CallingConvention = Platform.CC)] + private static extern IntPtr _GetISteamMusic( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + + #endregion + internal IntPtr GetISteamMusic( HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + { + var returnValue = _GetISteamMusic( Self, hSteamuser, hSteamPipe, pchVersion ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamMusicRemote", CallingConvention = Platform.CC)] + private static extern IntPtr _GetISteamMusicRemote( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + + #endregion + internal IntPtr GetISteamMusicRemote( HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + { + var returnValue = _GetISteamMusicRemote( Self, hSteamuser, hSteamPipe, pchVersion ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamHTMLSurface", CallingConvention = Platform.CC)] + private static extern IntPtr _GetISteamHTMLSurface( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + + #endregion + internal IntPtr GetISteamHTMLSurface( HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + { + var returnValue = _GetISteamHTMLSurface( Self, hSteamuser, hSteamPipe, pchVersion ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamInventory", CallingConvention = Platform.CC)] + private static extern IntPtr _GetISteamInventory( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + + #endregion + internal IntPtr GetISteamInventory( HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + { + var returnValue = _GetISteamInventory( Self, hSteamuser, hSteamPipe, pchVersion ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamVideo", CallingConvention = Platform.CC)] + private static extern IntPtr _GetISteamVideo( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + + #endregion + internal IntPtr GetISteamVideo( HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + { + var returnValue = _GetISteamVideo( Self, hSteamuser, hSteamPipe, pchVersion ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamParentalSettings", CallingConvention = Platform.CC)] + private static extern IntPtr _GetISteamParentalSettings( IntPtr self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + + #endregion + internal IntPtr GetISteamParentalSettings( HSteamUser hSteamuser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + { + var returnValue = _GetISteamParentalSettings( Self, hSteamuser, hSteamPipe, pchVersion ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamInput", CallingConvention = Platform.CC)] + private static extern IntPtr _GetISteamInput( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + + #endregion + internal IntPtr GetISteamInput( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + { + var returnValue = _GetISteamInput( Self, hSteamUser, hSteamPipe, pchVersion ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamParties", CallingConvention = Platform.CC)] + private static extern IntPtr _GetISteamParties( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + + #endregion + internal IntPtr GetISteamParties( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + { + var returnValue = _GetISteamParties( Self, hSteamUser, hSteamPipe, pchVersion ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamClient_GetISteamRemotePlay", CallingConvention = Platform.CC)] + private static extern IntPtr _GetISteamRemotePlay( IntPtr self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ); + + #endregion + internal IntPtr GetISteamRemotePlay( HSteamUser hSteamUser, HSteamPipe hSteamPipe, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersion ) + { + var returnValue = _GetISteamRemotePlay( Self, hSteamUser, hSteamPipe, pchVersion ); + return returnValue; + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamController.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamController.cs new file mode 100644 index 0000000..667db42 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamController.cs @@ -0,0 +1,392 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamController : SteamInterface + { + + internal ISteamController( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamController_v007", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamController_v007(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamController_v007(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_Init", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _Init( IntPtr self ); + + #endregion + internal bool Init() + { + var returnValue = _Init( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_Shutdown", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _Shutdown( IntPtr self ); + + #endregion + internal bool Shutdown() + { + var returnValue = _Shutdown( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_RunFrame", CallingConvention = Platform.CC)] + private static extern void _RunFrame( IntPtr self ); + + #endregion + internal void RunFrame() + { + _RunFrame( Self ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_GetConnectedControllers", CallingConvention = Platform.CC)] + private static extern int _GetConnectedControllers( IntPtr self, [In,Out] ControllerHandle_t[] handlesOut ); + + #endregion + internal int GetConnectedControllers( [In,Out] ControllerHandle_t[] handlesOut ) + { + var returnValue = _GetConnectedControllers( Self, handlesOut ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_GetActionSetHandle", CallingConvention = Platform.CC)] + private static extern ControllerActionSetHandle_t _GetActionSetHandle( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionSetName ); + + #endregion + internal ControllerActionSetHandle_t GetActionSetHandle( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionSetName ) + { + var returnValue = _GetActionSetHandle( Self, pszActionSetName ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_ActivateActionSet", CallingConvention = Platform.CC)] + private static extern void _ActivateActionSet( IntPtr self, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle ); + + #endregion + internal void ActivateActionSet( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle ) + { + _ActivateActionSet( Self, controllerHandle, actionSetHandle ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_GetCurrentActionSet", CallingConvention = Platform.CC)] + private static extern ControllerActionSetHandle_t _GetCurrentActionSet( IntPtr self, ControllerHandle_t controllerHandle ); + + #endregion + internal ControllerActionSetHandle_t GetCurrentActionSet( ControllerHandle_t controllerHandle ) + { + var returnValue = _GetCurrentActionSet( Self, controllerHandle ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_ActivateActionSetLayer", CallingConvention = Platform.CC)] + private static extern void _ActivateActionSetLayer( IntPtr self, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetLayerHandle ); + + #endregion + internal void ActivateActionSetLayer( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetLayerHandle ) + { + _ActivateActionSetLayer( Self, controllerHandle, actionSetLayerHandle ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_DeactivateActionSetLayer", CallingConvention = Platform.CC)] + private static extern void _DeactivateActionSetLayer( IntPtr self, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetLayerHandle ); + + #endregion + internal void DeactivateActionSetLayer( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetLayerHandle ) + { + _DeactivateActionSetLayer( Self, controllerHandle, actionSetLayerHandle ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_DeactivateAllActionSetLayers", CallingConvention = Platform.CC)] + private static extern void _DeactivateAllActionSetLayers( IntPtr self, ControllerHandle_t controllerHandle ); + + #endregion + internal void DeactivateAllActionSetLayers( ControllerHandle_t controllerHandle ) + { + _DeactivateAllActionSetLayers( Self, controllerHandle ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_GetActiveActionSetLayers", CallingConvention = Platform.CC)] + private static extern int _GetActiveActionSetLayers( IntPtr self, ControllerHandle_t controllerHandle, [In,Out] ControllerActionSetHandle_t[] handlesOut ); + + #endregion + internal int GetActiveActionSetLayers( ControllerHandle_t controllerHandle, [In,Out] ControllerActionSetHandle_t[] handlesOut ) + { + var returnValue = _GetActiveActionSetLayers( Self, controllerHandle, handlesOut ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_GetDigitalActionHandle", CallingConvention = Platform.CC)] + private static extern ControllerDigitalActionHandle_t _GetDigitalActionHandle( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionName ); + + #endregion + internal ControllerDigitalActionHandle_t GetDigitalActionHandle( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionName ) + { + var returnValue = _GetDigitalActionHandle( Self, pszActionName ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_GetDigitalActionData", CallingConvention = Platform.CC)] + private static extern DigitalState _GetDigitalActionData( IntPtr self, ControllerHandle_t controllerHandle, ControllerDigitalActionHandle_t digitalActionHandle ); + + #endregion + internal DigitalState GetDigitalActionData( ControllerHandle_t controllerHandle, ControllerDigitalActionHandle_t digitalActionHandle ) + { + var returnValue = _GetDigitalActionData( Self, controllerHandle, digitalActionHandle ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_GetDigitalActionOrigins", CallingConvention = Platform.CC)] + private static extern int _GetDigitalActionOrigins( IntPtr self, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerDigitalActionHandle_t digitalActionHandle, ref ControllerActionOrigin originsOut ); + + #endregion + internal int GetDigitalActionOrigins( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerDigitalActionHandle_t digitalActionHandle, ref ControllerActionOrigin originsOut ) + { + var returnValue = _GetDigitalActionOrigins( Self, controllerHandle, actionSetHandle, digitalActionHandle, ref originsOut ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_GetAnalogActionHandle", CallingConvention = Platform.CC)] + private static extern ControllerAnalogActionHandle_t _GetAnalogActionHandle( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionName ); + + #endregion + internal ControllerAnalogActionHandle_t GetAnalogActionHandle( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionName ) + { + var returnValue = _GetAnalogActionHandle( Self, pszActionName ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_GetAnalogActionData", CallingConvention = Platform.CC)] + private static extern AnalogState _GetAnalogActionData( IntPtr self, ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle ); + + #endregion + internal AnalogState GetAnalogActionData( ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle ) + { + var returnValue = _GetAnalogActionData( Self, controllerHandle, analogActionHandle ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_GetAnalogActionOrigins", CallingConvention = Platform.CC)] + private static extern int _GetAnalogActionOrigins( IntPtr self, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerAnalogActionHandle_t analogActionHandle, ref ControllerActionOrigin originsOut ); + + #endregion + internal int GetAnalogActionOrigins( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerAnalogActionHandle_t analogActionHandle, ref ControllerActionOrigin originsOut ) + { + var returnValue = _GetAnalogActionOrigins( Self, controllerHandle, actionSetHandle, analogActionHandle, ref originsOut ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_GetGlyphForActionOrigin", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetGlyphForActionOrigin( IntPtr self, ControllerActionOrigin eOrigin ); + + #endregion + internal string GetGlyphForActionOrigin( ControllerActionOrigin eOrigin ) + { + var returnValue = _GetGlyphForActionOrigin( Self, eOrigin ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_GetStringForActionOrigin", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetStringForActionOrigin( IntPtr self, ControllerActionOrigin eOrigin ); + + #endregion + internal string GetStringForActionOrigin( ControllerActionOrigin eOrigin ) + { + var returnValue = _GetStringForActionOrigin( Self, eOrigin ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_StopAnalogActionMomentum", CallingConvention = Platform.CC)] + private static extern void _StopAnalogActionMomentum( IntPtr self, ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t eAction ); + + #endregion + internal void StopAnalogActionMomentum( ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t eAction ) + { + _StopAnalogActionMomentum( Self, controllerHandle, eAction ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_GetMotionData", CallingConvention = Platform.CC)] + private static extern MotionState _GetMotionData( IntPtr self, ControllerHandle_t controllerHandle ); + + #endregion + internal MotionState GetMotionData( ControllerHandle_t controllerHandle ) + { + var returnValue = _GetMotionData( Self, controllerHandle ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_TriggerHapticPulse", CallingConvention = Platform.CC)] + private static extern void _TriggerHapticPulse( IntPtr self, ControllerHandle_t controllerHandle, SteamControllerPad eTargetPad, ushort usDurationMicroSec ); + + #endregion + internal void TriggerHapticPulse( ControllerHandle_t controllerHandle, SteamControllerPad eTargetPad, ushort usDurationMicroSec ) + { + _TriggerHapticPulse( Self, controllerHandle, eTargetPad, usDurationMicroSec ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_TriggerRepeatedHapticPulse", CallingConvention = Platform.CC)] + private static extern void _TriggerRepeatedHapticPulse( IntPtr self, ControllerHandle_t controllerHandle, SteamControllerPad eTargetPad, ushort usDurationMicroSec, ushort usOffMicroSec, ushort unRepeat, uint nFlags ); + + #endregion + internal void TriggerRepeatedHapticPulse( ControllerHandle_t controllerHandle, SteamControllerPad eTargetPad, ushort usDurationMicroSec, ushort usOffMicroSec, ushort unRepeat, uint nFlags ) + { + _TriggerRepeatedHapticPulse( Self, controllerHandle, eTargetPad, usDurationMicroSec, usOffMicroSec, unRepeat, nFlags ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_TriggerVibration", CallingConvention = Platform.CC)] + private static extern void _TriggerVibration( IntPtr self, ControllerHandle_t controllerHandle, ushort usLeftSpeed, ushort usRightSpeed ); + + #endregion + internal void TriggerVibration( ControllerHandle_t controllerHandle, ushort usLeftSpeed, ushort usRightSpeed ) + { + _TriggerVibration( Self, controllerHandle, usLeftSpeed, usRightSpeed ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_SetLEDColor", CallingConvention = Platform.CC)] + private static extern void _SetLEDColor( IntPtr self, ControllerHandle_t controllerHandle, byte nColorR, byte nColorG, byte nColorB, uint nFlags ); + + #endregion + internal void SetLEDColor( ControllerHandle_t controllerHandle, byte nColorR, byte nColorG, byte nColorB, uint nFlags ) + { + _SetLEDColor( Self, controllerHandle, nColorR, nColorG, nColorB, nFlags ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_ShowBindingPanel", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _ShowBindingPanel( IntPtr self, ControllerHandle_t controllerHandle ); + + #endregion + internal bool ShowBindingPanel( ControllerHandle_t controllerHandle ) + { + var returnValue = _ShowBindingPanel( Self, controllerHandle ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_GetInputTypeForHandle", CallingConvention = Platform.CC)] + private static extern InputType _GetInputTypeForHandle( IntPtr self, ControllerHandle_t controllerHandle ); + + #endregion + internal InputType GetInputTypeForHandle( ControllerHandle_t controllerHandle ) + { + var returnValue = _GetInputTypeForHandle( Self, controllerHandle ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_GetControllerForGamepadIndex", CallingConvention = Platform.CC)] + private static extern ControllerHandle_t _GetControllerForGamepadIndex( IntPtr self, int nIndex ); + + #endregion + internal ControllerHandle_t GetControllerForGamepadIndex( int nIndex ) + { + var returnValue = _GetControllerForGamepadIndex( Self, nIndex ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_GetGamepadIndexForController", CallingConvention = Platform.CC)] + private static extern int _GetGamepadIndexForController( IntPtr self, ControllerHandle_t ulControllerHandle ); + + #endregion + internal int GetGamepadIndexForController( ControllerHandle_t ulControllerHandle ) + { + var returnValue = _GetGamepadIndexForController( Self, ulControllerHandle ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_GetStringForXboxOrigin", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetStringForXboxOrigin( IntPtr self, XboxOrigin eOrigin ); + + #endregion + internal string GetStringForXboxOrigin( XboxOrigin eOrigin ) + { + var returnValue = _GetStringForXboxOrigin( Self, eOrigin ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_GetGlyphForXboxOrigin", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetGlyphForXboxOrigin( IntPtr self, XboxOrigin eOrigin ); + + #endregion + internal string GetGlyphForXboxOrigin( XboxOrigin eOrigin ) + { + var returnValue = _GetGlyphForXboxOrigin( Self, eOrigin ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_GetActionOriginFromXboxOrigin", CallingConvention = Platform.CC)] + private static extern ControllerActionOrigin _GetActionOriginFromXboxOrigin( IntPtr self, ControllerHandle_t controllerHandle, XboxOrigin eOrigin ); + + #endregion + internal ControllerActionOrigin GetActionOriginFromXboxOrigin( ControllerHandle_t controllerHandle, XboxOrigin eOrigin ) + { + var returnValue = _GetActionOriginFromXboxOrigin( Self, controllerHandle, eOrigin ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_TranslateActionOrigin", CallingConvention = Platform.CC)] + private static extern ControllerActionOrigin _TranslateActionOrigin( IntPtr self, InputType eDestinationInputType, ControllerActionOrigin eSourceOrigin ); + + #endregion + internal ControllerActionOrigin TranslateActionOrigin( InputType eDestinationInputType, ControllerActionOrigin eSourceOrigin ) + { + var returnValue = _TranslateActionOrigin( Self, eDestinationInputType, eSourceOrigin ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamController_GetControllerBindingRevision", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetControllerBindingRevision( IntPtr self, ControllerHandle_t controllerHandle, ref int pMajor, ref int pMinor ); + + #endregion + internal bool GetControllerBindingRevision( ControllerHandle_t controllerHandle, ref int pMajor, ref int pMinor ) + { + var returnValue = _GetControllerBindingRevision( Self, controllerHandle, ref pMajor, ref pMinor ); + return returnValue; + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs new file mode 100644 index 0000000..39ae314 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs @@ -0,0 +1,844 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamFriends : SteamInterface + { + + internal ISteamFriends( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamFriends_v017", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamFriends_v017(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamFriends_v017(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetPersonaName", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetPersonaName( IntPtr self ); + + #endregion + internal string GetPersonaName() + { + var returnValue = _GetPersonaName( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_SetPersonaName", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _SetPersonaName( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPersonaName ); + + #endregion + internal CallResult SetPersonaName( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPersonaName ) + { + var returnValue = _SetPersonaName( Self, pchPersonaName ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetPersonaState", CallingConvention = Platform.CC)] + private static extern FriendState _GetPersonaState( IntPtr self ); + + #endregion + internal FriendState GetPersonaState() + { + var returnValue = _GetPersonaState( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendCount", CallingConvention = Platform.CC)] + private static extern int _GetFriendCount( IntPtr self, int iFriendFlags ); + + #endregion + internal int GetFriendCount( int iFriendFlags ) + { + var returnValue = _GetFriendCount( Self, iFriendFlags ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendByIndex", CallingConvention = Platform.CC)] + private static extern SteamId _GetFriendByIndex( IntPtr self, int iFriend, int iFriendFlags ); + + #endregion + internal SteamId GetFriendByIndex( int iFriend, int iFriendFlags ) + { + var returnValue = _GetFriendByIndex( Self, iFriend, iFriendFlags ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendRelationship", CallingConvention = Platform.CC)] + private static extern Relationship _GetFriendRelationship( IntPtr self, SteamId steamIDFriend ); + + #endregion + internal Relationship GetFriendRelationship( SteamId steamIDFriend ) + { + var returnValue = _GetFriendRelationship( Self, steamIDFriend ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendPersonaState", CallingConvention = Platform.CC)] + private static extern FriendState _GetFriendPersonaState( IntPtr self, SteamId steamIDFriend ); + + #endregion + internal FriendState GetFriendPersonaState( SteamId steamIDFriend ) + { + var returnValue = _GetFriendPersonaState( Self, steamIDFriend ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendPersonaName", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetFriendPersonaName( IntPtr self, SteamId steamIDFriend ); + + #endregion + internal string GetFriendPersonaName( SteamId steamIDFriend ) + { + var returnValue = _GetFriendPersonaName( Self, steamIDFriend ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendGamePlayed", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetFriendGamePlayed( IntPtr self, SteamId steamIDFriend, ref FriendGameInfo_t pFriendGameInfo ); + + #endregion + internal bool GetFriendGamePlayed( SteamId steamIDFriend, ref FriendGameInfo_t pFriendGameInfo ) + { + var returnValue = _GetFriendGamePlayed( Self, steamIDFriend, ref pFriendGameInfo ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendPersonaNameHistory", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetFriendPersonaNameHistory( IntPtr self, SteamId steamIDFriend, int iPersonaName ); + + #endregion + internal string GetFriendPersonaNameHistory( SteamId steamIDFriend, int iPersonaName ) + { + var returnValue = _GetFriendPersonaNameHistory( Self, steamIDFriend, iPersonaName ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendSteamLevel", CallingConvention = Platform.CC)] + private static extern int _GetFriendSteamLevel( IntPtr self, SteamId steamIDFriend ); + + #endregion + internal int GetFriendSteamLevel( SteamId steamIDFriend ) + { + var returnValue = _GetFriendSteamLevel( Self, steamIDFriend ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetPlayerNickname", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetPlayerNickname( IntPtr self, SteamId steamIDPlayer ); + + #endregion + internal string GetPlayerNickname( SteamId steamIDPlayer ) + { + var returnValue = _GetPlayerNickname( Self, steamIDPlayer ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendsGroupCount", CallingConvention = Platform.CC)] + private static extern int _GetFriendsGroupCount( IntPtr self ); + + #endregion + internal int GetFriendsGroupCount() + { + var returnValue = _GetFriendsGroupCount( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendsGroupIDByIndex", CallingConvention = Platform.CC)] + private static extern FriendsGroupID_t _GetFriendsGroupIDByIndex( IntPtr self, int iFG ); + + #endregion + internal FriendsGroupID_t GetFriendsGroupIDByIndex( int iFG ) + { + var returnValue = _GetFriendsGroupIDByIndex( Self, iFG ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendsGroupName", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetFriendsGroupName( IntPtr self, FriendsGroupID_t friendsGroupID ); + + #endregion + internal string GetFriendsGroupName( FriendsGroupID_t friendsGroupID ) + { + var returnValue = _GetFriendsGroupName( Self, friendsGroupID ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendsGroupMembersCount", CallingConvention = Platform.CC)] + private static extern int _GetFriendsGroupMembersCount( IntPtr self, FriendsGroupID_t friendsGroupID ); + + #endregion + internal int GetFriendsGroupMembersCount( FriendsGroupID_t friendsGroupID ) + { + var returnValue = _GetFriendsGroupMembersCount( Self, friendsGroupID ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendsGroupMembersList", CallingConvention = Platform.CC)] + private static extern void _GetFriendsGroupMembersList( IntPtr self, FriendsGroupID_t friendsGroupID, [In,Out] SteamId[] pOutSteamIDMembers, int nMembersCount ); + + #endregion + internal void GetFriendsGroupMembersList( FriendsGroupID_t friendsGroupID, [In,Out] SteamId[] pOutSteamIDMembers, int nMembersCount ) + { + _GetFriendsGroupMembersList( Self, friendsGroupID, pOutSteamIDMembers, nMembersCount ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_HasFriend", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _HasFriend( IntPtr self, SteamId steamIDFriend, int iFriendFlags ); + + #endregion + internal bool HasFriend( SteamId steamIDFriend, int iFriendFlags ) + { + var returnValue = _HasFriend( Self, steamIDFriend, iFriendFlags ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetClanCount", CallingConvention = Platform.CC)] + private static extern int _GetClanCount( IntPtr self ); + + #endregion + internal int GetClanCount() + { + var returnValue = _GetClanCount( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetClanByIndex", CallingConvention = Platform.CC)] + private static extern SteamId _GetClanByIndex( IntPtr self, int iClan ); + + #endregion + internal SteamId GetClanByIndex( int iClan ) + { + var returnValue = _GetClanByIndex( Self, iClan ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetClanName", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetClanName( IntPtr self, SteamId steamIDClan ); + + #endregion + internal string GetClanName( SteamId steamIDClan ) + { + var returnValue = _GetClanName( Self, steamIDClan ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetClanTag", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetClanTag( IntPtr self, SteamId steamIDClan ); + + #endregion + internal string GetClanTag( SteamId steamIDClan ) + { + var returnValue = _GetClanTag( Self, steamIDClan ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetClanActivityCounts", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetClanActivityCounts( IntPtr self, SteamId steamIDClan, ref int pnOnline, ref int pnInGame, ref int pnChatting ); + + #endregion + internal bool GetClanActivityCounts( SteamId steamIDClan, ref int pnOnline, ref int pnInGame, ref int pnChatting ) + { + var returnValue = _GetClanActivityCounts( Self, steamIDClan, ref pnOnline, ref pnInGame, ref pnChatting ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_DownloadClanActivityCounts", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _DownloadClanActivityCounts( IntPtr self, [In,Out] SteamId[] psteamIDClans, int cClansToRequest ); + + #endregion + internal CallResult DownloadClanActivityCounts( [In,Out] SteamId[] psteamIDClans, int cClansToRequest ) + { + var returnValue = _DownloadClanActivityCounts( Self, psteamIDClans, cClansToRequest ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendCountFromSource", CallingConvention = Platform.CC)] + private static extern int _GetFriendCountFromSource( IntPtr self, SteamId steamIDSource ); + + #endregion + internal int GetFriendCountFromSource( SteamId steamIDSource ) + { + var returnValue = _GetFriendCountFromSource( Self, steamIDSource ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendFromSourceByIndex", CallingConvention = Platform.CC)] + private static extern SteamId _GetFriendFromSourceByIndex( IntPtr self, SteamId steamIDSource, int iFriend ); + + #endregion + internal SteamId GetFriendFromSourceByIndex( SteamId steamIDSource, int iFriend ) + { + var returnValue = _GetFriendFromSourceByIndex( Self, steamIDSource, iFriend ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_IsUserInSource", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _IsUserInSource( IntPtr self, SteamId steamIDUser, SteamId steamIDSource ); + + #endregion + internal bool IsUserInSource( SteamId steamIDUser, SteamId steamIDSource ) + { + var returnValue = _IsUserInSource( Self, steamIDUser, steamIDSource ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_SetInGameVoiceSpeaking", CallingConvention = Platform.CC)] + private static extern void _SetInGameVoiceSpeaking( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.U1 )] bool bSpeaking ); + + #endregion + internal void SetInGameVoiceSpeaking( SteamId steamIDUser, [MarshalAs( UnmanagedType.U1 )] bool bSpeaking ) + { + _SetInGameVoiceSpeaking( Self, steamIDUser, bSpeaking ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlay", CallingConvention = Platform.CC)] + private static extern void _ActivateGameOverlay( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDialog ); + + #endregion + internal void ActivateGameOverlay( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDialog ) + { + _ActivateGameOverlay( Self, pchDialog ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlayToUser", CallingConvention = Platform.CC)] + private static extern void _ActivateGameOverlayToUser( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDialog, SteamId steamID ); + + #endregion + internal void ActivateGameOverlayToUser( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDialog, SteamId steamID ) + { + _ActivateGameOverlayToUser( Self, pchDialog, steamID ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage", CallingConvention = Platform.CC)] + private static extern void _ActivateGameOverlayToWebPage( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchURL, ActivateGameOverlayToWebPageMode eMode ); + + #endregion + internal void ActivateGameOverlayToWebPage( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchURL, ActivateGameOverlayToWebPageMode eMode ) + { + _ActivateGameOverlayToWebPage( Self, pchURL, eMode ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlayToStore", CallingConvention = Platform.CC)] + private static extern void _ActivateGameOverlayToStore( IntPtr self, AppId nAppID, OverlayToStoreFlag eFlag ); + + #endregion + internal void ActivateGameOverlayToStore( AppId nAppID, OverlayToStoreFlag eFlag ) + { + _ActivateGameOverlayToStore( Self, nAppID, eFlag ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_SetPlayedWith", CallingConvention = Platform.CC)] + private static extern void _SetPlayedWith( IntPtr self, SteamId steamIDUserPlayedWith ); + + #endregion + internal void SetPlayedWith( SteamId steamIDUserPlayedWith ) + { + _SetPlayedWith( Self, steamIDUserPlayedWith ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog", CallingConvention = Platform.CC)] + private static extern void _ActivateGameOverlayInviteDialog( IntPtr self, SteamId steamIDLobby ); + + #endregion + internal void ActivateGameOverlayInviteDialog( SteamId steamIDLobby ) + { + _ActivateGameOverlayInviteDialog( Self, steamIDLobby ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetSmallFriendAvatar", CallingConvention = Platform.CC)] + private static extern int _GetSmallFriendAvatar( IntPtr self, SteamId steamIDFriend ); + + #endregion + internal int GetSmallFriendAvatar( SteamId steamIDFriend ) + { + var returnValue = _GetSmallFriendAvatar( Self, steamIDFriend ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetMediumFriendAvatar", CallingConvention = Platform.CC)] + private static extern int _GetMediumFriendAvatar( IntPtr self, SteamId steamIDFriend ); + + #endregion + internal int GetMediumFriendAvatar( SteamId steamIDFriend ) + { + var returnValue = _GetMediumFriendAvatar( Self, steamIDFriend ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetLargeFriendAvatar", CallingConvention = Platform.CC)] + private static extern int _GetLargeFriendAvatar( IntPtr self, SteamId steamIDFriend ); + + #endregion + internal int GetLargeFriendAvatar( SteamId steamIDFriend ) + { + var returnValue = _GetLargeFriendAvatar( Self, steamIDFriend ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_RequestUserInformation", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _RequestUserInformation( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.U1 )] bool bRequireNameOnly ); + + #endregion + internal bool RequestUserInformation( SteamId steamIDUser, [MarshalAs( UnmanagedType.U1 )] bool bRequireNameOnly ) + { + var returnValue = _RequestUserInformation( Self, steamIDUser, bRequireNameOnly ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_RequestClanOfficerList", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _RequestClanOfficerList( IntPtr self, SteamId steamIDClan ); + + #endregion + internal CallResult RequestClanOfficerList( SteamId steamIDClan ) + { + var returnValue = _RequestClanOfficerList( Self, steamIDClan ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetClanOwner", CallingConvention = Platform.CC)] + private static extern SteamId _GetClanOwner( IntPtr self, SteamId steamIDClan ); + + #endregion + internal SteamId GetClanOwner( SteamId steamIDClan ) + { + var returnValue = _GetClanOwner( Self, steamIDClan ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetClanOfficerCount", CallingConvention = Platform.CC)] + private static extern int _GetClanOfficerCount( IntPtr self, SteamId steamIDClan ); + + #endregion + internal int GetClanOfficerCount( SteamId steamIDClan ) + { + var returnValue = _GetClanOfficerCount( Self, steamIDClan ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetClanOfficerByIndex", CallingConvention = Platform.CC)] + private static extern SteamId _GetClanOfficerByIndex( IntPtr self, SteamId steamIDClan, int iOfficer ); + + #endregion + internal SteamId GetClanOfficerByIndex( SteamId steamIDClan, int iOfficer ) + { + var returnValue = _GetClanOfficerByIndex( Self, steamIDClan, iOfficer ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetUserRestrictions", CallingConvention = Platform.CC)] + private static extern uint _GetUserRestrictions( IntPtr self ); + + #endregion + internal uint GetUserRestrictions() + { + var returnValue = _GetUserRestrictions( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_SetRichPresence", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetRichPresence( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ); + + #endregion + internal bool SetRichPresence( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ) + { + var returnValue = _SetRichPresence( Self, pchKey, pchValue ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_ClearRichPresence", CallingConvention = Platform.CC)] + private static extern void _ClearRichPresence( IntPtr self ); + + #endregion + internal void ClearRichPresence() + { + _ClearRichPresence( Self ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendRichPresence", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetFriendRichPresence( IntPtr self, SteamId steamIDFriend, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); + + #endregion + internal string GetFriendRichPresence( SteamId steamIDFriend, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) + { + var returnValue = _GetFriendRichPresence( Self, steamIDFriend, pchKey ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendRichPresenceKeyCount", CallingConvention = Platform.CC)] + private static extern int _GetFriendRichPresenceKeyCount( IntPtr self, SteamId steamIDFriend ); + + #endregion + internal int GetFriendRichPresenceKeyCount( SteamId steamIDFriend ) + { + var returnValue = _GetFriendRichPresenceKeyCount( Self, steamIDFriend ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendRichPresenceKeyByIndex", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetFriendRichPresenceKeyByIndex( IntPtr self, SteamId steamIDFriend, int iKey ); + + #endregion + internal string GetFriendRichPresenceKeyByIndex( SteamId steamIDFriend, int iKey ) + { + var returnValue = _GetFriendRichPresenceKeyByIndex( Self, steamIDFriend, iKey ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_RequestFriendRichPresence", CallingConvention = Platform.CC)] + private static extern void _RequestFriendRichPresence( IntPtr self, SteamId steamIDFriend ); + + #endregion + internal void RequestFriendRichPresence( SteamId steamIDFriend ) + { + _RequestFriendRichPresence( Self, steamIDFriend ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_InviteUserToGame", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _InviteUserToGame( IntPtr self, SteamId steamIDFriend, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchConnectString ); + + #endregion + internal bool InviteUserToGame( SteamId steamIDFriend, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchConnectString ) + { + var returnValue = _InviteUserToGame( Self, steamIDFriend, pchConnectString ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetCoplayFriendCount", CallingConvention = Platform.CC)] + private static extern int _GetCoplayFriendCount( IntPtr self ); + + #endregion + internal int GetCoplayFriendCount() + { + var returnValue = _GetCoplayFriendCount( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetCoplayFriend", CallingConvention = Platform.CC)] + private static extern SteamId _GetCoplayFriend( IntPtr self, int iCoplayFriend ); + + #endregion + internal SteamId GetCoplayFriend( int iCoplayFriend ) + { + var returnValue = _GetCoplayFriend( Self, iCoplayFriend ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendCoplayTime", CallingConvention = Platform.CC)] + private static extern int _GetFriendCoplayTime( IntPtr self, SteamId steamIDFriend ); + + #endregion + internal int GetFriendCoplayTime( SteamId steamIDFriend ) + { + var returnValue = _GetFriendCoplayTime( Self, steamIDFriend ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendCoplayGame", CallingConvention = Platform.CC)] + private static extern AppId _GetFriendCoplayGame( IntPtr self, SteamId steamIDFriend ); + + #endregion + internal AppId GetFriendCoplayGame( SteamId steamIDFriend ) + { + var returnValue = _GetFriendCoplayGame( Self, steamIDFriend ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_JoinClanChatRoom", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _JoinClanChatRoom( IntPtr self, SteamId steamIDClan ); + + #endregion + internal CallResult JoinClanChatRoom( SteamId steamIDClan ) + { + var returnValue = _JoinClanChatRoom( Self, steamIDClan ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_LeaveClanChatRoom", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _LeaveClanChatRoom( IntPtr self, SteamId steamIDClan ); + + #endregion + internal bool LeaveClanChatRoom( SteamId steamIDClan ) + { + var returnValue = _LeaveClanChatRoom( Self, steamIDClan ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetClanChatMemberCount", CallingConvention = Platform.CC)] + private static extern int _GetClanChatMemberCount( IntPtr self, SteamId steamIDClan ); + + #endregion + internal int GetClanChatMemberCount( SteamId steamIDClan ) + { + var returnValue = _GetClanChatMemberCount( Self, steamIDClan ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetChatMemberByIndex", CallingConvention = Platform.CC)] + private static extern SteamId _GetChatMemberByIndex( IntPtr self, SteamId steamIDClan, int iUser ); + + #endregion + internal SteamId GetChatMemberByIndex( SteamId steamIDClan, int iUser ) + { + var returnValue = _GetChatMemberByIndex( Self, steamIDClan, iUser ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_SendClanChatMessage", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SendClanChatMessage( IntPtr self, SteamId steamIDClanChat, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchText ); + + #endregion + internal bool SendClanChatMessage( SteamId steamIDClanChat, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchText ) + { + var returnValue = _SendClanChatMessage( Self, steamIDClanChat, pchText ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetClanChatMessage", CallingConvention = Platform.CC)] + private static extern int _GetClanChatMessage( IntPtr self, SteamId steamIDClanChat, int iMessage, IntPtr prgchText, int cchTextMax, ref ChatEntryType peChatEntryType, ref SteamId psteamidChatter ); + + #endregion + internal int GetClanChatMessage( SteamId steamIDClanChat, int iMessage, IntPtr prgchText, int cchTextMax, ref ChatEntryType peChatEntryType, ref SteamId psteamidChatter ) + { + var returnValue = _GetClanChatMessage( Self, steamIDClanChat, iMessage, prgchText, cchTextMax, ref peChatEntryType, ref psteamidChatter ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_IsClanChatAdmin", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _IsClanChatAdmin( IntPtr self, SteamId steamIDClanChat, SteamId steamIDUser ); + + #endregion + internal bool IsClanChatAdmin( SteamId steamIDClanChat, SteamId steamIDUser ) + { + var returnValue = _IsClanChatAdmin( Self, steamIDClanChat, steamIDUser ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_IsClanChatWindowOpenInSteam", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _IsClanChatWindowOpenInSteam( IntPtr self, SteamId steamIDClanChat ); + + #endregion + internal bool IsClanChatWindowOpenInSteam( SteamId steamIDClanChat ) + { + var returnValue = _IsClanChatWindowOpenInSteam( Self, steamIDClanChat ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_OpenClanChatWindowInSteam", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _OpenClanChatWindowInSteam( IntPtr self, SteamId steamIDClanChat ); + + #endregion + internal bool OpenClanChatWindowInSteam( SteamId steamIDClanChat ) + { + var returnValue = _OpenClanChatWindowInSteam( Self, steamIDClanChat ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_CloseClanChatWindowInSteam", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _CloseClanChatWindowInSteam( IntPtr self, SteamId steamIDClanChat ); + + #endregion + internal bool CloseClanChatWindowInSteam( SteamId steamIDClanChat ) + { + var returnValue = _CloseClanChatWindowInSteam( Self, steamIDClanChat ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_SetListenForFriendsMessages", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetListenForFriendsMessages( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bInterceptEnabled ); + + #endregion + internal bool SetListenForFriendsMessages( [MarshalAs( UnmanagedType.U1 )] bool bInterceptEnabled ) + { + var returnValue = _SetListenForFriendsMessages( Self, bInterceptEnabled ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_ReplyToFriendMessage", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _ReplyToFriendMessage( IntPtr self, SteamId steamIDFriend, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMsgToSend ); + + #endregion + internal bool ReplyToFriendMessage( SteamId steamIDFriend, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMsgToSend ) + { + var returnValue = _ReplyToFriendMessage( Self, steamIDFriend, pchMsgToSend ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFriendMessage", CallingConvention = Platform.CC)] + private static extern int _GetFriendMessage( IntPtr self, SteamId steamIDFriend, int iMessageID, IntPtr pvData, int cubData, ref ChatEntryType peChatEntryType ); + + #endregion + internal int GetFriendMessage( SteamId steamIDFriend, int iMessageID, IntPtr pvData, int cubData, ref ChatEntryType peChatEntryType ) + { + var returnValue = _GetFriendMessage( Self, steamIDFriend, iMessageID, pvData, cubData, ref peChatEntryType ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetFollowerCount", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _GetFollowerCount( IntPtr self, SteamId steamID ); + + #endregion + internal CallResult GetFollowerCount( SteamId steamID ) + { + var returnValue = _GetFollowerCount( Self, steamID ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_IsFollowing", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _IsFollowing( IntPtr self, SteamId steamID ); + + #endregion + internal CallResult IsFollowing( SteamId steamID ) + { + var returnValue = _IsFollowing( Self, steamID ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_EnumerateFollowingList", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _EnumerateFollowingList( IntPtr self, uint unStartIndex ); + + #endregion + internal CallResult EnumerateFollowingList( uint unStartIndex ) + { + var returnValue = _EnumerateFollowingList( Self, unStartIndex ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_IsClanPublic", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _IsClanPublic( IntPtr self, SteamId steamIDClan ); + + #endregion + internal bool IsClanPublic( SteamId steamIDClan ) + { + var returnValue = _IsClanPublic( Self, steamIDClan ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_IsClanOfficialGameGroup", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _IsClanOfficialGameGroup( IntPtr self, SteamId steamIDClan ); + + #endregion + internal bool IsClanOfficialGameGroup( SteamId steamIDClan ) + { + var returnValue = _IsClanOfficialGameGroup( Self, steamIDClan ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_GetNumChatsWithUnreadPriorityMessages", CallingConvention = Platform.CC)] + private static extern int _GetNumChatsWithUnreadPriorityMessages( IntPtr self ); + + #endregion + internal int GetNumChatsWithUnreadPriorityMessages() + { + var returnValue = _GetNumChatsWithUnreadPriorityMessages( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlayRemotePlayTogetherInviteDialog", CallingConvention = Platform.CC)] + private static extern void _ActivateGameOverlayRemotePlayTogetherInviteDialog( IntPtr self, SteamId steamIDLobby ); + + #endregion + internal void ActivateGameOverlayRemotePlayTogetherInviteDialog( SteamId steamIDLobby ) + { + _ActivateGameOverlayRemotePlayTogetherInviteDialog( Self, steamIDLobby ); + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamGameSearch.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamGameSearch.cs new file mode 100644 index 0000000..025195b --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamGameSearch.cs @@ -0,0 +1,180 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamGameSearch : SteamInterface + { + + internal ISteamGameSearch( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamGameSearch_v001", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamGameSearch_v001(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamGameSearch_v001(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameSearch_AddGameSearchParams", CallingConvention = Platform.CC)] + private static extern GameSearchErrorCode_t _AddGameSearchParams( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToFind, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValuesToFind ); + + #endregion + internal GameSearchErrorCode_t AddGameSearchParams( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToFind, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValuesToFind ) + { + var returnValue = _AddGameSearchParams( Self, pchKeyToFind, pchValuesToFind ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameSearch_SearchForGameWithLobby", CallingConvention = Platform.CC)] + private static extern GameSearchErrorCode_t _SearchForGameWithLobby( IntPtr self, SteamId steamIDLobby, int nPlayerMin, int nPlayerMax ); + + #endregion + internal GameSearchErrorCode_t SearchForGameWithLobby( SteamId steamIDLobby, int nPlayerMin, int nPlayerMax ) + { + var returnValue = _SearchForGameWithLobby( Self, steamIDLobby, nPlayerMin, nPlayerMax ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameSearch_SearchForGameSolo", CallingConvention = Platform.CC)] + private static extern GameSearchErrorCode_t _SearchForGameSolo( IntPtr self, int nPlayerMin, int nPlayerMax ); + + #endregion + internal GameSearchErrorCode_t SearchForGameSolo( int nPlayerMin, int nPlayerMax ) + { + var returnValue = _SearchForGameSolo( Self, nPlayerMin, nPlayerMax ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameSearch_AcceptGame", CallingConvention = Platform.CC)] + private static extern GameSearchErrorCode_t _AcceptGame( IntPtr self ); + + #endregion + internal GameSearchErrorCode_t AcceptGame() + { + var returnValue = _AcceptGame( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameSearch_DeclineGame", CallingConvention = Platform.CC)] + private static extern GameSearchErrorCode_t _DeclineGame( IntPtr self ); + + #endregion + internal GameSearchErrorCode_t DeclineGame() + { + var returnValue = _DeclineGame( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameSearch_RetrieveConnectionDetails", CallingConvention = Platform.CC)] + private static extern GameSearchErrorCode_t _RetrieveConnectionDetails( IntPtr self, SteamId steamIDHost, IntPtr pchConnectionDetails, int cubConnectionDetails ); + + #endregion + internal GameSearchErrorCode_t RetrieveConnectionDetails( SteamId steamIDHost, out string pchConnectionDetails ) + { + IntPtr mempchConnectionDetails = Helpers.TakeMemory(); + var returnValue = _RetrieveConnectionDetails( Self, steamIDHost, mempchConnectionDetails, (1024 * 32) ); + pchConnectionDetails = Helpers.MemoryToString( mempchConnectionDetails ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameSearch_EndGameSearch", CallingConvention = Platform.CC)] + private static extern GameSearchErrorCode_t _EndGameSearch( IntPtr self ); + + #endregion + internal GameSearchErrorCode_t EndGameSearch() + { + var returnValue = _EndGameSearch( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameSearch_SetGameHostParams", CallingConvention = Platform.CC)] + private static extern GameSearchErrorCode_t _SetGameHostParams( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ); + + #endregion + internal GameSearchErrorCode_t SetGameHostParams( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ) + { + var returnValue = _SetGameHostParams( Self, pchKey, pchValue ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameSearch_SetConnectionDetails", CallingConvention = Platform.CC)] + private static extern GameSearchErrorCode_t _SetConnectionDetails( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchConnectionDetails, int cubConnectionDetails ); + + #endregion + internal GameSearchErrorCode_t SetConnectionDetails( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchConnectionDetails, int cubConnectionDetails ) + { + var returnValue = _SetConnectionDetails( Self, pchConnectionDetails, cubConnectionDetails ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameSearch_RequestPlayersForGame", CallingConvention = Platform.CC)] + private static extern GameSearchErrorCode_t _RequestPlayersForGame( IntPtr self, int nPlayerMin, int nPlayerMax, int nMaxTeamSize ); + + #endregion + internal GameSearchErrorCode_t RequestPlayersForGame( int nPlayerMin, int nPlayerMax, int nMaxTeamSize ) + { + var returnValue = _RequestPlayersForGame( Self, nPlayerMin, nPlayerMax, nMaxTeamSize ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameSearch_HostConfirmGameStart", CallingConvention = Platform.CC)] + private static extern GameSearchErrorCode_t _HostConfirmGameStart( IntPtr self, ulong ullUniqueGameID ); + + #endregion + internal GameSearchErrorCode_t HostConfirmGameStart( ulong ullUniqueGameID ) + { + var returnValue = _HostConfirmGameStart( Self, ullUniqueGameID ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameSearch_CancelRequestPlayersForGame", CallingConvention = Platform.CC)] + private static extern GameSearchErrorCode_t _CancelRequestPlayersForGame( IntPtr self ); + + #endregion + internal GameSearchErrorCode_t CancelRequestPlayersForGame() + { + var returnValue = _CancelRequestPlayersForGame( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameSearch_SubmitPlayerResult", CallingConvention = Platform.CC)] + private static extern GameSearchErrorCode_t _SubmitPlayerResult( IntPtr self, ulong ullUniqueGameID, SteamId steamIDPlayer, PlayerResult_t EPlayerResult ); + + #endregion + internal GameSearchErrorCode_t SubmitPlayerResult( ulong ullUniqueGameID, SteamId steamIDPlayer, PlayerResult_t EPlayerResult ) + { + var returnValue = _SubmitPlayerResult( Self, ullUniqueGameID, steamIDPlayer, EPlayerResult ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameSearch_EndGame", CallingConvention = Platform.CC)] + private static extern GameSearchErrorCode_t _EndGame( IntPtr self, ulong ullUniqueGameID ); + + #endregion + internal GameSearchErrorCode_t EndGame( ulong ullUniqueGameID ) + { + var returnValue = _EndGame( Self, ullUniqueGameID ); + return returnValue; + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServer.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServer.cs new file mode 100644 index 0000000..880cb6c --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServer.cs @@ -0,0 +1,478 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamGameServer : SteamInterface + { + + internal ISteamGameServer( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamGameServer_v013", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamGameServer_v013(); + public override IntPtr GetServerInterfacePointer() => SteamAPI_SteamGameServer_v013(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetProduct", CallingConvention = Platform.CC)] + private static extern void _SetProduct( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszProduct ); + + #endregion + internal void SetProduct( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszProduct ) + { + _SetProduct( Self, pszProduct ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetGameDescription", CallingConvention = Platform.CC)] + private static extern void _SetGameDescription( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszGameDescription ); + + #endregion + internal void SetGameDescription( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszGameDescription ) + { + _SetGameDescription( Self, pszGameDescription ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetModDir", CallingConvention = Platform.CC)] + private static extern void _SetModDir( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszModDir ); + + #endregion + internal void SetModDir( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszModDir ) + { + _SetModDir( Self, pszModDir ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetDedicatedServer", CallingConvention = Platform.CC)] + private static extern void _SetDedicatedServer( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bDedicated ); + + #endregion + internal void SetDedicatedServer( [MarshalAs( UnmanagedType.U1 )] bool bDedicated ) + { + _SetDedicatedServer( Self, bDedicated ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_LogOn", CallingConvention = Platform.CC)] + private static extern void _LogOn( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszToken ); + + #endregion + internal void LogOn( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszToken ) + { + _LogOn( Self, pszToken ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_LogOnAnonymous", CallingConvention = Platform.CC)] + private static extern void _LogOnAnonymous( IntPtr self ); + + #endregion + internal void LogOnAnonymous() + { + _LogOnAnonymous( Self ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_LogOff", CallingConvention = Platform.CC)] + private static extern void _LogOff( IntPtr self ); + + #endregion + internal void LogOff() + { + _LogOff( Self ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_BLoggedOn", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BLoggedOn( IntPtr self ); + + #endregion + internal bool BLoggedOn() + { + var returnValue = _BLoggedOn( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_BSecure", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BSecure( IntPtr self ); + + #endregion + internal bool BSecure() + { + var returnValue = _BSecure( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_GetSteamID", CallingConvention = Platform.CC)] + private static extern SteamId _GetSteamID( IntPtr self ); + + #endregion + internal SteamId GetSteamID() + { + var returnValue = _GetSteamID( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_WasRestartRequested", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _WasRestartRequested( IntPtr self ); + + #endregion + internal bool WasRestartRequested() + { + var returnValue = _WasRestartRequested( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetMaxPlayerCount", CallingConvention = Platform.CC)] + private static extern void _SetMaxPlayerCount( IntPtr self, int cPlayersMax ); + + #endregion + internal void SetMaxPlayerCount( int cPlayersMax ) + { + _SetMaxPlayerCount( Self, cPlayersMax ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetBotPlayerCount", CallingConvention = Platform.CC)] + private static extern void _SetBotPlayerCount( IntPtr self, int cBotplayers ); + + #endregion + internal void SetBotPlayerCount( int cBotplayers ) + { + _SetBotPlayerCount( Self, cBotplayers ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetServerName", CallingConvention = Platform.CC)] + private static extern void _SetServerName( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszServerName ); + + #endregion + internal void SetServerName( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszServerName ) + { + _SetServerName( Self, pszServerName ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetMapName", CallingConvention = Platform.CC)] + private static extern void _SetMapName( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszMapName ); + + #endregion + internal void SetMapName( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszMapName ) + { + _SetMapName( Self, pszMapName ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetPasswordProtected", CallingConvention = Platform.CC)] + private static extern void _SetPasswordProtected( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bPasswordProtected ); + + #endregion + internal void SetPasswordProtected( [MarshalAs( UnmanagedType.U1 )] bool bPasswordProtected ) + { + _SetPasswordProtected( Self, bPasswordProtected ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetSpectatorPort", CallingConvention = Platform.CC)] + private static extern void _SetSpectatorPort( IntPtr self, ushort unSpectatorPort ); + + #endregion + internal void SetSpectatorPort( ushort unSpectatorPort ) + { + _SetSpectatorPort( Self, unSpectatorPort ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetSpectatorServerName", CallingConvention = Platform.CC)] + private static extern void _SetSpectatorServerName( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszSpectatorServerName ); + + #endregion + internal void SetSpectatorServerName( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszSpectatorServerName ) + { + _SetSpectatorServerName( Self, pszSpectatorServerName ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_ClearAllKeyValues", CallingConvention = Platform.CC)] + private static extern void _ClearAllKeyValues( IntPtr self ); + + #endregion + internal void ClearAllKeyValues() + { + _ClearAllKeyValues( Self ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetKeyValue", CallingConvention = Platform.CC)] + private static extern void _SetKeyValue( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pValue ); + + #endregion + internal void SetKeyValue( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pValue ) + { + _SetKeyValue( Self, pKey, pValue ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetGameTags", CallingConvention = Platform.CC)] + private static extern void _SetGameTags( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchGameTags ); + + #endregion + internal void SetGameTags( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchGameTags ) + { + _SetGameTags( Self, pchGameTags ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetGameData", CallingConvention = Platform.CC)] + private static extern void _SetGameData( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchGameData ); + + #endregion + internal void SetGameData( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchGameData ) + { + _SetGameData( Self, pchGameData ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetRegion", CallingConvention = Platform.CC)] + private static extern void _SetRegion( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszRegion ); + + #endregion + internal void SetRegion( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszRegion ) + { + _SetRegion( Self, pszRegion ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SendUserConnectAndAuthenticate", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SendUserConnectAndAuthenticate( IntPtr self, uint unIPClient, IntPtr pvAuthBlob, uint cubAuthBlobSize, ref SteamId pSteamIDUser ); + + #endregion + internal bool SendUserConnectAndAuthenticate( uint unIPClient, IntPtr pvAuthBlob, uint cubAuthBlobSize, ref SteamId pSteamIDUser ) + { + var returnValue = _SendUserConnectAndAuthenticate( Self, unIPClient, pvAuthBlob, cubAuthBlobSize, ref pSteamIDUser ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_CreateUnauthenticatedUserConnection", CallingConvention = Platform.CC)] + private static extern SteamId _CreateUnauthenticatedUserConnection( IntPtr self ); + + #endregion + internal SteamId CreateUnauthenticatedUserConnection() + { + var returnValue = _CreateUnauthenticatedUserConnection( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SendUserDisconnect", CallingConvention = Platform.CC)] + private static extern void _SendUserDisconnect( IntPtr self, SteamId steamIDUser ); + + #endregion + internal void SendUserDisconnect( SteamId steamIDUser ) + { + _SendUserDisconnect( Self, steamIDUser ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_BUpdateUserData", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BUpdateUserData( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPlayerName, uint uScore ); + + #endregion + internal bool BUpdateUserData( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPlayerName, uint uScore ) + { + var returnValue = _BUpdateUserData( Self, steamIDUser, pchPlayerName, uScore ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_GetAuthSessionTicket", CallingConvention = Platform.CC)] + private static extern HAuthTicket _GetAuthSessionTicket( IntPtr self, IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket ); + + #endregion + internal HAuthTicket GetAuthSessionTicket( IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket ) + { + var returnValue = _GetAuthSessionTicket( Self, pTicket, cbMaxTicket, ref pcbTicket ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_BeginAuthSession", CallingConvention = Platform.CC)] + private static extern BeginAuthResult _BeginAuthSession( IntPtr self, IntPtr pAuthTicket, int cbAuthTicket, SteamId steamID ); + + #endregion + internal BeginAuthResult BeginAuthSession( IntPtr pAuthTicket, int cbAuthTicket, SteamId steamID ) + { + var returnValue = _BeginAuthSession( Self, pAuthTicket, cbAuthTicket, steamID ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_EndAuthSession", CallingConvention = Platform.CC)] + private static extern void _EndAuthSession( IntPtr self, SteamId steamID ); + + #endregion + internal void EndAuthSession( SteamId steamID ) + { + _EndAuthSession( Self, steamID ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_CancelAuthTicket", CallingConvention = Platform.CC)] + private static extern void _CancelAuthTicket( IntPtr self, HAuthTicket hAuthTicket ); + + #endregion + internal void CancelAuthTicket( HAuthTicket hAuthTicket ) + { + _CancelAuthTicket( Self, hAuthTicket ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_UserHasLicenseForApp", CallingConvention = Platform.CC)] + private static extern UserHasLicenseForAppResult _UserHasLicenseForApp( IntPtr self, SteamId steamID, AppId appID ); + + #endregion + internal UserHasLicenseForAppResult UserHasLicenseForApp( SteamId steamID, AppId appID ) + { + var returnValue = _UserHasLicenseForApp( Self, steamID, appID ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_RequestUserGroupStatus", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _RequestUserGroupStatus( IntPtr self, SteamId steamIDUser, SteamId steamIDGroup ); + + #endregion + internal bool RequestUserGroupStatus( SteamId steamIDUser, SteamId steamIDGroup ) + { + var returnValue = _RequestUserGroupStatus( Self, steamIDUser, steamIDGroup ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_GetGameplayStats", CallingConvention = Platform.CC)] + private static extern void _GetGameplayStats( IntPtr self ); + + #endregion + internal void GetGameplayStats() + { + _GetGameplayStats( Self ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_GetServerReputation", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _GetServerReputation( IntPtr self ); + + #endregion + internal CallResult GetServerReputation() + { + var returnValue = _GetServerReputation( Self ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_GetPublicIP", CallingConvention = Platform.CC)] + private static extern SteamIPAddress _GetPublicIP( IntPtr self ); + + #endregion + internal SteamIPAddress GetPublicIP() + { + var returnValue = _GetPublicIP( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_HandleIncomingPacket", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _HandleIncomingPacket( IntPtr self, IntPtr pData, int cbData, uint srcIP, ushort srcPort ); + + #endregion + internal bool HandleIncomingPacket( IntPtr pData, int cbData, uint srcIP, ushort srcPort ) + { + var returnValue = _HandleIncomingPacket( Self, pData, cbData, srcIP, srcPort ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_GetNextOutgoingPacket", CallingConvention = Platform.CC)] + private static extern int _GetNextOutgoingPacket( IntPtr self, IntPtr pOut, int cbMaxOut, ref uint pNetAdr, ref ushort pPort ); + + #endregion + internal int GetNextOutgoingPacket( IntPtr pOut, int cbMaxOut, ref uint pNetAdr, ref ushort pPort ) + { + var returnValue = _GetNextOutgoingPacket( Self, pOut, cbMaxOut, ref pNetAdr, ref pPort ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_EnableHeartbeats", CallingConvention = Platform.CC)] + private static extern void _EnableHeartbeats( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bActive ); + + #endregion + internal void EnableHeartbeats( [MarshalAs( UnmanagedType.U1 )] bool bActive ) + { + _EnableHeartbeats( Self, bActive ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_SetHeartbeatInterval", CallingConvention = Platform.CC)] + private static extern void _SetHeartbeatInterval( IntPtr self, int iHeartbeatInterval ); + + #endregion + internal void SetHeartbeatInterval( int iHeartbeatInterval ) + { + _SetHeartbeatInterval( Self, iHeartbeatInterval ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_ForceHeartbeat", CallingConvention = Platform.CC)] + private static extern void _ForceHeartbeat( IntPtr self ); + + #endregion + internal void ForceHeartbeat() + { + _ForceHeartbeat( Self ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_AssociateWithClan", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _AssociateWithClan( IntPtr self, SteamId steamIDClan ); + + #endregion + internal CallResult AssociateWithClan( SteamId steamIDClan ) + { + var returnValue = _AssociateWithClan( Self, steamIDClan ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServer_ComputeNewPlayerCompatibility", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _ComputeNewPlayerCompatibility( IntPtr self, SteamId steamIDNewPlayer ); + + #endregion + internal CallResult ComputeNewPlayerCompatibility( SteamId steamIDNewPlayer ) + { + var returnValue = _ComputeNewPlayerCompatibility( Self, steamIDNewPlayer ); + return new CallResult( returnValue, IsServer ); + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServerStats.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServerStats.cs new file mode 100644 index 0000000..d6edbf2 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServerStats.cs @@ -0,0 +1,142 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamGameServerStats : SteamInterface + { + + internal ISteamGameServerStats( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamGameServerStats_v001", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamGameServerStats_v001(); + public override IntPtr GetServerInterfacePointer() => SteamAPI_SteamGameServerStats_v001(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_RequestUserStats", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _RequestUserStats( IntPtr self, SteamId steamIDUser ); + + #endregion + internal CallResult RequestUserStats( SteamId steamIDUser ) + { + var returnValue = _RequestUserStats( Self, steamIDUser ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_GetUserStatInt32", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetUserStat( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ); + + #endregion + internal bool GetUserStat( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ) + { + var returnValue = _GetUserStat( Self, steamIDUser, pchName, ref pData ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_GetUserStatFloat", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetUserStat( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ); + + #endregion + internal bool GetUserStat( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ) + { + var returnValue = _GetUserStat( Self, steamIDUser, pchName, ref pData ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_GetUserAchievement", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetUserAchievement( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ); + + #endregion + internal bool GetUserAchievement( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ) + { + var returnValue = _GetUserAchievement( Self, steamIDUser, pchName, ref pbAchieved ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_SetUserStatInt32", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetUserStat( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, int nData ); + + #endregion + internal bool SetUserStat( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, int nData ) + { + var returnValue = _SetUserStat( Self, steamIDUser, pchName, nData ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_SetUserStatFloat", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetUserStat( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float fData ); + + #endregion + internal bool SetUserStat( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float fData ) + { + var returnValue = _SetUserStat( Self, steamIDUser, pchName, fData ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_UpdateUserAvgRateStat", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _UpdateUserAvgRateStat( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float flCountThisSession, double dSessionLength ); + + #endregion + internal bool UpdateUserAvgRateStat( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float flCountThisSession, double dSessionLength ) + { + var returnValue = _UpdateUserAvgRateStat( Self, steamIDUser, pchName, flCountThisSession, dSessionLength ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_SetUserAchievement", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetUserAchievement( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ); + + #endregion + internal bool SetUserAchievement( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ) + { + var returnValue = _SetUserAchievement( Self, steamIDUser, pchName ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_ClearUserAchievement", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _ClearUserAchievement( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ); + + #endregion + internal bool ClearUserAchievement( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ) + { + var returnValue = _ClearUserAchievement( Self, steamIDUser, pchName ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamGameServerStats_StoreUserStats", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _StoreUserStats( IntPtr self, SteamId steamIDUser ); + + #endregion + internal CallResult StoreUserStats( SteamId steamIDUser ) + { + var returnValue = _StoreUserStats( Self, steamIDUser ); + return new CallResult( returnValue, IsServer ); + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamHTMLSurface.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamHTMLSurface.cs new file mode 100644 index 0000000..030c73f --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamHTMLSurface.cs @@ -0,0 +1,399 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamHTMLSurface : SteamInterface + { + + internal ISteamHTMLSurface( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamHTMLSurface_v005", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamHTMLSurface_v005(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamHTMLSurface_v005(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_Init", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _Init( IntPtr self ); + + #endregion + internal bool Init() + { + var returnValue = _Init( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_Shutdown", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _Shutdown( IntPtr self ); + + #endregion + internal bool Shutdown() + { + var returnValue = _Shutdown( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_CreateBrowser", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _CreateBrowser( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchUserAgent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchUserCSS ); + + #endregion + internal CallResult CreateBrowser( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchUserAgent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchUserCSS ) + { + var returnValue = _CreateBrowser( Self, pchUserAgent, pchUserCSS ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_RemoveBrowser", CallingConvention = Platform.CC)] + private static extern void _RemoveBrowser( IntPtr self, HHTMLBrowser unBrowserHandle ); + + #endregion + internal void RemoveBrowser( HHTMLBrowser unBrowserHandle ) + { + _RemoveBrowser( Self, unBrowserHandle ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_LoadURL", CallingConvention = Platform.CC)] + private static extern void _LoadURL( IntPtr self, HHTMLBrowser unBrowserHandle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchURL, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPostData ); + + #endregion + internal void LoadURL( HHTMLBrowser unBrowserHandle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchURL, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPostData ) + { + _LoadURL( Self, unBrowserHandle, pchURL, pchPostData ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_SetSize", CallingConvention = Platform.CC)] + private static extern void _SetSize( IntPtr self, HHTMLBrowser unBrowserHandle, uint unWidth, uint unHeight ); + + #endregion + internal void SetSize( HHTMLBrowser unBrowserHandle, uint unWidth, uint unHeight ) + { + _SetSize( Self, unBrowserHandle, unWidth, unHeight ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_StopLoad", CallingConvention = Platform.CC)] + private static extern void _StopLoad( IntPtr self, HHTMLBrowser unBrowserHandle ); + + #endregion + internal void StopLoad( HHTMLBrowser unBrowserHandle ) + { + _StopLoad( Self, unBrowserHandle ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_Reload", CallingConvention = Platform.CC)] + private static extern void _Reload( IntPtr self, HHTMLBrowser unBrowserHandle ); + + #endregion + internal void Reload( HHTMLBrowser unBrowserHandle ) + { + _Reload( Self, unBrowserHandle ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_GoBack", CallingConvention = Platform.CC)] + private static extern void _GoBack( IntPtr self, HHTMLBrowser unBrowserHandle ); + + #endregion + internal void GoBack( HHTMLBrowser unBrowserHandle ) + { + _GoBack( Self, unBrowserHandle ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_GoForward", CallingConvention = Platform.CC)] + private static extern void _GoForward( IntPtr self, HHTMLBrowser unBrowserHandle ); + + #endregion + internal void GoForward( HHTMLBrowser unBrowserHandle ) + { + _GoForward( Self, unBrowserHandle ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_AddHeader", CallingConvention = Platform.CC)] + private static extern void _AddHeader( IntPtr self, HHTMLBrowser unBrowserHandle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ); + + #endregion + internal void AddHeader( HHTMLBrowser unBrowserHandle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ) + { + _AddHeader( Self, unBrowserHandle, pchKey, pchValue ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_ExecuteJavascript", CallingConvention = Platform.CC)] + private static extern void _ExecuteJavascript( IntPtr self, HHTMLBrowser unBrowserHandle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchScript ); + + #endregion + internal void ExecuteJavascript( HHTMLBrowser unBrowserHandle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchScript ) + { + _ExecuteJavascript( Self, unBrowserHandle, pchScript ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_MouseUp", CallingConvention = Platform.CC)] + private static extern void _MouseUp( IntPtr self, HHTMLBrowser unBrowserHandle, IntPtr eMouseButton ); + + #endregion + internal void MouseUp( HHTMLBrowser unBrowserHandle, IntPtr eMouseButton ) + { + _MouseUp( Self, unBrowserHandle, eMouseButton ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_MouseDown", CallingConvention = Platform.CC)] + private static extern void _MouseDown( IntPtr self, HHTMLBrowser unBrowserHandle, IntPtr eMouseButton ); + + #endregion + internal void MouseDown( HHTMLBrowser unBrowserHandle, IntPtr eMouseButton ) + { + _MouseDown( Self, unBrowserHandle, eMouseButton ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_MouseDoubleClick", CallingConvention = Platform.CC)] + private static extern void _MouseDoubleClick( IntPtr self, HHTMLBrowser unBrowserHandle, IntPtr eMouseButton ); + + #endregion + internal void MouseDoubleClick( HHTMLBrowser unBrowserHandle, IntPtr eMouseButton ) + { + _MouseDoubleClick( Self, unBrowserHandle, eMouseButton ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_MouseMove", CallingConvention = Platform.CC)] + private static extern void _MouseMove( IntPtr self, HHTMLBrowser unBrowserHandle, int x, int y ); + + #endregion + internal void MouseMove( HHTMLBrowser unBrowserHandle, int x, int y ) + { + _MouseMove( Self, unBrowserHandle, x, y ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_MouseWheel", CallingConvention = Platform.CC)] + private static extern void _MouseWheel( IntPtr self, HHTMLBrowser unBrowserHandle, int nDelta ); + + #endregion + internal void MouseWheel( HHTMLBrowser unBrowserHandle, int nDelta ) + { + _MouseWheel( Self, unBrowserHandle, nDelta ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_KeyDown", CallingConvention = Platform.CC)] + private static extern void _KeyDown( IntPtr self, HHTMLBrowser unBrowserHandle, uint nNativeKeyCode, IntPtr eHTMLKeyModifiers, [MarshalAs( UnmanagedType.U1 )] bool bIsSystemKey ); + + #endregion + internal void KeyDown( HHTMLBrowser unBrowserHandle, uint nNativeKeyCode, IntPtr eHTMLKeyModifiers, [MarshalAs( UnmanagedType.U1 )] bool bIsSystemKey ) + { + _KeyDown( Self, unBrowserHandle, nNativeKeyCode, eHTMLKeyModifiers, bIsSystemKey ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_KeyUp", CallingConvention = Platform.CC)] + private static extern void _KeyUp( IntPtr self, HHTMLBrowser unBrowserHandle, uint nNativeKeyCode, IntPtr eHTMLKeyModifiers ); + + #endregion + internal void KeyUp( HHTMLBrowser unBrowserHandle, uint nNativeKeyCode, IntPtr eHTMLKeyModifiers ) + { + _KeyUp( Self, unBrowserHandle, nNativeKeyCode, eHTMLKeyModifiers ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_KeyChar", CallingConvention = Platform.CC)] + private static extern void _KeyChar( IntPtr self, HHTMLBrowser unBrowserHandle, uint cUnicodeChar, IntPtr eHTMLKeyModifiers ); + + #endregion + internal void KeyChar( HHTMLBrowser unBrowserHandle, uint cUnicodeChar, IntPtr eHTMLKeyModifiers ) + { + _KeyChar( Self, unBrowserHandle, cUnicodeChar, eHTMLKeyModifiers ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_SetHorizontalScroll", CallingConvention = Platform.CC)] + private static extern void _SetHorizontalScroll( IntPtr self, HHTMLBrowser unBrowserHandle, uint nAbsolutePixelScroll ); + + #endregion + internal void SetHorizontalScroll( HHTMLBrowser unBrowserHandle, uint nAbsolutePixelScroll ) + { + _SetHorizontalScroll( Self, unBrowserHandle, nAbsolutePixelScroll ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_SetVerticalScroll", CallingConvention = Platform.CC)] + private static extern void _SetVerticalScroll( IntPtr self, HHTMLBrowser unBrowserHandle, uint nAbsolutePixelScroll ); + + #endregion + internal void SetVerticalScroll( HHTMLBrowser unBrowserHandle, uint nAbsolutePixelScroll ) + { + _SetVerticalScroll( Self, unBrowserHandle, nAbsolutePixelScroll ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_SetKeyFocus", CallingConvention = Platform.CC)] + private static extern void _SetKeyFocus( IntPtr self, HHTMLBrowser unBrowserHandle, [MarshalAs( UnmanagedType.U1 )] bool bHasKeyFocus ); + + #endregion + internal void SetKeyFocus( HHTMLBrowser unBrowserHandle, [MarshalAs( UnmanagedType.U1 )] bool bHasKeyFocus ) + { + _SetKeyFocus( Self, unBrowserHandle, bHasKeyFocus ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_ViewSource", CallingConvention = Platform.CC)] + private static extern void _ViewSource( IntPtr self, HHTMLBrowser unBrowserHandle ); + + #endregion + internal void ViewSource( HHTMLBrowser unBrowserHandle ) + { + _ViewSource( Self, unBrowserHandle ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_CopyToClipboard", CallingConvention = Platform.CC)] + private static extern void _CopyToClipboard( IntPtr self, HHTMLBrowser unBrowserHandle ); + + #endregion + internal void CopyToClipboard( HHTMLBrowser unBrowserHandle ) + { + _CopyToClipboard( Self, unBrowserHandle ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_PasteFromClipboard", CallingConvention = Platform.CC)] + private static extern void _PasteFromClipboard( IntPtr self, HHTMLBrowser unBrowserHandle ); + + #endregion + internal void PasteFromClipboard( HHTMLBrowser unBrowserHandle ) + { + _PasteFromClipboard( Self, unBrowserHandle ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_Find", CallingConvention = Platform.CC)] + private static extern void _Find( IntPtr self, HHTMLBrowser unBrowserHandle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchSearchStr, [MarshalAs( UnmanagedType.U1 )] bool bCurrentlyInFind, [MarshalAs( UnmanagedType.U1 )] bool bReverse ); + + #endregion + internal void Find( HHTMLBrowser unBrowserHandle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchSearchStr, [MarshalAs( UnmanagedType.U1 )] bool bCurrentlyInFind, [MarshalAs( UnmanagedType.U1 )] bool bReverse ) + { + _Find( Self, unBrowserHandle, pchSearchStr, bCurrentlyInFind, bReverse ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_StopFind", CallingConvention = Platform.CC)] + private static extern void _StopFind( IntPtr self, HHTMLBrowser unBrowserHandle ); + + #endregion + internal void StopFind( HHTMLBrowser unBrowserHandle ) + { + _StopFind( Self, unBrowserHandle ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_GetLinkAtPosition", CallingConvention = Platform.CC)] + private static extern void _GetLinkAtPosition( IntPtr self, HHTMLBrowser unBrowserHandle, int x, int y ); + + #endregion + internal void GetLinkAtPosition( HHTMLBrowser unBrowserHandle, int x, int y ) + { + _GetLinkAtPosition( Self, unBrowserHandle, x, y ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_SetCookie", CallingConvention = Platform.CC)] + private static extern void _SetCookie( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchHostname, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPath, RTime32 nExpires, [MarshalAs( UnmanagedType.U1 )] bool bSecure, [MarshalAs( UnmanagedType.U1 )] bool bHTTPOnly ); + + #endregion + internal void SetCookie( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchHostname, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPath, RTime32 nExpires, [MarshalAs( UnmanagedType.U1 )] bool bSecure, [MarshalAs( UnmanagedType.U1 )] bool bHTTPOnly ) + { + _SetCookie( Self, pchHostname, pchKey, pchValue, pchPath, nExpires, bSecure, bHTTPOnly ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_SetPageScaleFactor", CallingConvention = Platform.CC)] + private static extern void _SetPageScaleFactor( IntPtr self, HHTMLBrowser unBrowserHandle, float flZoom, int nPointX, int nPointY ); + + #endregion + internal void SetPageScaleFactor( HHTMLBrowser unBrowserHandle, float flZoom, int nPointX, int nPointY ) + { + _SetPageScaleFactor( Self, unBrowserHandle, flZoom, nPointX, nPointY ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_SetBackgroundMode", CallingConvention = Platform.CC)] + private static extern void _SetBackgroundMode( IntPtr self, HHTMLBrowser unBrowserHandle, [MarshalAs( UnmanagedType.U1 )] bool bBackgroundMode ); + + #endregion + internal void SetBackgroundMode( HHTMLBrowser unBrowserHandle, [MarshalAs( UnmanagedType.U1 )] bool bBackgroundMode ) + { + _SetBackgroundMode( Self, unBrowserHandle, bBackgroundMode ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_SetDPIScalingFactor", CallingConvention = Platform.CC)] + private static extern void _SetDPIScalingFactor( IntPtr self, HHTMLBrowser unBrowserHandle, float flDPIScaling ); + + #endregion + internal void SetDPIScalingFactor( HHTMLBrowser unBrowserHandle, float flDPIScaling ) + { + _SetDPIScalingFactor( Self, unBrowserHandle, flDPIScaling ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_OpenDeveloperTools", CallingConvention = Platform.CC)] + private static extern void _OpenDeveloperTools( IntPtr self, HHTMLBrowser unBrowserHandle ); + + #endregion + internal void OpenDeveloperTools( HHTMLBrowser unBrowserHandle ) + { + _OpenDeveloperTools( Self, unBrowserHandle ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_AllowStartRequest", CallingConvention = Platform.CC)] + private static extern void _AllowStartRequest( IntPtr self, HHTMLBrowser unBrowserHandle, [MarshalAs( UnmanagedType.U1 )] bool bAllowed ); + + #endregion + internal void AllowStartRequest( HHTMLBrowser unBrowserHandle, [MarshalAs( UnmanagedType.U1 )] bool bAllowed ) + { + _AllowStartRequest( Self, unBrowserHandle, bAllowed ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_JSDialogResponse", CallingConvention = Platform.CC)] + private static extern void _JSDialogResponse( IntPtr self, HHTMLBrowser unBrowserHandle, [MarshalAs( UnmanagedType.U1 )] bool bResult ); + + #endregion + internal void JSDialogResponse( HHTMLBrowser unBrowserHandle, [MarshalAs( UnmanagedType.U1 )] bool bResult ) + { + _JSDialogResponse( Self, unBrowserHandle, bResult ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTMLSurface_FileLoadDialogResponse", CallingConvention = Platform.CC)] + private static extern void _FileLoadDialogResponse( IntPtr self, HHTMLBrowser unBrowserHandle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchSelectedFiles ); + + #endregion + internal void FileLoadDialogResponse( HHTMLBrowser unBrowserHandle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchSelectedFiles ) + { + _FileLoadDialogResponse( Self, unBrowserHandle, pchSelectedFiles ); + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamHTTP.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamHTTP.cs new file mode 100644 index 0000000..02dd6f6 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamHTTP.cs @@ -0,0 +1,325 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamHTTP : SteamInterface + { + + internal ISteamHTTP( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamHTTP_v003", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamHTTP_v003(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamHTTP_v003(); + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamGameServerHTTP_v003", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamGameServerHTTP_v003(); + public override IntPtr GetServerInterfacePointer() => SteamAPI_SteamGameServerHTTP_v003(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_CreateHTTPRequest", CallingConvention = Platform.CC)] + private static extern HTTPRequestHandle _CreateHTTPRequest( IntPtr self, HTTPMethod eHTTPRequestMethod, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchAbsoluteURL ); + + #endregion + internal HTTPRequestHandle CreateHTTPRequest( HTTPMethod eHTTPRequestMethod, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchAbsoluteURL ) + { + var returnValue = _CreateHTTPRequest( Self, eHTTPRequestMethod, pchAbsoluteURL ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestContextValue", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetHTTPRequestContextValue( IntPtr self, HTTPRequestHandle hRequest, ulong ulContextValue ); + + #endregion + internal bool SetHTTPRequestContextValue( HTTPRequestHandle hRequest, ulong ulContextValue ) + { + var returnValue = _SetHTTPRequestContextValue( Self, hRequest, ulContextValue ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestNetworkActivityTimeout", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetHTTPRequestNetworkActivityTimeout( IntPtr self, HTTPRequestHandle hRequest, uint unTimeoutSeconds ); + + #endregion + internal bool SetHTTPRequestNetworkActivityTimeout( HTTPRequestHandle hRequest, uint unTimeoutSeconds ) + { + var returnValue = _SetHTTPRequestNetworkActivityTimeout( Self, hRequest, unTimeoutSeconds ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestHeaderValue", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetHTTPRequestHeaderValue( IntPtr self, HTTPRequestHandle hRequest, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchHeaderName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchHeaderValue ); + + #endregion + internal bool SetHTTPRequestHeaderValue( HTTPRequestHandle hRequest, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchHeaderName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchHeaderValue ) + { + var returnValue = _SetHTTPRequestHeaderValue( Self, hRequest, pchHeaderName, pchHeaderValue ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestGetOrPostParameter", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetHTTPRequestGetOrPostParameter( IntPtr self, HTTPRequestHandle hRequest, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchParamName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchParamValue ); + + #endregion + internal bool SetHTTPRequestGetOrPostParameter( HTTPRequestHandle hRequest, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchParamName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchParamValue ) + { + var returnValue = _SetHTTPRequestGetOrPostParameter( Self, hRequest, pchParamName, pchParamValue ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_SendHTTPRequest", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SendHTTPRequest( IntPtr self, HTTPRequestHandle hRequest, ref SteamAPICall_t pCallHandle ); + + #endregion + internal bool SendHTTPRequest( HTTPRequestHandle hRequest, ref SteamAPICall_t pCallHandle ) + { + var returnValue = _SendHTTPRequest( Self, hRequest, ref pCallHandle ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_SendHTTPRequestAndStreamResponse", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SendHTTPRequestAndStreamResponse( IntPtr self, HTTPRequestHandle hRequest, ref SteamAPICall_t pCallHandle ); + + #endregion + internal bool SendHTTPRequestAndStreamResponse( HTTPRequestHandle hRequest, ref SteamAPICall_t pCallHandle ) + { + var returnValue = _SendHTTPRequestAndStreamResponse( Self, hRequest, ref pCallHandle ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_DeferHTTPRequest", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _DeferHTTPRequest( IntPtr self, HTTPRequestHandle hRequest ); + + #endregion + internal bool DeferHTTPRequest( HTTPRequestHandle hRequest ) + { + var returnValue = _DeferHTTPRequest( Self, hRequest ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_PrioritizeHTTPRequest", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _PrioritizeHTTPRequest( IntPtr self, HTTPRequestHandle hRequest ); + + #endregion + internal bool PrioritizeHTTPRequest( HTTPRequestHandle hRequest ) + { + var returnValue = _PrioritizeHTTPRequest( Self, hRequest ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_GetHTTPResponseHeaderSize", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetHTTPResponseHeaderSize( IntPtr self, HTTPRequestHandle hRequest, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchHeaderName, ref uint unResponseHeaderSize ); + + #endregion + internal bool GetHTTPResponseHeaderSize( HTTPRequestHandle hRequest, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchHeaderName, ref uint unResponseHeaderSize ) + { + var returnValue = _GetHTTPResponseHeaderSize( Self, hRequest, pchHeaderName, ref unResponseHeaderSize ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_GetHTTPResponseHeaderValue", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetHTTPResponseHeaderValue( IntPtr self, HTTPRequestHandle hRequest, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchHeaderName, ref byte pHeaderValueBuffer, uint unBufferSize ); + + #endregion + internal bool GetHTTPResponseHeaderValue( HTTPRequestHandle hRequest, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchHeaderName, ref byte pHeaderValueBuffer, uint unBufferSize ) + { + var returnValue = _GetHTTPResponseHeaderValue( Self, hRequest, pchHeaderName, ref pHeaderValueBuffer, unBufferSize ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_GetHTTPResponseBodySize", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetHTTPResponseBodySize( IntPtr self, HTTPRequestHandle hRequest, ref uint unBodySize ); + + #endregion + internal bool GetHTTPResponseBodySize( HTTPRequestHandle hRequest, ref uint unBodySize ) + { + var returnValue = _GetHTTPResponseBodySize( Self, hRequest, ref unBodySize ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_GetHTTPResponseBodyData", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetHTTPResponseBodyData( IntPtr self, HTTPRequestHandle hRequest, ref byte pBodyDataBuffer, uint unBufferSize ); + + #endregion + internal bool GetHTTPResponseBodyData( HTTPRequestHandle hRequest, ref byte pBodyDataBuffer, uint unBufferSize ) + { + var returnValue = _GetHTTPResponseBodyData( Self, hRequest, ref pBodyDataBuffer, unBufferSize ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_GetHTTPStreamingResponseBodyData", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetHTTPStreamingResponseBodyData( IntPtr self, HTTPRequestHandle hRequest, uint cOffset, ref byte pBodyDataBuffer, uint unBufferSize ); + + #endregion + internal bool GetHTTPStreamingResponseBodyData( HTTPRequestHandle hRequest, uint cOffset, ref byte pBodyDataBuffer, uint unBufferSize ) + { + var returnValue = _GetHTTPStreamingResponseBodyData( Self, hRequest, cOffset, ref pBodyDataBuffer, unBufferSize ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_ReleaseHTTPRequest", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _ReleaseHTTPRequest( IntPtr self, HTTPRequestHandle hRequest ); + + #endregion + internal bool ReleaseHTTPRequest( HTTPRequestHandle hRequest ) + { + var returnValue = _ReleaseHTTPRequest( Self, hRequest ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_GetHTTPDownloadProgressPct", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetHTTPDownloadProgressPct( IntPtr self, HTTPRequestHandle hRequest, ref float pflPercentOut ); + + #endregion + internal bool GetHTTPDownloadProgressPct( HTTPRequestHandle hRequest, ref float pflPercentOut ) + { + var returnValue = _GetHTTPDownloadProgressPct( Self, hRequest, ref pflPercentOut ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestRawPostBody", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetHTTPRequestRawPostBody( IntPtr self, HTTPRequestHandle hRequest, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchContentType, [In,Out] byte[] pubBody, uint unBodyLen ); + + #endregion + internal bool SetHTTPRequestRawPostBody( HTTPRequestHandle hRequest, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchContentType, [In,Out] byte[] pubBody, uint unBodyLen ) + { + var returnValue = _SetHTTPRequestRawPostBody( Self, hRequest, pchContentType, pubBody, unBodyLen ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_CreateCookieContainer", CallingConvention = Platform.CC)] + private static extern HTTPCookieContainerHandle _CreateCookieContainer( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bAllowResponsesToModify ); + + #endregion + internal HTTPCookieContainerHandle CreateCookieContainer( [MarshalAs( UnmanagedType.U1 )] bool bAllowResponsesToModify ) + { + var returnValue = _CreateCookieContainer( Self, bAllowResponsesToModify ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_ReleaseCookieContainer", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _ReleaseCookieContainer( IntPtr self, HTTPCookieContainerHandle hCookieContainer ); + + #endregion + internal bool ReleaseCookieContainer( HTTPCookieContainerHandle hCookieContainer ) + { + var returnValue = _ReleaseCookieContainer( Self, hCookieContainer ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_SetCookie", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetCookie( IntPtr self, HTTPCookieContainerHandle hCookieContainer, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchHost, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchUrl, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchCookie ); + + #endregion + internal bool SetCookie( HTTPCookieContainerHandle hCookieContainer, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchHost, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchUrl, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchCookie ) + { + var returnValue = _SetCookie( Self, hCookieContainer, pchHost, pchUrl, pchCookie ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestCookieContainer", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetHTTPRequestCookieContainer( IntPtr self, HTTPRequestHandle hRequest, HTTPCookieContainerHandle hCookieContainer ); + + #endregion + internal bool SetHTTPRequestCookieContainer( HTTPRequestHandle hRequest, HTTPCookieContainerHandle hCookieContainer ) + { + var returnValue = _SetHTTPRequestCookieContainer( Self, hRequest, hCookieContainer ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestUserAgentInfo", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetHTTPRequestUserAgentInfo( IntPtr self, HTTPRequestHandle hRequest, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchUserAgentInfo ); + + #endregion + internal bool SetHTTPRequestUserAgentInfo( HTTPRequestHandle hRequest, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchUserAgentInfo ) + { + var returnValue = _SetHTTPRequestUserAgentInfo( Self, hRequest, pchUserAgentInfo ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetHTTPRequestRequiresVerifiedCertificate( IntPtr self, HTTPRequestHandle hRequest, [MarshalAs( UnmanagedType.U1 )] bool bRequireVerifiedCertificate ); + + #endregion + internal bool SetHTTPRequestRequiresVerifiedCertificate( HTTPRequestHandle hRequest, [MarshalAs( UnmanagedType.U1 )] bool bRequireVerifiedCertificate ) + { + var returnValue = _SetHTTPRequestRequiresVerifiedCertificate( Self, hRequest, bRequireVerifiedCertificate ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetHTTPRequestAbsoluteTimeoutMS( IntPtr self, HTTPRequestHandle hRequest, uint unMilliseconds ); + + #endregion + internal bool SetHTTPRequestAbsoluteTimeoutMS( HTTPRequestHandle hRequest, uint unMilliseconds ) + { + var returnValue = _SetHTTPRequestAbsoluteTimeoutMS( Self, hRequest, unMilliseconds ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetHTTPRequestWasTimedOut( IntPtr self, HTTPRequestHandle hRequest, [MarshalAs( UnmanagedType.U1 )] ref bool pbWasTimedOut ); + + #endregion + internal bool GetHTTPRequestWasTimedOut( HTTPRequestHandle hRequest, [MarshalAs( UnmanagedType.U1 )] ref bool pbWasTimedOut ) + { + var returnValue = _GetHTTPRequestWasTimedOut( Self, hRequest, ref pbWasTimedOut ); + return returnValue; + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamInput.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamInput.cs new file mode 100644 index 0000000..b37c4ba --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamInput.cs @@ -0,0 +1,403 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamInput : SteamInterface + { + + internal ISteamInput( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamInput_v001", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamInput_v001(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamInput_v001(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_Init", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _Init( IntPtr self ); + + #endregion + internal bool Init() + { + var returnValue = _Init( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_Shutdown", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _Shutdown( IntPtr self ); + + #endregion + internal bool Shutdown() + { + var returnValue = _Shutdown( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_RunFrame", CallingConvention = Platform.CC)] + private static extern void _RunFrame( IntPtr self ); + + #endregion + internal void RunFrame() + { + _RunFrame( Self ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetConnectedControllers", CallingConvention = Platform.CC)] + private static extern int _GetConnectedControllers( IntPtr self, [In,Out] InputHandle_t[] handlesOut ); + + #endregion + internal int GetConnectedControllers( [In,Out] InputHandle_t[] handlesOut ) + { + var returnValue = _GetConnectedControllers( Self, handlesOut ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetActionSetHandle", CallingConvention = Platform.CC)] + private static extern InputActionSetHandle_t _GetActionSetHandle( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionSetName ); + + #endregion + internal InputActionSetHandle_t GetActionSetHandle( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionSetName ) + { + var returnValue = _GetActionSetHandle( Self, pszActionSetName ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_ActivateActionSet", CallingConvention = Platform.CC)] + private static extern void _ActivateActionSet( IntPtr self, InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle ); + + #endregion + internal void ActivateActionSet( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle ) + { + _ActivateActionSet( Self, inputHandle, actionSetHandle ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetCurrentActionSet", CallingConvention = Platform.CC)] + private static extern InputActionSetHandle_t _GetCurrentActionSet( IntPtr self, InputHandle_t inputHandle ); + + #endregion + internal InputActionSetHandle_t GetCurrentActionSet( InputHandle_t inputHandle ) + { + var returnValue = _GetCurrentActionSet( Self, inputHandle ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_ActivateActionSetLayer", CallingConvention = Platform.CC)] + private static extern void _ActivateActionSetLayer( IntPtr self, InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ); + + #endregion + internal void ActivateActionSetLayer( InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ) + { + _ActivateActionSetLayer( Self, inputHandle, actionSetLayerHandle ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_DeactivateActionSetLayer", CallingConvention = Platform.CC)] + private static extern void _DeactivateActionSetLayer( IntPtr self, InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ); + + #endregion + internal void DeactivateActionSetLayer( InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ) + { + _DeactivateActionSetLayer( Self, inputHandle, actionSetLayerHandle ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_DeactivateAllActionSetLayers", CallingConvention = Platform.CC)] + private static extern void _DeactivateAllActionSetLayers( IntPtr self, InputHandle_t inputHandle ); + + #endregion + internal void DeactivateAllActionSetLayers( InputHandle_t inputHandle ) + { + _DeactivateAllActionSetLayers( Self, inputHandle ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetActiveActionSetLayers", CallingConvention = Platform.CC)] + private static extern int _GetActiveActionSetLayers( IntPtr self, InputHandle_t inputHandle, [In,Out] InputActionSetHandle_t[] handlesOut ); + + #endregion + internal int GetActiveActionSetLayers( InputHandle_t inputHandle, [In,Out] InputActionSetHandle_t[] handlesOut ) + { + var returnValue = _GetActiveActionSetLayers( Self, inputHandle, handlesOut ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetDigitalActionHandle", CallingConvention = Platform.CC)] + private static extern InputDigitalActionHandle_t _GetDigitalActionHandle( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionName ); + + #endregion + internal InputDigitalActionHandle_t GetDigitalActionHandle( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionName ) + { + var returnValue = _GetDigitalActionHandle( Self, pszActionName ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetDigitalActionData", CallingConvention = Platform.CC)] + private static extern DigitalState _GetDigitalActionData( IntPtr self, InputHandle_t inputHandle, InputDigitalActionHandle_t digitalActionHandle ); + + #endregion + internal DigitalState GetDigitalActionData( InputHandle_t inputHandle, InputDigitalActionHandle_t digitalActionHandle ) + { + var returnValue = _GetDigitalActionData( Self, inputHandle, digitalActionHandle ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetDigitalActionOrigins", CallingConvention = Platform.CC)] + private static extern int _GetDigitalActionOrigins( IntPtr self, InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputDigitalActionHandle_t digitalActionHandle, ref InputActionOrigin originsOut ); + + #endregion + internal int GetDigitalActionOrigins( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputDigitalActionHandle_t digitalActionHandle, ref InputActionOrigin originsOut ) + { + var returnValue = _GetDigitalActionOrigins( Self, inputHandle, actionSetHandle, digitalActionHandle, ref originsOut ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetAnalogActionHandle", CallingConvention = Platform.CC)] + private static extern InputAnalogActionHandle_t _GetAnalogActionHandle( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionName ); + + #endregion + internal InputAnalogActionHandle_t GetAnalogActionHandle( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionName ) + { + var returnValue = _GetAnalogActionHandle( Self, pszActionName ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetAnalogActionData", CallingConvention = Platform.CC)] + private static extern AnalogState _GetAnalogActionData( IntPtr self, InputHandle_t inputHandle, InputAnalogActionHandle_t analogActionHandle ); + + #endregion + internal AnalogState GetAnalogActionData( InputHandle_t inputHandle, InputAnalogActionHandle_t analogActionHandle ) + { + var returnValue = _GetAnalogActionData( Self, inputHandle, analogActionHandle ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetAnalogActionOrigins", CallingConvention = Platform.CC)] + private static extern int _GetAnalogActionOrigins( IntPtr self, InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputAnalogActionHandle_t analogActionHandle, ref InputActionOrigin originsOut ); + + #endregion + internal int GetAnalogActionOrigins( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputAnalogActionHandle_t analogActionHandle, ref InputActionOrigin originsOut ) + { + var returnValue = _GetAnalogActionOrigins( Self, inputHandle, actionSetHandle, analogActionHandle, ref originsOut ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetGlyphForActionOrigin", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetGlyphForActionOrigin( IntPtr self, InputActionOrigin eOrigin ); + + #endregion + internal string GetGlyphForActionOrigin( InputActionOrigin eOrigin ) + { + var returnValue = _GetGlyphForActionOrigin( Self, eOrigin ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetStringForActionOrigin", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetStringForActionOrigin( IntPtr self, InputActionOrigin eOrigin ); + + #endregion + internal string GetStringForActionOrigin( InputActionOrigin eOrigin ) + { + var returnValue = _GetStringForActionOrigin( Self, eOrigin ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_StopAnalogActionMomentum", CallingConvention = Platform.CC)] + private static extern void _StopAnalogActionMomentum( IntPtr self, InputHandle_t inputHandle, InputAnalogActionHandle_t eAction ); + + #endregion + internal void StopAnalogActionMomentum( InputHandle_t inputHandle, InputAnalogActionHandle_t eAction ) + { + _StopAnalogActionMomentum( Self, inputHandle, eAction ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetMotionData", CallingConvention = Platform.CC)] + private static extern MotionState _GetMotionData( IntPtr self, InputHandle_t inputHandle ); + + #endregion + internal MotionState GetMotionData( InputHandle_t inputHandle ) + { + var returnValue = _GetMotionData( Self, inputHandle ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_TriggerVibration", CallingConvention = Platform.CC)] + private static extern void _TriggerVibration( IntPtr self, InputHandle_t inputHandle, ushort usLeftSpeed, ushort usRightSpeed ); + + #endregion + internal void TriggerVibration( InputHandle_t inputHandle, ushort usLeftSpeed, ushort usRightSpeed ) + { + _TriggerVibration( Self, inputHandle, usLeftSpeed, usRightSpeed ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_SetLEDColor", CallingConvention = Platform.CC)] + private static extern void _SetLEDColor( IntPtr self, InputHandle_t inputHandle, byte nColorR, byte nColorG, byte nColorB, uint nFlags ); + + #endregion + internal void SetLEDColor( InputHandle_t inputHandle, byte nColorR, byte nColorG, byte nColorB, uint nFlags ) + { + _SetLEDColor( Self, inputHandle, nColorR, nColorG, nColorB, nFlags ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_TriggerHapticPulse", CallingConvention = Platform.CC)] + private static extern void _TriggerHapticPulse( IntPtr self, InputHandle_t inputHandle, SteamControllerPad eTargetPad, ushort usDurationMicroSec ); + + #endregion + internal void TriggerHapticPulse( InputHandle_t inputHandle, SteamControllerPad eTargetPad, ushort usDurationMicroSec ) + { + _TriggerHapticPulse( Self, inputHandle, eTargetPad, usDurationMicroSec ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_TriggerRepeatedHapticPulse", CallingConvention = Platform.CC)] + private static extern void _TriggerRepeatedHapticPulse( IntPtr self, InputHandle_t inputHandle, SteamControllerPad eTargetPad, ushort usDurationMicroSec, ushort usOffMicroSec, ushort unRepeat, uint nFlags ); + + #endregion + internal void TriggerRepeatedHapticPulse( InputHandle_t inputHandle, SteamControllerPad eTargetPad, ushort usDurationMicroSec, ushort usOffMicroSec, ushort unRepeat, uint nFlags ) + { + _TriggerRepeatedHapticPulse( Self, inputHandle, eTargetPad, usDurationMicroSec, usOffMicroSec, unRepeat, nFlags ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_ShowBindingPanel", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _ShowBindingPanel( IntPtr self, InputHandle_t inputHandle ); + + #endregion + internal bool ShowBindingPanel( InputHandle_t inputHandle ) + { + var returnValue = _ShowBindingPanel( Self, inputHandle ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetInputTypeForHandle", CallingConvention = Platform.CC)] + private static extern InputType _GetInputTypeForHandle( IntPtr self, InputHandle_t inputHandle ); + + #endregion + internal InputType GetInputTypeForHandle( InputHandle_t inputHandle ) + { + var returnValue = _GetInputTypeForHandle( Self, inputHandle ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetControllerForGamepadIndex", CallingConvention = Platform.CC)] + private static extern InputHandle_t _GetControllerForGamepadIndex( IntPtr self, int nIndex ); + + #endregion + internal InputHandle_t GetControllerForGamepadIndex( int nIndex ) + { + var returnValue = _GetControllerForGamepadIndex( Self, nIndex ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetGamepadIndexForController", CallingConvention = Platform.CC)] + private static extern int _GetGamepadIndexForController( IntPtr self, InputHandle_t ulinputHandle ); + + #endregion + internal int GetGamepadIndexForController( InputHandle_t ulinputHandle ) + { + var returnValue = _GetGamepadIndexForController( Self, ulinputHandle ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetStringForXboxOrigin", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetStringForXboxOrigin( IntPtr self, XboxOrigin eOrigin ); + + #endregion + internal string GetStringForXboxOrigin( XboxOrigin eOrigin ) + { + var returnValue = _GetStringForXboxOrigin( Self, eOrigin ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetGlyphForXboxOrigin", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetGlyphForXboxOrigin( IntPtr self, XboxOrigin eOrigin ); + + #endregion + internal string GetGlyphForXboxOrigin( XboxOrigin eOrigin ) + { + var returnValue = _GetGlyphForXboxOrigin( Self, eOrigin ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetActionOriginFromXboxOrigin", CallingConvention = Platform.CC)] + private static extern InputActionOrigin _GetActionOriginFromXboxOrigin( IntPtr self, InputHandle_t inputHandle, XboxOrigin eOrigin ); + + #endregion + internal InputActionOrigin GetActionOriginFromXboxOrigin( InputHandle_t inputHandle, XboxOrigin eOrigin ) + { + var returnValue = _GetActionOriginFromXboxOrigin( Self, inputHandle, eOrigin ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_TranslateActionOrigin", CallingConvention = Platform.CC)] + private static extern InputActionOrigin _TranslateActionOrigin( IntPtr self, InputType eDestinationInputType, InputActionOrigin eSourceOrigin ); + + #endregion + internal InputActionOrigin TranslateActionOrigin( InputType eDestinationInputType, InputActionOrigin eSourceOrigin ) + { + var returnValue = _TranslateActionOrigin( Self, eDestinationInputType, eSourceOrigin ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetDeviceBindingRevision", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetDeviceBindingRevision( IntPtr self, InputHandle_t inputHandle, ref int pMajor, ref int pMinor ); + + #endregion + internal bool GetDeviceBindingRevision( InputHandle_t inputHandle, ref int pMajor, ref int pMinor ) + { + var returnValue = _GetDeviceBindingRevision( Self, inputHandle, ref pMajor, ref pMinor ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInput_GetRemotePlaySessionID", CallingConvention = Platform.CC)] + private static extern uint _GetRemotePlaySessionID( IntPtr self, InputHandle_t inputHandle ); + + #endregion + internal uint GetRemotePlaySessionID( InputHandle_t inputHandle ) + { + var returnValue = _GetRemotePlaySessionID( Self, inputHandle ); + return returnValue; + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamInventory.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamInventory.cs new file mode 100644 index 0000000..f083fe0 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamInventory.cs @@ -0,0 +1,500 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamInventory : SteamInterface + { + + internal ISteamInventory( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamInventory_v003", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamInventory_v003(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamInventory_v003(); + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamGameServerInventory_v003", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamGameServerInventory_v003(); + public override IntPtr GetServerInterfacePointer() => SteamAPI_SteamGameServerInventory_v003(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetResultStatus", CallingConvention = Platform.CC)] + private static extern Result _GetResultStatus( IntPtr self, SteamInventoryResult_t resultHandle ); + + #endregion + /// + /// Find out the status of an asynchronous inventory result handle. + /// + internal Result GetResultStatus( SteamInventoryResult_t resultHandle ) + { + var returnValue = _GetResultStatus( Self, resultHandle ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetResultItems", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetResultItems( IntPtr self, SteamInventoryResult_t resultHandle, [In,Out] SteamItemDetails_t[] pOutItemsArray, ref uint punOutItemsArraySize ); + + #endregion + /// + /// Copies the contents of a result set into a flat array. The specific contents of the result set depend on which query which was used. + /// + internal bool GetResultItems( SteamInventoryResult_t resultHandle, [In,Out] SteamItemDetails_t[] pOutItemsArray, ref uint punOutItemsArraySize ) + { + var returnValue = _GetResultItems( Self, resultHandle, pOutItemsArray, ref punOutItemsArraySize ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetResultItemProperty", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetResultItemProperty( IntPtr self, SteamInventoryResult_t resultHandle, uint unItemIndex, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, IntPtr pchValueBuffer, ref uint punValueBufferSizeOut ); + + #endregion + internal bool GetResultItemProperty( SteamInventoryResult_t resultHandle, uint unItemIndex, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, out string pchValueBuffer, ref uint punValueBufferSizeOut ) + { + IntPtr mempchValueBuffer = Helpers.TakeMemory(); + var returnValue = _GetResultItemProperty( Self, resultHandle, unItemIndex, pchPropertyName, mempchValueBuffer, ref punValueBufferSizeOut ); + pchValueBuffer = Helpers.MemoryToString( mempchValueBuffer ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetResultTimestamp", CallingConvention = Platform.CC)] + private static extern uint _GetResultTimestamp( IntPtr self, SteamInventoryResult_t resultHandle ); + + #endregion + /// + /// Returns the server time at which the result was generated. Compare against the value of IClientUtils::GetServerRealTime() to determine age. + /// + internal uint GetResultTimestamp( SteamInventoryResult_t resultHandle ) + { + var returnValue = _GetResultTimestamp( Self, resultHandle ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_CheckResultSteamID", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _CheckResultSteamID( IntPtr self, SteamInventoryResult_t resultHandle, SteamId steamIDExpected ); + + #endregion + /// + /// Returns true if the result belongs to the target steam ID or false if the result does not. This is important when using DeserializeResult to verify that a remote player is not pretending to have a different users inventory. + /// + internal bool CheckResultSteamID( SteamInventoryResult_t resultHandle, SteamId steamIDExpected ) + { + var returnValue = _CheckResultSteamID( Self, resultHandle, steamIDExpected ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_DestroyResult", CallingConvention = Platform.CC)] + private static extern void _DestroyResult( IntPtr self, SteamInventoryResult_t resultHandle ); + + #endregion + /// + /// Destroys a result handle and frees all associated memory. + /// + internal void DestroyResult( SteamInventoryResult_t resultHandle ) + { + _DestroyResult( Self, resultHandle ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetAllItems", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetAllItems( IntPtr self, ref SteamInventoryResult_t pResultHandle ); + + #endregion + /// + /// Captures the entire state of the current users Steam inventory. + /// + internal bool GetAllItems( ref SteamInventoryResult_t pResultHandle ) + { + var returnValue = _GetAllItems( Self, ref pResultHandle ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetItemsByID", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetItemsByID( IntPtr self, ref SteamInventoryResult_t pResultHandle, ref InventoryItemId pInstanceIDs, uint unCountInstanceIDs ); + + #endregion + /// + /// Captures the state of a subset of the current users Steam inventory identified by an array of item instance IDs. + /// + internal bool GetItemsByID( ref SteamInventoryResult_t pResultHandle, ref InventoryItemId pInstanceIDs, uint unCountInstanceIDs ) + { + var returnValue = _GetItemsByID( Self, ref pResultHandle, ref pInstanceIDs, unCountInstanceIDs ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_SerializeResult", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SerializeResult( IntPtr self, SteamInventoryResult_t resultHandle, IntPtr pOutBuffer, ref uint punOutBufferSize ); + + #endregion + internal bool SerializeResult( SteamInventoryResult_t resultHandle, IntPtr pOutBuffer, ref uint punOutBufferSize ) + { + var returnValue = _SerializeResult( Self, resultHandle, pOutBuffer, ref punOutBufferSize ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_DeserializeResult", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _DeserializeResult( IntPtr self, ref SteamInventoryResult_t pOutResultHandle, IntPtr pBuffer, uint unBufferSize, [MarshalAs( UnmanagedType.U1 )] bool bRESERVED_MUST_BE_FALSE ); + + #endregion + internal bool DeserializeResult( ref SteamInventoryResult_t pOutResultHandle, IntPtr pBuffer, uint unBufferSize, [MarshalAs( UnmanagedType.U1 )] bool bRESERVED_MUST_BE_FALSE ) + { + var returnValue = _DeserializeResult( Self, ref pOutResultHandle, pBuffer, unBufferSize, bRESERVED_MUST_BE_FALSE ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GenerateItems", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GenerateItems( IntPtr self, ref SteamInventoryResult_t pResultHandle, [In,Out] InventoryDefId[] pArrayItemDefs, [In,Out] uint[] punArrayQuantity, uint unArrayLength ); + + #endregion + internal bool GenerateItems( ref SteamInventoryResult_t pResultHandle, [In,Out] InventoryDefId[] pArrayItemDefs, [In,Out] uint[] punArrayQuantity, uint unArrayLength ) + { + var returnValue = _GenerateItems( Self, ref pResultHandle, pArrayItemDefs, punArrayQuantity, unArrayLength ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GrantPromoItems", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GrantPromoItems( IntPtr self, ref SteamInventoryResult_t pResultHandle ); + + #endregion + /// + /// GrantPromoItems() checks the list of promotional items for which the user may be eligible and grants the items (one time only). + /// + internal bool GrantPromoItems( ref SteamInventoryResult_t pResultHandle ) + { + var returnValue = _GrantPromoItems( Self, ref pResultHandle ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_AddPromoItem", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _AddPromoItem( IntPtr self, ref SteamInventoryResult_t pResultHandle, InventoryDefId itemDef ); + + #endregion + internal bool AddPromoItem( ref SteamInventoryResult_t pResultHandle, InventoryDefId itemDef ) + { + var returnValue = _AddPromoItem( Self, ref pResultHandle, itemDef ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_AddPromoItems", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _AddPromoItems( IntPtr self, ref SteamInventoryResult_t pResultHandle, [In,Out] InventoryDefId[] pArrayItemDefs, uint unArrayLength ); + + #endregion + internal bool AddPromoItems( ref SteamInventoryResult_t pResultHandle, [In,Out] InventoryDefId[] pArrayItemDefs, uint unArrayLength ) + { + var returnValue = _AddPromoItems( Self, ref pResultHandle, pArrayItemDefs, unArrayLength ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_ConsumeItem", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _ConsumeItem( IntPtr self, ref SteamInventoryResult_t pResultHandle, InventoryItemId itemConsume, uint unQuantity ); + + #endregion + /// + /// ConsumeItem() removes items from the inventory permanently. + /// + internal bool ConsumeItem( ref SteamInventoryResult_t pResultHandle, InventoryItemId itemConsume, uint unQuantity ) + { + var returnValue = _ConsumeItem( Self, ref pResultHandle, itemConsume, unQuantity ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_ExchangeItems", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _ExchangeItems( IntPtr self, ref SteamInventoryResult_t pResultHandle, [In,Out] InventoryDefId[] pArrayGenerate, [In,Out] uint[] punArrayGenerateQuantity, uint unArrayGenerateLength, [In,Out] InventoryItemId[] pArrayDestroy, [In,Out] uint[] punArrayDestroyQuantity, uint unArrayDestroyLength ); + + #endregion + internal bool ExchangeItems( ref SteamInventoryResult_t pResultHandle, [In,Out] InventoryDefId[] pArrayGenerate, [In,Out] uint[] punArrayGenerateQuantity, uint unArrayGenerateLength, [In,Out] InventoryItemId[] pArrayDestroy, [In,Out] uint[] punArrayDestroyQuantity, uint unArrayDestroyLength ) + { + var returnValue = _ExchangeItems( Self, ref pResultHandle, pArrayGenerate, punArrayGenerateQuantity, unArrayGenerateLength, pArrayDestroy, punArrayDestroyQuantity, unArrayDestroyLength ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_TransferItemQuantity", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _TransferItemQuantity( IntPtr self, ref SteamInventoryResult_t pResultHandle, InventoryItemId itemIdSource, uint unQuantity, InventoryItemId itemIdDest ); + + #endregion + internal bool TransferItemQuantity( ref SteamInventoryResult_t pResultHandle, InventoryItemId itemIdSource, uint unQuantity, InventoryItemId itemIdDest ) + { + var returnValue = _TransferItemQuantity( Self, ref pResultHandle, itemIdSource, unQuantity, itemIdDest ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_SendItemDropHeartbeat", CallingConvention = Platform.CC)] + private static extern void _SendItemDropHeartbeat( IntPtr self ); + + #endregion + /// + /// Deprecated method. Playtime accounting is performed on the Steam servers. + /// + internal void SendItemDropHeartbeat() + { + _SendItemDropHeartbeat( Self ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_TriggerItemDrop", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _TriggerItemDrop( IntPtr self, ref SteamInventoryResult_t pResultHandle, InventoryDefId dropListDefinition ); + + #endregion + /// + /// Playtime credit must be consumed and turned into item drops by your game. + /// + internal bool TriggerItemDrop( ref SteamInventoryResult_t pResultHandle, InventoryDefId dropListDefinition ) + { + var returnValue = _TriggerItemDrop( Self, ref pResultHandle, dropListDefinition ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_TradeItems", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _TradeItems( IntPtr self, ref SteamInventoryResult_t pResultHandle, SteamId steamIDTradePartner, [In,Out] InventoryItemId[] pArrayGive, [In,Out] uint[] pArrayGiveQuantity, uint nArrayGiveLength, [In,Out] InventoryItemId[] pArrayGet, [In,Out] uint[] pArrayGetQuantity, uint nArrayGetLength ); + + #endregion + internal bool TradeItems( ref SteamInventoryResult_t pResultHandle, SteamId steamIDTradePartner, [In,Out] InventoryItemId[] pArrayGive, [In,Out] uint[] pArrayGiveQuantity, uint nArrayGiveLength, [In,Out] InventoryItemId[] pArrayGet, [In,Out] uint[] pArrayGetQuantity, uint nArrayGetLength ) + { + var returnValue = _TradeItems( Self, ref pResultHandle, steamIDTradePartner, pArrayGive, pArrayGiveQuantity, nArrayGiveLength, pArrayGet, pArrayGetQuantity, nArrayGetLength ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_LoadItemDefinitions", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _LoadItemDefinitions( IntPtr self ); + + #endregion + /// + /// LoadItemDefinitions triggers the automatic load and refresh of item definitions. + /// + internal bool LoadItemDefinitions() + { + var returnValue = _LoadItemDefinitions( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetItemDefinitionIDs", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetItemDefinitionIDs( IntPtr self, [In,Out] InventoryDefId[] pItemDefIDs, ref uint punItemDefIDsArraySize ); + + #endregion + internal bool GetItemDefinitionIDs( [In,Out] InventoryDefId[] pItemDefIDs, ref uint punItemDefIDsArraySize ) + { + var returnValue = _GetItemDefinitionIDs( Self, pItemDefIDs, ref punItemDefIDsArraySize ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetItemDefinitionProperty", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetItemDefinitionProperty( IntPtr self, InventoryDefId iDefinition, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, IntPtr pchValueBuffer, ref uint punValueBufferSizeOut ); + + #endregion + internal bool GetItemDefinitionProperty( InventoryDefId iDefinition, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, out string pchValueBuffer, ref uint punValueBufferSizeOut ) + { + IntPtr mempchValueBuffer = Helpers.TakeMemory(); + var returnValue = _GetItemDefinitionProperty( Self, iDefinition, pchPropertyName, mempchValueBuffer, ref punValueBufferSizeOut ); + pchValueBuffer = Helpers.MemoryToString( mempchValueBuffer ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_RequestEligiblePromoItemDefinitionsIDs", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _RequestEligiblePromoItemDefinitionsIDs( IntPtr self, SteamId steamID ); + + #endregion + internal CallResult RequestEligiblePromoItemDefinitionsIDs( SteamId steamID ) + { + var returnValue = _RequestEligiblePromoItemDefinitionsIDs( Self, steamID ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetEligiblePromoItemDefinitionIDs", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetEligiblePromoItemDefinitionIDs( IntPtr self, SteamId steamID, [In,Out] InventoryDefId[] pItemDefIDs, ref uint punItemDefIDsArraySize ); + + #endregion + internal bool GetEligiblePromoItemDefinitionIDs( SteamId steamID, [In,Out] InventoryDefId[] pItemDefIDs, ref uint punItemDefIDsArraySize ) + { + var returnValue = _GetEligiblePromoItemDefinitionIDs( Self, steamID, pItemDefIDs, ref punItemDefIDsArraySize ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_StartPurchase", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _StartPurchase( IntPtr self, [In,Out] InventoryDefId[] pArrayItemDefs, [In,Out] uint[] punArrayQuantity, uint unArrayLength ); + + #endregion + internal CallResult StartPurchase( [In,Out] InventoryDefId[] pArrayItemDefs, [In,Out] uint[] punArrayQuantity, uint unArrayLength ) + { + var returnValue = _StartPurchase( Self, pArrayItemDefs, punArrayQuantity, unArrayLength ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_RequestPrices", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _RequestPrices( IntPtr self ); + + #endregion + internal CallResult RequestPrices() + { + var returnValue = _RequestPrices( Self ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetNumItemsWithPrices", CallingConvention = Platform.CC)] + private static extern uint _GetNumItemsWithPrices( IntPtr self ); + + #endregion + internal uint GetNumItemsWithPrices() + { + var returnValue = _GetNumItemsWithPrices( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetItemsWithPrices", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetItemsWithPrices( IntPtr self, [In,Out] InventoryDefId[] pArrayItemDefs, [In,Out] ulong[] pCurrentPrices, [In,Out] ulong[] pBasePrices, uint unArrayLength ); + + #endregion + internal bool GetItemsWithPrices( [In,Out] InventoryDefId[] pArrayItemDefs, [In,Out] ulong[] pCurrentPrices, [In,Out] ulong[] pBasePrices, uint unArrayLength ) + { + var returnValue = _GetItemsWithPrices( Self, pArrayItemDefs, pCurrentPrices, pBasePrices, unArrayLength ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_GetItemPrice", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetItemPrice( IntPtr self, InventoryDefId iDefinition, ref ulong pCurrentPrice, ref ulong pBasePrice ); + + #endregion + internal bool GetItemPrice( InventoryDefId iDefinition, ref ulong pCurrentPrice, ref ulong pBasePrice ) + { + var returnValue = _GetItemPrice( Self, iDefinition, ref pCurrentPrice, ref pBasePrice ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_StartUpdateProperties", CallingConvention = Platform.CC)] + private static extern SteamInventoryUpdateHandle_t _StartUpdateProperties( IntPtr self ); + + #endregion + internal SteamInventoryUpdateHandle_t StartUpdateProperties() + { + var returnValue = _StartUpdateProperties( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_RemoveProperty", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _RemoveProperty( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName ); + + #endregion + internal bool RemoveProperty( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName ) + { + var returnValue = _RemoveProperty( Self, handle, nItemID, pchPropertyName ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_SetPropertyString", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetProperty( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyValue ); + + #endregion + internal bool SetProperty( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyValue ) + { + var returnValue = _SetProperty( Self, handle, nItemID, pchPropertyName, pchPropertyValue ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_SetPropertyBool", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetProperty( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, [MarshalAs( UnmanagedType.U1 )] bool bValue ); + + #endregion + internal bool SetProperty( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, [MarshalAs( UnmanagedType.U1 )] bool bValue ) + { + var returnValue = _SetProperty( Self, handle, nItemID, pchPropertyName, bValue ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_SetPropertyInt64", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetProperty( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, long nValue ); + + #endregion + internal bool SetProperty( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, long nValue ) + { + var returnValue = _SetProperty( Self, handle, nItemID, pchPropertyName, nValue ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_SetPropertyFloat", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetProperty( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, float flValue ); + + #endregion + internal bool SetProperty( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, float flValue ) + { + var returnValue = _SetProperty( Self, handle, nItemID, pchPropertyName, flValue ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamInventory_SubmitUpdateProperties", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SubmitUpdateProperties( IntPtr self, SteamInventoryUpdateHandle_t handle, ref SteamInventoryResult_t pResultHandle ); + + #endregion + internal bool SubmitUpdateProperties( SteamInventoryUpdateHandle_t handle, ref SteamInventoryResult_t pResultHandle ) + { + var returnValue = _SubmitUpdateProperties( Self, handle, ref pResultHandle ); + return returnValue; + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmaking.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmaking.cs new file mode 100644 index 0000000..c147053 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmaking.cs @@ -0,0 +1,450 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamMatchmaking : SteamInterface + { + + internal ISteamMatchmaking( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamMatchmaking_v009", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamMatchmaking_v009(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamMatchmaking_v009(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetFavoriteGameCount", CallingConvention = Platform.CC)] + private static extern int _GetFavoriteGameCount( IntPtr self ); + + #endregion + internal int GetFavoriteGameCount() + { + var returnValue = _GetFavoriteGameCount( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetFavoriteGame", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetFavoriteGame( IntPtr self, int iGame, ref AppId pnAppID, ref uint pnIP, ref ushort pnConnPort, ref ushort pnQueryPort, ref uint punFlags, ref uint pRTime32LastPlayedOnServer ); + + #endregion + internal bool GetFavoriteGame( int iGame, ref AppId pnAppID, ref uint pnIP, ref ushort pnConnPort, ref ushort pnQueryPort, ref uint punFlags, ref uint pRTime32LastPlayedOnServer ) + { + var returnValue = _GetFavoriteGame( Self, iGame, ref pnAppID, ref pnIP, ref pnConnPort, ref pnQueryPort, ref punFlags, ref pRTime32LastPlayedOnServer ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_AddFavoriteGame", CallingConvention = Platform.CC)] + private static extern int _AddFavoriteGame( IntPtr self, AppId nAppID, uint nIP, ushort nConnPort, ushort nQueryPort, uint unFlags, uint rTime32LastPlayedOnServer ); + + #endregion + internal int AddFavoriteGame( AppId nAppID, uint nIP, ushort nConnPort, ushort nQueryPort, uint unFlags, uint rTime32LastPlayedOnServer ) + { + var returnValue = _AddFavoriteGame( Self, nAppID, nIP, nConnPort, nQueryPort, unFlags, rTime32LastPlayedOnServer ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_RemoveFavoriteGame", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _RemoveFavoriteGame( IntPtr self, AppId nAppID, uint nIP, ushort nConnPort, ushort nQueryPort, uint unFlags ); + + #endregion + internal bool RemoveFavoriteGame( AppId nAppID, uint nIP, ushort nConnPort, ushort nQueryPort, uint unFlags ) + { + var returnValue = _RemoveFavoriteGame( Self, nAppID, nIP, nConnPort, nQueryPort, unFlags ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_RequestLobbyList", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _RequestLobbyList( IntPtr self ); + + #endregion + internal CallResult RequestLobbyList() + { + var returnValue = _RequestLobbyList( Self ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter", CallingConvention = Platform.CC)] + private static extern void _AddRequestLobbyListStringFilter( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToMatch, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValueToMatch, LobbyComparison eComparisonType ); + + #endregion + internal void AddRequestLobbyListStringFilter( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToMatch, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValueToMatch, LobbyComparison eComparisonType ) + { + _AddRequestLobbyListStringFilter( Self, pchKeyToMatch, pchValueToMatch, eComparisonType ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter", CallingConvention = Platform.CC)] + private static extern void _AddRequestLobbyListNumericalFilter( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToMatch, int nValueToMatch, LobbyComparison eComparisonType ); + + #endregion + internal void AddRequestLobbyListNumericalFilter( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToMatch, int nValueToMatch, LobbyComparison eComparisonType ) + { + _AddRequestLobbyListNumericalFilter( Self, pchKeyToMatch, nValueToMatch, eComparisonType ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListNearValueFilter", CallingConvention = Platform.CC)] + private static extern void _AddRequestLobbyListNearValueFilter( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToMatch, int nValueToBeCloseTo ); + + #endregion + internal void AddRequestLobbyListNearValueFilter( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToMatch, int nValueToBeCloseTo ) + { + _AddRequestLobbyListNearValueFilter( Self, pchKeyToMatch, nValueToBeCloseTo ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable", CallingConvention = Platform.CC)] + private static extern void _AddRequestLobbyListFilterSlotsAvailable( IntPtr self, int nSlotsAvailable ); + + #endregion + internal void AddRequestLobbyListFilterSlotsAvailable( int nSlotsAvailable ) + { + _AddRequestLobbyListFilterSlotsAvailable( Self, nSlotsAvailable ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListDistanceFilter", CallingConvention = Platform.CC)] + private static extern void _AddRequestLobbyListDistanceFilter( IntPtr self, LobbyDistanceFilter eLobbyDistanceFilter ); + + #endregion + internal void AddRequestLobbyListDistanceFilter( LobbyDistanceFilter eLobbyDistanceFilter ) + { + _AddRequestLobbyListDistanceFilter( Self, eLobbyDistanceFilter ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListResultCountFilter", CallingConvention = Platform.CC)] + private static extern void _AddRequestLobbyListResultCountFilter( IntPtr self, int cMaxResults ); + + #endregion + internal void AddRequestLobbyListResultCountFilter( int cMaxResults ) + { + _AddRequestLobbyListResultCountFilter( Self, cMaxResults ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter", CallingConvention = Platform.CC)] + private static extern void _AddRequestLobbyListCompatibleMembersFilter( IntPtr self, SteamId steamIDLobby ); + + #endregion + internal void AddRequestLobbyListCompatibleMembersFilter( SteamId steamIDLobby ) + { + _AddRequestLobbyListCompatibleMembersFilter( Self, steamIDLobby ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyByIndex", CallingConvention = Platform.CC)] + private static extern SteamId _GetLobbyByIndex( IntPtr self, int iLobby ); + + #endregion + internal SteamId GetLobbyByIndex( int iLobby ) + { + var returnValue = _GetLobbyByIndex( Self, iLobby ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_CreateLobby", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _CreateLobby( IntPtr self, LobbyType eLobbyType, int cMaxMembers ); + + #endregion + internal CallResult CreateLobby( LobbyType eLobbyType, int cMaxMembers ) + { + var returnValue = _CreateLobby( Self, eLobbyType, cMaxMembers ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_JoinLobby", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _JoinLobby( IntPtr self, SteamId steamIDLobby ); + + #endregion + internal CallResult JoinLobby( SteamId steamIDLobby ) + { + var returnValue = _JoinLobby( Self, steamIDLobby ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_LeaveLobby", CallingConvention = Platform.CC)] + private static extern void _LeaveLobby( IntPtr self, SteamId steamIDLobby ); + + #endregion + internal void LeaveLobby( SteamId steamIDLobby ) + { + _LeaveLobby( Self, steamIDLobby ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_InviteUserToLobby", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _InviteUserToLobby( IntPtr self, SteamId steamIDLobby, SteamId steamIDInvitee ); + + #endregion + internal bool InviteUserToLobby( SteamId steamIDLobby, SteamId steamIDInvitee ) + { + var returnValue = _InviteUserToLobby( Self, steamIDLobby, steamIDInvitee ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetNumLobbyMembers", CallingConvention = Platform.CC)] + private static extern int _GetNumLobbyMembers( IntPtr self, SteamId steamIDLobby ); + + #endregion + internal int GetNumLobbyMembers( SteamId steamIDLobby ) + { + var returnValue = _GetNumLobbyMembers( Self, steamIDLobby ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyMemberByIndex", CallingConvention = Platform.CC)] + private static extern SteamId _GetLobbyMemberByIndex( IntPtr self, SteamId steamIDLobby, int iMember ); + + #endregion + internal SteamId GetLobbyMemberByIndex( SteamId steamIDLobby, int iMember ) + { + var returnValue = _GetLobbyMemberByIndex( Self, steamIDLobby, iMember ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyData", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetLobbyData( IntPtr self, SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); + + #endregion + internal string GetLobbyData( SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) + { + var returnValue = _GetLobbyData( Self, steamIDLobby, pchKey ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyData", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetLobbyData( IntPtr self, SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ); + + #endregion + internal bool SetLobbyData( SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ) + { + var returnValue = _SetLobbyData( Self, steamIDLobby, pchKey, pchValue ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyDataCount", CallingConvention = Platform.CC)] + private static extern int _GetLobbyDataCount( IntPtr self, SteamId steamIDLobby ); + + #endregion + internal int GetLobbyDataCount( SteamId steamIDLobby ) + { + var returnValue = _GetLobbyDataCount( Self, steamIDLobby ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyDataByIndex", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetLobbyDataByIndex( IntPtr self, SteamId steamIDLobby, int iLobbyData, IntPtr pchKey, int cchKeyBufferSize, IntPtr pchValue, int cchValueBufferSize ); + + #endregion + internal bool GetLobbyDataByIndex( SteamId steamIDLobby, int iLobbyData, out string pchKey, out string pchValue ) + { + IntPtr mempchKey = Helpers.TakeMemory(); + IntPtr mempchValue = Helpers.TakeMemory(); + var returnValue = _GetLobbyDataByIndex( Self, steamIDLobby, iLobbyData, mempchKey, (1024 * 32), mempchValue, (1024 * 32) ); + pchKey = Helpers.MemoryToString( mempchKey ); + pchValue = Helpers.MemoryToString( mempchValue ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_DeleteLobbyData", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _DeleteLobbyData( IntPtr self, SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); + + #endregion + internal bool DeleteLobbyData( SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) + { + var returnValue = _DeleteLobbyData( Self, steamIDLobby, pchKey ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyMemberData", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetLobbyMemberData( IntPtr self, SteamId steamIDLobby, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); + + #endregion + internal string GetLobbyMemberData( SteamId steamIDLobby, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) + { + var returnValue = _GetLobbyMemberData( Self, steamIDLobby, steamIDUser, pchKey ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyMemberData", CallingConvention = Platform.CC)] + private static extern void _SetLobbyMemberData( IntPtr self, SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ); + + #endregion + internal void SetLobbyMemberData( SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ) + { + _SetLobbyMemberData( Self, steamIDLobby, pchKey, pchValue ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_SendLobbyChatMsg", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SendLobbyChatMsg( IntPtr self, SteamId steamIDLobby, IntPtr pvMsgBody, int cubMsgBody ); + + #endregion + internal bool SendLobbyChatMsg( SteamId steamIDLobby, IntPtr pvMsgBody, int cubMsgBody ) + { + var returnValue = _SendLobbyChatMsg( Self, steamIDLobby, pvMsgBody, cubMsgBody ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyChatEntry", CallingConvention = Platform.CC)] + private static extern int _GetLobbyChatEntry( IntPtr self, SteamId steamIDLobby, int iChatID, ref SteamId pSteamIDUser, IntPtr pvData, int cubData, ref ChatEntryType peChatEntryType ); + + #endregion + internal int GetLobbyChatEntry( SteamId steamIDLobby, int iChatID, ref SteamId pSteamIDUser, IntPtr pvData, int cubData, ref ChatEntryType peChatEntryType ) + { + var returnValue = _GetLobbyChatEntry( Self, steamIDLobby, iChatID, ref pSteamIDUser, pvData, cubData, ref peChatEntryType ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_RequestLobbyData", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _RequestLobbyData( IntPtr self, SteamId steamIDLobby ); + + #endregion + internal bool RequestLobbyData( SteamId steamIDLobby ) + { + var returnValue = _RequestLobbyData( Self, steamIDLobby ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyGameServer", CallingConvention = Platform.CC)] + private static extern void _SetLobbyGameServer( IntPtr self, SteamId steamIDLobby, uint unGameServerIP, ushort unGameServerPort, SteamId steamIDGameServer ); + + #endregion + internal void SetLobbyGameServer( SteamId steamIDLobby, uint unGameServerIP, ushort unGameServerPort, SteamId steamIDGameServer ) + { + _SetLobbyGameServer( Self, steamIDLobby, unGameServerIP, unGameServerPort, steamIDGameServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyGameServer", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetLobbyGameServer( IntPtr self, SteamId steamIDLobby, ref uint punGameServerIP, ref ushort punGameServerPort, ref SteamId psteamIDGameServer ); + + #endregion + internal bool GetLobbyGameServer( SteamId steamIDLobby, ref uint punGameServerIP, ref ushort punGameServerPort, ref SteamId psteamIDGameServer ) + { + var returnValue = _GetLobbyGameServer( Self, steamIDLobby, ref punGameServerIP, ref punGameServerPort, ref psteamIDGameServer ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyMemberLimit", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetLobbyMemberLimit( IntPtr self, SteamId steamIDLobby, int cMaxMembers ); + + #endregion + internal bool SetLobbyMemberLimit( SteamId steamIDLobby, int cMaxMembers ) + { + var returnValue = _SetLobbyMemberLimit( Self, steamIDLobby, cMaxMembers ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyMemberLimit", CallingConvention = Platform.CC)] + private static extern int _GetLobbyMemberLimit( IntPtr self, SteamId steamIDLobby ); + + #endregion + internal int GetLobbyMemberLimit( SteamId steamIDLobby ) + { + var returnValue = _GetLobbyMemberLimit( Self, steamIDLobby ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyType", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetLobbyType( IntPtr self, SteamId steamIDLobby, LobbyType eLobbyType ); + + #endregion + internal bool SetLobbyType( SteamId steamIDLobby, LobbyType eLobbyType ) + { + var returnValue = _SetLobbyType( Self, steamIDLobby, eLobbyType ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyJoinable", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetLobbyJoinable( IntPtr self, SteamId steamIDLobby, [MarshalAs( UnmanagedType.U1 )] bool bLobbyJoinable ); + + #endregion + internal bool SetLobbyJoinable( SteamId steamIDLobby, [MarshalAs( UnmanagedType.U1 )] bool bLobbyJoinable ) + { + var returnValue = _SetLobbyJoinable( Self, steamIDLobby, bLobbyJoinable ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_GetLobbyOwner", CallingConvention = Platform.CC)] + private static extern SteamId _GetLobbyOwner( IntPtr self, SteamId steamIDLobby ); + + #endregion + internal SteamId GetLobbyOwner( SteamId steamIDLobby ) + { + var returnValue = _GetLobbyOwner( Self, steamIDLobby ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLobbyOwner", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetLobbyOwner( IntPtr self, SteamId steamIDLobby, SteamId steamIDNewOwner ); + + #endregion + internal bool SetLobbyOwner( SteamId steamIDLobby, SteamId steamIDNewOwner ) + { + var returnValue = _SetLobbyOwner( Self, steamIDLobby, steamIDNewOwner ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmaking_SetLinkedLobby", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetLinkedLobby( IntPtr self, SteamId steamIDLobby, SteamId steamIDLobbyDependent ); + + #endregion + internal bool SetLinkedLobby( SteamId steamIDLobby, SteamId steamIDLobbyDependent ) + { + var returnValue = _SetLinkedLobby( Self, steamIDLobby, steamIDLobbyDependent ); + return returnValue; + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingPingResponse.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingPingResponse.cs new file mode 100644 index 0000000..cf3825e --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingPingResponse.cs @@ -0,0 +1,39 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamMatchmakingPingResponse : SteamInterface + { + + internal ISteamMatchmakingPingResponse( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingPingResponse_ServerResponded", CallingConvention = Platform.CC)] + private static extern void _ServerResponded( IntPtr self, ref gameserveritem_t server ); + + #endregion + internal void ServerResponded( ref gameserveritem_t server ) + { + _ServerResponded( Self, ref server ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingPingResponse_ServerFailedToRespond", CallingConvention = Platform.CC)] + private static extern void _ServerFailedToRespond( IntPtr self ); + + #endregion + internal void ServerFailedToRespond() + { + _ServerFailedToRespond( Self ); + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingPlayersResponse.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingPlayersResponse.cs new file mode 100644 index 0000000..bad4b55 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingPlayersResponse.cs @@ -0,0 +1,49 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamMatchmakingPlayersResponse : SteamInterface + { + + internal ISteamMatchmakingPlayersResponse( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingPlayersResponse_AddPlayerToList", CallingConvention = Platform.CC)] + private static extern void _AddPlayerToList( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, int nScore, float flTimePlayed ); + + #endregion + internal void AddPlayerToList( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, int nScore, float flTimePlayed ) + { + _AddPlayerToList( Self, pchName, nScore, flTimePlayed ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingPlayersResponse_PlayersFailedToRespond", CallingConvention = Platform.CC)] + private static extern void _PlayersFailedToRespond( IntPtr self ); + + #endregion + internal void PlayersFailedToRespond() + { + _PlayersFailedToRespond( Self ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingPlayersResponse_PlayersRefreshComplete", CallingConvention = Platform.CC)] + private static extern void _PlayersRefreshComplete( IntPtr self ); + + #endregion + internal void PlayersRefreshComplete() + { + _PlayersRefreshComplete( Self ); + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingRulesResponse.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingRulesResponse.cs new file mode 100644 index 0000000..664b53d --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingRulesResponse.cs @@ -0,0 +1,49 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamMatchmakingRulesResponse : SteamInterface + { + + internal ISteamMatchmakingRulesResponse( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingRulesResponse_RulesResponded", CallingConvention = Platform.CC)] + private static extern void _RulesResponded( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchRule, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ); + + #endregion + internal void RulesResponded( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchRule, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ) + { + _RulesResponded( Self, pchRule, pchValue ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingRulesResponse_RulesFailedToRespond", CallingConvention = Platform.CC)] + private static extern void _RulesFailedToRespond( IntPtr self ); + + #endregion + internal void RulesFailedToRespond() + { + _RulesFailedToRespond( Self ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingRulesResponse_RulesRefreshComplete", CallingConvention = Platform.CC)] + private static extern void _RulesRefreshComplete( IntPtr self ); + + #endregion + internal void RulesRefreshComplete() + { + _RulesRefreshComplete( Self ); + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServerListResponse.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServerListResponse.cs new file mode 100644 index 0000000..5f84a23 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServerListResponse.cs @@ -0,0 +1,49 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamMatchmakingServerListResponse : SteamInterface + { + + internal ISteamMatchmakingServerListResponse( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServerListResponse_ServerResponded", CallingConvention = Platform.CC)] + private static extern void _ServerResponded( IntPtr self, HServerListRequest hRequest, int iServer ); + + #endregion + internal void ServerResponded( HServerListRequest hRequest, int iServer ) + { + _ServerResponded( Self, hRequest, iServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServerListResponse_ServerFailedToRespond", CallingConvention = Platform.CC)] + private static extern void _ServerFailedToRespond( IntPtr self, HServerListRequest hRequest, int iServer ); + + #endregion + internal void ServerFailedToRespond( HServerListRequest hRequest, int iServer ) + { + _ServerFailedToRespond( Self, hRequest, iServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServerListResponse_RefreshComplete", CallingConvention = Platform.CC)] + private static extern void _RefreshComplete( IntPtr self, HServerListRequest hRequest, MatchMakingServerResponse response ); + + #endregion + internal void RefreshComplete( HServerListRequest hRequest, MatchMakingServerResponse response ) + { + _RefreshComplete( Self, hRequest, response ); + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServers.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServers.cs new file mode 100644 index 0000000..e939a56 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServers.cs @@ -0,0 +1,207 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamMatchmakingServers : SteamInterface + { + + internal ISteamMatchmakingServers( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamMatchmakingServers_v002", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamMatchmakingServers_v002(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamMatchmakingServers_v002(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_RequestInternetServerList", CallingConvention = Platform.CC)] + private static extern HServerListRequest _RequestInternetServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); + + #endregion + internal HServerListRequest RequestInternetServerList( AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) + { + var returnValue = _RequestInternetServerList( Self, iApp, ref ppchFilters, nFilters, pRequestServersResponse ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_RequestLANServerList", CallingConvention = Platform.CC)] + private static extern HServerListRequest _RequestLANServerList( IntPtr self, AppId iApp, IntPtr pRequestServersResponse ); + + #endregion + internal HServerListRequest RequestLANServerList( AppId iApp, IntPtr pRequestServersResponse ) + { + var returnValue = _RequestLANServerList( Self, iApp, pRequestServersResponse ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_RequestFriendsServerList", CallingConvention = Platform.CC)] + private static extern HServerListRequest _RequestFriendsServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); + + #endregion + internal HServerListRequest RequestFriendsServerList( AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) + { + var returnValue = _RequestFriendsServerList( Self, iApp, ref ppchFilters, nFilters, pRequestServersResponse ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_RequestFavoritesServerList", CallingConvention = Platform.CC)] + private static extern HServerListRequest _RequestFavoritesServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); + + #endregion + internal HServerListRequest RequestFavoritesServerList( AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) + { + var returnValue = _RequestFavoritesServerList( Self, iApp, ref ppchFilters, nFilters, pRequestServersResponse ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_RequestHistoryServerList", CallingConvention = Platform.CC)] + private static extern HServerListRequest _RequestHistoryServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); + + #endregion + internal HServerListRequest RequestHistoryServerList( AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) + { + var returnValue = _RequestHistoryServerList( Self, iApp, ref ppchFilters, nFilters, pRequestServersResponse ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_RequestSpectatorServerList", CallingConvention = Platform.CC)] + private static extern HServerListRequest _RequestSpectatorServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); + + #endregion + internal HServerListRequest RequestSpectatorServerList( AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) + { + var returnValue = _RequestSpectatorServerList( Self, iApp, ref ppchFilters, nFilters, pRequestServersResponse ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_ReleaseRequest", CallingConvention = Platform.CC)] + private static extern void _ReleaseRequest( IntPtr self, HServerListRequest hServerListRequest ); + + #endregion + internal void ReleaseRequest( HServerListRequest hServerListRequest ) + { + _ReleaseRequest( Self, hServerListRequest ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_GetServerDetails", CallingConvention = Platform.CC)] + private static extern IntPtr _GetServerDetails( IntPtr self, HServerListRequest hRequest, int iServer ); + + #endregion + internal gameserveritem_t GetServerDetails( HServerListRequest hRequest, int iServer ) + { + var returnValue = _GetServerDetails( Self, hRequest, iServer ); + return returnValue.ToType(); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_CancelQuery", CallingConvention = Platform.CC)] + private static extern void _CancelQuery( IntPtr self, HServerListRequest hRequest ); + + #endregion + internal void CancelQuery( HServerListRequest hRequest ) + { + _CancelQuery( Self, hRequest ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_RefreshQuery", CallingConvention = Platform.CC)] + private static extern void _RefreshQuery( IntPtr self, HServerListRequest hRequest ); + + #endregion + internal void RefreshQuery( HServerListRequest hRequest ) + { + _RefreshQuery( Self, hRequest ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_IsRefreshing", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _IsRefreshing( IntPtr self, HServerListRequest hRequest ); + + #endregion + internal bool IsRefreshing( HServerListRequest hRequest ) + { + var returnValue = _IsRefreshing( Self, hRequest ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_GetServerCount", CallingConvention = Platform.CC)] + private static extern int _GetServerCount( IntPtr self, HServerListRequest hRequest ); + + #endregion + internal int GetServerCount( HServerListRequest hRequest ) + { + var returnValue = _GetServerCount( Self, hRequest ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_RefreshServer", CallingConvention = Platform.CC)] + private static extern void _RefreshServer( IntPtr self, HServerListRequest hRequest, int iServer ); + + #endregion + internal void RefreshServer( HServerListRequest hRequest, int iServer ) + { + _RefreshServer( Self, hRequest, iServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_PingServer", CallingConvention = Platform.CC)] + private static extern HServerQuery _PingServer( IntPtr self, uint unIP, ushort usPort, IntPtr pRequestServersResponse ); + + #endregion + internal HServerQuery PingServer( uint unIP, ushort usPort, IntPtr pRequestServersResponse ) + { + var returnValue = _PingServer( Self, unIP, usPort, pRequestServersResponse ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_PlayerDetails", CallingConvention = Platform.CC)] + private static extern HServerQuery _PlayerDetails( IntPtr self, uint unIP, ushort usPort, IntPtr pRequestServersResponse ); + + #endregion + internal HServerQuery PlayerDetails( uint unIP, ushort usPort, IntPtr pRequestServersResponse ) + { + var returnValue = _PlayerDetails( Self, unIP, usPort, pRequestServersResponse ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_ServerRules", CallingConvention = Platform.CC)] + private static extern HServerQuery _ServerRules( IntPtr self, uint unIP, ushort usPort, IntPtr pRequestServersResponse ); + + #endregion + internal HServerQuery ServerRules( uint unIP, ushort usPort, IntPtr pRequestServersResponse ) + { + var returnValue = _ServerRules( Self, unIP, usPort, pRequestServersResponse ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMatchmakingServers_CancelServerQuery", CallingConvention = Platform.CC)] + private static extern void _CancelServerQuery( IntPtr self, HServerQuery hServerQuery ); + + #endregion + internal void CancelServerQuery( HServerQuery hServerQuery ) + { + _CancelServerQuery( Self, hServerQuery ); + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamMusic.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamMusic.cs new file mode 100644 index 0000000..703d184 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamMusic.cs @@ -0,0 +1,120 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamMusic : SteamInterface + { + + internal ISteamMusic( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamMusic_v001", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamMusic_v001(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamMusic_v001(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusic_BIsEnabled", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BIsEnabled( IntPtr self ); + + #endregion + internal bool BIsEnabled() + { + var returnValue = _BIsEnabled( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusic_BIsPlaying", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BIsPlaying( IntPtr self ); + + #endregion + internal bool BIsPlaying() + { + var returnValue = _BIsPlaying( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusic_GetPlaybackStatus", CallingConvention = Platform.CC)] + private static extern MusicStatus _GetPlaybackStatus( IntPtr self ); + + #endregion + internal MusicStatus GetPlaybackStatus() + { + var returnValue = _GetPlaybackStatus( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusic_Play", CallingConvention = Platform.CC)] + private static extern void _Play( IntPtr self ); + + #endregion + internal void Play() + { + _Play( Self ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusic_Pause", CallingConvention = Platform.CC)] + private static extern void _Pause( IntPtr self ); + + #endregion + internal void Pause() + { + _Pause( Self ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusic_PlayPrevious", CallingConvention = Platform.CC)] + private static extern void _PlayPrevious( IntPtr self ); + + #endregion + internal void PlayPrevious() + { + _PlayPrevious( Self ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusic_PlayNext", CallingConvention = Platform.CC)] + private static extern void _PlayNext( IntPtr self ); + + #endregion + internal void PlayNext() + { + _PlayNext( Self ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusic_SetVolume", CallingConvention = Platform.CC)] + private static extern void _SetVolume( IntPtr self, float flVolume ); + + #endregion + internal void SetVolume( float flVolume ) + { + _SetVolume( Self, flVolume ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusic_GetVolume", CallingConvention = Platform.CC)] + private static extern float _GetVolume( IntPtr self ); + + #endregion + internal float GetVolume() + { + var returnValue = _GetVolume( Self ); + return returnValue; + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamMusicRemote.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamMusicRemote.cs new file mode 100644 index 0000000..41dae54 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamMusicRemote.cs @@ -0,0 +1,408 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamMusicRemote : SteamInterface + { + + internal ISteamMusicRemote( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamMusicRemote_v001", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamMusicRemote_v001(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamMusicRemote_v001(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_RegisterSteamMusicRemote", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _RegisterSteamMusicRemote( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ); + + #endregion + internal bool RegisterSteamMusicRemote( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ) + { + var returnValue = _RegisterSteamMusicRemote( Self, pchName ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_DeregisterSteamMusicRemote", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _DeregisterSteamMusicRemote( IntPtr self ); + + #endregion + internal bool DeregisterSteamMusicRemote() + { + var returnValue = _DeregisterSteamMusicRemote( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_BIsCurrentMusicRemote", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BIsCurrentMusicRemote( IntPtr self ); + + #endregion + internal bool BIsCurrentMusicRemote() + { + var returnValue = _BIsCurrentMusicRemote( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_BActivationSuccess", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BActivationSuccess( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bValue ); + + #endregion + internal bool BActivationSuccess( [MarshalAs( UnmanagedType.U1 )] bool bValue ) + { + var returnValue = _BActivationSuccess( Self, bValue ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_SetDisplayName", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetDisplayName( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDisplayName ); + + #endregion + internal bool SetDisplayName( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDisplayName ) + { + var returnValue = _SetDisplayName( Self, pchDisplayName ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_SetPNGIcon_64x64", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetPNGIcon_64x64( IntPtr self, IntPtr pvBuffer, uint cbBufferLength ); + + #endregion + internal bool SetPNGIcon_64x64( IntPtr pvBuffer, uint cbBufferLength ) + { + var returnValue = _SetPNGIcon_64x64( Self, pvBuffer, cbBufferLength ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_EnablePlayPrevious", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _EnablePlayPrevious( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bValue ); + + #endregion + internal bool EnablePlayPrevious( [MarshalAs( UnmanagedType.U1 )] bool bValue ) + { + var returnValue = _EnablePlayPrevious( Self, bValue ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_EnablePlayNext", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _EnablePlayNext( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bValue ); + + #endregion + internal bool EnablePlayNext( [MarshalAs( UnmanagedType.U1 )] bool bValue ) + { + var returnValue = _EnablePlayNext( Self, bValue ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_EnableShuffled", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _EnableShuffled( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bValue ); + + #endregion + internal bool EnableShuffled( [MarshalAs( UnmanagedType.U1 )] bool bValue ) + { + var returnValue = _EnableShuffled( Self, bValue ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_EnableLooped", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _EnableLooped( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bValue ); + + #endregion + internal bool EnableLooped( [MarshalAs( UnmanagedType.U1 )] bool bValue ) + { + var returnValue = _EnableLooped( Self, bValue ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_EnableQueue", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _EnableQueue( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bValue ); + + #endregion + internal bool EnableQueue( [MarshalAs( UnmanagedType.U1 )] bool bValue ) + { + var returnValue = _EnableQueue( Self, bValue ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_EnablePlaylists", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _EnablePlaylists( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bValue ); + + #endregion + internal bool EnablePlaylists( [MarshalAs( UnmanagedType.U1 )] bool bValue ) + { + var returnValue = _EnablePlaylists( Self, bValue ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_UpdatePlaybackStatus", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _UpdatePlaybackStatus( IntPtr self, MusicStatus nStatus ); + + #endregion + internal bool UpdatePlaybackStatus( MusicStatus nStatus ) + { + var returnValue = _UpdatePlaybackStatus( Self, nStatus ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_UpdateShuffled", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _UpdateShuffled( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bValue ); + + #endregion + internal bool UpdateShuffled( [MarshalAs( UnmanagedType.U1 )] bool bValue ) + { + var returnValue = _UpdateShuffled( Self, bValue ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_UpdateLooped", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _UpdateLooped( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bValue ); + + #endregion + internal bool UpdateLooped( [MarshalAs( UnmanagedType.U1 )] bool bValue ) + { + var returnValue = _UpdateLooped( Self, bValue ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_UpdateVolume", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _UpdateVolume( IntPtr self, float flValue ); + + #endregion + internal bool UpdateVolume( float flValue ) + { + var returnValue = _UpdateVolume( Self, flValue ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_CurrentEntryWillChange", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _CurrentEntryWillChange( IntPtr self ); + + #endregion + internal bool CurrentEntryWillChange() + { + var returnValue = _CurrentEntryWillChange( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_CurrentEntryIsAvailable", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _CurrentEntryIsAvailable( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bAvailable ); + + #endregion + internal bool CurrentEntryIsAvailable( [MarshalAs( UnmanagedType.U1 )] bool bAvailable ) + { + var returnValue = _CurrentEntryIsAvailable( Self, bAvailable ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_UpdateCurrentEntryText", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _UpdateCurrentEntryText( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchText ); + + #endregion + internal bool UpdateCurrentEntryText( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchText ) + { + var returnValue = _UpdateCurrentEntryText( Self, pchText ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _UpdateCurrentEntryElapsedSeconds( IntPtr self, int nValue ); + + #endregion + internal bool UpdateCurrentEntryElapsedSeconds( int nValue ) + { + var returnValue = _UpdateCurrentEntryElapsedSeconds( Self, nValue ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_UpdateCurrentEntryCoverArt", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _UpdateCurrentEntryCoverArt( IntPtr self, IntPtr pvBuffer, uint cbBufferLength ); + + #endregion + internal bool UpdateCurrentEntryCoverArt( IntPtr pvBuffer, uint cbBufferLength ) + { + var returnValue = _UpdateCurrentEntryCoverArt( Self, pvBuffer, cbBufferLength ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_CurrentEntryDidChange", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _CurrentEntryDidChange( IntPtr self ); + + #endregion + internal bool CurrentEntryDidChange() + { + var returnValue = _CurrentEntryDidChange( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_QueueWillChange", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _QueueWillChange( IntPtr self ); + + #endregion + internal bool QueueWillChange() + { + var returnValue = _QueueWillChange( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_ResetQueueEntries", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _ResetQueueEntries( IntPtr self ); + + #endregion + internal bool ResetQueueEntries() + { + var returnValue = _ResetQueueEntries( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_SetQueueEntry", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetQueueEntry( IntPtr self, int nID, int nPosition, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchEntryText ); + + #endregion + internal bool SetQueueEntry( int nID, int nPosition, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchEntryText ) + { + var returnValue = _SetQueueEntry( Self, nID, nPosition, pchEntryText ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_SetCurrentQueueEntry", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetCurrentQueueEntry( IntPtr self, int nID ); + + #endregion + internal bool SetCurrentQueueEntry( int nID ) + { + var returnValue = _SetCurrentQueueEntry( Self, nID ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_QueueDidChange", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _QueueDidChange( IntPtr self ); + + #endregion + internal bool QueueDidChange() + { + var returnValue = _QueueDidChange( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_PlaylistWillChange", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _PlaylistWillChange( IntPtr self ); + + #endregion + internal bool PlaylistWillChange() + { + var returnValue = _PlaylistWillChange( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_ResetPlaylistEntries", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _ResetPlaylistEntries( IntPtr self ); + + #endregion + internal bool ResetPlaylistEntries() + { + var returnValue = _ResetPlaylistEntries( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_SetPlaylistEntry", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetPlaylistEntry( IntPtr self, int nID, int nPosition, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchEntryText ); + + #endregion + internal bool SetPlaylistEntry( int nID, int nPosition, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchEntryText ) + { + var returnValue = _SetPlaylistEntry( Self, nID, nPosition, pchEntryText ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_SetCurrentPlaylistEntry", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetCurrentPlaylistEntry( IntPtr self, int nID ); + + #endregion + internal bool SetCurrentPlaylistEntry( int nID ) + { + var returnValue = _SetCurrentPlaylistEntry( Self, nID ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamMusicRemote_PlaylistDidChange", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _PlaylistDidChange( IntPtr self ); + + #endregion + internal bool PlaylistDidChange() + { + var returnValue = _PlaylistDidChange( Self ); + return returnValue; + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworking.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworking.cs new file mode 100644 index 0000000..961af5e --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworking.cs @@ -0,0 +1,134 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamNetworking : SteamInterface + { + + internal ISteamNetworking( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworking_v006", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamNetworking_v006(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamNetworking_v006(); + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamGameServerNetworking_v006", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamGameServerNetworking_v006(); + public override IntPtr GetServerInterfacePointer() => SteamAPI_SteamGameServerNetworking_v006(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_SendP2PPacket", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SendP2PPacket( IntPtr self, SteamId steamIDRemote, IntPtr pubData, uint cubData, P2PSend eP2PSendType, int nChannel ); + + #endregion + internal bool SendP2PPacket( SteamId steamIDRemote, IntPtr pubData, uint cubData, P2PSend eP2PSendType, int nChannel ) + { + var returnValue = _SendP2PPacket( Self, steamIDRemote, pubData, cubData, eP2PSendType, nChannel ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_IsP2PPacketAvailable", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _IsP2PPacketAvailable( IntPtr self, ref uint pcubMsgSize, int nChannel ); + + #endregion + internal bool IsP2PPacketAvailable( ref uint pcubMsgSize, int nChannel ) + { + var returnValue = _IsP2PPacketAvailable( Self, ref pcubMsgSize, nChannel ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_ReadP2PPacket", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _ReadP2PPacket( IntPtr self, IntPtr pubDest, uint cubDest, ref uint pcubMsgSize, ref SteamId psteamIDRemote, int nChannel ); + + #endregion + internal bool ReadP2PPacket( IntPtr pubDest, uint cubDest, ref uint pcubMsgSize, ref SteamId psteamIDRemote, int nChannel ) + { + var returnValue = _ReadP2PPacket( Self, pubDest, cubDest, ref pcubMsgSize, ref psteamIDRemote, nChannel ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_AcceptP2PSessionWithUser", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _AcceptP2PSessionWithUser( IntPtr self, SteamId steamIDRemote ); + + #endregion + internal bool AcceptP2PSessionWithUser( SteamId steamIDRemote ) + { + var returnValue = _AcceptP2PSessionWithUser( Self, steamIDRemote ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_CloseP2PSessionWithUser", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _CloseP2PSessionWithUser( IntPtr self, SteamId steamIDRemote ); + + #endregion + internal bool CloseP2PSessionWithUser( SteamId steamIDRemote ) + { + var returnValue = _CloseP2PSessionWithUser( Self, steamIDRemote ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_CloseP2PChannelWithUser", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _CloseP2PChannelWithUser( IntPtr self, SteamId steamIDRemote, int nChannel ); + + #endregion + internal bool CloseP2PChannelWithUser( SteamId steamIDRemote, int nChannel ) + { + var returnValue = _CloseP2PChannelWithUser( Self, steamIDRemote, nChannel ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_GetP2PSessionState", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetP2PSessionState( IntPtr self, SteamId steamIDRemote, ref P2PSessionState_t pConnectionState ); + + #endregion + internal bool GetP2PSessionState( SteamId steamIDRemote, ref P2PSessionState_t pConnectionState ) + { + var returnValue = _GetP2PSessionState( Self, steamIDRemote, ref pConnectionState ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_AllowP2PPacketRelay", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _AllowP2PPacketRelay( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bAllow ); + + #endregion + internal bool AllowP2PPacketRelay( [MarshalAs( UnmanagedType.U1 )] bool bAllow ) + { + var returnValue = _AllowP2PPacketRelay( Self, bAllow ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworking_CreateP2PConnectionSocket", CallingConvention = Platform.CC)] + private static extern SNetSocket_t _CreateP2PConnectionSocket( IntPtr self, SteamId steamIDTarget, int nVirtualPort, int nTimeoutSec, [MarshalAs( UnmanagedType.U1 )] bool bAllowUseOfPacketRelay ); + + #endregion + internal SNetSocket_t CreateP2PConnectionSocket( SteamId steamIDTarget, int nVirtualPort, int nTimeoutSec, [MarshalAs( UnmanagedType.U1 )] bool bAllowUseOfPacketRelay ) + { + var returnValue = _CreateP2PConnectionSocket( Self, steamIDTarget, nVirtualPort, nTimeoutSec, bAllowUseOfPacketRelay ); + return returnValue; + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingConnectionCustomSignaling.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingConnectionCustomSignaling.cs new file mode 100644 index 0000000..be513c0 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingConnectionCustomSignaling.cs @@ -0,0 +1,41 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamNetworkingConnectionCustomSignaling : SteamInterface + { + + internal ISteamNetworkingConnectionCustomSignaling( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingConnectionCustomSignaling_SendSignal", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SendSignal( IntPtr self, Connection hConn, ref ConnectionInfo info, IntPtr pMsg, int cbMsg ); + + #endregion + internal bool SendSignal( Connection hConn, ref ConnectionInfo info, IntPtr pMsg, int cbMsg ) + { + var returnValue = _SendSignal( Self, hConn, ref info, pMsg, cbMsg ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingConnectionCustomSignaling_Release", CallingConvention = Platform.CC)] + private static extern void _Release( IntPtr self ); + + #endregion + internal void Release() + { + _Release( Self ); + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingCustomSignalingRecvContext.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingCustomSignalingRecvContext.cs new file mode 100644 index 0000000..d7552bb --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingCustomSignalingRecvContext.cs @@ -0,0 +1,40 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamNetworkingCustomSignalingRecvContext : SteamInterface + { + + internal ISteamNetworkingCustomSignalingRecvContext( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingCustomSignalingRecvContext_OnConnectRequest", CallingConvention = Platform.CC)] + private static extern IntPtr _OnConnectRequest( IntPtr self, Connection hConn, ref NetIdentity identityPeer ); + + #endregion + internal IntPtr OnConnectRequest( Connection hConn, ref NetIdentity identityPeer ) + { + var returnValue = _OnConnectRequest( Self, hConn, ref identityPeer ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingCustomSignalingRecvContext_SendRejectionSignal", CallingConvention = Platform.CC)] + private static extern void _SendRejectionSignal( IntPtr self, ref NetIdentity identityPeer, IntPtr pMsg, int cbMsg ); + + #endregion + internal void SendRejectionSignal( ref NetIdentity identityPeer, IntPtr pMsg, int cbMsg ) + { + _SendRejectionSignal( Self, ref identityPeer, pMsg, cbMsg ); + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingSockets.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingSockets.cs new file mode 100644 index 0000000..8713eb9 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingSockets.cs @@ -0,0 +1,473 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamNetworkingSockets : SteamInterface + { + + internal ISteamNetworkingSockets( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingSockets_v008", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamNetworkingSockets_v008(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamNetworkingSockets_v008(); + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamGameServerNetworkingSockets_v008", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamGameServerNetworkingSockets_v008(); + public override IntPtr GetServerInterfacePointer() => SteamAPI_SteamGameServerNetworkingSockets_v008(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_CreateListenSocketIP", CallingConvention = Platform.CC)] + private static extern Socket _CreateListenSocketIP( IntPtr self, ref NetAddress localAddress, int nOptions, [In,Out] NetKeyValue[] pOptions ); + + #endregion + internal Socket CreateListenSocketIP( ref NetAddress localAddress, int nOptions, [In,Out] NetKeyValue[] pOptions ) + { + var returnValue = _CreateListenSocketIP( Self, ref localAddress, nOptions, pOptions ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_ConnectByIPAddress", CallingConvention = Platform.CC)] + private static extern Connection _ConnectByIPAddress( IntPtr self, ref NetAddress address, int nOptions, [In,Out] NetKeyValue[] pOptions ); + + #endregion + internal Connection ConnectByIPAddress( ref NetAddress address, int nOptions, [In,Out] NetKeyValue[] pOptions ) + { + var returnValue = _ConnectByIPAddress( Self, ref address, nOptions, pOptions ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_CreateListenSocketP2P", CallingConvention = Platform.CC)] + private static extern Socket _CreateListenSocketP2P( IntPtr self, int nVirtualPort, int nOptions, [In,Out] NetKeyValue[] pOptions ); + + #endregion + internal Socket CreateListenSocketP2P( int nVirtualPort, int nOptions, [In,Out] NetKeyValue[] pOptions ) + { + var returnValue = _CreateListenSocketP2P( Self, nVirtualPort, nOptions, pOptions ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_ConnectP2P", CallingConvention = Platform.CC)] + private static extern Connection _ConnectP2P( IntPtr self, ref NetIdentity identityRemote, int nVirtualPort, int nOptions, [In,Out] NetKeyValue[] pOptions ); + + #endregion + internal Connection ConnectP2P( ref NetIdentity identityRemote, int nVirtualPort, int nOptions, [In,Out] NetKeyValue[] pOptions ) + { + var returnValue = _ConnectP2P( Self, ref identityRemote, nVirtualPort, nOptions, pOptions ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_AcceptConnection", CallingConvention = Platform.CC)] + private static extern Result _AcceptConnection( IntPtr self, Connection hConn ); + + #endregion + internal Result AcceptConnection( Connection hConn ) + { + var returnValue = _AcceptConnection( Self, hConn ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_CloseConnection", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _CloseConnection( IntPtr self, Connection hPeer, int nReason, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszDebug, [MarshalAs( UnmanagedType.U1 )] bool bEnableLinger ); + + #endregion + internal bool CloseConnection( Connection hPeer, int nReason, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszDebug, [MarshalAs( UnmanagedType.U1 )] bool bEnableLinger ) + { + var returnValue = _CloseConnection( Self, hPeer, nReason, pszDebug, bEnableLinger ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_CloseListenSocket", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _CloseListenSocket( IntPtr self, Socket hSocket ); + + #endregion + internal bool CloseListenSocket( Socket hSocket ) + { + var returnValue = _CloseListenSocket( Self, hSocket ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_SetConnectionUserData", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetConnectionUserData( IntPtr self, Connection hPeer, long nUserData ); + + #endregion + internal bool SetConnectionUserData( Connection hPeer, long nUserData ) + { + var returnValue = _SetConnectionUserData( Self, hPeer, nUserData ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetConnectionUserData", CallingConvention = Platform.CC)] + private static extern long _GetConnectionUserData( IntPtr self, Connection hPeer ); + + #endregion + internal long GetConnectionUserData( Connection hPeer ) + { + var returnValue = _GetConnectionUserData( Self, hPeer ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_SetConnectionName", CallingConvention = Platform.CC)] + private static extern void _SetConnectionName( IntPtr self, Connection hPeer, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszName ); + + #endregion + internal void SetConnectionName( Connection hPeer, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszName ) + { + _SetConnectionName( Self, hPeer, pszName ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetConnectionName", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetConnectionName( IntPtr self, Connection hPeer, IntPtr pszName, int nMaxLen ); + + #endregion + internal bool GetConnectionName( Connection hPeer, out string pszName ) + { + IntPtr mempszName = Helpers.TakeMemory(); + var returnValue = _GetConnectionName( Self, hPeer, mempszName, (1024 * 32) ); + pszName = Helpers.MemoryToString( mempszName ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_SendMessageToConnection", CallingConvention = Platform.CC)] + private static extern Result _SendMessageToConnection( IntPtr self, Connection hConn, IntPtr pData, uint cbData, int nSendFlags, ref long pOutMessageNumber ); + + #endregion + internal Result SendMessageToConnection( Connection hConn, IntPtr pData, uint cbData, int nSendFlags, ref long pOutMessageNumber ) + { + var returnValue = _SendMessageToConnection( Self, hConn, pData, cbData, nSendFlags, ref pOutMessageNumber ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_SendMessages", CallingConvention = Platform.CC)] + private static extern void _SendMessages( IntPtr self, int nMessages, ref NetMsg pMessages, [In,Out] long[] pOutMessageNumberOrResult ); + + #endregion + internal void SendMessages( int nMessages, ref NetMsg pMessages, [In,Out] long[] pOutMessageNumberOrResult ) + { + _SendMessages( Self, nMessages, ref pMessages, pOutMessageNumberOrResult ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_FlushMessagesOnConnection", CallingConvention = Platform.CC)] + private static extern Result _FlushMessagesOnConnection( IntPtr self, Connection hConn ); + + #endregion + internal Result FlushMessagesOnConnection( Connection hConn ) + { + var returnValue = _FlushMessagesOnConnection( Self, hConn ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_ReceiveMessagesOnConnection", CallingConvention = Platform.CC)] + private static extern int _ReceiveMessagesOnConnection( IntPtr self, Connection hConn, IntPtr ppOutMessages, int nMaxMessages ); + + #endregion + internal int ReceiveMessagesOnConnection( Connection hConn, IntPtr ppOutMessages, int nMaxMessages ) + { + var returnValue = _ReceiveMessagesOnConnection( Self, hConn, ppOutMessages, nMaxMessages ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetConnectionInfo", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetConnectionInfo( IntPtr self, Connection hConn, ref ConnectionInfo pInfo ); + + #endregion + internal bool GetConnectionInfo( Connection hConn, ref ConnectionInfo pInfo ) + { + var returnValue = _GetConnectionInfo( Self, hConn, ref pInfo ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetQuickConnectionStatus", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetQuickConnectionStatus( IntPtr self, Connection hConn, ref SteamNetworkingQuickConnectionStatus pStats ); + + #endregion + internal bool GetQuickConnectionStatus( Connection hConn, ref SteamNetworkingQuickConnectionStatus pStats ) + { + var returnValue = _GetQuickConnectionStatus( Self, hConn, ref pStats ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetDetailedConnectionStatus", CallingConvention = Platform.CC)] + private static extern int _GetDetailedConnectionStatus( IntPtr self, Connection hConn, IntPtr pszBuf, int cbBuf ); + + #endregion + internal int GetDetailedConnectionStatus( Connection hConn, out string pszBuf ) + { + IntPtr mempszBuf = Helpers.TakeMemory(); + var returnValue = _GetDetailedConnectionStatus( Self, hConn, mempszBuf, (1024 * 32) ); + pszBuf = Helpers.MemoryToString( mempszBuf ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetListenSocketAddress", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetListenSocketAddress( IntPtr self, Socket hSocket, ref NetAddress address ); + + #endregion + internal bool GetListenSocketAddress( Socket hSocket, ref NetAddress address ) + { + var returnValue = _GetListenSocketAddress( Self, hSocket, ref address ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_CreateSocketPair", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _CreateSocketPair( IntPtr self, [In,Out] Connection[] pOutConnection1, [In,Out] Connection[] pOutConnection2, [MarshalAs( UnmanagedType.U1 )] bool bUseNetworkLoopback, ref NetIdentity pIdentity1, ref NetIdentity pIdentity2 ); + + #endregion + internal bool CreateSocketPair( [In,Out] Connection[] pOutConnection1, [In,Out] Connection[] pOutConnection2, [MarshalAs( UnmanagedType.U1 )] bool bUseNetworkLoopback, ref NetIdentity pIdentity1, ref NetIdentity pIdentity2 ) + { + var returnValue = _CreateSocketPair( Self, pOutConnection1, pOutConnection2, bUseNetworkLoopback, ref pIdentity1, ref pIdentity2 ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetIdentity", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetIdentity( IntPtr self, ref NetIdentity pIdentity ); + + #endregion + internal bool GetIdentity( ref NetIdentity pIdentity ) + { + var returnValue = _GetIdentity( Self, ref pIdentity ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_InitAuthentication", CallingConvention = Platform.CC)] + private static extern SteamNetworkingAvailability _InitAuthentication( IntPtr self ); + + #endregion + internal SteamNetworkingAvailability InitAuthentication() + { + var returnValue = _InitAuthentication( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetAuthenticationStatus", CallingConvention = Platform.CC)] + private static extern SteamNetworkingAvailability _GetAuthenticationStatus( IntPtr self, ref SteamNetAuthenticationStatus_t pDetails ); + + #endregion + internal SteamNetworkingAvailability GetAuthenticationStatus( ref SteamNetAuthenticationStatus_t pDetails ) + { + var returnValue = _GetAuthenticationStatus( Self, ref pDetails ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_CreatePollGroup", CallingConvention = Platform.CC)] + private static extern HSteamNetPollGroup _CreatePollGroup( IntPtr self ); + + #endregion + internal HSteamNetPollGroup CreatePollGroup() + { + var returnValue = _CreatePollGroup( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_DestroyPollGroup", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _DestroyPollGroup( IntPtr self, HSteamNetPollGroup hPollGroup ); + + #endregion + internal bool DestroyPollGroup( HSteamNetPollGroup hPollGroup ) + { + var returnValue = _DestroyPollGroup( Self, hPollGroup ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_SetConnectionPollGroup", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetConnectionPollGroup( IntPtr self, Connection hConn, HSteamNetPollGroup hPollGroup ); + + #endregion + internal bool SetConnectionPollGroup( Connection hConn, HSteamNetPollGroup hPollGroup ) + { + var returnValue = _SetConnectionPollGroup( Self, hConn, hPollGroup ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_ReceiveMessagesOnPollGroup", CallingConvention = Platform.CC)] + private static extern int _ReceiveMessagesOnPollGroup( IntPtr self, HSteamNetPollGroup hPollGroup, IntPtr ppOutMessages, int nMaxMessages ); + + #endregion + internal int ReceiveMessagesOnPollGroup( HSteamNetPollGroup hPollGroup, IntPtr ppOutMessages, int nMaxMessages ) + { + var returnValue = _ReceiveMessagesOnPollGroup( Self, hPollGroup, ppOutMessages, nMaxMessages ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_ReceivedRelayAuthTicket", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _ReceivedRelayAuthTicket( IntPtr self, IntPtr pvTicket, int cbTicket, [In,Out] SteamDatagramRelayAuthTicket[] pOutParsedTicket ); + + #endregion + internal bool ReceivedRelayAuthTicket( IntPtr pvTicket, int cbTicket, [In,Out] SteamDatagramRelayAuthTicket[] pOutParsedTicket ) + { + var returnValue = _ReceivedRelayAuthTicket( Self, pvTicket, cbTicket, pOutParsedTicket ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_FindRelayAuthTicketForServer", CallingConvention = Platform.CC)] + private static extern int _FindRelayAuthTicketForServer( IntPtr self, ref NetIdentity identityGameServer, int nVirtualPort, [In,Out] SteamDatagramRelayAuthTicket[] pOutParsedTicket ); + + #endregion + internal int FindRelayAuthTicketForServer( ref NetIdentity identityGameServer, int nVirtualPort, [In,Out] SteamDatagramRelayAuthTicket[] pOutParsedTicket ) + { + var returnValue = _FindRelayAuthTicketForServer( Self, ref identityGameServer, nVirtualPort, pOutParsedTicket ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_ConnectToHostedDedicatedServer", CallingConvention = Platform.CC)] + private static extern Connection _ConnectToHostedDedicatedServer( IntPtr self, ref NetIdentity identityTarget, int nVirtualPort, int nOptions, [In,Out] NetKeyValue[] pOptions ); + + #endregion + internal Connection ConnectToHostedDedicatedServer( ref NetIdentity identityTarget, int nVirtualPort, int nOptions, [In,Out] NetKeyValue[] pOptions ) + { + var returnValue = _ConnectToHostedDedicatedServer( Self, ref identityTarget, nVirtualPort, nOptions, pOptions ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetHostedDedicatedServerPort", CallingConvention = Platform.CC)] + private static extern ushort _GetHostedDedicatedServerPort( IntPtr self ); + + #endregion + internal ushort GetHostedDedicatedServerPort() + { + var returnValue = _GetHostedDedicatedServerPort( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetHostedDedicatedServerPOPID", CallingConvention = Platform.CC)] + private static extern SteamNetworkingPOPID _GetHostedDedicatedServerPOPID( IntPtr self ); + + #endregion + internal SteamNetworkingPOPID GetHostedDedicatedServerPOPID() + { + var returnValue = _GetHostedDedicatedServerPOPID( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetHostedDedicatedServerAddress", CallingConvention = Platform.CC)] + private static extern Result _GetHostedDedicatedServerAddress( IntPtr self, ref SteamDatagramHostedAddress pRouting ); + + #endregion + internal Result GetHostedDedicatedServerAddress( ref SteamDatagramHostedAddress pRouting ) + { + var returnValue = _GetHostedDedicatedServerAddress( Self, ref pRouting ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_CreateHostedDedicatedServerListenSocket", CallingConvention = Platform.CC)] + private static extern Socket _CreateHostedDedicatedServerListenSocket( IntPtr self, int nVirtualPort, int nOptions, [In,Out] NetKeyValue[] pOptions ); + + #endregion + internal Socket CreateHostedDedicatedServerListenSocket( int nVirtualPort, int nOptions, [In,Out] NetKeyValue[] pOptions ) + { + var returnValue = _CreateHostedDedicatedServerListenSocket( Self, nVirtualPort, nOptions, pOptions ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetGameCoordinatorServerLogin", CallingConvention = Platform.CC)] + private static extern Result _GetGameCoordinatorServerLogin( IntPtr self, ref SteamDatagramGameCoordinatorServerLogin pLoginInfo, ref int pcbSignedBlob, IntPtr pBlob ); + + #endregion + internal Result GetGameCoordinatorServerLogin( ref SteamDatagramGameCoordinatorServerLogin pLoginInfo, ref int pcbSignedBlob, IntPtr pBlob ) + { + var returnValue = _GetGameCoordinatorServerLogin( Self, ref pLoginInfo, ref pcbSignedBlob, pBlob ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_ConnectP2PCustomSignaling", CallingConvention = Platform.CC)] + private static extern Connection _ConnectP2PCustomSignaling( IntPtr self, IntPtr pSignaling, ref NetIdentity pPeerIdentity, int nOptions, [In,Out] NetKeyValue[] pOptions ); + + #endregion + internal Connection ConnectP2PCustomSignaling( IntPtr pSignaling, ref NetIdentity pPeerIdentity, int nOptions, [In,Out] NetKeyValue[] pOptions ) + { + var returnValue = _ConnectP2PCustomSignaling( Self, pSignaling, ref pPeerIdentity, nOptions, pOptions ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_ReceivedP2PCustomSignal", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _ReceivedP2PCustomSignal( IntPtr self, IntPtr pMsg, int cbMsg, IntPtr pContext ); + + #endregion + internal bool ReceivedP2PCustomSignal( IntPtr pMsg, int cbMsg, IntPtr pContext ) + { + var returnValue = _ReceivedP2PCustomSignal( Self, pMsg, cbMsg, pContext ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_GetCertificateRequest", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetCertificateRequest( IntPtr self, ref int pcbBlob, IntPtr pBlob, ref NetErrorMessage errMsg ); + + #endregion + internal bool GetCertificateRequest( ref int pcbBlob, IntPtr pBlob, ref NetErrorMessage errMsg ) + { + var returnValue = _GetCertificateRequest( Self, ref pcbBlob, pBlob, ref errMsg ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_SetCertificate", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetCertificate( IntPtr self, IntPtr pCertificate, int cbCertificate, ref NetErrorMessage errMsg ); + + #endregion + internal bool SetCertificate( IntPtr pCertificate, int cbCertificate, ref NetErrorMessage errMsg ) + { + var returnValue = _SetCertificate( Self, pCertificate, cbCertificate, ref errMsg ); + return returnValue; + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs new file mode 100644 index 0000000..c2a1881 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs @@ -0,0 +1,368 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamNetworkingUtils : SteamInterface + { + + internal ISteamNetworkingUtils( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingUtils_v003", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamNetworkingUtils_v003(); + public override IntPtr GetGlobalInterfacePointer() => SteamAPI_SteamNetworkingUtils_v003(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_AllocateMessage", CallingConvention = Platform.CC)] + private static extern IntPtr _AllocateMessage( IntPtr self, int cbAllocateBuffer ); + + #endregion + internal NetMsg AllocateMessage( int cbAllocateBuffer ) + { + var returnValue = _AllocateMessage( Self, cbAllocateBuffer ); + return returnValue.ToType(); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_InitRelayNetworkAccess", CallingConvention = Platform.CC)] + private static extern void _InitRelayNetworkAccess( IntPtr self ); + + #endregion + internal void InitRelayNetworkAccess() + { + _InitRelayNetworkAccess( Self ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_GetRelayNetworkStatus", CallingConvention = Platform.CC)] + private static extern SteamNetworkingAvailability _GetRelayNetworkStatus( IntPtr self, ref SteamRelayNetworkStatus_t pDetails ); + + #endregion + internal SteamNetworkingAvailability GetRelayNetworkStatus( ref SteamRelayNetworkStatus_t pDetails ) + { + var returnValue = _GetRelayNetworkStatus( Self, ref pDetails ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_GetLocalPingLocation", CallingConvention = Platform.CC)] + private static extern float _GetLocalPingLocation( IntPtr self, ref NetPingLocation result ); + + #endregion + internal float GetLocalPingLocation( ref NetPingLocation result ) + { + var returnValue = _GetLocalPingLocation( Self, ref result ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_EstimatePingTimeBetweenTwoLocations", CallingConvention = Platform.CC)] + private static extern int _EstimatePingTimeBetweenTwoLocations( IntPtr self, ref NetPingLocation location1, ref NetPingLocation location2 ); + + #endregion + internal int EstimatePingTimeBetweenTwoLocations( ref NetPingLocation location1, ref NetPingLocation location2 ) + { + var returnValue = _EstimatePingTimeBetweenTwoLocations( Self, ref location1, ref location2 ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_EstimatePingTimeFromLocalHost", CallingConvention = Platform.CC)] + private static extern int _EstimatePingTimeFromLocalHost( IntPtr self, ref NetPingLocation remoteLocation ); + + #endregion + internal int EstimatePingTimeFromLocalHost( ref NetPingLocation remoteLocation ) + { + var returnValue = _EstimatePingTimeFromLocalHost( Self, ref remoteLocation ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_ConvertPingLocationToString", CallingConvention = Platform.CC)] + private static extern void _ConvertPingLocationToString( IntPtr self, ref NetPingLocation location, IntPtr pszBuf, int cchBufSize ); + + #endregion + internal void ConvertPingLocationToString( ref NetPingLocation location, out string pszBuf ) + { + IntPtr mempszBuf = Helpers.TakeMemory(); + _ConvertPingLocationToString( Self, ref location, mempszBuf, (1024 * 32) ); + pszBuf = Helpers.MemoryToString( mempszBuf ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_ParsePingLocationString", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _ParsePingLocationString( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszString, ref NetPingLocation result ); + + #endregion + internal bool ParsePingLocationString( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszString, ref NetPingLocation result ) + { + var returnValue = _ParsePingLocationString( Self, pszString, ref result ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_CheckPingDataUpToDate", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _CheckPingDataUpToDate( IntPtr self, float flMaxAgeSeconds ); + + #endregion + internal bool CheckPingDataUpToDate( float flMaxAgeSeconds ) + { + var returnValue = _CheckPingDataUpToDate( Self, flMaxAgeSeconds ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_GetPingToDataCenter", CallingConvention = Platform.CC)] + private static extern int _GetPingToDataCenter( IntPtr self, SteamNetworkingPOPID popID, ref SteamNetworkingPOPID pViaRelayPoP ); + + #endregion + internal int GetPingToDataCenter( SteamNetworkingPOPID popID, ref SteamNetworkingPOPID pViaRelayPoP ) + { + var returnValue = _GetPingToDataCenter( Self, popID, ref pViaRelayPoP ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_GetDirectPingToPOP", CallingConvention = Platform.CC)] + private static extern int _GetDirectPingToPOP( IntPtr self, SteamNetworkingPOPID popID ); + + #endregion + internal int GetDirectPingToPOP( SteamNetworkingPOPID popID ) + { + var returnValue = _GetDirectPingToPOP( Self, popID ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_GetPOPCount", CallingConvention = Platform.CC)] + private static extern int _GetPOPCount( IntPtr self ); + + #endregion + internal int GetPOPCount() + { + var returnValue = _GetPOPCount( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_GetPOPList", CallingConvention = Platform.CC)] + private static extern int _GetPOPList( IntPtr self, ref SteamNetworkingPOPID list, int nListSz ); + + #endregion + internal int GetPOPList( ref SteamNetworkingPOPID list, int nListSz ) + { + var returnValue = _GetPOPList( Self, ref list, nListSz ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_GetLocalTimestamp", CallingConvention = Platform.CC)] + private static extern long _GetLocalTimestamp( IntPtr self ); + + #endregion + internal long GetLocalTimestamp() + { + var returnValue = _GetLocalTimestamp( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SetDebugOutputFunction", CallingConvention = Platform.CC)] + private static extern void _SetDebugOutputFunction( IntPtr self, NetDebugOutput eDetailLevel, NetDebugFunc pfnFunc ); + + #endregion + internal void SetDebugOutputFunction( NetDebugOutput eDetailLevel, NetDebugFunc pfnFunc ) + { + _SetDebugOutputFunction( Self, eDetailLevel, pfnFunc ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SetGlobalConfigValueInt32", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetGlobalConfigValueInt32( IntPtr self, NetConfig eValue, int val ); + + #endregion + internal bool SetGlobalConfigValueInt32( NetConfig eValue, int val ) + { + var returnValue = _SetGlobalConfigValueInt32( Self, eValue, val ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SetGlobalConfigValueFloat", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetGlobalConfigValueFloat( IntPtr self, NetConfig eValue, float val ); + + #endregion + internal bool SetGlobalConfigValueFloat( NetConfig eValue, float val ) + { + var returnValue = _SetGlobalConfigValueFloat( Self, eValue, val ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SetGlobalConfigValueString", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetGlobalConfigValueString( IntPtr self, NetConfig eValue, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string val ); + + #endregion + internal bool SetGlobalConfigValueString( NetConfig eValue, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string val ) + { + var returnValue = _SetGlobalConfigValueString( Self, eValue, val ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SetConnectionConfigValueInt32", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetConnectionConfigValueInt32( IntPtr self, Connection hConn, NetConfig eValue, int val ); + + #endregion + internal bool SetConnectionConfigValueInt32( Connection hConn, NetConfig eValue, int val ) + { + var returnValue = _SetConnectionConfigValueInt32( Self, hConn, eValue, val ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SetConnectionConfigValueFloat", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetConnectionConfigValueFloat( IntPtr self, Connection hConn, NetConfig eValue, float val ); + + #endregion + internal bool SetConnectionConfigValueFloat( Connection hConn, NetConfig eValue, float val ) + { + var returnValue = _SetConnectionConfigValueFloat( Self, hConn, eValue, val ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SetConnectionConfigValueString", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetConnectionConfigValueString( IntPtr self, Connection hConn, NetConfig eValue, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string val ); + + #endregion + internal bool SetConnectionConfigValueString( Connection hConn, NetConfig eValue, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string val ) + { + var returnValue = _SetConnectionConfigValueString( Self, hConn, eValue, val ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SetConfigValue", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetConfigValue( IntPtr self, NetConfig eValue, NetConfigScope eScopeType, IntPtr scopeObj, NetConfigType eDataType, IntPtr pArg ); + + #endregion + internal bool SetConfigValue( NetConfig eValue, NetConfigScope eScopeType, IntPtr scopeObj, NetConfigType eDataType, IntPtr pArg ) + { + var returnValue = _SetConfigValue( Self, eValue, eScopeType, scopeObj, eDataType, pArg ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SetConfigValueStruct", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetConfigValueStruct( IntPtr self, ref NetKeyValue opt, NetConfigScope eScopeType, IntPtr scopeObj ); + + #endregion + internal bool SetConfigValueStruct( ref NetKeyValue opt, NetConfigScope eScopeType, IntPtr scopeObj ) + { + var returnValue = _SetConfigValueStruct( Self, ref opt, eScopeType, scopeObj ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_GetConfigValue", CallingConvention = Platform.CC)] + private static extern NetConfigResult _GetConfigValue( IntPtr self, NetConfig eValue, NetConfigScope eScopeType, IntPtr scopeObj, ref NetConfigType pOutDataType, IntPtr pResult, ref UIntPtr cbResult ); + + #endregion + internal NetConfigResult GetConfigValue( NetConfig eValue, NetConfigScope eScopeType, IntPtr scopeObj, ref NetConfigType pOutDataType, IntPtr pResult, ref UIntPtr cbResult ) + { + var returnValue = _GetConfigValue( Self, eValue, eScopeType, scopeObj, ref pOutDataType, pResult, ref cbResult ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_GetConfigValueInfo", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetConfigValueInfo( IntPtr self, NetConfig eValue, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pOutName, ref NetConfigType pOutDataType, [In,Out] NetConfigScope[] pOutScope, [In,Out] NetConfig[] pOutNextValue ); + + #endregion + internal bool GetConfigValueInfo( NetConfig eValue, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pOutName, ref NetConfigType pOutDataType, [In,Out] NetConfigScope[] pOutScope, [In,Out] NetConfig[] pOutNextValue ) + { + var returnValue = _GetConfigValueInfo( Self, eValue, pOutName, ref pOutDataType, pOutScope, pOutNextValue ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_GetFirstConfigValue", CallingConvention = Platform.CC)] + private static extern NetConfig _GetFirstConfigValue( IntPtr self ); + + #endregion + internal NetConfig GetFirstConfigValue() + { + var returnValue = _GetFirstConfigValue( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SteamNetworkingIPAddr_ToString", CallingConvention = Platform.CC)] + private static extern void _SteamNetworkingIPAddr_ToString( IntPtr self, ref NetAddress addr, IntPtr buf, uint cbBuf, [MarshalAs( UnmanagedType.U1 )] bool bWithPort ); + + #endregion + internal void SteamNetworkingIPAddr_ToString( ref NetAddress addr, out string buf, [MarshalAs( UnmanagedType.U1 )] bool bWithPort ) + { + IntPtr membuf = Helpers.TakeMemory(); + _SteamNetworkingIPAddr_ToString( Self, ref addr, membuf, (1024 * 32), bWithPort ); + buf = Helpers.MemoryToString( membuf ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SteamNetworkingIPAddr_ParseString", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SteamNetworkingIPAddr_ParseString( IntPtr self, ref NetAddress pAddr, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszStr ); + + #endregion + internal bool SteamNetworkingIPAddr_ParseString( ref NetAddress pAddr, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszStr ) + { + var returnValue = _SteamNetworkingIPAddr_ParseString( Self, ref pAddr, pszStr ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SteamNetworkingIdentity_ToString", CallingConvention = Platform.CC)] + private static extern void _SteamNetworkingIdentity_ToString( IntPtr self, ref NetIdentity identity, IntPtr buf, uint cbBuf ); + + #endregion + internal void SteamNetworkingIdentity_ToString( ref NetIdentity identity, out string buf ) + { + IntPtr membuf = Helpers.TakeMemory(); + _SteamNetworkingIdentity_ToString( Self, ref identity, membuf, (1024 * 32) ); + buf = Helpers.MemoryToString( membuf ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamNetworkingUtils_SteamNetworkingIdentity_ParseString", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SteamNetworkingIdentity_ParseString( IntPtr self, ref NetIdentity pIdentity, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszStr ); + + #endregion + internal bool SteamNetworkingIdentity_ParseString( ref NetIdentity pIdentity, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszStr ) + { + var returnValue = _SteamNetworkingIdentity_ParseString( Self, ref pIdentity, pszStr ); + return returnValue; + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamParentalSettings.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamParentalSettings.cs new file mode 100644 index 0000000..6c10d6b --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamParentalSettings.cs @@ -0,0 +1,96 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamParentalSettings : SteamInterface + { + + internal ISteamParentalSettings( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamParentalSettings_v001", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamParentalSettings_v001(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamParentalSettings_v001(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParentalSettings_BIsParentalLockEnabled", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BIsParentalLockEnabled( IntPtr self ); + + #endregion + internal bool BIsParentalLockEnabled() + { + var returnValue = _BIsParentalLockEnabled( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParentalSettings_BIsParentalLockLocked", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BIsParentalLockLocked( IntPtr self ); + + #endregion + internal bool BIsParentalLockLocked() + { + var returnValue = _BIsParentalLockLocked( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParentalSettings_BIsAppBlocked", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BIsAppBlocked( IntPtr self, AppId nAppID ); + + #endregion + internal bool BIsAppBlocked( AppId nAppID ) + { + var returnValue = _BIsAppBlocked( Self, nAppID ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParentalSettings_BIsAppInBlockList", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BIsAppInBlockList( IntPtr self, AppId nAppID ); + + #endregion + internal bool BIsAppInBlockList( AppId nAppID ) + { + var returnValue = _BIsAppInBlockList( Self, nAppID ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParentalSettings_BIsFeatureBlocked", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BIsFeatureBlocked( IntPtr self, ParentalFeature eFeature ); + + #endregion + internal bool BIsFeatureBlocked( ParentalFeature eFeature ) + { + var returnValue = _BIsFeatureBlocked( Self, eFeature ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParentalSettings_BIsFeatureInBlockList", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BIsFeatureInBlockList( IntPtr self, ParentalFeature eFeature ); + + #endregion + internal bool BIsFeatureInBlockList( ParentalFeature eFeature ) + { + var returnValue = _BIsFeatureInBlockList( Self, eFeature ); + return returnValue; + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamParties.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamParties.cs new file mode 100644 index 0000000..b909d63 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamParties.cs @@ -0,0 +1,163 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamParties : SteamInterface + { + + internal ISteamParties( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamParties_v002", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamParties_v002(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamParties_v002(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_GetNumActiveBeacons", CallingConvention = Platform.CC)] + private static extern uint _GetNumActiveBeacons( IntPtr self ); + + #endregion + internal uint GetNumActiveBeacons() + { + var returnValue = _GetNumActiveBeacons( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_GetBeaconByIndex", CallingConvention = Platform.CC)] + private static extern PartyBeaconID_t _GetBeaconByIndex( IntPtr self, uint unIndex ); + + #endregion + internal PartyBeaconID_t GetBeaconByIndex( uint unIndex ) + { + var returnValue = _GetBeaconByIndex( Self, unIndex ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_GetBeaconDetails", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetBeaconDetails( IntPtr self, PartyBeaconID_t ulBeaconID, ref SteamId pSteamIDBeaconOwner, ref SteamPartyBeaconLocation_t pLocation, IntPtr pchMetadata, int cchMetadata ); + + #endregion + internal bool GetBeaconDetails( PartyBeaconID_t ulBeaconID, ref SteamId pSteamIDBeaconOwner, ref SteamPartyBeaconLocation_t pLocation, out string pchMetadata ) + { + IntPtr mempchMetadata = Helpers.TakeMemory(); + var returnValue = _GetBeaconDetails( Self, ulBeaconID, ref pSteamIDBeaconOwner, ref pLocation, mempchMetadata, (1024 * 32) ); + pchMetadata = Helpers.MemoryToString( mempchMetadata ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_JoinParty", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _JoinParty( IntPtr self, PartyBeaconID_t ulBeaconID ); + + #endregion + internal CallResult JoinParty( PartyBeaconID_t ulBeaconID ) + { + var returnValue = _JoinParty( Self, ulBeaconID ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_GetNumAvailableBeaconLocations", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetNumAvailableBeaconLocations( IntPtr self, ref uint puNumLocations ); + + #endregion + internal bool GetNumAvailableBeaconLocations( ref uint puNumLocations ) + { + var returnValue = _GetNumAvailableBeaconLocations( Self, ref puNumLocations ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_GetAvailableBeaconLocations", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetAvailableBeaconLocations( IntPtr self, ref SteamPartyBeaconLocation_t pLocationList, uint uMaxNumLocations ); + + #endregion + internal bool GetAvailableBeaconLocations( ref SteamPartyBeaconLocation_t pLocationList, uint uMaxNumLocations ) + { + var returnValue = _GetAvailableBeaconLocations( Self, ref pLocationList, uMaxNumLocations ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_CreateBeacon", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _CreateBeacon( IntPtr self, uint unOpenSlots, ref SteamPartyBeaconLocation_t pBeaconLocation, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchConnectString, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMetadata ); + + #endregion + internal CallResult CreateBeacon( uint unOpenSlots, /* ref */ SteamPartyBeaconLocation_t pBeaconLocation, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchConnectString, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMetadata ) + { + var returnValue = _CreateBeacon( Self, unOpenSlots, ref pBeaconLocation, pchConnectString, pchMetadata ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_OnReservationCompleted", CallingConvention = Platform.CC)] + private static extern void _OnReservationCompleted( IntPtr self, PartyBeaconID_t ulBeacon, SteamId steamIDUser ); + + #endregion + internal void OnReservationCompleted( PartyBeaconID_t ulBeacon, SteamId steamIDUser ) + { + _OnReservationCompleted( Self, ulBeacon, steamIDUser ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_CancelReservation", CallingConvention = Platform.CC)] + private static extern void _CancelReservation( IntPtr self, PartyBeaconID_t ulBeacon, SteamId steamIDUser ); + + #endregion + internal void CancelReservation( PartyBeaconID_t ulBeacon, SteamId steamIDUser ) + { + _CancelReservation( Self, ulBeacon, steamIDUser ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_ChangeNumOpenSlots", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _ChangeNumOpenSlots( IntPtr self, PartyBeaconID_t ulBeacon, uint unOpenSlots ); + + #endregion + internal CallResult ChangeNumOpenSlots( PartyBeaconID_t ulBeacon, uint unOpenSlots ) + { + var returnValue = _ChangeNumOpenSlots( Self, ulBeacon, unOpenSlots ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_DestroyBeacon", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _DestroyBeacon( IntPtr self, PartyBeaconID_t ulBeacon ); + + #endregion + internal bool DestroyBeacon( PartyBeaconID_t ulBeacon ) + { + var returnValue = _DestroyBeacon( Self, ulBeacon ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamParties_GetBeaconLocationData", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetBeaconLocationData( IntPtr self, SteamPartyBeaconLocation_t BeaconLocation, SteamPartyBeaconLocationData eData, IntPtr pchDataStringOut, int cchDataStringOut ); + + #endregion + internal bool GetBeaconLocationData( SteamPartyBeaconLocation_t BeaconLocation, SteamPartyBeaconLocationData eData, out string pchDataStringOut ) + { + IntPtr mempchDataStringOut = Helpers.TakeMemory(); + var returnValue = _GetBeaconLocationData( Self, BeaconLocation, eData, mempchDataStringOut, (1024 * 32) ); + pchDataStringOut = Helpers.MemoryToString( mempchDataStringOut ); + return returnValue; + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamRemotePlay.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamRemotePlay.cs new file mode 100644 index 0000000..d306fd8 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamRemotePlay.cs @@ -0,0 +1,103 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamRemotePlay : SteamInterface + { + + internal ISteamRemotePlay( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamRemotePlay_v001", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamRemotePlay_v001(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamRemotePlay_v001(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemotePlay_GetSessionCount", CallingConvention = Platform.CC)] + private static extern uint _GetSessionCount( IntPtr self ); + + #endregion + internal uint GetSessionCount() + { + var returnValue = _GetSessionCount( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemotePlay_GetSessionID", CallingConvention = Platform.CC)] + private static extern RemotePlaySessionID_t _GetSessionID( IntPtr self, int iSessionIndex ); + + #endregion + internal RemotePlaySessionID_t GetSessionID( int iSessionIndex ) + { + var returnValue = _GetSessionID( Self, iSessionIndex ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemotePlay_GetSessionSteamID", CallingConvention = Platform.CC)] + private static extern SteamId _GetSessionSteamID( IntPtr self, RemotePlaySessionID_t unSessionID ); + + #endregion + internal SteamId GetSessionSteamID( RemotePlaySessionID_t unSessionID ) + { + var returnValue = _GetSessionSteamID( Self, unSessionID ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemotePlay_GetSessionClientName", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetSessionClientName( IntPtr self, RemotePlaySessionID_t unSessionID ); + + #endregion + internal string GetSessionClientName( RemotePlaySessionID_t unSessionID ) + { + var returnValue = _GetSessionClientName( Self, unSessionID ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemotePlay_GetSessionClientFormFactor", CallingConvention = Platform.CC)] + private static extern SteamDeviceFormFactor _GetSessionClientFormFactor( IntPtr self, RemotePlaySessionID_t unSessionID ); + + #endregion + internal SteamDeviceFormFactor GetSessionClientFormFactor( RemotePlaySessionID_t unSessionID ) + { + var returnValue = _GetSessionClientFormFactor( Self, unSessionID ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemotePlay_BGetSessionClientResolution", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BGetSessionClientResolution( IntPtr self, RemotePlaySessionID_t unSessionID, ref int pnResolutionX, ref int pnResolutionY ); + + #endregion + internal bool BGetSessionClientResolution( RemotePlaySessionID_t unSessionID, ref int pnResolutionX, ref int pnResolutionY ) + { + var returnValue = _BGetSessionClientResolution( Self, unSessionID, ref pnResolutionX, ref pnResolutionY ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemotePlay_BSendRemotePlayTogetherInvite", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BSendRemotePlayTogetherInvite( IntPtr self, SteamId steamIDFriend ); + + #endregion + internal bool BSendRemotePlayTogetherInvite( SteamId steamIDFriend ) + { + var returnValue = _BSendRemotePlayTogetherInvite( Self, steamIDFriend ); + return returnValue; + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamRemoteStorage.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamRemoteStorage.cs new file mode 100644 index 0000000..11034bb --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamRemoteStorage.cs @@ -0,0 +1,379 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamRemoteStorage : SteamInterface + { + + internal ISteamRemoteStorage( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamRemoteStorage_v014", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamRemoteStorage_v014(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamRemoteStorage_v014(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWrite", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _FileWrite( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, int cubData ); + + #endregion + internal bool FileWrite( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, int cubData ) + { + var returnValue = _FileWrite( Self, pchFile, pvData, cubData ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileRead", CallingConvention = Platform.CC)] + private static extern int _FileRead( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, int cubDataToRead ); + + #endregion + internal int FileRead( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, int cubDataToRead ) + { + var returnValue = _FileRead( Self, pchFile, pvData, cubDataToRead ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWriteAsync", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _FileWriteAsync( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, uint cubData ); + + #endregion + internal CallResult FileWriteAsync( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, uint cubData ) + { + var returnValue = _FileWriteAsync( Self, pchFile, pvData, cubData ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileReadAsync", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _FileReadAsync( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, uint nOffset, uint cubToRead ); + + #endregion + internal CallResult FileReadAsync( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, uint nOffset, uint cubToRead ) + { + var returnValue = _FileReadAsync( Self, pchFile, nOffset, cubToRead ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileReadAsyncComplete", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _FileReadAsyncComplete( IntPtr self, SteamAPICall_t hReadCall, IntPtr pvBuffer, uint cubToRead ); + + #endregion + internal bool FileReadAsyncComplete( SteamAPICall_t hReadCall, IntPtr pvBuffer, uint cubToRead ) + { + var returnValue = _FileReadAsyncComplete( Self, hReadCall, pvBuffer, cubToRead ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileForget", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _FileForget( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); + + #endregion + internal bool FileForget( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + { + var returnValue = _FileForget( Self, pchFile ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileDelete", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _FileDelete( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); + + #endregion + internal bool FileDelete( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + { + var returnValue = _FileDelete( Self, pchFile ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileShare", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _FileShare( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); + + #endregion + internal CallResult FileShare( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + { + var returnValue = _FileShare( Self, pchFile ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_SetSyncPlatforms", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetSyncPlatforms( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, RemoteStoragePlatform eRemoteStoragePlatform ); + + #endregion + internal bool SetSyncPlatforms( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, RemoteStoragePlatform eRemoteStoragePlatform ) + { + var returnValue = _SetSyncPlatforms( Self, pchFile, eRemoteStoragePlatform ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWriteStreamOpen", CallingConvention = Platform.CC)] + private static extern UGCFileWriteStreamHandle_t _FileWriteStreamOpen( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); + + #endregion + internal UGCFileWriteStreamHandle_t FileWriteStreamOpen( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + { + var returnValue = _FileWriteStreamOpen( Self, pchFile ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWriteStreamWriteChunk", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _FileWriteStreamWriteChunk( IntPtr self, UGCFileWriteStreamHandle_t writeHandle, IntPtr pvData, int cubData ); + + #endregion + internal bool FileWriteStreamWriteChunk( UGCFileWriteStreamHandle_t writeHandle, IntPtr pvData, int cubData ) + { + var returnValue = _FileWriteStreamWriteChunk( Self, writeHandle, pvData, cubData ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWriteStreamClose", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _FileWriteStreamClose( IntPtr self, UGCFileWriteStreamHandle_t writeHandle ); + + #endregion + internal bool FileWriteStreamClose( UGCFileWriteStreamHandle_t writeHandle ) + { + var returnValue = _FileWriteStreamClose( Self, writeHandle ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWriteStreamCancel", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _FileWriteStreamCancel( IntPtr self, UGCFileWriteStreamHandle_t writeHandle ); + + #endregion + internal bool FileWriteStreamCancel( UGCFileWriteStreamHandle_t writeHandle ) + { + var returnValue = _FileWriteStreamCancel( Self, writeHandle ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FileExists", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _FileExists( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); + + #endregion + internal bool FileExists( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + { + var returnValue = _FileExists( Self, pchFile ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_FilePersisted", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _FilePersisted( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); + + #endregion + internal bool FilePersisted( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + { + var returnValue = _FilePersisted( Self, pchFile ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetFileSize", CallingConvention = Platform.CC)] + private static extern int _GetFileSize( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); + + #endregion + internal int GetFileSize( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + { + var returnValue = _GetFileSize( Self, pchFile ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetFileTimestamp", CallingConvention = Platform.CC)] + private static extern long _GetFileTimestamp( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); + + #endregion + internal long GetFileTimestamp( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + { + var returnValue = _GetFileTimestamp( Self, pchFile ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetSyncPlatforms", CallingConvention = Platform.CC)] + private static extern RemoteStoragePlatform _GetSyncPlatforms( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); + + #endregion + internal RemoteStoragePlatform GetSyncPlatforms( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + { + var returnValue = _GetSyncPlatforms( Self, pchFile ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetFileCount", CallingConvention = Platform.CC)] + private static extern int _GetFileCount( IntPtr self ); + + #endregion + internal int GetFileCount() + { + var returnValue = _GetFileCount( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetFileNameAndSize", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetFileNameAndSize( IntPtr self, int iFile, ref int pnFileSizeInBytes ); + + #endregion + internal string GetFileNameAndSize( int iFile, ref int pnFileSizeInBytes ) + { + var returnValue = _GetFileNameAndSize( Self, iFile, ref pnFileSizeInBytes ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetQuota", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetQuota( IntPtr self, ref ulong pnTotalBytes, ref ulong puAvailableBytes ); + + #endregion + internal bool GetQuota( ref ulong pnTotalBytes, ref ulong puAvailableBytes ) + { + var returnValue = _GetQuota( Self, ref pnTotalBytes, ref puAvailableBytes ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_IsCloudEnabledForAccount", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _IsCloudEnabledForAccount( IntPtr self ); + + #endregion + internal bool IsCloudEnabledForAccount() + { + var returnValue = _IsCloudEnabledForAccount( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_IsCloudEnabledForApp", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _IsCloudEnabledForApp( IntPtr self ); + + #endregion + internal bool IsCloudEnabledForApp() + { + var returnValue = _IsCloudEnabledForApp( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_SetCloudEnabledForApp", CallingConvention = Platform.CC)] + private static extern void _SetCloudEnabledForApp( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bEnabled ); + + #endregion + internal void SetCloudEnabledForApp( [MarshalAs( UnmanagedType.U1 )] bool bEnabled ) + { + _SetCloudEnabledForApp( Self, bEnabled ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_UGCDownload", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _UGCDownload( IntPtr self, UGCHandle_t hContent, uint unPriority ); + + #endregion + internal CallResult UGCDownload( UGCHandle_t hContent, uint unPriority ) + { + var returnValue = _UGCDownload( Self, hContent, unPriority ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetUGCDownloadProgress", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetUGCDownloadProgress( IntPtr self, UGCHandle_t hContent, ref int pnBytesDownloaded, ref int pnBytesExpected ); + + #endregion + internal bool GetUGCDownloadProgress( UGCHandle_t hContent, ref int pnBytesDownloaded, ref int pnBytesExpected ) + { + var returnValue = _GetUGCDownloadProgress( Self, hContent, ref pnBytesDownloaded, ref pnBytesExpected ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetUGCDetails", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetUGCDetails( IntPtr self, UGCHandle_t hContent, ref AppId pnAppID, [In,Out] ref char[] ppchName, ref int pnFileSizeInBytes, ref SteamId pSteamIDOwner ); + + #endregion + internal bool GetUGCDetails( UGCHandle_t hContent, ref AppId pnAppID, [In,Out] ref char[] ppchName, ref int pnFileSizeInBytes, ref SteamId pSteamIDOwner ) + { + var returnValue = _GetUGCDetails( Self, hContent, ref pnAppID, ref ppchName, ref pnFileSizeInBytes, ref pSteamIDOwner ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_UGCRead", CallingConvention = Platform.CC)] + private static extern int _UGCRead( IntPtr self, UGCHandle_t hContent, IntPtr pvData, int cubDataToRead, uint cOffset, UGCReadAction eAction ); + + #endregion + internal int UGCRead( UGCHandle_t hContent, IntPtr pvData, int cubDataToRead, uint cOffset, UGCReadAction eAction ) + { + var returnValue = _UGCRead( Self, hContent, pvData, cubDataToRead, cOffset, eAction ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetCachedUGCCount", CallingConvention = Platform.CC)] + private static extern int _GetCachedUGCCount( IntPtr self ); + + #endregion + internal int GetCachedUGCCount() + { + var returnValue = _GetCachedUGCCount( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle", CallingConvention = Platform.CC)] + private static extern UGCHandle_t _GetCachedUGCHandle( IntPtr self, int iCachedContent ); + + #endregion + internal UGCHandle_t GetCachedUGCHandle( int iCachedContent ) + { + var returnValue = _GetCachedUGCHandle( Self, iCachedContent ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _UGCDownloadToLocation( IntPtr self, UGCHandle_t hContent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLocation, uint unPriority ); + + #endregion + internal CallResult UGCDownloadToLocation( UGCHandle_t hContent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLocation, uint unPriority ) + { + var returnValue = _UGCDownloadToLocation( Self, hContent, pchLocation, unPriority ); + return new CallResult( returnValue, IsServer ); + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamScreenshots.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamScreenshots.cs new file mode 100644 index 0000000..0b55937 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamScreenshots.cs @@ -0,0 +1,125 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamScreenshots : SteamInterface + { + + internal ISteamScreenshots( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamScreenshots_v003", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamScreenshots_v003(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamScreenshots_v003(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamScreenshots_WriteScreenshot", CallingConvention = Platform.CC)] + private static extern ScreenshotHandle _WriteScreenshot( IntPtr self, IntPtr pubRGB, uint cubRGB, int nWidth, int nHeight ); + + #endregion + internal ScreenshotHandle WriteScreenshot( IntPtr pubRGB, uint cubRGB, int nWidth, int nHeight ) + { + var returnValue = _WriteScreenshot( Self, pubRGB, cubRGB, nWidth, nHeight ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamScreenshots_AddScreenshotToLibrary", CallingConvention = Platform.CC)] + private static extern ScreenshotHandle _AddScreenshotToLibrary( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFilename, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchThumbnailFilename, int nWidth, int nHeight ); + + #endregion + internal ScreenshotHandle AddScreenshotToLibrary( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFilename, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchThumbnailFilename, int nWidth, int nHeight ) + { + var returnValue = _AddScreenshotToLibrary( Self, pchFilename, pchThumbnailFilename, nWidth, nHeight ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamScreenshots_TriggerScreenshot", CallingConvention = Platform.CC)] + private static extern void _TriggerScreenshot( IntPtr self ); + + #endregion + internal void TriggerScreenshot() + { + _TriggerScreenshot( Self ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamScreenshots_HookScreenshots", CallingConvention = Platform.CC)] + private static extern void _HookScreenshots( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bHook ); + + #endregion + internal void HookScreenshots( [MarshalAs( UnmanagedType.U1 )] bool bHook ) + { + _HookScreenshots( Self, bHook ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamScreenshots_SetLocation", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetLocation( IntPtr self, ScreenshotHandle hScreenshot, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLocation ); + + #endregion + internal bool SetLocation( ScreenshotHandle hScreenshot, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLocation ) + { + var returnValue = _SetLocation( Self, hScreenshot, pchLocation ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamScreenshots_TagUser", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _TagUser( IntPtr self, ScreenshotHandle hScreenshot, SteamId steamID ); + + #endregion + internal bool TagUser( ScreenshotHandle hScreenshot, SteamId steamID ) + { + var returnValue = _TagUser( Self, hScreenshot, steamID ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamScreenshots_TagPublishedFile", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _TagPublishedFile( IntPtr self, ScreenshotHandle hScreenshot, PublishedFileId unPublishedFileID ); + + #endregion + internal bool TagPublishedFile( ScreenshotHandle hScreenshot, PublishedFileId unPublishedFileID ) + { + var returnValue = _TagPublishedFile( Self, hScreenshot, unPublishedFileID ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamScreenshots_IsScreenshotsHooked", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _IsScreenshotsHooked( IntPtr self ); + + #endregion + internal bool IsScreenshotsHooked() + { + var returnValue = _IsScreenshotsHooked( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamScreenshots_AddVRScreenshotToLibrary", CallingConvention = Platform.CC)] + private static extern ScreenshotHandle _AddVRScreenshotToLibrary( IntPtr self, VRScreenshotType eType, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFilename, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVRFilename ); + + #endregion + internal ScreenshotHandle AddVRScreenshotToLibrary( VRScreenshotType eType, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFilename, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVRFilename ) + { + var returnValue = _AddVRScreenshotToLibrary( Self, eType, pchFilename, pchVRFilename ); + return returnValue; + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamTV.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamTV.cs new file mode 100644 index 0000000..bb6cf47 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamTV.cs @@ -0,0 +1,97 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamTV : SteamInterface + { + + internal ISteamTV( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamTV_v001", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamTV_v001(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamTV_v001(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTV_IsBroadcasting", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _IsBroadcasting( IntPtr self, ref int pnNumViewers ); + + #endregion + internal bool IsBroadcasting( ref int pnNumViewers ) + { + var returnValue = _IsBroadcasting( Self, ref pnNumViewers ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTV_AddBroadcastGameData", CallingConvention = Platform.CC)] + private static extern void _AddBroadcastGameData( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ); + + #endregion + internal void AddBroadcastGameData( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ) + { + _AddBroadcastGameData( Self, pchKey, pchValue ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTV_RemoveBroadcastGameData", CallingConvention = Platform.CC)] + private static extern void _RemoveBroadcastGameData( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); + + #endregion + internal void RemoveBroadcastGameData( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) + { + _RemoveBroadcastGameData( Self, pchKey ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTV_AddTimelineMarker", CallingConvention = Platform.CC)] + private static extern void _AddTimelineMarker( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTemplateName, [MarshalAs( UnmanagedType.U1 )] bool bPersistent, byte nColorR, byte nColorG, byte nColorB ); + + #endregion + internal void AddTimelineMarker( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTemplateName, [MarshalAs( UnmanagedType.U1 )] bool bPersistent, byte nColorR, byte nColorG, byte nColorB ) + { + _AddTimelineMarker( Self, pchTemplateName, bPersistent, nColorR, nColorG, nColorB ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTV_RemoveTimelineMarker", CallingConvention = Platform.CC)] + private static extern void _RemoveTimelineMarker( IntPtr self ); + + #endregion + internal void RemoveTimelineMarker() + { + _RemoveTimelineMarker( Self ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTV_AddRegion", CallingConvention = Platform.CC)] + private static extern uint _AddRegion( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchElementName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTimelineDataSection, ref SteamTVRegion_t pSteamTVRegion, SteamTVRegionBehavior eSteamTVRegionBehavior ); + + #endregion + internal uint AddRegion( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchElementName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTimelineDataSection, ref SteamTVRegion_t pSteamTVRegion, SteamTVRegionBehavior eSteamTVRegionBehavior ) + { + var returnValue = _AddRegion( Self, pchElementName, pchTimelineDataSection, ref pSteamTVRegion, eSteamTVRegionBehavior ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamTV_RemoveRegion", CallingConvention = Platform.CC)] + private static extern void _RemoveRegion( IntPtr self, uint unRegionHandle ); + + #endregion + internal void RemoveRegion( uint unRegionHandle ) + { + _RemoveRegion( Self, unRegionHandle ); + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs new file mode 100644 index 0000000..429ec28 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs @@ -0,0 +1,948 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamUGC : SteamInterface + { + + internal ISteamUGC( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamUGC_v014", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamUGC_v014(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamUGC_v014(); + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamGameServerUGC_v014", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamGameServerUGC_v014(); + public override IntPtr GetServerInterfacePointer() => SteamAPI_SteamGameServerUGC_v014(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_CreateQueryUserUGCRequest", CallingConvention = Platform.CC)] + private static extern UGCQueryHandle_t _CreateQueryUserUGCRequest( IntPtr self, AccountID_t unAccountID, UserUGCList eListType, UgcType eMatchingUGCType, UserUGCListSortOrder eSortOrder, AppId nCreatorAppID, AppId nConsumerAppID, uint unPage ); + + #endregion + internal UGCQueryHandle_t CreateQueryUserUGCRequest( AccountID_t unAccountID, UserUGCList eListType, UgcType eMatchingUGCType, UserUGCListSortOrder eSortOrder, AppId nCreatorAppID, AppId nConsumerAppID, uint unPage ) + { + var returnValue = _CreateQueryUserUGCRequest( Self, unAccountID, eListType, eMatchingUGCType, eSortOrder, nCreatorAppID, nConsumerAppID, unPage ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_CreateQueryAllUGCRequestPage", CallingConvention = Platform.CC)] + private static extern UGCQueryHandle_t _CreateQueryAllUGCRequest( IntPtr self, UGCQuery eQueryType, UgcType eMatchingeMatchingUGCTypeFileType, AppId nCreatorAppID, AppId nConsumerAppID, uint unPage ); + + #endregion + internal UGCQueryHandle_t CreateQueryAllUGCRequest( UGCQuery eQueryType, UgcType eMatchingeMatchingUGCTypeFileType, AppId nCreatorAppID, AppId nConsumerAppID, uint unPage ) + { + var returnValue = _CreateQueryAllUGCRequest( Self, eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, unPage ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_CreateQueryAllUGCRequestCursor", CallingConvention = Platform.CC)] + private static extern UGCQueryHandle_t _CreateQueryAllUGCRequest( IntPtr self, UGCQuery eQueryType, UgcType eMatchingeMatchingUGCTypeFileType, AppId nCreatorAppID, AppId nConsumerAppID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchCursor ); + + #endregion + internal UGCQueryHandle_t CreateQueryAllUGCRequest( UGCQuery eQueryType, UgcType eMatchingeMatchingUGCTypeFileType, AppId nCreatorAppID, AppId nConsumerAppID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchCursor ) + { + var returnValue = _CreateQueryAllUGCRequest( Self, eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, pchCursor ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest", CallingConvention = Platform.CC)] + private static extern UGCQueryHandle_t _CreateQueryUGCDetailsRequest( IntPtr self, [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ); + + #endregion + internal UGCQueryHandle_t CreateQueryUGCDetailsRequest( [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ) + { + var returnValue = _CreateQueryUGCDetailsRequest( Self, pvecPublishedFileID, unNumPublishedFileIDs ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SendQueryUGCRequest", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _SendQueryUGCRequest( IntPtr self, UGCQueryHandle_t handle ); + + #endregion + internal CallResult SendQueryUGCRequest( UGCQueryHandle_t handle ) + { + var returnValue = _SendQueryUGCRequest( Self, handle ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCResult", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetQueryUGCResult( IntPtr self, UGCQueryHandle_t handle, uint index, ref SteamUGCDetails_t pDetails ); + + #endregion + internal bool GetQueryUGCResult( UGCQueryHandle_t handle, uint index, ref SteamUGCDetails_t pDetails ) + { + var returnValue = _GetQueryUGCResult( Self, handle, index, ref pDetails ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCPreviewURL", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetQueryUGCPreviewURL( IntPtr self, UGCQueryHandle_t handle, uint index, IntPtr pchURL, uint cchURLSize ); + + #endregion + internal bool GetQueryUGCPreviewURL( UGCQueryHandle_t handle, uint index, out string pchURL ) + { + IntPtr mempchURL = Helpers.TakeMemory(); + var returnValue = _GetQueryUGCPreviewURL( Self, handle, index, mempchURL, (1024 * 32) ); + pchURL = Helpers.MemoryToString( mempchURL ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCMetadata", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetQueryUGCMetadata( IntPtr self, UGCQueryHandle_t handle, uint index, IntPtr pchMetadata, uint cchMetadatasize ); + + #endregion + internal bool GetQueryUGCMetadata( UGCQueryHandle_t handle, uint index, out string pchMetadata ) + { + IntPtr mempchMetadata = Helpers.TakeMemory(); + var returnValue = _GetQueryUGCMetadata( Self, handle, index, mempchMetadata, (1024 * 32) ); + pchMetadata = Helpers.MemoryToString( mempchMetadata ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCChildren", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetQueryUGCChildren( IntPtr self, UGCQueryHandle_t handle, uint index, [In,Out] PublishedFileId[] pvecPublishedFileID, uint cMaxEntries ); + + #endregion + internal bool GetQueryUGCChildren( UGCQueryHandle_t handle, uint index, [In,Out] PublishedFileId[] pvecPublishedFileID, uint cMaxEntries ) + { + var returnValue = _GetQueryUGCChildren( Self, handle, index, pvecPublishedFileID, cMaxEntries ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCStatistic", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetQueryUGCStatistic( IntPtr self, UGCQueryHandle_t handle, uint index, ItemStatistic eStatType, ref ulong pStatValue ); + + #endregion + internal bool GetQueryUGCStatistic( UGCQueryHandle_t handle, uint index, ItemStatistic eStatType, ref ulong pStatValue ) + { + var returnValue = _GetQueryUGCStatistic( Self, handle, index, eStatType, ref pStatValue ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCNumAdditionalPreviews", CallingConvention = Platform.CC)] + private static extern uint _GetQueryUGCNumAdditionalPreviews( IntPtr self, UGCQueryHandle_t handle, uint index ); + + #endregion + internal uint GetQueryUGCNumAdditionalPreviews( UGCQueryHandle_t handle, uint index ) + { + var returnValue = _GetQueryUGCNumAdditionalPreviews( Self, handle, index ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCAdditionalPreview", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetQueryUGCAdditionalPreview( IntPtr self, UGCQueryHandle_t handle, uint index, uint previewIndex, IntPtr pchURLOrVideoID, uint cchURLSize, IntPtr pchOriginalFileName, uint cchOriginalFileNameSize, ref ItemPreviewType pPreviewType ); + + #endregion + internal bool GetQueryUGCAdditionalPreview( UGCQueryHandle_t handle, uint index, uint previewIndex, out string pchURLOrVideoID, out string pchOriginalFileName, ref ItemPreviewType pPreviewType ) + { + IntPtr mempchURLOrVideoID = Helpers.TakeMemory(); + IntPtr mempchOriginalFileName = Helpers.TakeMemory(); + var returnValue = _GetQueryUGCAdditionalPreview( Self, handle, index, previewIndex, mempchURLOrVideoID, (1024 * 32), mempchOriginalFileName, (1024 * 32), ref pPreviewType ); + pchURLOrVideoID = Helpers.MemoryToString( mempchURLOrVideoID ); + pchOriginalFileName = Helpers.MemoryToString( mempchOriginalFileName ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCNumKeyValueTags", CallingConvention = Platform.CC)] + private static extern uint _GetQueryUGCNumKeyValueTags( IntPtr self, UGCQueryHandle_t handle, uint index ); + + #endregion + internal uint GetQueryUGCNumKeyValueTags( UGCQueryHandle_t handle, uint index ) + { + var returnValue = _GetQueryUGCNumKeyValueTags( Self, handle, index ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetQueryUGCKeyValueTag", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetQueryUGCKeyValueTag( IntPtr self, UGCQueryHandle_t handle, uint index, uint keyValueTagIndex, IntPtr pchKey, uint cchKeySize, IntPtr pchValue, uint cchValueSize ); + + #endregion + internal bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint index, uint keyValueTagIndex, out string pchKey, out string pchValue ) + { + IntPtr mempchKey = Helpers.TakeMemory(); + IntPtr mempchValue = Helpers.TakeMemory(); + var returnValue = _GetQueryUGCKeyValueTag( Self, handle, index, keyValueTagIndex, mempchKey, (1024 * 32), mempchValue, (1024 * 32) ); + pchKey = Helpers.MemoryToString( mempchKey ); + pchValue = Helpers.MemoryToString( mempchValue ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetQueryFirstUGCKeyValueTag", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetQueryUGCKeyValueTag( IntPtr self, UGCQueryHandle_t handle, uint index, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, IntPtr pchValue, uint cchValueSize ); + + #endregion + internal bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint index, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, out string pchValue ) + { + IntPtr mempchValue = Helpers.TakeMemory(); + var returnValue = _GetQueryUGCKeyValueTag( Self, handle, index, pchKey, mempchValue, (1024 * 32) ); + pchValue = Helpers.MemoryToString( mempchValue ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_ReleaseQueryUGCRequest", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _ReleaseQueryUGCRequest( IntPtr self, UGCQueryHandle_t handle ); + + #endregion + internal bool ReleaseQueryUGCRequest( UGCQueryHandle_t handle ) + { + var returnValue = _ReleaseQueryUGCRequest( Self, handle ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_AddRequiredTag", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _AddRequiredTag( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pTagName ); + + #endregion + internal bool AddRequiredTag( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pTagName ) + { + var returnValue = _AddRequiredTag( Self, handle, pTagName ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_AddRequiredTagGroup", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _AddRequiredTagGroup( IntPtr self, UGCQueryHandle_t handle, ref SteamParamStringArray_t pTagGroups ); + + #endregion + internal bool AddRequiredTagGroup( UGCQueryHandle_t handle, ref SteamParamStringArray_t pTagGroups ) + { + var returnValue = _AddRequiredTagGroup( Self, handle, ref pTagGroups ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_AddExcludedTag", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _AddExcludedTag( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pTagName ); + + #endregion + internal bool AddExcludedTag( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pTagName ) + { + var returnValue = _AddExcludedTag( Self, handle, pTagName ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetReturnOnlyIDs", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetReturnOnlyIDs( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnOnlyIDs ); + + #endregion + internal bool SetReturnOnlyIDs( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnOnlyIDs ) + { + var returnValue = _SetReturnOnlyIDs( Self, handle, bReturnOnlyIDs ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetReturnKeyValueTags", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetReturnKeyValueTags( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnKeyValueTags ); + + #endregion + internal bool SetReturnKeyValueTags( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnKeyValueTags ) + { + var returnValue = _SetReturnKeyValueTags( Self, handle, bReturnKeyValueTags ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetReturnLongDescription", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetReturnLongDescription( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnLongDescription ); + + #endregion + internal bool SetReturnLongDescription( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnLongDescription ) + { + var returnValue = _SetReturnLongDescription( Self, handle, bReturnLongDescription ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetReturnMetadata", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetReturnMetadata( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnMetadata ); + + #endregion + internal bool SetReturnMetadata( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnMetadata ) + { + var returnValue = _SetReturnMetadata( Self, handle, bReturnMetadata ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetReturnChildren", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetReturnChildren( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnChildren ); + + #endregion + internal bool SetReturnChildren( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnChildren ) + { + var returnValue = _SetReturnChildren( Self, handle, bReturnChildren ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetReturnAdditionalPreviews", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetReturnAdditionalPreviews( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnAdditionalPreviews ); + + #endregion + internal bool SetReturnAdditionalPreviews( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnAdditionalPreviews ) + { + var returnValue = _SetReturnAdditionalPreviews( Self, handle, bReturnAdditionalPreviews ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetReturnTotalOnly", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetReturnTotalOnly( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnTotalOnly ); + + #endregion + internal bool SetReturnTotalOnly( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnTotalOnly ) + { + var returnValue = _SetReturnTotalOnly( Self, handle, bReturnTotalOnly ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetReturnPlaytimeStats", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetReturnPlaytimeStats( IntPtr self, UGCQueryHandle_t handle, uint unDays ); + + #endregion + internal bool SetReturnPlaytimeStats( UGCQueryHandle_t handle, uint unDays ) + { + var returnValue = _SetReturnPlaytimeStats( Self, handle, unDays ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetLanguage", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetLanguage( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLanguage ); + + #endregion + internal bool SetLanguage( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLanguage ) + { + var returnValue = _SetLanguage( Self, handle, pchLanguage ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetAllowCachedResponse", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetAllowCachedResponse( IntPtr self, UGCQueryHandle_t handle, uint unMaxAgeSeconds ); + + #endregion + internal bool SetAllowCachedResponse( UGCQueryHandle_t handle, uint unMaxAgeSeconds ) + { + var returnValue = _SetAllowCachedResponse( Self, handle, unMaxAgeSeconds ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetCloudFileNameFilter", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetCloudFileNameFilter( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pMatchCloudFileName ); + + #endregion + internal bool SetCloudFileNameFilter( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pMatchCloudFileName ) + { + var returnValue = _SetCloudFileNameFilter( Self, handle, pMatchCloudFileName ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetMatchAnyTag", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetMatchAnyTag( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bMatchAnyTag ); + + #endregion + internal bool SetMatchAnyTag( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bMatchAnyTag ) + { + var returnValue = _SetMatchAnyTag( Self, handle, bMatchAnyTag ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetSearchText", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetSearchText( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pSearchText ); + + #endregion + internal bool SetSearchText( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pSearchText ) + { + var returnValue = _SetSearchText( Self, handle, pSearchText ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetRankedByTrendDays", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetRankedByTrendDays( IntPtr self, UGCQueryHandle_t handle, uint unDays ); + + #endregion + internal bool SetRankedByTrendDays( UGCQueryHandle_t handle, uint unDays ) + { + var returnValue = _SetRankedByTrendDays( Self, handle, unDays ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_AddRequiredKeyValueTag", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _AddRequiredKeyValueTag( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pValue ); + + #endregion + internal bool AddRequiredKeyValueTag( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pValue ) + { + var returnValue = _AddRequiredKeyValueTag( Self, handle, pKey, pValue ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_CreateItem", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _CreateItem( IntPtr self, AppId nConsumerAppId, WorkshopFileType eFileType ); + + #endregion + internal CallResult CreateItem( AppId nConsumerAppId, WorkshopFileType eFileType ) + { + var returnValue = _CreateItem( Self, nConsumerAppId, eFileType ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_StartItemUpdate", CallingConvention = Platform.CC)] + private static extern UGCUpdateHandle_t _StartItemUpdate( IntPtr self, AppId nConsumerAppId, PublishedFileId nPublishedFileID ); + + #endregion + internal UGCUpdateHandle_t StartItemUpdate( AppId nConsumerAppId, PublishedFileId nPublishedFileID ) + { + var returnValue = _StartItemUpdate( Self, nConsumerAppId, nPublishedFileID ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetItemTitle", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetItemTitle( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle ); + + #endregion + internal bool SetItemTitle( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle ) + { + var returnValue = _SetItemTitle( Self, handle, pchTitle ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetItemDescription", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetItemDescription( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription ); + + #endregion + internal bool SetItemDescription( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription ) + { + var returnValue = _SetItemDescription( Self, handle, pchDescription ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetItemUpdateLanguage", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetItemUpdateLanguage( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLanguage ); + + #endregion + internal bool SetItemUpdateLanguage( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLanguage ) + { + var returnValue = _SetItemUpdateLanguage( Self, handle, pchLanguage ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetItemMetadata", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetItemMetadata( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMetaData ); + + #endregion + internal bool SetItemMetadata( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMetaData ) + { + var returnValue = _SetItemMetadata( Self, handle, pchMetaData ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetItemVisibility", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetItemVisibility( IntPtr self, UGCUpdateHandle_t handle, RemoteStoragePublishedFileVisibility eVisibility ); + + #endregion + internal bool SetItemVisibility( UGCUpdateHandle_t handle, RemoteStoragePublishedFileVisibility eVisibility ) + { + var returnValue = _SetItemVisibility( Self, handle, eVisibility ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetItemTags", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetItemTags( IntPtr self, UGCUpdateHandle_t updateHandle, ref SteamParamStringArray_t pTags ); + + #endregion + internal bool SetItemTags( UGCUpdateHandle_t updateHandle, ref SteamParamStringArray_t pTags ) + { + var returnValue = _SetItemTags( Self, updateHandle, ref pTags ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetItemContent", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetItemContent( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszContentFolder ); + + #endregion + internal bool SetItemContent( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszContentFolder ) + { + var returnValue = _SetItemContent( Self, handle, pszContentFolder ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetItemPreview", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetItemPreview( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszPreviewFile ); + + #endregion + internal bool SetItemPreview( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszPreviewFile ) + { + var returnValue = _SetItemPreview( Self, handle, pszPreviewFile ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetAllowLegacyUpload", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetAllowLegacyUpload( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bAllowLegacyUpload ); + + #endregion + internal bool SetAllowLegacyUpload( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bAllowLegacyUpload ) + { + var returnValue = _SetAllowLegacyUpload( Self, handle, bAllowLegacyUpload ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_RemoveAllItemKeyValueTags", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _RemoveAllItemKeyValueTags( IntPtr self, UGCUpdateHandle_t handle ); + + #endregion + internal bool RemoveAllItemKeyValueTags( UGCUpdateHandle_t handle ) + { + var returnValue = _RemoveAllItemKeyValueTags( Self, handle ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_RemoveItemKeyValueTags", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _RemoveItemKeyValueTags( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); + + #endregion + internal bool RemoveItemKeyValueTags( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) + { + var returnValue = _RemoveItemKeyValueTags( Self, handle, pchKey ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_AddItemKeyValueTag", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _AddItemKeyValueTag( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ); + + #endregion + internal bool AddItemKeyValueTag( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ) + { + var returnValue = _AddItemKeyValueTag( Self, handle, pchKey, pchValue ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_AddItemPreviewFile", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _AddItemPreviewFile( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszPreviewFile, ItemPreviewType type ); + + #endregion + internal bool AddItemPreviewFile( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszPreviewFile, ItemPreviewType type ) + { + var returnValue = _AddItemPreviewFile( Self, handle, pszPreviewFile, type ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_AddItemPreviewVideo", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _AddItemPreviewVideo( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszVideoID ); + + #endregion + internal bool AddItemPreviewVideo( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszVideoID ) + { + var returnValue = _AddItemPreviewVideo( Self, handle, pszVideoID ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_UpdateItemPreviewFile", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _UpdateItemPreviewFile( IntPtr self, UGCUpdateHandle_t handle, uint index, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszPreviewFile ); + + #endregion + internal bool UpdateItemPreviewFile( UGCUpdateHandle_t handle, uint index, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszPreviewFile ) + { + var returnValue = _UpdateItemPreviewFile( Self, handle, index, pszPreviewFile ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_UpdateItemPreviewVideo", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _UpdateItemPreviewVideo( IntPtr self, UGCUpdateHandle_t handle, uint index, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszVideoID ); + + #endregion + internal bool UpdateItemPreviewVideo( UGCUpdateHandle_t handle, uint index, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszVideoID ) + { + var returnValue = _UpdateItemPreviewVideo( Self, handle, index, pszVideoID ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_RemoveItemPreview", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _RemoveItemPreview( IntPtr self, UGCUpdateHandle_t handle, uint index ); + + #endregion + internal bool RemoveItemPreview( UGCUpdateHandle_t handle, uint index ) + { + var returnValue = _RemoveItemPreview( Self, handle, index ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SubmitItemUpdate", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _SubmitItemUpdate( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchChangeNote ); + + #endregion + internal CallResult SubmitItemUpdate( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchChangeNote ) + { + var returnValue = _SubmitItemUpdate( Self, handle, pchChangeNote ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetItemUpdateProgress", CallingConvention = Platform.CC)] + private static extern ItemUpdateStatus _GetItemUpdateProgress( IntPtr self, UGCUpdateHandle_t handle, ref ulong punBytesProcessed, ref ulong punBytesTotal ); + + #endregion + internal ItemUpdateStatus GetItemUpdateProgress( UGCUpdateHandle_t handle, ref ulong punBytesProcessed, ref ulong punBytesTotal ) + { + var returnValue = _GetItemUpdateProgress( Self, handle, ref punBytesProcessed, ref punBytesTotal ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SetUserItemVote", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _SetUserItemVote( IntPtr self, PublishedFileId nPublishedFileID, [MarshalAs( UnmanagedType.U1 )] bool bVoteUp ); + + #endregion + internal CallResult SetUserItemVote( PublishedFileId nPublishedFileID, [MarshalAs( UnmanagedType.U1 )] bool bVoteUp ) + { + var returnValue = _SetUserItemVote( Self, nPublishedFileID, bVoteUp ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetUserItemVote", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _GetUserItemVote( IntPtr self, PublishedFileId nPublishedFileID ); + + #endregion + internal CallResult GetUserItemVote( PublishedFileId nPublishedFileID ) + { + var returnValue = _GetUserItemVote( Self, nPublishedFileID ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_AddItemToFavorites", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _AddItemToFavorites( IntPtr self, AppId nAppId, PublishedFileId nPublishedFileID ); + + #endregion + internal CallResult AddItemToFavorites( AppId nAppId, PublishedFileId nPublishedFileID ) + { + var returnValue = _AddItemToFavorites( Self, nAppId, nPublishedFileID ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_RemoveItemFromFavorites", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _RemoveItemFromFavorites( IntPtr self, AppId nAppId, PublishedFileId nPublishedFileID ); + + #endregion + internal CallResult RemoveItemFromFavorites( AppId nAppId, PublishedFileId nPublishedFileID ) + { + var returnValue = _RemoveItemFromFavorites( Self, nAppId, nPublishedFileID ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SubscribeItem", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _SubscribeItem( IntPtr self, PublishedFileId nPublishedFileID ); + + #endregion + internal CallResult SubscribeItem( PublishedFileId nPublishedFileID ) + { + var returnValue = _SubscribeItem( Self, nPublishedFileID ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_UnsubscribeItem", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _UnsubscribeItem( IntPtr self, PublishedFileId nPublishedFileID ); + + #endregion + internal CallResult UnsubscribeItem( PublishedFileId nPublishedFileID ) + { + var returnValue = _UnsubscribeItem( Self, nPublishedFileID ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetNumSubscribedItems", CallingConvention = Platform.CC)] + private static extern uint _GetNumSubscribedItems( IntPtr self ); + + #endregion + internal uint GetNumSubscribedItems() + { + var returnValue = _GetNumSubscribedItems( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetSubscribedItems", CallingConvention = Platform.CC)] + private static extern uint _GetSubscribedItems( IntPtr self, [In,Out] PublishedFileId[] pvecPublishedFileID, uint cMaxEntries ); + + #endregion + internal uint GetSubscribedItems( [In,Out] PublishedFileId[] pvecPublishedFileID, uint cMaxEntries ) + { + var returnValue = _GetSubscribedItems( Self, pvecPublishedFileID, cMaxEntries ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetItemState", CallingConvention = Platform.CC)] + private static extern uint _GetItemState( IntPtr self, PublishedFileId nPublishedFileID ); + + #endregion + internal uint GetItemState( PublishedFileId nPublishedFileID ) + { + var returnValue = _GetItemState( Self, nPublishedFileID ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetItemInstallInfo", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetItemInstallInfo( IntPtr self, PublishedFileId nPublishedFileID, ref ulong punSizeOnDisk, IntPtr pchFolder, uint cchFolderSize, ref uint punTimeStamp ); + + #endregion + internal bool GetItemInstallInfo( PublishedFileId nPublishedFileID, ref ulong punSizeOnDisk, out string pchFolder, ref uint punTimeStamp ) + { + IntPtr mempchFolder = Helpers.TakeMemory(); + var returnValue = _GetItemInstallInfo( Self, nPublishedFileID, ref punSizeOnDisk, mempchFolder, (1024 * 32), ref punTimeStamp ); + pchFolder = Helpers.MemoryToString( mempchFolder ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetItemDownloadInfo", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetItemDownloadInfo( IntPtr self, PublishedFileId nPublishedFileID, ref ulong punBytesDownloaded, ref ulong punBytesTotal ); + + #endregion + internal bool GetItemDownloadInfo( PublishedFileId nPublishedFileID, ref ulong punBytesDownloaded, ref ulong punBytesTotal ) + { + var returnValue = _GetItemDownloadInfo( Self, nPublishedFileID, ref punBytesDownloaded, ref punBytesTotal ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_DownloadItem", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _DownloadItem( IntPtr self, PublishedFileId nPublishedFileID, [MarshalAs( UnmanagedType.U1 )] bool bHighPriority ); + + #endregion + internal bool DownloadItem( PublishedFileId nPublishedFileID, [MarshalAs( UnmanagedType.U1 )] bool bHighPriority ) + { + var returnValue = _DownloadItem( Self, nPublishedFileID, bHighPriority ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_BInitWorkshopForGameServer", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BInitWorkshopForGameServer( IntPtr self, DepotId_t unWorkshopDepotID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszFolder ); + + #endregion + internal bool BInitWorkshopForGameServer( DepotId_t unWorkshopDepotID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszFolder ) + { + var returnValue = _BInitWorkshopForGameServer( Self, unWorkshopDepotID, pszFolder ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_SuspendDownloads", CallingConvention = Platform.CC)] + private static extern void _SuspendDownloads( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bSuspend ); + + #endregion + internal void SuspendDownloads( [MarshalAs( UnmanagedType.U1 )] bool bSuspend ) + { + _SuspendDownloads( Self, bSuspend ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_StartPlaytimeTracking", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _StartPlaytimeTracking( IntPtr self, [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ); + + #endregion + internal CallResult StartPlaytimeTracking( [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ) + { + var returnValue = _StartPlaytimeTracking( Self, pvecPublishedFileID, unNumPublishedFileIDs ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_StopPlaytimeTracking", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _StopPlaytimeTracking( IntPtr self, [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ); + + #endregion + internal CallResult StopPlaytimeTracking( [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ) + { + var returnValue = _StopPlaytimeTracking( Self, pvecPublishedFileID, unNumPublishedFileIDs ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_StopPlaytimeTrackingForAllItems", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _StopPlaytimeTrackingForAllItems( IntPtr self ); + + #endregion + internal CallResult StopPlaytimeTrackingForAllItems() + { + var returnValue = _StopPlaytimeTrackingForAllItems( Self ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_AddDependency", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _AddDependency( IntPtr self, PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID ); + + #endregion + internal CallResult AddDependency( PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID ) + { + var returnValue = _AddDependency( Self, nParentPublishedFileID, nChildPublishedFileID ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_RemoveDependency", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _RemoveDependency( IntPtr self, PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID ); + + #endregion + internal CallResult RemoveDependency( PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID ) + { + var returnValue = _RemoveDependency( Self, nParentPublishedFileID, nChildPublishedFileID ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_AddAppDependency", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _AddAppDependency( IntPtr self, PublishedFileId nPublishedFileID, AppId nAppID ); + + #endregion + internal CallResult AddAppDependency( PublishedFileId nPublishedFileID, AppId nAppID ) + { + var returnValue = _AddAppDependency( Self, nPublishedFileID, nAppID ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_RemoveAppDependency", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _RemoveAppDependency( IntPtr self, PublishedFileId nPublishedFileID, AppId nAppID ); + + #endregion + internal CallResult RemoveAppDependency( PublishedFileId nPublishedFileID, AppId nAppID ) + { + var returnValue = _RemoveAppDependency( Self, nPublishedFileID, nAppID ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_GetAppDependencies", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _GetAppDependencies( IntPtr self, PublishedFileId nPublishedFileID ); + + #endregion + internal CallResult GetAppDependencies( PublishedFileId nPublishedFileID ) + { + var returnValue = _GetAppDependencies( Self, nPublishedFileID ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUGC_DeleteItem", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _DeleteItem( IntPtr self, PublishedFileId nPublishedFileID ); + + #endregion + internal CallResult DeleteItem( PublishedFileId nPublishedFileID ) + { + var returnValue = _DeleteItem( Self, nPublishedFileID ); + return new CallResult( returnValue, IsServer ); + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamUser.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamUser.cs new file mode 100644 index 0000000..68bc1ce --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamUser.cs @@ -0,0 +1,368 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamUser : SteamInterface + { + + internal ISteamUser( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamUser_v020", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamUser_v020(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamUser_v020(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetHSteamUser", CallingConvention = Platform.CC)] + private static extern HSteamUser _GetHSteamUser( IntPtr self ); + + #endregion + internal HSteamUser GetHSteamUser() + { + var returnValue = _GetHSteamUser( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_BLoggedOn", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BLoggedOn( IntPtr self ); + + #endregion + internal bool BLoggedOn() + { + var returnValue = _BLoggedOn( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetSteamID", CallingConvention = Platform.CC)] + private static extern SteamId _GetSteamID( IntPtr self ); + + #endregion + internal SteamId GetSteamID() + { + var returnValue = _GetSteamID( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_InitiateGameConnection", CallingConvention = Platform.CC)] + private static extern int _InitiateGameConnection( IntPtr self, IntPtr pAuthBlob, int cbMaxAuthBlob, SteamId steamIDGameServer, uint unIPServer, ushort usPortServer, [MarshalAs( UnmanagedType.U1 )] bool bSecure ); + + #endregion + internal int InitiateGameConnection( IntPtr pAuthBlob, int cbMaxAuthBlob, SteamId steamIDGameServer, uint unIPServer, ushort usPortServer, [MarshalAs( UnmanagedType.U1 )] bool bSecure ) + { + var returnValue = _InitiateGameConnection( Self, pAuthBlob, cbMaxAuthBlob, steamIDGameServer, unIPServer, usPortServer, bSecure ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_TerminateGameConnection", CallingConvention = Platform.CC)] + private static extern void _TerminateGameConnection( IntPtr self, uint unIPServer, ushort usPortServer ); + + #endregion + internal void TerminateGameConnection( uint unIPServer, ushort usPortServer ) + { + _TerminateGameConnection( Self, unIPServer, usPortServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_TrackAppUsageEvent", CallingConvention = Platform.CC)] + private static extern void _TrackAppUsageEvent( IntPtr self, GameId gameID, int eAppUsageEvent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchExtraInfo ); + + #endregion + internal void TrackAppUsageEvent( GameId gameID, int eAppUsageEvent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchExtraInfo ) + { + _TrackAppUsageEvent( Self, gameID, eAppUsageEvent, pchExtraInfo ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetUserDataFolder", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetUserDataFolder( IntPtr self, IntPtr pchBuffer, int cubBuffer ); + + #endregion + internal bool GetUserDataFolder( out string pchBuffer ) + { + IntPtr mempchBuffer = Helpers.TakeMemory(); + var returnValue = _GetUserDataFolder( Self, mempchBuffer, (1024 * 32) ); + pchBuffer = Helpers.MemoryToString( mempchBuffer ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_StartVoiceRecording", CallingConvention = Platform.CC)] + private static extern void _StartVoiceRecording( IntPtr self ); + + #endregion + internal void StartVoiceRecording() + { + _StartVoiceRecording( Self ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_StopVoiceRecording", CallingConvention = Platform.CC)] + private static extern void _StopVoiceRecording( IntPtr self ); + + #endregion + internal void StopVoiceRecording() + { + _StopVoiceRecording( Self ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetAvailableVoice", CallingConvention = Platform.CC)] + private static extern VoiceResult _GetAvailableVoice( IntPtr self, ref uint pcbCompressed, ref uint pcbUncompressed_Deprecated, uint nUncompressedVoiceDesiredSampleRate_Deprecated ); + + #endregion + internal VoiceResult GetAvailableVoice( ref uint pcbCompressed, ref uint pcbUncompressed_Deprecated, uint nUncompressedVoiceDesiredSampleRate_Deprecated ) + { + var returnValue = _GetAvailableVoice( Self, ref pcbCompressed, ref pcbUncompressed_Deprecated, nUncompressedVoiceDesiredSampleRate_Deprecated ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetVoice", CallingConvention = Platform.CC)] + private static extern VoiceResult _GetVoice( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bWantCompressed, IntPtr pDestBuffer, uint cbDestBufferSize, ref uint nBytesWritten, [MarshalAs( UnmanagedType.U1 )] bool bWantUncompressed_Deprecated, IntPtr pUncompressedDestBuffer_Deprecated, uint cbUncompressedDestBufferSize_Deprecated, ref uint nUncompressBytesWritten_Deprecated, uint nUncompressedVoiceDesiredSampleRate_Deprecated ); + + #endregion + internal VoiceResult GetVoice( [MarshalAs( UnmanagedType.U1 )] bool bWantCompressed, IntPtr pDestBuffer, uint cbDestBufferSize, ref uint nBytesWritten, [MarshalAs( UnmanagedType.U1 )] bool bWantUncompressed_Deprecated, IntPtr pUncompressedDestBuffer_Deprecated, uint cbUncompressedDestBufferSize_Deprecated, ref uint nUncompressBytesWritten_Deprecated, uint nUncompressedVoiceDesiredSampleRate_Deprecated ) + { + var returnValue = _GetVoice( Self, bWantCompressed, pDestBuffer, cbDestBufferSize, ref nBytesWritten, bWantUncompressed_Deprecated, pUncompressedDestBuffer_Deprecated, cbUncompressedDestBufferSize_Deprecated, ref nUncompressBytesWritten_Deprecated, nUncompressedVoiceDesiredSampleRate_Deprecated ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_DecompressVoice", CallingConvention = Platform.CC)] + private static extern VoiceResult _DecompressVoice( IntPtr self, IntPtr pCompressed, uint cbCompressed, IntPtr pDestBuffer, uint cbDestBufferSize, ref uint nBytesWritten, uint nDesiredSampleRate ); + + #endregion + internal VoiceResult DecompressVoice( IntPtr pCompressed, uint cbCompressed, IntPtr pDestBuffer, uint cbDestBufferSize, ref uint nBytesWritten, uint nDesiredSampleRate ) + { + var returnValue = _DecompressVoice( Self, pCompressed, cbCompressed, pDestBuffer, cbDestBufferSize, ref nBytesWritten, nDesiredSampleRate ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetVoiceOptimalSampleRate", CallingConvention = Platform.CC)] + private static extern uint _GetVoiceOptimalSampleRate( IntPtr self ); + + #endregion + internal uint GetVoiceOptimalSampleRate() + { + var returnValue = _GetVoiceOptimalSampleRate( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetAuthSessionTicket", CallingConvention = Platform.CC)] + private static extern HAuthTicket _GetAuthSessionTicket( IntPtr self, IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket ); + + #endregion + internal HAuthTicket GetAuthSessionTicket( IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket ) + { + var returnValue = _GetAuthSessionTicket( Self, pTicket, cbMaxTicket, ref pcbTicket ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_BeginAuthSession", CallingConvention = Platform.CC)] + private static extern BeginAuthResult _BeginAuthSession( IntPtr self, IntPtr pAuthTicket, int cbAuthTicket, SteamId steamID ); + + #endregion + internal BeginAuthResult BeginAuthSession( IntPtr pAuthTicket, int cbAuthTicket, SteamId steamID ) + { + var returnValue = _BeginAuthSession( Self, pAuthTicket, cbAuthTicket, steamID ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_EndAuthSession", CallingConvention = Platform.CC)] + private static extern void _EndAuthSession( IntPtr self, SteamId steamID ); + + #endregion + internal void EndAuthSession( SteamId steamID ) + { + _EndAuthSession( Self, steamID ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_CancelAuthTicket", CallingConvention = Platform.CC)] + private static extern void _CancelAuthTicket( IntPtr self, HAuthTicket hAuthTicket ); + + #endregion + internal void CancelAuthTicket( HAuthTicket hAuthTicket ) + { + _CancelAuthTicket( Self, hAuthTicket ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_UserHasLicenseForApp", CallingConvention = Platform.CC)] + private static extern UserHasLicenseForAppResult _UserHasLicenseForApp( IntPtr self, SteamId steamID, AppId appID ); + + #endregion + internal UserHasLicenseForAppResult UserHasLicenseForApp( SteamId steamID, AppId appID ) + { + var returnValue = _UserHasLicenseForApp( Self, steamID, appID ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_BIsBehindNAT", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BIsBehindNAT( IntPtr self ); + + #endregion + internal bool BIsBehindNAT() + { + var returnValue = _BIsBehindNAT( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_AdvertiseGame", CallingConvention = Platform.CC)] + private static extern void _AdvertiseGame( IntPtr self, SteamId steamIDGameServer, uint unIPServer, ushort usPortServer ); + + #endregion + internal void AdvertiseGame( SteamId steamIDGameServer, uint unIPServer, ushort usPortServer ) + { + _AdvertiseGame( Self, steamIDGameServer, unIPServer, usPortServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_RequestEncryptedAppTicket", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _RequestEncryptedAppTicket( IntPtr self, IntPtr pDataToInclude, int cbDataToInclude ); + + #endregion + internal CallResult RequestEncryptedAppTicket( IntPtr pDataToInclude, int cbDataToInclude ) + { + var returnValue = _RequestEncryptedAppTicket( Self, pDataToInclude, cbDataToInclude ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetEncryptedAppTicket", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetEncryptedAppTicket( IntPtr self, IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket ); + + #endregion + internal bool GetEncryptedAppTicket( IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket ) + { + var returnValue = _GetEncryptedAppTicket( Self, pTicket, cbMaxTicket, ref pcbTicket ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetGameBadgeLevel", CallingConvention = Platform.CC)] + private static extern int _GetGameBadgeLevel( IntPtr self, int nSeries, [MarshalAs( UnmanagedType.U1 )] bool bFoil ); + + #endregion + internal int GetGameBadgeLevel( int nSeries, [MarshalAs( UnmanagedType.U1 )] bool bFoil ) + { + var returnValue = _GetGameBadgeLevel( Self, nSeries, bFoil ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetPlayerSteamLevel", CallingConvention = Platform.CC)] + private static extern int _GetPlayerSteamLevel( IntPtr self ); + + #endregion + internal int GetPlayerSteamLevel() + { + var returnValue = _GetPlayerSteamLevel( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_RequestStoreAuthURL", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _RequestStoreAuthURL( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchRedirectURL ); + + #endregion + internal CallResult RequestStoreAuthURL( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchRedirectURL ) + { + var returnValue = _RequestStoreAuthURL( Self, pchRedirectURL ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_BIsPhoneVerified", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BIsPhoneVerified( IntPtr self ); + + #endregion + internal bool BIsPhoneVerified() + { + var returnValue = _BIsPhoneVerified( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_BIsTwoFactorEnabled", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BIsTwoFactorEnabled( IntPtr self ); + + #endregion + internal bool BIsTwoFactorEnabled() + { + var returnValue = _BIsTwoFactorEnabled( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_BIsPhoneIdentifying", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BIsPhoneIdentifying( IntPtr self ); + + #endregion + internal bool BIsPhoneIdentifying() + { + var returnValue = _BIsPhoneIdentifying( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_BIsPhoneRequiringVerification", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BIsPhoneRequiringVerification( IntPtr self ); + + #endregion + internal bool BIsPhoneRequiringVerification() + { + var returnValue = _BIsPhoneRequiringVerification( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetMarketEligibility", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _GetMarketEligibility( IntPtr self ); + + #endregion + internal CallResult GetMarketEligibility() + { + var returnValue = _GetMarketEligibility( Self ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUser_GetDurationControl", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _GetDurationControl( IntPtr self ); + + #endregion + internal CallResult GetDurationControl() + { + var returnValue = _GetDurationControl( Self ); + return new CallResult( returnValue, IsServer ); + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamUserStats.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamUserStats.cs new file mode 100644 index 0000000..36d4583 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamUserStats.cs @@ -0,0 +1,525 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamUserStats : SteamInterface + { + + internal ISteamUserStats( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamUserStats_v011", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamUserStats_v011(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamUserStats_v011(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_RequestCurrentStats", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _RequestCurrentStats( IntPtr self ); + + #endregion + internal bool RequestCurrentStats() + { + var returnValue = _RequestCurrentStats( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetStatInt32", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetStat( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ); + + #endregion + internal bool GetStat( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ) + { + var returnValue = _GetStat( Self, pchName, ref pData ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetStatFloat", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetStat( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ); + + #endregion + internal bool GetStat( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ) + { + var returnValue = _GetStat( Self, pchName, ref pData ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_SetStatInt32", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetStat( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, int nData ); + + #endregion + internal bool SetStat( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, int nData ) + { + var returnValue = _SetStat( Self, pchName, nData ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_SetStatFloat", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetStat( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float fData ); + + #endregion + internal bool SetStat( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float fData ) + { + var returnValue = _SetStat( Self, pchName, fData ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_UpdateAvgRateStat", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _UpdateAvgRateStat( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float flCountThisSession, double dSessionLength ); + + #endregion + internal bool UpdateAvgRateStat( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float flCountThisSession, double dSessionLength ) + { + var returnValue = _UpdateAvgRateStat( Self, pchName, flCountThisSession, dSessionLength ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetAchievement", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetAchievement( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ); + + #endregion + internal bool GetAchievement( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ) + { + var returnValue = _GetAchievement( Self, pchName, ref pbAchieved ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_SetAchievement", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _SetAchievement( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ); + + #endregion + internal bool SetAchievement( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ) + { + var returnValue = _SetAchievement( Self, pchName ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_ClearAchievement", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _ClearAchievement( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ); + + #endregion + internal bool ClearAchievement( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ) + { + var returnValue = _ClearAchievement( Self, pchName ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetAchievementAndUnlockTime", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetAchievementAndUnlockTime( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved, ref uint punUnlockTime ); + + #endregion + internal bool GetAchievementAndUnlockTime( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved, ref uint punUnlockTime ) + { + var returnValue = _GetAchievementAndUnlockTime( Self, pchName, ref pbAchieved, ref punUnlockTime ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_StoreStats", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _StoreStats( IntPtr self ); + + #endregion + internal bool StoreStats() + { + var returnValue = _StoreStats( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetAchievementIcon", CallingConvention = Platform.CC)] + private static extern int _GetAchievementIcon( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ); + + #endregion + internal int GetAchievementIcon( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ) + { + var returnValue = _GetAchievementIcon( Self, pchName ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetAchievementDisplayAttribute", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetAchievementDisplayAttribute( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); + + #endregion + internal string GetAchievementDisplayAttribute( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) + { + var returnValue = _GetAchievementDisplayAttribute( Self, pchName, pchKey ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_IndicateAchievementProgress", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _IndicateAchievementProgress( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, uint nCurProgress, uint nMaxProgress ); + + #endregion + internal bool IndicateAchievementProgress( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, uint nCurProgress, uint nMaxProgress ) + { + var returnValue = _IndicateAchievementProgress( Self, pchName, nCurProgress, nMaxProgress ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetNumAchievements", CallingConvention = Platform.CC)] + private static extern uint _GetNumAchievements( IntPtr self ); + + #endregion + internal uint GetNumAchievements() + { + var returnValue = _GetNumAchievements( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetAchievementName", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetAchievementName( IntPtr self, uint iAchievement ); + + #endregion + internal string GetAchievementName( uint iAchievement ) + { + var returnValue = _GetAchievementName( Self, iAchievement ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_RequestUserStats", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _RequestUserStats( IntPtr self, SteamId steamIDUser ); + + #endregion + internal CallResult RequestUserStats( SteamId steamIDUser ) + { + var returnValue = _RequestUserStats( Self, steamIDUser ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetUserStatInt32", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetUserStat( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ); + + #endregion + internal bool GetUserStat( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ) + { + var returnValue = _GetUserStat( Self, steamIDUser, pchName, ref pData ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetUserStatFloat", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetUserStat( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ); + + #endregion + internal bool GetUserStat( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ) + { + var returnValue = _GetUserStat( Self, steamIDUser, pchName, ref pData ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetUserAchievement", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetUserAchievement( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ); + + #endregion + internal bool GetUserAchievement( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ) + { + var returnValue = _GetUserAchievement( Self, steamIDUser, pchName, ref pbAchieved ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetUserAchievementAndUnlockTime", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetUserAchievementAndUnlockTime( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved, ref uint punUnlockTime ); + + #endregion + internal bool GetUserAchievementAndUnlockTime( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved, ref uint punUnlockTime ) + { + var returnValue = _GetUserAchievementAndUnlockTime( Self, steamIDUser, pchName, ref pbAchieved, ref punUnlockTime ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_ResetAllStats", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _ResetAllStats( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bAchievementsToo ); + + #endregion + internal bool ResetAllStats( [MarshalAs( UnmanagedType.U1 )] bool bAchievementsToo ) + { + var returnValue = _ResetAllStats( Self, bAchievementsToo ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_FindOrCreateLeaderboard", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _FindOrCreateLeaderboard( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName, LeaderboardSort eLeaderboardSortMethod, LeaderboardDisplay eLeaderboardDisplayType ); + + #endregion + internal CallResult FindOrCreateLeaderboard( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName, LeaderboardSort eLeaderboardSortMethod, LeaderboardDisplay eLeaderboardDisplayType ) + { + var returnValue = _FindOrCreateLeaderboard( Self, pchLeaderboardName, eLeaderboardSortMethod, eLeaderboardDisplayType ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_FindLeaderboard", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _FindLeaderboard( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName ); + + #endregion + internal CallResult FindLeaderboard( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName ) + { + var returnValue = _FindLeaderboard( Self, pchLeaderboardName ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetLeaderboardName", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetLeaderboardName( IntPtr self, SteamLeaderboard_t hSteamLeaderboard ); + + #endregion + internal string GetLeaderboardName( SteamLeaderboard_t hSteamLeaderboard ) + { + var returnValue = _GetLeaderboardName( Self, hSteamLeaderboard ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetLeaderboardEntryCount", CallingConvention = Platform.CC)] + private static extern int _GetLeaderboardEntryCount( IntPtr self, SteamLeaderboard_t hSteamLeaderboard ); + + #endregion + internal int GetLeaderboardEntryCount( SteamLeaderboard_t hSteamLeaderboard ) + { + var returnValue = _GetLeaderboardEntryCount( Self, hSteamLeaderboard ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetLeaderboardSortMethod", CallingConvention = Platform.CC)] + private static extern LeaderboardSort _GetLeaderboardSortMethod( IntPtr self, SteamLeaderboard_t hSteamLeaderboard ); + + #endregion + internal LeaderboardSort GetLeaderboardSortMethod( SteamLeaderboard_t hSteamLeaderboard ) + { + var returnValue = _GetLeaderboardSortMethod( Self, hSteamLeaderboard ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetLeaderboardDisplayType", CallingConvention = Platform.CC)] + private static extern LeaderboardDisplay _GetLeaderboardDisplayType( IntPtr self, SteamLeaderboard_t hSteamLeaderboard ); + + #endregion + internal LeaderboardDisplay GetLeaderboardDisplayType( SteamLeaderboard_t hSteamLeaderboard ) + { + var returnValue = _GetLeaderboardDisplayType( Self, hSteamLeaderboard ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_DownloadLeaderboardEntries", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _DownloadLeaderboardEntries( IntPtr self, SteamLeaderboard_t hSteamLeaderboard, LeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd ); + + #endregion + internal CallResult DownloadLeaderboardEntries( SteamLeaderboard_t hSteamLeaderboard, LeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd ) + { + var returnValue = _DownloadLeaderboardEntries( Self, hSteamLeaderboard, eLeaderboardDataRequest, nRangeStart, nRangeEnd ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_DownloadLeaderboardEntriesForUsers", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _DownloadLeaderboardEntriesForUsers( IntPtr self, SteamLeaderboard_t hSteamLeaderboard, [In,Out] SteamId[] prgUsers, int cUsers ); + + #endregion + /// + /// Downloads leaderboard entries for an arbitrary set of users - ELeaderboardDataRequest is k_ELeaderboardDataRequestUsers + /// + internal CallResult DownloadLeaderboardEntriesForUsers( SteamLeaderboard_t hSteamLeaderboard, [In,Out] SteamId[] prgUsers, int cUsers ) + { + var returnValue = _DownloadLeaderboardEntriesForUsers( Self, hSteamLeaderboard, prgUsers, cUsers ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetDownloadedLeaderboardEntry", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetDownloadedLeaderboardEntry( IntPtr self, SteamLeaderboardEntries_t hSteamLeaderboardEntries, int index, ref LeaderboardEntry_t pLeaderboardEntry, [In,Out] int[] pDetails, int cDetailsMax ); + + #endregion + internal bool GetDownloadedLeaderboardEntry( SteamLeaderboardEntries_t hSteamLeaderboardEntries, int index, ref LeaderboardEntry_t pLeaderboardEntry, [In,Out] int[] pDetails, int cDetailsMax ) + { + var returnValue = _GetDownloadedLeaderboardEntry( Self, hSteamLeaderboardEntries, index, ref pLeaderboardEntry, pDetails, cDetailsMax ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_UploadLeaderboardScore", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _UploadLeaderboardScore( IntPtr self, SteamLeaderboard_t hSteamLeaderboard, LeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int nScore, [In,Out] int[] pScoreDetails, int cScoreDetailsCount ); + + #endregion + internal CallResult UploadLeaderboardScore( SteamLeaderboard_t hSteamLeaderboard, LeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int nScore, [In,Out] int[] pScoreDetails, int cScoreDetailsCount ) + { + var returnValue = _UploadLeaderboardScore( Self, hSteamLeaderboard, eLeaderboardUploadScoreMethod, nScore, pScoreDetails, cScoreDetailsCount ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_AttachLeaderboardUGC", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _AttachLeaderboardUGC( IntPtr self, SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC ); + + #endregion + internal CallResult AttachLeaderboardUGC( SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC ) + { + var returnValue = _AttachLeaderboardUGC( Self, hSteamLeaderboard, hUGC ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetNumberOfCurrentPlayers", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _GetNumberOfCurrentPlayers( IntPtr self ); + + #endregion + internal CallResult GetNumberOfCurrentPlayers() + { + var returnValue = _GetNumberOfCurrentPlayers( Self ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_RequestGlobalAchievementPercentages", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _RequestGlobalAchievementPercentages( IntPtr self ); + + #endregion + internal CallResult RequestGlobalAchievementPercentages() + { + var returnValue = _RequestGlobalAchievementPercentages( Self ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetMostAchievedAchievementInfo", CallingConvention = Platform.CC)] + private static extern int _GetMostAchievedAchievementInfo( IntPtr self, IntPtr pchName, uint unNameBufLen, ref float pflPercent, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ); + + #endregion + internal int GetMostAchievedAchievementInfo( out string pchName, ref float pflPercent, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ) + { + IntPtr mempchName = Helpers.TakeMemory(); + var returnValue = _GetMostAchievedAchievementInfo( Self, mempchName, (1024 * 32), ref pflPercent, ref pbAchieved ); + pchName = Helpers.MemoryToString( mempchName ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetNextMostAchievedAchievementInfo", CallingConvention = Platform.CC)] + private static extern int _GetNextMostAchievedAchievementInfo( IntPtr self, int iIteratorPrevious, IntPtr pchName, uint unNameBufLen, ref float pflPercent, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ); + + #endregion + internal int GetNextMostAchievedAchievementInfo( int iIteratorPrevious, out string pchName, ref float pflPercent, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ) + { + IntPtr mempchName = Helpers.TakeMemory(); + var returnValue = _GetNextMostAchievedAchievementInfo( Self, iIteratorPrevious, mempchName, (1024 * 32), ref pflPercent, ref pbAchieved ); + pchName = Helpers.MemoryToString( mempchName ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetAchievementAchievedPercent", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetAchievementAchievedPercent( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pflPercent ); + + #endregion + internal bool GetAchievementAchievedPercent( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pflPercent ) + { + var returnValue = _GetAchievementAchievedPercent( Self, pchName, ref pflPercent ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_RequestGlobalStats", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _RequestGlobalStats( IntPtr self, int nHistoryDays ); + + #endregion + internal CallResult RequestGlobalStats( int nHistoryDays ) + { + var returnValue = _RequestGlobalStats( Self, nHistoryDays ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetGlobalStatInt64", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetGlobalStat( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, ref long pData ); + + #endregion + internal bool GetGlobalStat( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, ref long pData ) + { + var returnValue = _GetGlobalStat( Self, pchStatName, ref pData ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetGlobalStatDouble", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetGlobalStat( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, ref double pData ); + + #endregion + internal bool GetGlobalStat( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, ref double pData ) + { + var returnValue = _GetGlobalStat( Self, pchStatName, ref pData ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetGlobalStatHistoryInt64", CallingConvention = Platform.CC)] + private static extern int _GetGlobalStatHistory( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, [In,Out] long[] pData, uint cubData ); + + #endregion + internal int GetGlobalStatHistory( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, [In,Out] long[] pData, uint cubData ) + { + var returnValue = _GetGlobalStatHistory( Self, pchStatName, pData, cubData ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUserStats_GetGlobalStatHistoryDouble", CallingConvention = Platform.CC)] + private static extern int _GetGlobalStatHistory( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, [In,Out] double[] pData, uint cubData ); + + #endregion + internal int GetGlobalStatHistory( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, [In,Out] double[] pData, uint cubData ) + { + var returnValue = _GetGlobalStatHistory( Self, pchStatName, pData, cubData ); + return returnValue; + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamUtils.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamUtils.cs new file mode 100644 index 0000000..47c1231 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamUtils.cs @@ -0,0 +1,403 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamUtils : SteamInterface + { + + internal ISteamUtils( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamUtils_v009", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamUtils_v009(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamUtils_v009(); + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamGameServerUtils_v009", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamGameServerUtils_v009(); + public override IntPtr GetServerInterfacePointer() => SteamAPI_SteamGameServerUtils_v009(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetSecondsSinceAppActive", CallingConvention = Platform.CC)] + private static extern uint _GetSecondsSinceAppActive( IntPtr self ); + + #endregion + internal uint GetSecondsSinceAppActive() + { + var returnValue = _GetSecondsSinceAppActive( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetSecondsSinceComputerActive", CallingConvention = Platform.CC)] + private static extern uint _GetSecondsSinceComputerActive( IntPtr self ); + + #endregion + internal uint GetSecondsSinceComputerActive() + { + var returnValue = _GetSecondsSinceComputerActive( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetConnectedUniverse", CallingConvention = Platform.CC)] + private static extern Universe _GetConnectedUniverse( IntPtr self ); + + #endregion + internal Universe GetConnectedUniverse() + { + var returnValue = _GetConnectedUniverse( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetServerRealTime", CallingConvention = Platform.CC)] + private static extern uint _GetServerRealTime( IntPtr self ); + + #endregion + internal uint GetServerRealTime() + { + var returnValue = _GetServerRealTime( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetIPCountry", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetIPCountry( IntPtr self ); + + #endregion + internal string GetIPCountry() + { + var returnValue = _GetIPCountry( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetImageSize", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetImageSize( IntPtr self, int iImage, ref uint pnWidth, ref uint pnHeight ); + + #endregion + internal bool GetImageSize( int iImage, ref uint pnWidth, ref uint pnHeight ) + { + var returnValue = _GetImageSize( Self, iImage, ref pnWidth, ref pnHeight ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetImageRGBA", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetImageRGBA( IntPtr self, int iImage, [In,Out] byte[] pubDest, int nDestBufferSize ); + + #endregion + internal bool GetImageRGBA( int iImage, [In,Out] byte[] pubDest, int nDestBufferSize ) + { + var returnValue = _GetImageRGBA( Self, iImage, pubDest, nDestBufferSize ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetCSERIPPort", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetCSERIPPort( IntPtr self, ref uint unIP, ref ushort usPort ); + + #endregion + internal bool GetCSERIPPort( ref uint unIP, ref ushort usPort ) + { + var returnValue = _GetCSERIPPort( Self, ref unIP, ref usPort ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetCurrentBatteryPower", CallingConvention = Platform.CC)] + private static extern byte _GetCurrentBatteryPower( IntPtr self ); + + #endregion + internal byte GetCurrentBatteryPower() + { + var returnValue = _GetCurrentBatteryPower( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetAppID", CallingConvention = Platform.CC)] + private static extern uint _GetAppID( IntPtr self ); + + #endregion + internal uint GetAppID() + { + var returnValue = _GetAppID( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_SetOverlayNotificationPosition", CallingConvention = Platform.CC)] + private static extern void _SetOverlayNotificationPosition( IntPtr self, NotificationPosition eNotificationPosition ); + + #endregion + internal void SetOverlayNotificationPosition( NotificationPosition eNotificationPosition ) + { + _SetOverlayNotificationPosition( Self, eNotificationPosition ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_IsAPICallCompleted", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _IsAPICallCompleted( IntPtr self, SteamAPICall_t hSteamAPICall, [MarshalAs( UnmanagedType.U1 )] ref bool pbFailed ); + + #endregion + internal bool IsAPICallCompleted( SteamAPICall_t hSteamAPICall, [MarshalAs( UnmanagedType.U1 )] ref bool pbFailed ) + { + var returnValue = _IsAPICallCompleted( Self, hSteamAPICall, ref pbFailed ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetAPICallFailureReason", CallingConvention = Platform.CC)] + private static extern SteamAPICallFailure _GetAPICallFailureReason( IntPtr self, SteamAPICall_t hSteamAPICall ); + + #endregion + internal SteamAPICallFailure GetAPICallFailureReason( SteamAPICall_t hSteamAPICall ) + { + var returnValue = _GetAPICallFailureReason( Self, hSteamAPICall ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetAPICallResult", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetAPICallResult( IntPtr self, SteamAPICall_t hSteamAPICall, IntPtr pCallback, int cubCallback, int iCallbackExpected, [MarshalAs( UnmanagedType.U1 )] ref bool pbFailed ); + + #endregion + internal bool GetAPICallResult( SteamAPICall_t hSteamAPICall, IntPtr pCallback, int cubCallback, int iCallbackExpected, [MarshalAs( UnmanagedType.U1 )] ref bool pbFailed ) + { + var returnValue = _GetAPICallResult( Self, hSteamAPICall, pCallback, cubCallback, iCallbackExpected, ref pbFailed ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetIPCCallCount", CallingConvention = Platform.CC)] + private static extern uint _GetIPCCallCount( IntPtr self ); + + #endregion + internal uint GetIPCCallCount() + { + var returnValue = _GetIPCCallCount( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_SetWarningMessageHook", CallingConvention = Platform.CC)] + private static extern void _SetWarningMessageHook( IntPtr self, IntPtr pFunction ); + + #endregion + internal void SetWarningMessageHook( IntPtr pFunction ) + { + _SetWarningMessageHook( Self, pFunction ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_IsOverlayEnabled", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _IsOverlayEnabled( IntPtr self ); + + #endregion + internal bool IsOverlayEnabled() + { + var returnValue = _IsOverlayEnabled( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_BOverlayNeedsPresent", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _BOverlayNeedsPresent( IntPtr self ); + + #endregion + internal bool BOverlayNeedsPresent() + { + var returnValue = _BOverlayNeedsPresent( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_CheckFileSignature", CallingConvention = Platform.CC)] + private static extern SteamAPICall_t _CheckFileSignature( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string szFileName ); + + #endregion + internal CallResult CheckFileSignature( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string szFileName ) + { + var returnValue = _CheckFileSignature( Self, szFileName ); + return new CallResult( returnValue, IsServer ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_ShowGamepadTextInput", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _ShowGamepadTextInput( IntPtr self, GamepadTextInputMode eInputMode, GamepadTextInputLineMode eLineInputMode, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, uint unCharMax, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchExistingText ); + + #endregion + internal bool ShowGamepadTextInput( GamepadTextInputMode eInputMode, GamepadTextInputLineMode eLineInputMode, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, uint unCharMax, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchExistingText ) + { + var returnValue = _ShowGamepadTextInput( Self, eInputMode, eLineInputMode, pchDescription, unCharMax, pchExistingText ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetEnteredGamepadTextLength", CallingConvention = Platform.CC)] + private static extern uint _GetEnteredGamepadTextLength( IntPtr self ); + + #endregion + internal uint GetEnteredGamepadTextLength() + { + var returnValue = _GetEnteredGamepadTextLength( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetEnteredGamepadTextInput", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetEnteredGamepadTextInput( IntPtr self, IntPtr pchText, uint cchText ); + + #endregion + internal bool GetEnteredGamepadTextInput( out string pchText ) + { + IntPtr mempchText = Helpers.TakeMemory(); + var returnValue = _GetEnteredGamepadTextInput( Self, mempchText, (1024 * 32) ); + pchText = Helpers.MemoryToString( mempchText ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetSteamUILanguage", CallingConvention = Platform.CC)] + private static extern Utf8StringPointer _GetSteamUILanguage( IntPtr self ); + + #endregion + internal string GetSteamUILanguage() + { + var returnValue = _GetSteamUILanguage( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_IsSteamRunningInVR", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _IsSteamRunningInVR( IntPtr self ); + + #endregion + internal bool IsSteamRunningInVR() + { + var returnValue = _IsSteamRunningInVR( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_SetOverlayNotificationInset", CallingConvention = Platform.CC)] + private static extern void _SetOverlayNotificationInset( IntPtr self, int nHorizontalInset, int nVerticalInset ); + + #endregion + internal void SetOverlayNotificationInset( int nHorizontalInset, int nVerticalInset ) + { + _SetOverlayNotificationInset( Self, nHorizontalInset, nVerticalInset ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_IsSteamInBigPictureMode", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _IsSteamInBigPictureMode( IntPtr self ); + + #endregion + internal bool IsSteamInBigPictureMode() + { + var returnValue = _IsSteamInBigPictureMode( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_StartVRDashboard", CallingConvention = Platform.CC)] + private static extern void _StartVRDashboard( IntPtr self ); + + #endregion + internal void StartVRDashboard() + { + _StartVRDashboard( Self ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_IsVRHeadsetStreamingEnabled", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _IsVRHeadsetStreamingEnabled( IntPtr self ); + + #endregion + internal bool IsVRHeadsetStreamingEnabled() + { + var returnValue = _IsVRHeadsetStreamingEnabled( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled", CallingConvention = Platform.CC)] + private static extern void _SetVRHeadsetStreamingEnabled( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bEnabled ); + + #endregion + internal void SetVRHeadsetStreamingEnabled( [MarshalAs( UnmanagedType.U1 )] bool bEnabled ) + { + _SetVRHeadsetStreamingEnabled( Self, bEnabled ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_IsSteamChinaLauncher", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _IsSteamChinaLauncher( IntPtr self ); + + #endregion + internal bool IsSteamChinaLauncher() + { + var returnValue = _IsSteamChinaLauncher( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_InitFilterText", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _InitFilterText( IntPtr self ); + + #endregion + internal bool InitFilterText() + { + var returnValue = _InitFilterText( Self ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_FilterText", CallingConvention = Platform.CC)] + private static extern int _FilterText( IntPtr self, IntPtr pchOutFilteredText, uint nByteSizeOutFilteredText, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchInputMessage, [MarshalAs( UnmanagedType.U1 )] bool bLegalOnly ); + + #endregion + internal int FilterText( out string pchOutFilteredText, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchInputMessage, [MarshalAs( UnmanagedType.U1 )] bool bLegalOnly ) + { + IntPtr mempchOutFilteredText = Helpers.TakeMemory(); + var returnValue = _FilterText( Self, mempchOutFilteredText, (1024 * 32), pchInputMessage, bLegalOnly ); + pchOutFilteredText = Helpers.MemoryToString( mempchOutFilteredText ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamUtils_GetIPv6ConnectivityState", CallingConvention = Platform.CC)] + private static extern SteamIPv6ConnectivityState _GetIPv6ConnectivityState( IntPtr self, SteamIPv6ConnectivityProtocol eProtocol ); + + #endregion + internal SteamIPv6ConnectivityState GetIPv6ConnectivityState( SteamIPv6ConnectivityProtocol eProtocol ) + { + var returnValue = _GetIPv6ConnectivityState( Self, eProtocol ); + return returnValue; + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamVideo.cs b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamVideo.cs new file mode 100644 index 0000000..227970e --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/Interfaces/ISteamVideo.cs @@ -0,0 +1,70 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + + +namespace Facepunch.Steamworks +{ + internal class ISteamVideo : SteamInterface + { + + internal ISteamVideo( bool IsGameServer ) + { + SetupInterface( IsGameServer ); + } + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamVideo_v002", CallingConvention = Platform.CC)] + internal static extern IntPtr SteamAPI_SteamVideo_v002(); + public override IntPtr GetUserInterfacePointer() => SteamAPI_SteamVideo_v002(); + + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamVideo_GetVideoURL", CallingConvention = Platform.CC)] + private static extern void _GetVideoURL( IntPtr self, AppId unVideoAppID ); + + #endregion + internal void GetVideoURL( AppId unVideoAppID ) + { + _GetVideoURL( Self, unVideoAppID ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamVideo_IsBroadcasting", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _IsBroadcasting( IntPtr self, ref int pnNumViewers ); + + #endregion + internal bool IsBroadcasting( ref int pnNumViewers ) + { + var returnValue = _IsBroadcasting( Self, ref pnNumViewers ); + return returnValue; + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamVideo_GetOPFSettings", CallingConvention = Platform.CC)] + private static extern void _GetOPFSettings( IntPtr self, AppId unVideoAppID ); + + #endregion + internal void GetOPFSettings( AppId unVideoAppID ) + { + _GetOPFSettings( Self, unVideoAppID ); + } + + #region FunctionMeta + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_ISteamVideo_GetOPFStringForApp", CallingConvention = Platform.CC)] + [return: MarshalAs( UnmanagedType.I1 )] + private static extern bool _GetOPFStringForApp( IntPtr self, AppId unVideoAppID, IntPtr pchBuffer, ref int pnBufferSize ); + + #endregion + internal bool GetOPFStringForApp( AppId unVideoAppID, out string pchBuffer, ref int pnBufferSize ) + { + IntPtr mempchBuffer = Helpers.TakeMemory(); + var returnValue = _GetOPFStringForApp( Self, unVideoAppID, mempchBuffer, ref pnBufferSize ); + pchBuffer = Helpers.MemoryToString( mempchBuffer ); + return returnValue; + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/SteamCallbacks.cs b/BoneSync/Facepunch.Steamworks/Generated/SteamCallbacks.cs new file mode 100644 index 0000000..36a0ac5 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/SteamCallbacks.cs @@ -0,0 +1,2909 @@ +using System; +using System.Runtime.InteropServices; +using System.Linq; +using Facepunch.Steamworks.Data; +using System.Threading.Tasks; + +namespace Facepunch.Steamworks.Data +{ + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamServersConnected_t : ICallbackData + { + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamServersConnected_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.SteamServersConnected; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamServerConnectFailure_t : ICallbackData + { + internal Result Result; // m_eResult EResult + [MarshalAs(UnmanagedType.I1)] + internal bool StillRetrying; // m_bStillRetrying bool + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamServerConnectFailure_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.SteamServerConnectFailure; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamServersDisconnected_t : ICallbackData + { + internal Result Result; // m_eResult EResult + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamServersDisconnected_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.SteamServersDisconnected; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct ClientGameServerDeny_t : ICallbackData + { + internal uint AppID; // m_uAppID uint32 + internal uint GameServerIP; // m_unGameServerIP uint32 + internal ushort GameServerPort; // m_usGameServerPort uint16 + internal ushort Secure; // m_bSecure uint16 + internal uint Reason; // m_uReason uint32 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ClientGameServerDeny_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.ClientGameServerDeny; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct IPCFailure_t : ICallbackData + { + internal byte FailureType; // m_eFailureType uint8 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(IPCFailure_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.IPCFailure; + #endregion + internal enum EFailureType : int + { + FlushedCallbackQueue = 0, + PipeFail = 1, + } + + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LicensesUpdated_t : ICallbackData + { + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LicensesUpdated_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.LicensesUpdated; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct ValidateAuthTicketResponse_t : ICallbackData + { + internal ulong SteamID; // m_SteamID CSteamID + internal AuthResponse AuthSessionResponse; // m_eAuthSessionResponse EAuthSessionResponse + internal ulong OwnerSteamID; // m_OwnerSteamID CSteamID + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ValidateAuthTicketResponse_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.ValidateAuthTicketResponse; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct MicroTxnAuthorizationResponse_t : ICallbackData + { + internal uint AppID; // m_unAppID uint32 + internal ulong OrderID; // m_ulOrderID uint64 + internal byte Authorized; // m_bAuthorized uint8 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MicroTxnAuthorizationResponse_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.MicroTxnAuthorizationResponse; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct EncryptedAppTicketResponse_t : ICallbackData + { + internal Result Result; // m_eResult EResult + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(EncryptedAppTicketResponse_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.EncryptedAppTicketResponse; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GetAuthSessionTicketResponse_t : ICallbackData + { + internal uint AuthTicket; // m_hAuthTicket HAuthTicket + internal Result Result; // m_eResult EResult + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GetAuthSessionTicketResponse_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.GetAuthSessionTicketResponse; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GameWebCallback_t : ICallbackData + { + internal string URLUTF8() => System.Text.Encoding.UTF8.GetString( URL, 0, System.Array.IndexOf( URL, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] // byte[] m_szURL + internal byte[] URL; // m_szURL char [256] + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameWebCallback_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.GameWebCallback; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct StoreAuthURLResponse_t : ICallbackData + { + internal string URLUTF8() => System.Text.Encoding.UTF8.GetString( URL, 0, System.Array.IndexOf( URL, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] // byte[] m_szURL + internal byte[] URL; // m_szURL char [512] + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(StoreAuthURLResponse_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.StoreAuthURLResponse; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct MarketEligibilityResponse_t : ICallbackData + { + [MarshalAs(UnmanagedType.I1)] + internal bool Allowed; // m_bAllowed bool + internal MarketNotAllowedReasonFlags NotAllowedReason; // m_eNotAllowedReason EMarketNotAllowedReasonFlags + internal uint TAllowedAtTime; // m_rtAllowedAtTime RTime32 + internal int CdaySteamGuardRequiredDays; // m_cdaySteamGuardRequiredDays int + internal int CdayNewDeviceCooldown; // m_cdayNewDeviceCooldown int + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MarketEligibilityResponse_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.MarketEligibilityResponse; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct DurationControl_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal AppId Appid; // m_appid AppId_t + [MarshalAs(UnmanagedType.I1)] + internal bool Applicable; // m_bApplicable bool + internal int CsecsLast5h; // m_csecsLast5h int32 + internal DurationControlProgress Progress; // m_progress EDurationControlProgress + internal DurationControlNotification Otification; // m_notification EDurationControlNotification + internal int CsecsToday; // m_csecsToday int32 + internal int CsecsRemaining; // m_csecsRemaining int32 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(DurationControl_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.DurationControl; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct PersonaStateChange_t : ICallbackData + { + internal ulong SteamID; // m_ulSteamID uint64 + internal int ChangeFlags; // m_nChangeFlags int + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(PersonaStateChange_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.PersonaStateChange; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GameOverlayActivated_t : ICallbackData + { + internal byte Active; // m_bActive uint8 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameOverlayActivated_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.GameOverlayActivated; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GameServerChangeRequested_t : ICallbackData + { + internal string ServerUTF8() => System.Text.Encoding.UTF8.GetString( Server, 0, System.Array.IndexOf( Server, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] // byte[] m_rgchServer + internal byte[] Server; // m_rgchServer char [64] + internal string PasswordUTF8() => System.Text.Encoding.UTF8.GetString( Password, 0, System.Array.IndexOf( Password, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] // byte[] m_rgchPassword + internal byte[] Password; // m_rgchPassword char [64] + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameServerChangeRequested_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.GameServerChangeRequested; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct GameLobbyJoinRequested_t : ICallbackData + { + internal ulong SteamIDLobby; // m_steamIDLobby CSteamID + internal ulong SteamIDFriend; // m_steamIDFriend CSteamID + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameLobbyJoinRequested_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.GameLobbyJoinRequested; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct AvatarImageLoaded_t : ICallbackData + { + internal ulong SteamID; // m_steamID CSteamID + internal int Image; // m_iImage int + internal int Wide; // m_iWide int + internal int Tall; // m_iTall int + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(AvatarImageLoaded_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.AvatarImageLoaded; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct ClanOfficerListResponse_t : ICallbackData + { + internal ulong SteamIDClan; // m_steamIDClan CSteamID + internal int COfficers; // m_cOfficers int + internal byte Success; // m_bSuccess uint8 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ClanOfficerListResponse_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.ClanOfficerListResponse; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct FriendRichPresenceUpdate_t : ICallbackData + { + internal ulong SteamIDFriend; // m_steamIDFriend CSteamID + internal AppId AppID; // m_nAppID AppId_t + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendRichPresenceUpdate_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.FriendRichPresenceUpdate; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GameRichPresenceJoinRequested_t : ICallbackData + { + internal ulong SteamIDFriend; // m_steamIDFriend CSteamID + internal string ConnectUTF8() => System.Text.Encoding.UTF8.GetString( Connect, 0, System.Array.IndexOf( Connect, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] // byte[] m_rgchConnect + internal byte[] Connect; // m_rgchConnect char [256] + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameRichPresenceJoinRequested_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.GameRichPresenceJoinRequested; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct GameConnectedClanChatMsg_t : ICallbackData + { + internal ulong SteamIDClanChat; // m_steamIDClanChat CSteamID + internal ulong SteamIDUser; // m_steamIDUser CSteamID + internal int MessageID; // m_iMessageID int + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameConnectedClanChatMsg_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.GameConnectedClanChatMsg; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct GameConnectedChatJoin_t : ICallbackData + { + internal ulong SteamIDClanChat; // m_steamIDClanChat CSteamID + internal ulong SteamIDUser; // m_steamIDUser CSteamID + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameConnectedChatJoin_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.GameConnectedChatJoin; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct GameConnectedChatLeave_t : ICallbackData + { + internal ulong SteamIDClanChat; // m_steamIDClanChat CSteamID + internal ulong SteamIDUser; // m_steamIDUser CSteamID + [MarshalAs(UnmanagedType.I1)] + internal bool Kicked; // m_bKicked bool + [MarshalAs(UnmanagedType.I1)] + internal bool Dropped; // m_bDropped bool + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameConnectedChatLeave_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.GameConnectedChatLeave; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct DownloadClanActivityCountsResult_t : ICallbackData + { + [MarshalAs(UnmanagedType.I1)] + internal bool Success; // m_bSuccess bool + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(DownloadClanActivityCountsResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.DownloadClanActivityCountsResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct JoinClanChatRoomCompletionResult_t : ICallbackData + { + internal ulong SteamIDClanChat; // m_steamIDClanChat CSteamID + internal RoomEnter ChatRoomEnterResponse; // m_eChatRoomEnterResponse EChatRoomEnterResponse + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(JoinClanChatRoomCompletionResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.JoinClanChatRoomCompletionResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GameConnectedFriendChatMsg_t : ICallbackData + { + internal ulong SteamIDUser; // m_steamIDUser CSteamID + internal int MessageID; // m_iMessageID int + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameConnectedFriendChatMsg_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.GameConnectedFriendChatMsg; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct FriendsGetFollowerCount_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal ulong SteamID; // m_steamID CSteamID + internal int Count; // m_nCount int + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendsGetFollowerCount_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.FriendsGetFollowerCount; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct FriendsIsFollowing_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal ulong SteamID; // m_steamID CSteamID + [MarshalAs(UnmanagedType.I1)] + internal bool IsFollowing; // m_bIsFollowing bool + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendsIsFollowing_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.FriendsIsFollowing; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct FriendsEnumerateFollowingList_t : ICallbackData + { + internal Result Result; // m_eResult EResult + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] + internal ulong[] GSteamID; // m_rgSteamID CSteamID [50] + internal int ResultsReturned; // m_nResultsReturned int32 + internal int TotalResultCount; // m_nTotalResultCount int32 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendsEnumerateFollowingList_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.FriendsEnumerateFollowingList; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SetPersonaNameResponse_t : ICallbackData + { + [MarshalAs(UnmanagedType.I1)] + internal bool Success; // m_bSuccess bool + [MarshalAs(UnmanagedType.I1)] + internal bool LocalSuccess; // m_bLocalSuccess bool + internal Result Result; // m_result EResult + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SetPersonaNameResponse_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.SetPersonaNameResponse; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct UnreadChatMessagesChanged_t : ICallbackData + { + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(UnreadChatMessagesChanged_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.UnreadChatMessagesChanged; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct IPCountry_t : ICallbackData + { + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(IPCountry_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.IPCountry; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LowBatteryPower_t : ICallbackData + { + internal byte MinutesBatteryLeft; // m_nMinutesBatteryLeft uint8 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LowBatteryPower_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.LowBatteryPower; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamAPICallCompleted_t : ICallbackData + { + internal ulong AsyncCall; // m_hAsyncCall SteamAPICall_t + internal int Callback; // m_iCallback int + internal uint ParamCount; // m_cubParam uint32 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamAPICallCompleted_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.SteamAPICallCompleted; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamShutdown_t : ICallbackData + { + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamShutdown_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.SteamShutdown; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct CheckFileSignature_t : ICallbackData + { + internal CheckFileSignature CheckFileSignature; // m_eCheckFileSignature ECheckFileSignature + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(CheckFileSignature_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.CheckFileSignature; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GamepadTextInputDismissed_t : ICallbackData + { + [MarshalAs(UnmanagedType.I1)] + internal bool Submitted; // m_bSubmitted bool + internal uint SubmittedText; // m_unSubmittedText uint32 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GamepadTextInputDismissed_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.GamepadTextInputDismissed; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct FavoritesListChanged_t : ICallbackData + { + internal uint IP; // m_nIP uint32 + internal uint QueryPort; // m_nQueryPort uint32 + internal uint ConnPort; // m_nConnPort uint32 + internal uint AppID; // m_nAppID uint32 + internal uint Flags; // m_nFlags uint32 + [MarshalAs(UnmanagedType.I1)] + internal bool Add; // m_bAdd bool + internal uint AccountId; // m_unAccountId AccountID_t + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FavoritesListChanged_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.FavoritesListChanged; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LobbyInvite_t : ICallbackData + { + internal ulong SteamIDUser; // m_ulSteamIDUser uint64 + internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 + internal ulong GameID; // m_ulGameID uint64 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyInvite_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.LobbyInvite; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LobbyEnter_t : ICallbackData + { + internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 + internal uint GfChatPermissions; // m_rgfChatPermissions uint32 + [MarshalAs(UnmanagedType.I1)] + internal bool Locked; // m_bLocked bool + internal uint EChatRoomEnterResponse; // m_EChatRoomEnterResponse uint32 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyEnter_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.LobbyEnter; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LobbyDataUpdate_t : ICallbackData + { + internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 + internal ulong SteamIDMember; // m_ulSteamIDMember uint64 + internal byte Success; // m_bSuccess uint8 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyDataUpdate_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.LobbyDataUpdate; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LobbyChatUpdate_t : ICallbackData + { + internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 + internal ulong SteamIDUserChanged; // m_ulSteamIDUserChanged uint64 + internal ulong SteamIDMakingChange; // m_ulSteamIDMakingChange uint64 + internal uint GfChatMemberStateChange; // m_rgfChatMemberStateChange uint32 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyChatUpdate_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.LobbyChatUpdate; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LobbyChatMsg_t : ICallbackData + { + internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 + internal ulong SteamIDUser; // m_ulSteamIDUser uint64 + internal byte ChatEntryType; // m_eChatEntryType uint8 + internal uint ChatID; // m_iChatID uint32 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyChatMsg_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.LobbyChatMsg; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LobbyGameCreated_t : ICallbackData + { + internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 + internal ulong SteamIDGameServer; // m_ulSteamIDGameServer uint64 + internal uint IP; // m_unIP uint32 + internal ushort Port; // m_usPort uint16 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyGameCreated_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.LobbyGameCreated; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LobbyMatchList_t : ICallbackData + { + internal uint LobbiesMatching; // m_nLobbiesMatching uint32 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyMatchList_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.LobbyMatchList; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LobbyKicked_t : ICallbackData + { + internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 + internal ulong SteamIDAdmin; // m_ulSteamIDAdmin uint64 + internal byte KickedDueToDisconnect; // m_bKickedDueToDisconnect uint8 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyKicked_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.LobbyKicked; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LobbyCreated_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyCreated_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.LobbyCreated; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct PSNGameBootInviteResult_t : ICallbackData + { + [MarshalAs(UnmanagedType.I1)] + internal bool GameBootInviteExists; // m_bGameBootInviteExists bool + internal ulong SteamIDLobby; // m_steamIDLobby CSteamID + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(PSNGameBootInviteResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.PSNGameBootInviteResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct FavoritesListAccountsUpdated_t : ICallbackData + { + internal Result Result; // m_eResult EResult + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FavoritesListAccountsUpdated_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.FavoritesListAccountsUpdated; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct SearchForGameProgressCallback_t : ICallbackData + { + internal ulong LSearchID; // m_ullSearchID uint64 + internal Result Result; // m_eResult EResult + internal ulong LobbyID; // m_lobbyID CSteamID + internal ulong SteamIDEndedSearch; // m_steamIDEndedSearch CSteamID + internal int SecondsRemainingEstimate; // m_nSecondsRemainingEstimate int32 + internal int CPlayersSearching; // m_cPlayersSearching int32 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SearchForGameProgressCallback_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.SearchForGameProgressCallback; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct SearchForGameResultCallback_t : ICallbackData + { + internal ulong LSearchID; // m_ullSearchID uint64 + internal Result Result; // m_eResult EResult + internal int CountPlayersInGame; // m_nCountPlayersInGame int32 + internal int CountAcceptedGame; // m_nCountAcceptedGame int32 + internal ulong SteamIDHost; // m_steamIDHost CSteamID + [MarshalAs(UnmanagedType.I1)] + internal bool FinalCallback; // m_bFinalCallback bool + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SearchForGameResultCallback_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.SearchForGameResultCallback; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RequestPlayersForGameProgressCallback_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal ulong LSearchID; // m_ullSearchID uint64 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RequestPlayersForGameProgressCallback_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RequestPlayersForGameProgressCallback; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct RequestPlayersForGameResultCallback_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal ulong LSearchID; // m_ullSearchID uint64 + internal ulong SteamIDPlayerFound; // m_SteamIDPlayerFound CSteamID + internal ulong SteamIDLobby; // m_SteamIDLobby CSteamID + internal RequestPlayersForGameResultCallback_t.PlayerAcceptState_t PlayerAcceptState; // m_ePlayerAcceptState RequestPlayersForGameResultCallback_t::PlayerAcceptState_t + internal int PlayerIndex; // m_nPlayerIndex int32 + internal int TotalPlayersFound; // m_nTotalPlayersFound int32 + internal int TotalPlayersAcceptedGame; // m_nTotalPlayersAcceptedGame int32 + internal int SuggestedTeamIndex; // m_nSuggestedTeamIndex int32 + internal ulong LUniqueGameID; // m_ullUniqueGameID uint64 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RequestPlayersForGameResultCallback_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RequestPlayersForGameResultCallback; + #endregion + internal enum PlayerAcceptState_t : int + { + Unknown = 0, + PlayerAccepted = 1, + PlayerDeclined = 2, + } + + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RequestPlayersForGameFinalResultCallback_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal ulong LSearchID; // m_ullSearchID uint64 + internal ulong LUniqueGameID; // m_ullUniqueGameID uint64 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RequestPlayersForGameFinalResultCallback_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RequestPlayersForGameFinalResultCallback; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct SubmitPlayerResultResultCallback_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal ulong UllUniqueGameID; // ullUniqueGameID uint64 + internal ulong SteamIDPlayer; // steamIDPlayer CSteamID + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SubmitPlayerResultResultCallback_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.SubmitPlayerResultResultCallback; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct EndGameResultCallback_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal ulong UllUniqueGameID; // ullUniqueGameID uint64 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(EndGameResultCallback_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.EndGameResultCallback; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct JoinPartyCallback_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal ulong BeaconID; // m_ulBeaconID PartyBeaconID_t + internal ulong SteamIDBeaconOwner; // m_SteamIDBeaconOwner CSteamID + internal string ConnectStringUTF8() => System.Text.Encoding.UTF8.GetString( ConnectString, 0, System.Array.IndexOf( ConnectString, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] // byte[] m_rgchConnectString + internal byte[] ConnectString; // m_rgchConnectString char [256] + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(JoinPartyCallback_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.JoinPartyCallback; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct CreateBeaconCallback_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal ulong BeaconID; // m_ulBeaconID PartyBeaconID_t + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(CreateBeaconCallback_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.CreateBeaconCallback; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct ReservationNotificationCallback_t : ICallbackData + { + internal ulong BeaconID; // m_ulBeaconID PartyBeaconID_t + internal ulong SteamIDJoiner; // m_steamIDJoiner CSteamID + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ReservationNotificationCallback_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.ReservationNotificationCallback; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct ChangeNumOpenSlotsCallback_t : ICallbackData + { + internal Result Result; // m_eResult EResult + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ChangeNumOpenSlotsCallback_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.ChangeNumOpenSlotsCallback; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct AvailableBeaconLocationsUpdated_t : ICallbackData + { + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(AvailableBeaconLocationsUpdated_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.AvailableBeaconLocationsUpdated; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct ActiveBeaconsUpdated_t : ICallbackData + { + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ActiveBeaconsUpdated_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.ActiveBeaconsUpdated; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageAppSyncedClient_t : ICallbackData + { + internal AppId AppID; // m_nAppID AppId_t + internal Result Result; // m_eResult EResult + internal int NumDownloads; // m_unNumDownloads int + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageAppSyncedClient_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoteStorageAppSyncedClient; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageAppSyncedServer_t : ICallbackData + { + internal AppId AppID; // m_nAppID AppId_t + internal Result Result; // m_eResult EResult + internal int NumUploads; // m_unNumUploads int + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageAppSyncedServer_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoteStorageAppSyncedServer; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageAppSyncProgress_t : ICallbackData + { + internal string CurrentFileUTF8() => System.Text.Encoding.UTF8.GetString( CurrentFile, 0, System.Array.IndexOf( CurrentFile, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 260)] // byte[] m_rgchCurrentFile + internal byte[] CurrentFile; // m_rgchCurrentFile char [260] + internal AppId AppID; // m_nAppID AppId_t + internal uint BytesTransferredThisChunk; // m_uBytesTransferredThisChunk uint32 + internal double DAppPercentComplete; // m_dAppPercentComplete double + [MarshalAs(UnmanagedType.I1)] + internal bool Uploading; // m_bUploading bool + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageAppSyncProgress_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoteStorageAppSyncProgress; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageAppSyncStatusCheck_t : ICallbackData + { + internal AppId AppID; // m_nAppID AppId_t + internal Result Result; // m_eResult EResult + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageAppSyncStatusCheck_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoteStorageAppSyncStatusCheck; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageFileShareResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal ulong File; // m_hFile UGCHandle_t + internal string FilenameUTF8() => System.Text.Encoding.UTF8.GetString( Filename, 0, System.Array.IndexOf( Filename, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 260)] // byte[] m_rgchFilename + internal byte[] Filename; // m_rgchFilename char [260] + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageFileShareResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoteStorageFileShareResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStoragePublishFileResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + [MarshalAs(UnmanagedType.I1)] + internal bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement bool + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishFileResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoteStoragePublishFileResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageDeletePublishedFileResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageDeletePublishedFileResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoteStorageDeletePublishedFileResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageEnumerateUserPublishedFilesResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal int ResultsReturned; // m_nResultsReturned int32 + internal int TotalResultCount; // m_nTotalResultCount int32 + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] + internal PublishedFileId[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageEnumerateUserPublishedFilesResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoteStorageEnumerateUserPublishedFilesResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageSubscribePublishedFileResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageSubscribePublishedFileResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoteStorageSubscribePublishedFileResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageEnumerateUserSubscribedFilesResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal int ResultsReturned; // m_nResultsReturned int32 + internal int TotalResultCount; // m_nTotalResultCount int32 + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] + internal PublishedFileId[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U4)] + internal uint[] GRTimeSubscribed; // m_rgRTimeSubscribed uint32 [50] + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageEnumerateUserSubscribedFilesResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoteStorageEnumerateUserSubscribedFilesResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageUnsubscribePublishedFileResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageUnsubscribePublishedFileResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoteStorageUnsubscribePublishedFileResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageUpdatePublishedFileResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + [MarshalAs(UnmanagedType.I1)] + internal bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement bool + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageUpdatePublishedFileResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoteStorageUpdatePublishedFileResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageDownloadUGCResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal ulong File; // m_hFile UGCHandle_t + internal AppId AppID; // m_nAppID AppId_t + internal int SizeInBytes; // m_nSizeInBytes int32 + internal string PchFileNameUTF8() => System.Text.Encoding.UTF8.GetString( PchFileName, 0, System.Array.IndexOf( PchFileName, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 260)] // byte[] m_pchFileName + internal byte[] PchFileName; // m_pchFileName char [260] + internal ulong SteamIDOwner; // m_ulSteamIDOwner uint64 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageDownloadUGCResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoteStorageDownloadUGCResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageGetPublishedFileDetailsResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal AppId CreatorAppID; // m_nCreatorAppID AppId_t + internal AppId ConsumerAppID; // m_nConsumerAppID AppId_t + internal string TitleUTF8() => System.Text.Encoding.UTF8.GetString( Title, 0, System.Array.IndexOf( Title, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 129)] // byte[] m_rgchTitle + internal byte[] Title; // m_rgchTitle char [129] + internal string DescriptionUTF8() => System.Text.Encoding.UTF8.GetString( Description, 0, System.Array.IndexOf( Description, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8000)] // byte[] m_rgchDescription + internal byte[] Description; // m_rgchDescription char [8000] + internal ulong File; // m_hFile UGCHandle_t + internal ulong PreviewFile; // m_hPreviewFile UGCHandle_t + internal ulong SteamIDOwner; // m_ulSteamIDOwner uint64 + internal uint TimeCreated; // m_rtimeCreated uint32 + internal uint TimeUpdated; // m_rtimeUpdated uint32 + internal RemoteStoragePublishedFileVisibility Visibility; // m_eVisibility ERemoteStoragePublishedFileVisibility + [MarshalAs(UnmanagedType.I1)] + internal bool Banned; // m_bBanned bool + internal string TagsUTF8() => System.Text.Encoding.UTF8.GetString( Tags, 0, System.Array.IndexOf( Tags, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1025)] // byte[] m_rgchTags + internal byte[] Tags; // m_rgchTags char [1025] + [MarshalAs(UnmanagedType.I1)] + internal bool TagsTruncated; // m_bTagsTruncated bool + internal string PchFileNameUTF8() => System.Text.Encoding.UTF8.GetString( PchFileName, 0, System.Array.IndexOf( PchFileName, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 260)] // byte[] m_pchFileName + internal byte[] PchFileName; // m_pchFileName char [260] + internal int FileSize; // m_nFileSize int32 + internal int PreviewFileSize; // m_nPreviewFileSize int32 + internal string URLUTF8() => System.Text.Encoding.UTF8.GetString( URL, 0, System.Array.IndexOf( URL, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] // byte[] m_rgchURL + internal byte[] URL; // m_rgchURL char [256] + internal WorkshopFileType FileType; // m_eFileType EWorkshopFileType + [MarshalAs(UnmanagedType.I1)] + internal bool AcceptedForUse; // m_bAcceptedForUse bool + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageGetPublishedFileDetailsResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoteStorageGetPublishedFileDetailsResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageEnumerateWorkshopFilesResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal int ResultsReturned; // m_nResultsReturned int32 + internal int TotalResultCount; // m_nTotalResultCount int32 + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] + internal PublishedFileId[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.R4)] + internal float[] GScore; // m_rgScore float [50] + internal AppId AppId; // m_nAppId AppId_t + internal uint StartIndex; // m_unStartIndex uint32 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageEnumerateWorkshopFilesResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoteStorageEnumerateWorkshopFilesResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageGetPublishedItemVoteDetailsResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal PublishedFileId PublishedFileId; // m_unPublishedFileId PublishedFileId_t + internal int VotesFor; // m_nVotesFor int32 + internal int VotesAgainst; // m_nVotesAgainst int32 + internal int Reports; // m_nReports int32 + internal float FScore; // m_fScore float + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageGetPublishedItemVoteDetailsResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoteStorageGetPublishedItemVoteDetailsResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStoragePublishedFileSubscribed_t : ICallbackData + { + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal AppId AppID; // m_nAppID AppId_t + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishedFileSubscribed_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoteStoragePublishedFileSubscribed; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStoragePublishedFileUnsubscribed_t : ICallbackData + { + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal AppId AppID; // m_nAppID AppId_t + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishedFileUnsubscribed_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoteStoragePublishedFileUnsubscribed; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStoragePublishedFileDeleted_t : ICallbackData + { + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal AppId AppID; // m_nAppID AppId_t + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishedFileDeleted_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoteStoragePublishedFileDeleted; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageUpdateUserPublishedItemVoteResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageUpdateUserPublishedItemVoteResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoteStorageUpdateUserPublishedItemVoteResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageUserVoteDetails_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal WorkshopVote Vote; // m_eVote EWorkshopVote + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageUserVoteDetails_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoteStorageUserVoteDetails; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageEnumerateUserSharedWorkshopFilesResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal int ResultsReturned; // m_nResultsReturned int32 + internal int TotalResultCount; // m_nTotalResultCount int32 + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] + internal PublishedFileId[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageEnumerateUserSharedWorkshopFilesResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoteStorageEnumerateUserSharedWorkshopFilesResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageSetUserPublishedFileActionResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal WorkshopFileAction Action; // m_eAction EWorkshopFileAction + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageSetUserPublishedFileActionResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoteStorageSetUserPublishedFileActionResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageEnumeratePublishedFilesByUserActionResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal WorkshopFileAction Action; // m_eAction EWorkshopFileAction + internal int ResultsReturned; // m_nResultsReturned int32 + internal int TotalResultCount; // m_nTotalResultCount int32 + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] + internal PublishedFileId[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U4)] + internal uint[] GRTimeUpdated; // m_rgRTimeUpdated uint32 [50] + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageEnumeratePublishedFilesByUserActionResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoteStorageEnumeratePublishedFilesByUserActionResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStoragePublishFileProgress_t : ICallbackData + { + internal double DPercentFile; // m_dPercentFile double + [MarshalAs(UnmanagedType.I1)] + internal bool Preview; // m_bPreview bool + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishFileProgress_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoteStoragePublishFileProgress; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStoragePublishedFileUpdated_t : ICallbackData + { + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal AppId AppID; // m_nAppID AppId_t + internal ulong Unused; // m_ulUnused uint64 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishedFileUpdated_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoteStoragePublishedFileUpdated; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageFileWriteAsyncComplete_t : ICallbackData + { + internal Result Result; // m_eResult EResult + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageFileWriteAsyncComplete_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoteStorageFileWriteAsyncComplete; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageFileReadAsyncComplete_t : ICallbackData + { + internal ulong FileReadAsync; // m_hFileReadAsync SteamAPICall_t + internal Result Result; // m_eResult EResult + internal uint Offset; // m_nOffset uint32 + internal uint Read; // m_cubRead uint32 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageFileReadAsyncComplete_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoteStorageFileReadAsyncComplete; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct UserStatsReceived_t : ICallbackData + { + internal ulong GameID; // m_nGameID uint64 + internal Result Result; // m_eResult EResult + internal ulong SteamIDUser; // m_steamIDUser CSteamID + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserStatsReceived_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.UserStatsReceived; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct UserStatsStored_t : ICallbackData + { + internal ulong GameID; // m_nGameID uint64 + internal Result Result; // m_eResult EResult + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserStatsStored_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.UserStatsStored; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct UserAchievementStored_t : ICallbackData + { + internal ulong GameID; // m_nGameID uint64 + [MarshalAs(UnmanagedType.I1)] + internal bool GroupAchievement; // m_bGroupAchievement bool + internal string AchievementNameUTF8() => System.Text.Encoding.UTF8.GetString( AchievementName, 0, System.Array.IndexOf( AchievementName, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] // byte[] m_rgchAchievementName + internal byte[] AchievementName; // m_rgchAchievementName char [128] + internal uint CurProgress; // m_nCurProgress uint32 + internal uint MaxProgress; // m_nMaxProgress uint32 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserAchievementStored_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.UserAchievementStored; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LeaderboardFindResult_t : ICallbackData + { + internal ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t + internal byte LeaderboardFound; // m_bLeaderboardFound uint8 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LeaderboardFindResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.LeaderboardFindResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LeaderboardScoresDownloaded_t : ICallbackData + { + internal ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t + internal ulong SteamLeaderboardEntries; // m_hSteamLeaderboardEntries SteamLeaderboardEntries_t + internal int CEntryCount; // m_cEntryCount int + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LeaderboardScoresDownloaded_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.LeaderboardScoresDownloaded; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LeaderboardScoreUploaded_t : ICallbackData + { + internal byte Success; // m_bSuccess uint8 + internal ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t + internal int Score; // m_nScore int32 + internal byte ScoreChanged; // m_bScoreChanged uint8 + internal int GlobalRankNew; // m_nGlobalRankNew int + internal int GlobalRankPrevious; // m_nGlobalRankPrevious int + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LeaderboardScoreUploaded_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.LeaderboardScoreUploaded; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct NumberOfCurrentPlayers_t : ICallbackData + { + internal byte Success; // m_bSuccess uint8 + internal int CPlayers; // m_cPlayers int32 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(NumberOfCurrentPlayers_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.NumberOfCurrentPlayers; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct UserStatsUnloaded_t : ICallbackData + { + internal ulong SteamIDUser; // m_steamIDUser CSteamID + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserStatsUnloaded_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.UserStatsUnloaded; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct UserAchievementIconFetched_t : ICallbackData + { + internal GameId GameID; // m_nGameID CGameID + internal string AchievementNameUTF8() => System.Text.Encoding.UTF8.GetString( AchievementName, 0, System.Array.IndexOf( AchievementName, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] // byte[] m_rgchAchievementName + internal byte[] AchievementName; // m_rgchAchievementName char [128] + [MarshalAs(UnmanagedType.I1)] + internal bool Achieved; // m_bAchieved bool + internal int IconHandle; // m_nIconHandle int + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserAchievementIconFetched_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.UserAchievementIconFetched; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GlobalAchievementPercentagesReady_t : ICallbackData + { + internal ulong GameID; // m_nGameID uint64 + internal Result Result; // m_eResult EResult + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GlobalAchievementPercentagesReady_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.GlobalAchievementPercentagesReady; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LeaderboardUGCSet_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LeaderboardUGCSet_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.LeaderboardUGCSet; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GlobalStatsReceived_t : ICallbackData + { + internal ulong GameID; // m_nGameID uint64 + internal Result Result; // m_eResult EResult + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GlobalStatsReceived_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.GlobalStatsReceived; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct DlcInstalled_t : ICallbackData + { + internal AppId AppID; // m_nAppID AppId_t + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(DlcInstalled_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.DlcInstalled; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RegisterActivationCodeResponse_t : ICallbackData + { + internal RegisterActivationCodeResult Result; // m_eResult ERegisterActivationCodeResult + internal uint PackageRegistered; // m_unPackageRegistered uint32 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RegisterActivationCodeResponse_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RegisterActivationCodeResponse; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct NewUrlLaunchParameters_t : ICallbackData + { + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(NewUrlLaunchParameters_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.NewUrlLaunchParameters; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct AppProofOfPurchaseKeyResponse_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal uint AppID; // m_nAppID uint32 + internal uint CchKeyLength; // m_cchKeyLength uint32 + internal string KeyUTF8() => System.Text.Encoding.UTF8.GetString( Key, 0, System.Array.IndexOf( Key, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 240)] // byte[] m_rgchKey + internal byte[] Key; // m_rgchKey char [240] + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(AppProofOfPurchaseKeyResponse_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.AppProofOfPurchaseKeyResponse; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct FileDetailsResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal ulong FileSize; // m_ulFileSize uint64 + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] // m_FileSHA + internal byte[] FileSHA; // m_FileSHA uint8 [20] + internal uint Flags; // m_unFlags uint32 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FileDetailsResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.FileDetailsResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct P2PSessionRequest_t : ICallbackData + { + internal ulong SteamIDRemote; // m_steamIDRemote CSteamID + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(P2PSessionRequest_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.P2PSessionRequest; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct P2PSessionConnectFail_t : ICallbackData + { + internal ulong SteamIDRemote; // m_steamIDRemote CSteamID + internal byte P2PSessionError; // m_eP2PSessionError uint8 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(P2PSessionConnectFail_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.P2PSessionConnectFail; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct ScreenshotReady_t : ICallbackData + { + internal uint Local; // m_hLocal ScreenshotHandle + internal Result Result; // m_eResult EResult + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ScreenshotReady_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.ScreenshotReady; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct ScreenshotRequested_t : ICallbackData + { + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ScreenshotRequested_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.ScreenshotRequested; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct PlaybackStatusHasChanged_t : ICallbackData + { + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(PlaybackStatusHasChanged_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.PlaybackStatusHasChanged; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct VolumeHasChanged_t : ICallbackData + { + internal float NewVolume; // m_flNewVolume float + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(VolumeHasChanged_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.VolumeHasChanged; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct MusicPlayerRemoteWillActivate_t : ICallbackData + { + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerRemoteWillActivate_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.MusicPlayerRemoteWillActivate; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct MusicPlayerRemoteWillDeactivate_t : ICallbackData + { + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerRemoteWillDeactivate_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.MusicPlayerRemoteWillDeactivate; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct MusicPlayerRemoteToFront_t : ICallbackData + { + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerRemoteToFront_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.MusicPlayerRemoteToFront; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct MusicPlayerWillQuit_t : ICallbackData + { + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerWillQuit_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.MusicPlayerWillQuit; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct MusicPlayerWantsPlay_t : ICallbackData + { + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerWantsPlay_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.MusicPlayerWantsPlay; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct MusicPlayerWantsPause_t : ICallbackData + { + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerWantsPause_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.MusicPlayerWantsPause; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct MusicPlayerWantsPlayPrevious_t : ICallbackData + { + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerWantsPlayPrevious_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.MusicPlayerWantsPlayPrevious; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct MusicPlayerWantsPlayNext_t : ICallbackData + { + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerWantsPlayNext_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.MusicPlayerWantsPlayNext; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct MusicPlayerWantsShuffled_t : ICallbackData + { + [MarshalAs(UnmanagedType.I1)] + internal bool Shuffled; // m_bShuffled bool + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerWantsShuffled_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.MusicPlayerWantsShuffled; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct MusicPlayerWantsLooped_t : ICallbackData + { + [MarshalAs(UnmanagedType.I1)] + internal bool Looped; // m_bLooped bool + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerWantsLooped_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.MusicPlayerWantsLooped; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct MusicPlayerWantsVolume_t : ICallbackData + { + internal float NewVolume; // m_flNewVolume float + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerWantsVolume_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.MusicPlayerWantsVolume; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct MusicPlayerSelectsQueueEntry_t : ICallbackData + { + internal int NID; // nID int + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerSelectsQueueEntry_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.MusicPlayerSelectsQueueEntry; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct MusicPlayerSelectsPlaylistEntry_t : ICallbackData + { + internal int NID; // nID int + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerSelectsPlaylistEntry_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.MusicPlayerSelectsPlaylistEntry; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct MusicPlayerWantsPlayingRepeatStatus_t : ICallbackData + { + internal int PlayingRepeatStatus; // m_nPlayingRepeatStatus int + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerWantsPlayingRepeatStatus_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.MusicPlayerWantsPlayingRepeatStatus; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTTPRequestCompleted_t : ICallbackData + { + internal uint Request; // m_hRequest HTTPRequestHandle + internal ulong ContextValue; // m_ulContextValue uint64 + [MarshalAs(UnmanagedType.I1)] + internal bool RequestSuccessful; // m_bRequestSuccessful bool + internal HTTPStatusCode StatusCode; // m_eStatusCode EHTTPStatusCode + internal uint BodySize; // m_unBodySize uint32 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTTPRequestCompleted_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.HTTPRequestCompleted; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTTPRequestHeadersReceived_t : ICallbackData + { + internal uint Request; // m_hRequest HTTPRequestHandle + internal ulong ContextValue; // m_ulContextValue uint64 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTTPRequestHeadersReceived_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.HTTPRequestHeadersReceived; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTTPRequestDataReceived_t : ICallbackData + { + internal uint Request; // m_hRequest HTTPRequestHandle + internal ulong ContextValue; // m_ulContextValue uint64 + internal uint COffset; // m_cOffset uint32 + internal uint CBytesReceived; // m_cBytesReceived uint32 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTTPRequestDataReceived_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.HTTPRequestDataReceived; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamUGCQueryCompleted_t : ICallbackData + { + internal ulong Handle; // m_handle UGCQueryHandle_t + internal Result Result; // m_eResult EResult + internal uint NumResultsReturned; // m_unNumResultsReturned uint32 + internal uint TotalMatchingResults; // m_unTotalMatchingResults uint32 + [MarshalAs(UnmanagedType.I1)] + internal bool CachedData; // m_bCachedData bool + internal string NextCursorUTF8() => System.Text.Encoding.UTF8.GetString( NextCursor, 0, System.Array.IndexOf( NextCursor, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] // byte[] m_rgchNextCursor + internal byte[] NextCursor; // m_rgchNextCursor char [256] + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamUGCQueryCompleted_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.SteamUGCQueryCompleted; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamUGCRequestUGCDetailsResult_t : ICallbackData + { + internal SteamUGCDetails_t Details; // m_details SteamUGCDetails_t + [MarshalAs(UnmanagedType.I1)] + internal bool CachedData; // m_bCachedData bool + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamUGCRequestUGCDetailsResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.SteamUGCRequestUGCDetailsResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct CreateItemResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + [MarshalAs(UnmanagedType.I1)] + internal bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement bool + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(CreateItemResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.CreateItemResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SubmitItemUpdateResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + [MarshalAs(UnmanagedType.I1)] + internal bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement bool + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SubmitItemUpdateResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.SubmitItemUpdateResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct ItemInstalled_t : ICallbackData + { + internal AppId AppID; // m_unAppID AppId_t + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ItemInstalled_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.ItemInstalled; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct DownloadItemResult_t : ICallbackData + { + internal AppId AppID; // m_unAppID AppId_t + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal Result Result; // m_eResult EResult + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(DownloadItemResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.DownloadItemResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct UserFavoriteItemsListChanged_t : ICallbackData + { + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal Result Result; // m_eResult EResult + [MarshalAs(UnmanagedType.I1)] + internal bool WasAddRequest; // m_bWasAddRequest bool + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserFavoriteItemsListChanged_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.UserFavoriteItemsListChanged; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SetUserItemVoteResult_t : ICallbackData + { + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal Result Result; // m_eResult EResult + [MarshalAs(UnmanagedType.I1)] + internal bool VoteUp; // m_bVoteUp bool + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SetUserItemVoteResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.SetUserItemVoteResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GetUserItemVoteResult_t : ICallbackData + { + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal Result Result; // m_eResult EResult + [MarshalAs(UnmanagedType.I1)] + internal bool VotedUp; // m_bVotedUp bool + [MarshalAs(UnmanagedType.I1)] + internal bool VotedDown; // m_bVotedDown bool + [MarshalAs(UnmanagedType.I1)] + internal bool VoteSkipped; // m_bVoteSkipped bool + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GetUserItemVoteResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.GetUserItemVoteResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct StartPlaytimeTrackingResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(StartPlaytimeTrackingResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.StartPlaytimeTrackingResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct StopPlaytimeTrackingResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(StopPlaytimeTrackingResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.StopPlaytimeTrackingResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct AddUGCDependencyResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal PublishedFileId ChildPublishedFileId; // m_nChildPublishedFileId PublishedFileId_t + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(AddUGCDependencyResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.AddUGCDependencyResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoveUGCDependencyResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal PublishedFileId ChildPublishedFileId; // m_nChildPublishedFileId PublishedFileId_t + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoveUGCDependencyResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoveUGCDependencyResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct AddAppDependencyResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal AppId AppID; // m_nAppID AppId_t + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(AddAppDependencyResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.AddAppDependencyResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoveAppDependencyResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal AppId AppID; // m_nAppID AppId_t + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoveAppDependencyResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.RemoveAppDependencyResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GetAppDependenciesResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32, ArraySubType = UnmanagedType.U4)] + internal AppId[] GAppIDs; // m_rgAppIDs AppId_t [32] + internal uint NumAppDependencies; // m_nNumAppDependencies uint32 + internal uint TotalNumAppDependencies; // m_nTotalNumAppDependencies uint32 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GetAppDependenciesResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.GetAppDependenciesResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct DeleteItemResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(DeleteItemResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.DeleteItemResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamAppInstalled_t : ICallbackData + { + internal AppId AppID; // m_nAppID AppId_t + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamAppInstalled_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.SteamAppInstalled; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamAppUninstalled_t : ICallbackData + { + internal AppId AppID; // m_nAppID AppId_t + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamAppUninstalled_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.SteamAppUninstalled; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_BrowserReady_t : ICallbackData + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_BrowserReady_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.HTML_BrowserReady; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_NeedsPaint_t : ICallbackData + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PBGRA; // pBGRA const char * + internal uint UnWide; // unWide uint32 + internal uint UnTall; // unTall uint32 + internal uint UnUpdateX; // unUpdateX uint32 + internal uint UnUpdateY; // unUpdateY uint32 + internal uint UnUpdateWide; // unUpdateWide uint32 + internal uint UnUpdateTall; // unUpdateTall uint32 + internal uint UnScrollX; // unScrollX uint32 + internal uint UnScrollY; // unScrollY uint32 + internal float FlPageScale; // flPageScale float + internal uint UnPageSerial; // unPageSerial uint32 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_NeedsPaint_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.HTML_NeedsPaint; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_StartRequest_t : ICallbackData + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchURL; // pchURL const char * + internal string PchTarget; // pchTarget const char * + internal string PchPostData; // pchPostData const char * + [MarshalAs(UnmanagedType.I1)] + internal bool BIsRedirect; // bIsRedirect bool + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_StartRequest_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.HTML_StartRequest; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_CloseBrowser_t : ICallbackData + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_CloseBrowser_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.HTML_CloseBrowser; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_URLChanged_t : ICallbackData + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchURL; // pchURL const char * + internal string PchPostData; // pchPostData const char * + [MarshalAs(UnmanagedType.I1)] + internal bool BIsRedirect; // bIsRedirect bool + internal string PchPageTitle; // pchPageTitle const char * + [MarshalAs(UnmanagedType.I1)] + internal bool BNewNavigation; // bNewNavigation bool + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_URLChanged_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.HTML_URLChanged; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_FinishedRequest_t : ICallbackData + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchURL; // pchURL const char * + internal string PchPageTitle; // pchPageTitle const char * + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_FinishedRequest_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.HTML_FinishedRequest; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_OpenLinkInNewTab_t : ICallbackData + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchURL; // pchURL const char * + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_OpenLinkInNewTab_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.HTML_OpenLinkInNewTab; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_ChangedTitle_t : ICallbackData + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchTitle; // pchTitle const char * + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_ChangedTitle_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.HTML_ChangedTitle; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_SearchResults_t : ICallbackData + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal uint UnResults; // unResults uint32 + internal uint UnCurrentMatch; // unCurrentMatch uint32 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_SearchResults_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.HTML_SearchResults; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_CanGoBackAndForward_t : ICallbackData + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + [MarshalAs(UnmanagedType.I1)] + internal bool BCanGoBack; // bCanGoBack bool + [MarshalAs(UnmanagedType.I1)] + internal bool BCanGoForward; // bCanGoForward bool + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_CanGoBackAndForward_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.HTML_CanGoBackAndForward; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_HorizontalScroll_t : ICallbackData + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal uint UnScrollMax; // unScrollMax uint32 + internal uint UnScrollCurrent; // unScrollCurrent uint32 + internal float FlPageScale; // flPageScale float + [MarshalAs(UnmanagedType.I1)] + internal bool BVisible; // bVisible bool + internal uint UnPageSize; // unPageSize uint32 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_HorizontalScroll_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.HTML_HorizontalScroll; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_VerticalScroll_t : ICallbackData + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal uint UnScrollMax; // unScrollMax uint32 + internal uint UnScrollCurrent; // unScrollCurrent uint32 + internal float FlPageScale; // flPageScale float + [MarshalAs(UnmanagedType.I1)] + internal bool BVisible; // bVisible bool + internal uint UnPageSize; // unPageSize uint32 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_VerticalScroll_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.HTML_VerticalScroll; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_LinkAtPosition_t : ICallbackData + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal uint X; // x uint32 + internal uint Y; // y uint32 + internal string PchURL; // pchURL const char * + [MarshalAs(UnmanagedType.I1)] + internal bool BInput; // bInput bool + [MarshalAs(UnmanagedType.I1)] + internal bool BLiveLink; // bLiveLink bool + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_LinkAtPosition_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.HTML_LinkAtPosition; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_JSAlert_t : ICallbackData + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchMessage; // pchMessage const char * + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_JSAlert_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.HTML_JSAlert; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_JSConfirm_t : ICallbackData + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchMessage; // pchMessage const char * + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_JSConfirm_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.HTML_JSConfirm; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_FileOpenDialog_t : ICallbackData + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchTitle; // pchTitle const char * + internal string PchInitialFile; // pchInitialFile const char * + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_FileOpenDialog_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.HTML_FileOpenDialog; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_NewWindow_t : ICallbackData + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchURL; // pchURL const char * + internal uint UnX; // unX uint32 + internal uint UnY; // unY uint32 + internal uint UnWide; // unWide uint32 + internal uint UnTall; // unTall uint32 + internal uint UnNewWindow_BrowserHandle_IGNORE; // unNewWindow_BrowserHandle_IGNORE HHTMLBrowser + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_NewWindow_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.HTML_NewWindow; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_SetCursor_t : ICallbackData + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal uint EMouseCursor; // eMouseCursor uint32 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_SetCursor_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.HTML_SetCursor; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_StatusText_t : ICallbackData + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchMsg; // pchMsg const char * + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_StatusText_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.HTML_StatusText; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_ShowToolTip_t : ICallbackData + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchMsg; // pchMsg const char * + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_ShowToolTip_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.HTML_ShowToolTip; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_UpdateToolTip_t : ICallbackData + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchMsg; // pchMsg const char * + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_UpdateToolTip_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.HTML_UpdateToolTip; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_HideToolTip_t : ICallbackData + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_HideToolTip_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.HTML_HideToolTip; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_BrowserRestarted_t : ICallbackData + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal uint UnOldBrowserHandle; // unOldBrowserHandle HHTMLBrowser + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_BrowserRestarted_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.HTML_BrowserRestarted; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamInventoryResultReady_t : ICallbackData + { + internal int Handle; // m_handle SteamInventoryResult_t + internal Result Result; // m_result EResult + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryResultReady_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.SteamInventoryResultReady; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamInventoryFullUpdate_t : ICallbackData + { + internal int Handle; // m_handle SteamInventoryResult_t + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryFullUpdate_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.SteamInventoryFullUpdate; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamInventoryDefinitionUpdate_t : ICallbackData + { + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryDefinitionUpdate_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.SteamInventoryDefinitionUpdate; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct SteamInventoryEligiblePromoItemDefIDs_t : ICallbackData + { + internal Result Result; // m_result EResult + internal ulong SteamID; // m_steamID CSteamID + internal int UmEligiblePromoItemDefs; // m_numEligiblePromoItemDefs int + [MarshalAs(UnmanagedType.I1)] + internal bool CachedData; // m_bCachedData bool + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryEligiblePromoItemDefIDs_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.SteamInventoryEligiblePromoItemDefIDs; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamInventoryStartPurchaseResult_t : ICallbackData + { + internal Result Result; // m_result EResult + internal ulong OrderID; // m_ulOrderID uint64 + internal ulong TransID; // m_ulTransID uint64 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryStartPurchaseResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.SteamInventoryStartPurchaseResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamInventoryRequestPricesResult_t : ICallbackData + { + internal Result Result; // m_result EResult + internal string CurrencyUTF8() => System.Text.Encoding.UTF8.GetString( Currency, 0, System.Array.IndexOf( Currency, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] // byte[] m_rgchCurrency + internal byte[] Currency; // m_rgchCurrency char [4] + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryRequestPricesResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.SteamInventoryRequestPricesResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GetVideoURLResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal AppId VideoAppID; // m_unVideoAppID AppId_t + internal string URLUTF8() => System.Text.Encoding.UTF8.GetString( URL, 0, System.Array.IndexOf( URL, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] // byte[] m_rgchURL + internal byte[] URL; // m_rgchURL char [256] + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GetVideoURLResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.GetVideoURLResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GetOPFSettingsResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal AppId VideoAppID; // m_unVideoAppID AppId_t + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GetOPFSettingsResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.GetOPFSettingsResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct BroadcastUploadStart_t : ICallbackData + { + [MarshalAs(UnmanagedType.I1)] + internal bool IsRTMP; // m_bIsRTMP bool + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(BroadcastUploadStart_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.BroadcastUploadStart; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct BroadcastUploadStop_t : ICallbackData + { + internal BroadcastUploadResult Result; // m_eResult EBroadcastUploadResult + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(BroadcastUploadStop_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.BroadcastUploadStop; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamParentalSettingsChanged_t : ICallbackData + { + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamParentalSettingsChanged_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.SteamParentalSettingsChanged; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamRemotePlaySessionConnected_t : ICallbackData + { + internal uint SessionID; // m_unSessionID RemotePlaySessionID_t + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamRemotePlaySessionConnected_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.SteamRemotePlaySessionConnected; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamRemotePlaySessionDisconnected_t : ICallbackData + { + internal uint SessionID; // m_unSessionID RemotePlaySessionID_t + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamRemotePlaySessionDisconnected_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.SteamRemotePlaySessionDisconnected; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamNetConnectionStatusChangedCallback_t : ICallbackData + { + internal Connection Conn; // m_hConn HSteamNetConnection + internal ConnectionInfo Nfo; // m_info SteamNetConnectionInfo_t + internal ConnectionState OldState; // m_eOldState ESteamNetworkingConnectionState + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamNetConnectionStatusChangedCallback_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.SteamNetConnectionStatusChangedCallback; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamNetAuthenticationStatus_t : ICallbackData + { + internal SteamNetworkingAvailability Avail; // m_eAvail ESteamNetworkingAvailability + internal string DebugMsgUTF8() => System.Text.Encoding.UTF8.GetString( DebugMsg, 0, System.Array.IndexOf( DebugMsg, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] // byte[] m_debugMsg + internal byte[] DebugMsg; // m_debugMsg char [256] + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamNetAuthenticationStatus_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.SteamNetAuthenticationStatus; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamRelayNetworkStatus_t : ICallbackData + { + internal SteamNetworkingAvailability Avail; // m_eAvail ESteamNetworkingAvailability + internal int PingMeasurementInProgress; // m_bPingMeasurementInProgress int + internal SteamNetworkingAvailability AvailNetworkConfig; // m_eAvailNetworkConfig ESteamNetworkingAvailability + internal SteamNetworkingAvailability AvailAnyRelay; // m_eAvailAnyRelay ESteamNetworkingAvailability + internal string DebugMsgUTF8() => System.Text.Encoding.UTF8.GetString( DebugMsg, 0, System.Array.IndexOf( DebugMsg, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] // byte[] m_debugMsg + internal byte[] DebugMsg; // m_debugMsg char [256] + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamRelayNetworkStatus_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.SteamRelayNetworkStatus; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct GSClientApprove_t : ICallbackData + { + internal ulong SteamID; // m_SteamID CSteamID + internal ulong OwnerSteamID; // m_OwnerSteamID CSteamID + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientApprove_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.GSClientApprove; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GSClientDeny_t : ICallbackData + { + internal ulong SteamID; // m_SteamID CSteamID + internal DenyReason DenyReason; // m_eDenyReason EDenyReason + internal string OptionalTextUTF8() => System.Text.Encoding.UTF8.GetString( OptionalText, 0, System.Array.IndexOf( OptionalText, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] // byte[] m_rgchOptionalText + internal byte[] OptionalText; // m_rgchOptionalText char [128] + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientDeny_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.GSClientDeny; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GSClientKick_t : ICallbackData + { + internal ulong SteamID; // m_SteamID CSteamID + internal DenyReason DenyReason; // m_eDenyReason EDenyReason + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientKick_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.GSClientKick; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GSClientAchievementStatus_t : ICallbackData + { + internal ulong SteamID; // m_SteamID uint64 + internal string PchAchievementUTF8() => System.Text.Encoding.UTF8.GetString( PchAchievement, 0, System.Array.IndexOf( PchAchievement, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] // byte[] m_pchAchievement + internal byte[] PchAchievement; // m_pchAchievement char [128] + [MarshalAs(UnmanagedType.I1)] + internal bool Unlocked; // m_bUnlocked bool + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientAchievementStatus_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.GSClientAchievementStatus; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GSPolicyResponse_t : ICallbackData + { + internal byte Secure; // m_bSecure uint8 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSPolicyResponse_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.GSPolicyResponse; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GSGameplayStats_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal int Rank; // m_nRank int32 + internal uint TotalConnects; // m_unTotalConnects uint32 + internal uint TotalMinutesPlayed; // m_unTotalMinutesPlayed uint32 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSGameplayStats_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.GSGameplayStats; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct GSClientGroupStatus_t : ICallbackData + { + internal ulong SteamIDUser; // m_SteamIDUser CSteamID + internal ulong SteamIDGroup; // m_SteamIDGroup CSteamID + [MarshalAs(UnmanagedType.I1)] + internal bool Member; // m_bMember bool + [MarshalAs(UnmanagedType.I1)] + internal bool Officer; // m_bOfficer bool + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientGroupStatus_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.GSClientGroupStatus; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GSReputation_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal uint ReputationScore; // m_unReputationScore uint32 + [MarshalAs(UnmanagedType.I1)] + internal bool Banned; // m_bBanned bool + internal uint BannedIP; // m_unBannedIP uint32 + internal ushort BannedPort; // m_usBannedPort uint16 + internal ulong BannedGameID; // m_ulBannedGameID uint64 + internal uint BanExpires; // m_unBanExpires uint32 + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSReputation_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.GSReputation; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct AssociateWithClanResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(AssociateWithClanResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.AssociateWithClanResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct ComputeNewPlayerCompatibilityResult_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal int CPlayersThatDontLikeCandidate; // m_cPlayersThatDontLikeCandidate int + internal int CPlayersThatCandidateDoesntLike; // m_cPlayersThatCandidateDoesntLike int + internal int CClanPlayersThatDontLikeCandidate; // m_cClanPlayersThatDontLikeCandidate int + internal ulong SteamIDCandidate; // m_SteamIDCandidate CSteamID + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ComputeNewPlayerCompatibilityResult_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.ComputeNewPlayerCompatibilityResult; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct GSStatsReceived_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal ulong SteamIDUser; // m_steamIDUser CSteamID + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSStatsReceived_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.GSStatsReceived; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct GSStatsStored_t : ICallbackData + { + internal Result Result; // m_eResult EResult + internal ulong SteamIDUser; // m_steamIDUser CSteamID + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSStatsStored_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.GSStatsStored; + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GSStatsUnloaded_t : ICallbackData + { + internal ulong SteamIDUser; // m_steamIDUser CSteamID + + #region SteamCallback + public static int _datasize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSStatsUnloaded_t) ); + public int DataSize => _datasize; + public CallbackType CallbackType => CallbackType.GSStatsUnloaded; + #endregion + } + +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/SteamConstants.cs b/BoneSync/Facepunch.Steamworks/Generated/SteamConstants.cs new file mode 100644 index 0000000..5267234 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/SteamConstants.cs @@ -0,0 +1,104 @@ +using System; +using System.Runtime.InteropServices; +using System.Linq; +using Facepunch.Steamworks.Data; +using System.Threading.Tasks; + +namespace Facepunch.Steamworks.Data +{ + internal static class Defines + { + internal static readonly int k_cubSaltSize = 8; + internal static readonly GID_t k_GIDNil = 0xffffffffffffffff; + internal static readonly GID_t k_TxnIDNil = k_GIDNil; + internal static readonly GID_t k_TxnIDUnknown = 0; + internal static readonly JobID_t k_JobIDNil = 0xffffffffffffffff; + internal static readonly PackageId_t k_uPackageIdInvalid = 0xFFFFFFFF; + internal static readonly BundleId_t k_uBundleIdInvalid = 0; + internal static readonly AppId k_uAppIdInvalid = 0x0; + internal static readonly AssetClassId_t k_ulAssetClassIdInvalid = 0x0; + internal static readonly PhysicalItemId_t k_uPhysicalItemIdInvalid = 0x0; + internal static readonly DepotId_t k_uDepotIdInvalid = 0x0; + internal static readonly CellID_t k_uCellIDInvalid = 0xFFFFFFFF; + internal static readonly SteamAPICall_t k_uAPICallInvalid = 0x0; + internal static readonly PartnerId_t k_uPartnerIdInvalid = 0; + internal static readonly ManifestId_t k_uManifestIdInvalid = 0; + internal static readonly SiteId_t k_ulSiteIdInvalid = 0; + internal static readonly PartyBeaconID_t k_ulPartyBeaconIdInvalid = 0; + internal static readonly HAuthTicket k_HAuthTicketInvalid = 0; + internal static readonly uint k_unSteamAccountIDMask = 0xFFFFFFFF; + internal static readonly uint k_unSteamAccountInstanceMask = 0x000FFFFF; + internal static readonly uint k_unSteamUserDefaultInstance = 1; + internal static readonly int k_cchGameExtraInfoMax = 64; + internal static readonly int k_cchMaxFriendsGroupName = 64; + internal static readonly int k_cFriendsGroupLimit = 100; + internal static readonly FriendsGroupID_t k_FriendsGroupID_Invalid = - 1; + internal static readonly int k_cEnumerateFollowersMax = 50; + internal static readonly uint k_cubChatMetadataMax = 8192; + internal static readonly int k_cbMaxGameServerGameDir = 32; + internal static readonly int k_cbMaxGameServerMapName = 32; + internal static readonly int k_cbMaxGameServerGameDescription = 64; + internal static readonly int k_cbMaxGameServerName = 64; + internal static readonly int k_cbMaxGameServerTags = 128; + internal static readonly int k_cbMaxGameServerGameData = 2048; + internal static readonly int HSERVERQUERY_INVALID = -1; + internal static readonly uint k_unFavoriteFlagNone = 0x00; + internal static readonly uint k_unFavoriteFlagFavorite = 0x01; + internal static readonly uint k_unFavoriteFlagHistory = 0x02; + internal static readonly uint k_unMaxCloudFileChunkSize = 100 * 1024 * 1024; + internal static readonly PublishedFileId k_PublishedFileIdInvalid = 0; + internal static readonly UGCHandle_t k_UGCHandleInvalid = 0xffffffffffffffff; + internal static readonly PublishedFileUpdateHandle_t k_PublishedFileUpdateHandleInvalid = 0xffffffffffffffff; + internal static readonly UGCFileWriteStreamHandle_t k_UGCFileStreamHandleInvalid = 0xffffffffffffffff; + internal static readonly uint k_cchPublishedDocumentTitleMax = 128 + 1; + internal static readonly uint k_cchPublishedDocumentDescriptionMax = 8000; + internal static readonly uint k_cchPublishedDocumentChangeDescriptionMax = 8000; + internal static readonly uint k_unEnumeratePublishedFilesMaxResults = 50; + internal static readonly uint k_cchTagListMax = 1024 + 1; + internal static readonly uint k_cchFilenameMax = 260; + internal static readonly uint k_cchPublishedFileURLMax = 256; + internal static readonly int k_cubAppProofOfPurchaseKeyMax = 240; + internal static readonly uint k_nScreenshotMaxTaggedUsers = 32; + internal static readonly uint k_nScreenshotMaxTaggedPublishedFiles = 32; + internal static readonly int k_cubUFSTagTypeMax = 255; + internal static readonly int k_cubUFSTagValueMax = 255; + internal static readonly int k_ScreenshotThumbWidth = 200; + internal static readonly UGCQueryHandle_t k_UGCQueryHandleInvalid = 0xffffffffffffffff; + internal static readonly UGCUpdateHandle_t k_UGCUpdateHandleInvalid = 0xffffffffffffffff; + internal static readonly uint kNumUGCResultsPerPage = 50; + internal static readonly uint k_cchDeveloperMetadataMax = 5000; + internal static readonly uint INVALID_HTMLBROWSER = 0; + internal static readonly InventoryItemId k_SteamItemInstanceIDInvalid = ~default(ulong); + internal static readonly SteamInventoryResult_t k_SteamInventoryResultInvalid = - 1; + internal static readonly SteamInventoryUpdateHandle_t k_SteamInventoryUpdateHandleInvalid = 0xffffffffffffffff; + internal static readonly Connection k_HSteamNetConnection_Invalid = 0; + internal static readonly Socket k_HSteamListenSocket_Invalid = 0; + internal static readonly HSteamNetPollGroup k_HSteamNetPollGroup_Invalid = 0; + internal static readonly int k_cchMaxSteamNetworkingErrMsg = 1024; + internal static readonly int k_cchSteamNetworkingMaxConnectionCloseReason = 128; + internal static readonly int k_cchSteamNetworkingMaxConnectionDescription = 128; + internal static readonly int k_cbMaxSteamNetworkingSocketsMessageSizeSend = 512 * 1024; + internal static readonly int k_nSteamNetworkingSend_Unreliable = 0; + internal static readonly int k_nSteamNetworkingSend_NoNagle = 1; + internal static readonly int k_nSteamNetworkingSend_UnreliableNoNagle = k_nSteamNetworkingSend_Unreliable | k_nSteamNetworkingSend_NoNagle; + internal static readonly int k_nSteamNetworkingSend_NoDelay = 4; + internal static readonly int k_nSteamNetworkingSend_UnreliableNoDelay = k_nSteamNetworkingSend_Unreliable | k_nSteamNetworkingSend_NoDelay | k_nSteamNetworkingSend_NoNagle; + internal static readonly int k_nSteamNetworkingSend_Reliable = 8; + internal static readonly int k_nSteamNetworkingSend_ReliableNoNagle = k_nSteamNetworkingSend_Reliable | k_nSteamNetworkingSend_NoNagle; + internal static readonly int k_nSteamNetworkingSend_UseCurrentThread = 16; + internal static readonly int k_cchMaxSteamNetworkingPingLocationString = 1024; + internal static readonly int k_nSteamNetworkingPing_Failed = - 1; + internal static readonly int k_nSteamNetworkingPing_Unknown = - 2; + internal static readonly SteamNetworkingPOPID k_SteamDatagramPOPID_dev = ( ( uint ) 'd' << 16 ) | ( ( uint ) 'e' << 8 ) | ( uint ) 'v'; + internal static readonly uint k_unServerFlagNone = 0x00; + internal static readonly uint k_unServerFlagActive = 0x01; + internal static readonly uint k_unServerFlagSecure = 0x02; + internal static readonly uint k_unServerFlagDedicated = 0x04; + internal static readonly uint k_unServerFlagLinux = 0x08; + internal static readonly uint k_unServerFlagPassworded = 0x10; + internal static readonly uint k_unServerFlagPrivate = 0x20; + internal static readonly uint k_cbSteamDatagramMaxSerializedTicket = 512; + internal static readonly uint k_cbMaxSteamDatagramGameCoordinatorServerLoginAppData = 2048; + internal static readonly uint k_cbMaxSteamDatagramGameCoordinatorServerLoginSerialized = 4096; + } +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/SteamEnums.cs b/BoneSync/Facepunch.Steamworks/Generated/SteamEnums.cs new file mode 100644 index 0000000..c454a53 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/SteamEnums.cs @@ -0,0 +1,2107 @@ +using System; +using System.Runtime.InteropServices; +using System.Linq; +using Facepunch.Steamworks.Data; +using System.Threading.Tasks; + +namespace Facepunch.Steamworks +{ + // + // ESteamIPType + // + internal enum SteamIPType : int + { + Type4 = 0, + Type6 = 1, + } + + // + // EUniverse + // + public enum Universe : int + { + Invalid = 0, + Public = 1, + Beta = 2, + Internal = 3, + Dev = 4, + Max = 5, + } + + // + // EResult + // + public enum Result : int + { + None = 0, + OK = 1, + Fail = 2, + NoConnection = 3, + InvalidPassword = 5, + LoggedInElsewhere = 6, + InvalidProtocolVer = 7, + InvalidParam = 8, + FileNotFound = 9, + Busy = 10, + InvalidState = 11, + InvalidName = 12, + InvalidEmail = 13, + DuplicateName = 14, + AccessDenied = 15, + Timeout = 16, + Banned = 17, + AccountNotFound = 18, + InvalidSteamID = 19, + ServiceUnavailable = 20, + NotLoggedOn = 21, + Pending = 22, + EncryptionFailure = 23, + InsufficientPrivilege = 24, + LimitExceeded = 25, + Revoked = 26, + Expired = 27, + AlreadyRedeemed = 28, + DuplicateRequest = 29, + AlreadyOwned = 30, + IPNotFound = 31, + PersistFailed = 32, + LockingFailed = 33, + LogonSessionReplaced = 34, + ConnectFailed = 35, + HandshakeFailed = 36, + IOFailure = 37, + RemoteDisconnect = 38, + ShoppingCartNotFound = 39, + Blocked = 40, + Ignored = 41, + NoMatch = 42, + AccountDisabled = 43, + ServiceReadOnly = 44, + AccountNotFeatured = 45, + AdministratorOK = 46, + ContentVersion = 47, + TryAnotherCM = 48, + PasswordRequiredToKickSession = 49, + AlreadyLoggedInElsewhere = 50, + Suspended = 51, + Cancelled = 52, + DataCorruption = 53, + DiskFull = 54, + RemoteCallFailed = 55, + PasswordUnset = 56, + ExternalAccountUnlinked = 57, + PSNTicketInvalid = 58, + ExternalAccountAlreadyLinked = 59, + RemoteFileConflict = 60, + IllegalPassword = 61, + SameAsPreviousValue = 62, + AccountLogonDenied = 63, + CannotUseOldPassword = 64, + InvalidLoginAuthCode = 65, + AccountLogonDeniedNoMail = 66, + HardwareNotCapableOfIPT = 67, + IPTInitError = 68, + ParentalControlRestricted = 69, + FacebookQueryError = 70, + ExpiredLoginAuthCode = 71, + IPLoginRestrictionFailed = 72, + AccountLockedDown = 73, + AccountLogonDeniedVerifiedEmailRequired = 74, + NoMatchingURL = 75, + BadResponse = 76, + RequirePasswordReEntry = 77, + ValueOutOfRange = 78, + UnexpectedError = 79, + Disabled = 80, + InvalidCEGSubmission = 81, + RestrictedDevice = 82, + RegionLocked = 83, + RateLimitExceeded = 84, + AccountLoginDeniedNeedTwoFactor = 85, + ItemDeleted = 86, + AccountLoginDeniedThrottle = 87, + TwoFactorCodeMismatch = 88, + TwoFactorActivationCodeMismatch = 89, + AccountAssociatedToMultiplePartners = 90, + NotModified = 91, + NoMobileDevice = 92, + TimeNotSynced = 93, + SmsCodeFailed = 94, + AccountLimitExceeded = 95, + AccountActivityLimitExceeded = 96, + PhoneActivityLimitExceeded = 97, + RefundToWallet = 98, + EmailSendFailure = 99, + NotSettled = 100, + NeedCaptcha = 101, + GSLTDenied = 102, + GSOwnerDenied = 103, + InvalidItemType = 104, + IPBanned = 105, + GSLTExpired = 106, + InsufficientFunds = 107, + TooManyPending = 108, + NoSiteLicensesFound = 109, + WGNetworkSendExceeded = 110, + AccountNotFriends = 111, + LimitedUserAccount = 112, + CantRemoveItem = 113, + AccountDeleted = 114, + ExistingUserCancelledLicense = 115, + } + + // + // EVoiceResult + // + internal enum VoiceResult : int + { + OK = 0, + NotInitialized = 1, + NotRecording = 2, + NoData = 3, + BufferTooSmall = 4, + DataCorrupted = 5, + Restricted = 6, + UnsupportedCodec = 7, + ReceiverOutOfDate = 8, + ReceiverDidNotAnswer = 9, + } + + // + // EDenyReason + // + internal enum DenyReason : int + { + Invalid = 0, + InvalidVersion = 1, + Generic = 2, + NotLoggedOn = 3, + NoLicense = 4, + Cheater = 5, + LoggedInElseWhere = 6, + UnknownText = 7, + IncompatibleAnticheat = 8, + MemoryCorruption = 9, + IncompatibleSoftware = 10, + SteamConnectionLost = 11, + SteamConnectionError = 12, + SteamResponseTimedOut = 13, + SteamValidationStalled = 14, + SteamOwnerLeftGuestUser = 15, + } + + // + // EBeginAuthSessionResult + // + public enum BeginAuthResult : int + { + OK = 0, + InvalidTicket = 1, + DuplicateRequest = 2, + InvalidVersion = 3, + GameMismatch = 4, + ExpiredTicket = 5, + } + + // + // EAuthSessionResponse + // + public enum AuthResponse : int + { + OK = 0, + UserNotConnectedToSteam = 1, + NoLicenseOrExpired = 2, + VACBanned = 3, + LoggedInElseWhere = 4, + VACCheckTimedOut = 5, + AuthTicketCanceled = 6, + AuthTicketInvalidAlreadyUsed = 7, + AuthTicketInvalid = 8, + PublisherIssuedBan = 9, + } + + // + // EUserHasLicenseForAppResult + // + public enum UserHasLicenseForAppResult : int + { + HasLicense = 0, + DoesNotHaveLicense = 1, + NoAuth = 2, + } + + // + // EAccountType + // + internal enum AccountType : int + { + Invalid = 0, + Individual = 1, + Multiseat = 2, + GameServer = 3, + AnonGameServer = 4, + Pending = 5, + ContentServer = 6, + Clan = 7, + Chat = 8, + ConsoleUser = 9, + AnonUser = 10, + Max = 11, + } + + // + // EAppReleaseState + // + internal enum AppReleaseState : int + { + Unknown = 0, + Unavailable = 1, + Prerelease = 2, + PreloadOnly = 3, + Released = 4, + } + + // + // EAppOwnershipFlags + // + internal enum AppOwnershipFlags : int + { + None = 0, + OwnsLicense = 1, + FreeLicense = 2, + RegionRestricted = 4, + LowViolence = 8, + InvalidPlatform = 16, + SharedLicense = 32, + FreeWeekend = 64, + RetailLicense = 128, + LicenseLocked = 256, + LicensePending = 512, + LicenseExpired = 1024, + LicensePermanent = 2048, + LicenseRecurring = 4096, + LicenseCanceled = 8192, + AutoGrant = 16384, + PendingGift = 32768, + RentalNotActivated = 65536, + Rental = 131072, + SiteLicense = 262144, + LegacyFreeSub = 524288, + InvalidOSType = 1048576, + } + + // + // EAppType + // + internal enum AppType : int + { + Invalid = 0, + Game = 1, + Application = 2, + Tool = 4, + Demo = 8, + Media_DEPRECATED = 16, + DLC = 32, + Guide = 64, + Driver = 128, + Config = 256, + Hardware = 512, + Franchise = 1024, + Video = 2048, + Plugin = 4096, + MusicAlbum = 8192, + Series = 16384, + Comic_UNUSED = 32768, + Beta = 65536, + Shortcut = 1073741824, + DepotOnly = -2147483648, + } + + // + // ESteamUserStatType + // + internal enum SteamUserStatType : int + { + INVALID = 0, + INT = 1, + FLOAT = 2, + AVGRATE = 3, + ACHIEVEMENTS = 4, + GROUPACHIEVEMENTS = 5, + MAX = 6, + } + + // + // EChatEntryType + // + internal enum ChatEntryType : int + { + Invalid = 0, + ChatMsg = 1, + Typing = 2, + InviteGame = 3, + Emote = 4, + LeftConversation = 6, + Entered = 7, + WasKicked = 8, + WasBanned = 9, + Disconnected = 10, + HistoricalChat = 11, + LinkBlocked = 14, + } + + // + // EChatRoomEnterResponse + // + public enum RoomEnter : int + { + Success = 1, + DoesntExist = 2, + NotAllowed = 3, + Full = 4, + Error = 5, + Banned = 6, + Limited = 7, + ClanDisabled = 8, + CommunityBan = 9, + MemberBlockedYou = 10, + YouBlockedMember = 11, + RatelimitExceeded = 15, + } + + // + // EChatSteamIDInstanceFlags + // + internal enum ChatSteamIDInstanceFlags : int + { + AccountInstanceMask = 4095, + InstanceFlagClan = 524288, + InstanceFlagLobby = 262144, + InstanceFlagMMSLobby = 131072, + } + + // + // EMarketingMessageFlags + // + internal enum MarketingMessageFlags : int + { + None = 0, + HighPriority = 1, + PlatformWindows = 2, + PlatformMac = 4, + PlatformLinux = 8, + PlatformRestrictions = 14, + } + + // + // ENotificationPosition + // + public enum NotificationPosition : int + { + TopLeft = 0, + TopRight = 1, + BottomLeft = 2, + BottomRight = 3, + } + + // + // EBroadcastUploadResult + // + public enum BroadcastUploadResult : int + { + None = 0, + OK = 1, + InitFailed = 2, + FrameFailed = 3, + Timeout = 4, + BandwidthExceeded = 5, + LowFPS = 6, + MissingKeyFrames = 7, + NoConnection = 8, + RelayFailed = 9, + SettingsChanged = 10, + MissingAudio = 11, + TooFarBehind = 12, + TranscodeBehind = 13, + NotAllowedToPlay = 14, + Busy = 15, + Banned = 16, + AlreadyActive = 17, + ForcedOff = 18, + AudioBehind = 19, + Shutdown = 20, + Disconnect = 21, + VideoInitFailed = 22, + AudioInitFailed = 23, + } + + // + // ELaunchOptionType + // + internal enum LaunchOptionType : int + { + None = 0, + Default = 1, + SafeMode = 2, + Multiplayer = 3, + Config = 4, + OpenVR = 5, + Server = 6, + Editor = 7, + Manual = 8, + Benchmark = 9, + Option1 = 10, + Option2 = 11, + Option3 = 12, + OculusVR = 13, + OpenVROverlay = 14, + OSVR = 15, + Dialog = 1000, + } + + // + // EVRHMDType + // + internal enum VRHMDType : int + { + MDType_None = -1, + MDType_Unknown = 0, + MDType_HTC_Dev = 1, + MDType_HTC_VivePre = 2, + MDType_HTC_Vive = 3, + MDType_HTC_VivePro = 4, + MDType_HTC_ViveCosmos = 5, + MDType_HTC_Unknown = 20, + MDType_Oculus_DK1 = 21, + MDType_Oculus_DK2 = 22, + MDType_Oculus_Rift = 23, + MDType_Oculus_RiftS = 24, + MDType_Oculus_Quest = 25, + MDType_Oculus_Unknown = 40, + MDType_Acer_Unknown = 50, + MDType_Acer_WindowsMR = 51, + MDType_Dell_Unknown = 60, + MDType_Dell_Visor = 61, + MDType_Lenovo_Unknown = 70, + MDType_Lenovo_Explorer = 71, + MDType_HP_Unknown = 80, + MDType_HP_WindowsMR = 81, + MDType_HP_Reverb = 82, + MDType_Samsung_Unknown = 90, + MDType_Samsung_Odyssey = 91, + MDType_Unannounced_Unknown = 100, + MDType_Unannounced_WindowsMR = 101, + MDType_vridge = 110, + MDType_Huawei_Unknown = 120, + MDType_Huawei_VR2 = 121, + MDType_Huawei_EndOfRange = 129, + mdType_Valve_Unknown = 130, + mdType_Valve_Index = 131, + } + + // + // EMarketNotAllowedReasonFlags + // + internal enum MarketNotAllowedReasonFlags : int + { + None = 0, + TemporaryFailure = 1, + AccountDisabled = 2, + AccountLockedDown = 4, + AccountLimited = 8, + TradeBanned = 16, + AccountNotTrusted = 32, + SteamGuardNotEnabled = 64, + SteamGuardOnlyRecentlyEnabled = 128, + RecentPasswordReset = 256, + NewPaymentMethod = 512, + InvalidCookie = 1024, + UsingNewDevice = 2048, + RecentSelfRefund = 4096, + NewPaymentMethodCannotBeVerified = 8192, + NoRecentPurchases = 16384, + AcceptedWalletGift = 32768, + } + + // + // EDurationControlProgress + // + public enum DurationControlProgress : int + { + Progress_Full = 0, + Progress_Half = 1, + Progress_None = 2, + ExitSoon_3h = 3, + ExitSoon_5h = 4, + ExitSoon_Night = 5, + } + + // + // EDurationControlNotification + // + internal enum DurationControlNotification : int + { + None = 0, + DurationControlNotification1Hour = 1, + DurationControlNotification3Hours = 2, + HalfProgress = 3, + NoProgress = 4, + ExitSoon_3h = 5, + ExitSoon_5h = 6, + ExitSoon_Night = 7, + } + + // + // EGameSearchErrorCode_t + // + internal enum GameSearchErrorCode_t : int + { + OK = 1, + Failed_Search_Already_In_Progress = 2, + Failed_No_Search_In_Progress = 3, + Failed_Not_Lobby_Leader = 4, + Failed_No_Host_Available = 5, + Failed_Search_Params_Invalid = 6, + Failed_Offline = 7, + Failed_NotAuthorized = 8, + Failed_Unknown_Error = 9, + } + + // + // EPlayerResult_t + // + internal enum PlayerResult_t : int + { + FailedToConnect = 1, + Abandoned = 2, + Kicked = 3, + Incomplete = 4, + Completed = 5, + } + + // + // ESteamIPv6ConnectivityProtocol + // + internal enum SteamIPv6ConnectivityProtocol : int + { + Invalid = 0, + HTTP = 1, + UDP = 2, + } + + // + // ESteamIPv6ConnectivityState + // + internal enum SteamIPv6ConnectivityState : int + { + Unknown = 0, + Good = 1, + Bad = 2, + } + + // + // EFriendRelationship + // + public enum Relationship : int + { + None = 0, + Blocked = 1, + RequestRecipient = 2, + Friend = 3, + RequestInitiator = 4, + Ignored = 5, + IgnoredFriend = 6, + Suggested_DEPRECATED = 7, + Max = 8, + } + + // + // EPersonaState + // + public enum FriendState : int + { + Offline = 0, + Online = 1, + Busy = 2, + Away = 3, + Snooze = 4, + LookingToTrade = 5, + LookingToPlay = 6, + Invisible = 7, + Max = 8, + } + + // + // EFriendFlags + // + internal enum FriendFlags : int + { + None = 0, + Blocked = 1, + FriendshipRequested = 2, + Immediate = 4, + ClanMember = 8, + OnGameServer = 16, + RequestingFriendship = 128, + RequestingInfo = 256, + Ignored = 512, + IgnoredFriend = 1024, + ChatMember = 4096, + All = 65535, + } + + // + // EUserRestriction + // + internal enum UserRestriction : int + { + None = 0, + Unknown = 1, + AnyChat = 2, + VoiceChat = 4, + GroupChat = 8, + Rating = 16, + GameInvites = 32, + Trading = 64, + } + + // + // EOverlayToStoreFlag + // + internal enum OverlayToStoreFlag : int + { + None = 0, + AddToCart = 1, + AddToCartAndShow = 2, + } + + // + // EActivateGameOverlayToWebPageMode + // + internal enum ActivateGameOverlayToWebPageMode : int + { + Default = 0, + Modal = 1, + } + + // + // EPersonaChange + // + internal enum PersonaChange : int + { + Name = 1, + Status = 2, + ComeOnline = 4, + GoneOffline = 8, + GamePlayed = 16, + GameServer = 32, + Avatar = 64, + JoinedSource = 128, + LeftSource = 256, + RelationshipChanged = 512, + NameFirstSet = 1024, + Broadcast = 2048, + Nickname = 4096, + SteamLevel = 8192, + RichPresence = 16384, + } + + // + // ESteamAPICallFailure + // + internal enum SteamAPICallFailure : int + { + None = -1, + SteamGone = 0, + NetworkFailure = 1, + InvalidHandle = 2, + MismatchedCallback = 3, + } + + // + // EGamepadTextInputMode + // + public enum GamepadTextInputMode : int + { + Normal = 0, + Password = 1, + } + + // + // EGamepadTextInputLineMode + // + public enum GamepadTextInputLineMode : int + { + SingleLine = 0, + MultipleLines = 1, + } + + // + // ECheckFileSignature + // + public enum CheckFileSignature : int + { + InvalidSignature = 0, + ValidSignature = 1, + FileNotFound = 2, + NoSignaturesFoundForThisApp = 3, + NoSignaturesFoundForThisFile = 4, + } + + // + // EMatchMakingServerResponse + // + internal enum MatchMakingServerResponse : int + { + ServerResponded = 0, + ServerFailedToRespond = 1, + NoServersListedOnMasterServer = 2, + } + + // + // ELobbyType + // + internal enum LobbyType : int + { + Private = 0, + FriendsOnly = 1, + Public = 2, + Invisible = 3, + PrivateUnique = 4, + } + + // + // ELobbyComparison + // + internal enum LobbyComparison : int + { + EqualToOrLessThan = -2, + LessThan = -1, + Equal = 0, + GreaterThan = 1, + EqualToOrGreaterThan = 2, + NotEqual = 3, + } + + // + // ELobbyDistanceFilter + // + internal enum LobbyDistanceFilter : int + { + Close = 0, + Default = 1, + Far = 2, + Worldwide = 3, + } + + // + // EChatMemberStateChange + // + internal enum ChatMemberStateChange : int + { + Entered = 1, + Left = 2, + Disconnected = 4, + Kicked = 8, + Banned = 16, + } + + // + // ESteamPartyBeaconLocationType + // + internal enum SteamPartyBeaconLocationType : int + { + Invalid = 0, + ChatGroup = 1, + Max = 2, + } + + // + // ESteamPartyBeaconLocationData + // + internal enum SteamPartyBeaconLocationData : int + { + Invalid = 0, + Name = 1, + IconURLSmall = 2, + IconURLMedium = 3, + IconURLLarge = 4, + } + + // + // ERemoteStoragePlatform + // + internal enum RemoteStoragePlatform : int + { + None = 0, + Windows = 1, + OSX = 2, + PS3 = 4, + Linux = 8, + Switch = 16, + Android = 32, + IOS = 64, + All = -1, + } + + // + // ERemoteStoragePublishedFileVisibility + // + internal enum RemoteStoragePublishedFileVisibility : int + { + Public = 0, + FriendsOnly = 1, + Private = 2, + Unlisted = 3, + } + + // + // EWorkshopFileType + // + internal enum WorkshopFileType : int + { + First = 0, + Community = 0, + Microtransaction = 1, + Collection = 2, + Art = 3, + Video = 4, + Screenshot = 5, + Game = 6, + Software = 7, + Concept = 8, + WebGuide = 9, + IntegratedGuide = 10, + Merch = 11, + ControllerBinding = 12, + SteamworksAccessInvite = 13, + SteamVideo = 14, + GameManagedItem = 15, + Max = 16, + } + + // + // EWorkshopVote + // + internal enum WorkshopVote : int + { + Unvoted = 0, + For = 1, + Against = 2, + Later = 3, + } + + // + // EWorkshopFileAction + // + internal enum WorkshopFileAction : int + { + Played = 0, + Completed = 1, + } + + // + // EWorkshopEnumerationType + // + internal enum WorkshopEnumerationType : int + { + RankedByVote = 0, + Recent = 1, + Trending = 2, + FavoritesOfFriends = 3, + VotedByFriends = 4, + ContentByFriends = 5, + RecentFromFollowedUsers = 6, + } + + // + // EWorkshopVideoProvider + // + internal enum WorkshopVideoProvider : int + { + None = 0, + Youtube = 1, + } + + // + // EUGCReadAction + // + internal enum UGCReadAction : int + { + ontinueReadingUntilFinished = 0, + ontinueReading = 1, + lose = 2, + } + + // + // ELeaderboardDataRequest + // + internal enum LeaderboardDataRequest : int + { + Global = 0, + GlobalAroundUser = 1, + Friends = 2, + Users = 3, + } + + // + // ELeaderboardSortMethod + // + // + // ELeaderboardDisplayType + // + // + // ELeaderboardUploadScoreMethod + // + internal enum LeaderboardUploadScoreMethod : int + { + None = 0, + KeepBest = 1, + ForceUpdate = 2, + } + + // + // ERegisterActivationCodeResult + // + internal enum RegisterActivationCodeResult : int + { + ResultOK = 0, + ResultFail = 1, + ResultAlreadyRegistered = 2, + ResultTimeout = 3, + AlreadyOwned = 4, + } + + // + // EP2PSessionError + // + public enum P2PSessionError : int + { + None = 0, + NotRunningApp = 1, + NoRightsToApp = 2, + DestinationNotLoggedIn = 3, + Timeout = 4, + Max = 5, + } + + // + // EP2PSend + // + public enum P2PSend : int + { + Unreliable = 0, + UnreliableNoDelay = 1, + Reliable = 2, + ReliableWithBuffering = 3, + } + + // + // ESNetSocketState + // + // + // ESNetSocketConnectionType + // + // + // EVRScreenshotType + // + internal enum VRScreenshotType : int + { + None = 0, + Mono = 1, + Stereo = 2, + MonoCubemap = 3, + MonoPanorama = 4, + StereoPanorama = 5, + } + + // + // AudioPlayback_Status + // + public enum MusicStatus : int + { + Undefined = 0, + Playing = 1, + Paused = 2, + Idle = 3, + } + + // + // EHTTPMethod + // + internal enum HTTPMethod : int + { + Invalid = 0, + GET = 1, + HEAD = 2, + POST = 3, + PUT = 4, + DELETE = 5, + OPTIONS = 6, + PATCH = 7, + } + + // + // EHTTPStatusCode + // + internal enum HTTPStatusCode : int + { + Invalid = 0, + Code100Continue = 100, + Code101SwitchingProtocols = 101, + Code200OK = 200, + Code201Created = 201, + Code202Accepted = 202, + Code203NonAuthoritative = 203, + Code204NoContent = 204, + Code205ResetContent = 205, + Code206PartialContent = 206, + Code300MultipleChoices = 300, + Code301MovedPermanently = 301, + Code302Found = 302, + Code303SeeOther = 303, + Code304NotModified = 304, + Code305UseProxy = 305, + Code307TemporaryRedirect = 307, + Code400BadRequest = 400, + Code401Unauthorized = 401, + Code402PaymentRequired = 402, + Code403Forbidden = 403, + Code404NotFound = 404, + Code405MethodNotAllowed = 405, + Code406NotAcceptable = 406, + Code407ProxyAuthRequired = 407, + Code408RequestTimeout = 408, + Code409Conflict = 409, + Code410Gone = 410, + Code411LengthRequired = 411, + Code412PreconditionFailed = 412, + Code413RequestEntityTooLarge = 413, + Code414RequestURITooLong = 414, + Code415UnsupportedMediaType = 415, + Code416RequestedRangeNotSatisfiable = 416, + Code417ExpectationFailed = 417, + Code4xxUnknown = 418, + Code429TooManyRequests = 429, + Code500InternalServerError = 500, + Code501NotImplemented = 501, + Code502BadGateway = 502, + Code503ServiceUnavailable = 503, + Code504GatewayTimeout = 504, + Code505HTTPVersionNotSupported = 505, + Code5xxUnknown = 599, + } + + // + // EInputSourceMode + // + public enum InputSourceMode : int + { + None = 0, + Dpad = 1, + Buttons = 2, + FourButtons = 3, + AbsoluteMouse = 4, + RelativeMouse = 5, + JoystickMove = 6, + JoystickMouse = 7, + JoystickCamera = 8, + ScrollWheel = 9, + Trigger = 10, + TouchMenu = 11, + MouseJoystick = 12, + MouseRegion = 13, + RadialMenu = 14, + SingleButton = 15, + Switches = 16, + } + + // + // EInputActionOrigin + // + internal enum InputActionOrigin : int + { + None = 0, + SteamController_A = 1, + SteamController_B = 2, + SteamController_X = 3, + SteamController_Y = 4, + SteamController_LeftBumper = 5, + SteamController_RightBumper = 6, + SteamController_LeftGrip = 7, + SteamController_RightGrip = 8, + SteamController_Start = 9, + SteamController_Back = 10, + SteamController_LeftPad_Touch = 11, + SteamController_LeftPad_Swipe = 12, + SteamController_LeftPad_Click = 13, + SteamController_LeftPad_DPadNorth = 14, + SteamController_LeftPad_DPadSouth = 15, + SteamController_LeftPad_DPadWest = 16, + SteamController_LeftPad_DPadEast = 17, + SteamController_RightPad_Touch = 18, + SteamController_RightPad_Swipe = 19, + SteamController_RightPad_Click = 20, + SteamController_RightPad_DPadNorth = 21, + SteamController_RightPad_DPadSouth = 22, + SteamController_RightPad_DPadWest = 23, + SteamController_RightPad_DPadEast = 24, + SteamController_LeftTrigger_Pull = 25, + SteamController_LeftTrigger_Click = 26, + SteamController_RightTrigger_Pull = 27, + SteamController_RightTrigger_Click = 28, + SteamController_LeftStick_Move = 29, + SteamController_LeftStick_Click = 30, + SteamController_LeftStick_DPadNorth = 31, + SteamController_LeftStick_DPadSouth = 32, + SteamController_LeftStick_DPadWest = 33, + SteamController_LeftStick_DPadEast = 34, + SteamController_Gyro_Move = 35, + SteamController_Gyro_Pitch = 36, + SteamController_Gyro_Yaw = 37, + SteamController_Gyro_Roll = 38, + SteamController_Reserved0 = 39, + SteamController_Reserved1 = 40, + SteamController_Reserved2 = 41, + SteamController_Reserved3 = 42, + SteamController_Reserved4 = 43, + SteamController_Reserved5 = 44, + SteamController_Reserved6 = 45, + SteamController_Reserved7 = 46, + SteamController_Reserved8 = 47, + SteamController_Reserved9 = 48, + SteamController_Reserved10 = 49, + PS4_X = 50, + PS4_Circle = 51, + PS4_Triangle = 52, + PS4_Square = 53, + PS4_LeftBumper = 54, + PS4_RightBumper = 55, + PS4_Options = 56, + PS4_Share = 57, + PS4_LeftPad_Touch = 58, + PS4_LeftPad_Swipe = 59, + PS4_LeftPad_Click = 60, + PS4_LeftPad_DPadNorth = 61, + PS4_LeftPad_DPadSouth = 62, + PS4_LeftPad_DPadWest = 63, + PS4_LeftPad_DPadEast = 64, + PS4_RightPad_Touch = 65, + PS4_RightPad_Swipe = 66, + PS4_RightPad_Click = 67, + PS4_RightPad_DPadNorth = 68, + PS4_RightPad_DPadSouth = 69, + PS4_RightPad_DPadWest = 70, + PS4_RightPad_DPadEast = 71, + PS4_CenterPad_Touch = 72, + PS4_CenterPad_Swipe = 73, + PS4_CenterPad_Click = 74, + PS4_CenterPad_DPadNorth = 75, + PS4_CenterPad_DPadSouth = 76, + PS4_CenterPad_DPadWest = 77, + PS4_CenterPad_DPadEast = 78, + PS4_LeftTrigger_Pull = 79, + PS4_LeftTrigger_Click = 80, + PS4_RightTrigger_Pull = 81, + PS4_RightTrigger_Click = 82, + PS4_LeftStick_Move = 83, + PS4_LeftStick_Click = 84, + PS4_LeftStick_DPadNorth = 85, + PS4_LeftStick_DPadSouth = 86, + PS4_LeftStick_DPadWest = 87, + PS4_LeftStick_DPadEast = 88, + PS4_RightStick_Move = 89, + PS4_RightStick_Click = 90, + PS4_RightStick_DPadNorth = 91, + PS4_RightStick_DPadSouth = 92, + PS4_RightStick_DPadWest = 93, + PS4_RightStick_DPadEast = 94, + PS4_DPad_North = 95, + PS4_DPad_South = 96, + PS4_DPad_West = 97, + PS4_DPad_East = 98, + PS4_Gyro_Move = 99, + PS4_Gyro_Pitch = 100, + PS4_Gyro_Yaw = 101, + PS4_Gyro_Roll = 102, + PS4_DPad_Move = 103, + PS4_Reserved1 = 104, + PS4_Reserved2 = 105, + PS4_Reserved3 = 106, + PS4_Reserved4 = 107, + PS4_Reserved5 = 108, + PS4_Reserved6 = 109, + PS4_Reserved7 = 110, + PS4_Reserved8 = 111, + PS4_Reserved9 = 112, + PS4_Reserved10 = 113, + XBoxOne_A = 114, + XBoxOne_B = 115, + XBoxOne_X = 116, + XBoxOne_Y = 117, + XBoxOne_LeftBumper = 118, + XBoxOne_RightBumper = 119, + XBoxOne_Menu = 120, + XBoxOne_View = 121, + XBoxOne_LeftTrigger_Pull = 122, + XBoxOne_LeftTrigger_Click = 123, + XBoxOne_RightTrigger_Pull = 124, + XBoxOne_RightTrigger_Click = 125, + XBoxOne_LeftStick_Move = 126, + XBoxOne_LeftStick_Click = 127, + XBoxOne_LeftStick_DPadNorth = 128, + XBoxOne_LeftStick_DPadSouth = 129, + XBoxOne_LeftStick_DPadWest = 130, + XBoxOne_LeftStick_DPadEast = 131, + XBoxOne_RightStick_Move = 132, + XBoxOne_RightStick_Click = 133, + XBoxOne_RightStick_DPadNorth = 134, + XBoxOne_RightStick_DPadSouth = 135, + XBoxOne_RightStick_DPadWest = 136, + XBoxOne_RightStick_DPadEast = 137, + XBoxOne_DPad_North = 138, + XBoxOne_DPad_South = 139, + XBoxOne_DPad_West = 140, + XBoxOne_DPad_East = 141, + XBoxOne_DPad_Move = 142, + XBoxOne_Reserved1 = 143, + XBoxOne_Reserved2 = 144, + XBoxOne_Reserved3 = 145, + XBoxOne_Reserved4 = 146, + XBoxOne_Reserved5 = 147, + XBoxOne_Reserved6 = 148, + XBoxOne_Reserved7 = 149, + XBoxOne_Reserved8 = 150, + XBoxOne_Reserved9 = 151, + XBoxOne_Reserved10 = 152, + XBox360_A = 153, + XBox360_B = 154, + XBox360_X = 155, + XBox360_Y = 156, + XBox360_LeftBumper = 157, + XBox360_RightBumper = 158, + XBox360_Start = 159, + XBox360_Back = 160, + XBox360_LeftTrigger_Pull = 161, + XBox360_LeftTrigger_Click = 162, + XBox360_RightTrigger_Pull = 163, + XBox360_RightTrigger_Click = 164, + XBox360_LeftStick_Move = 165, + XBox360_LeftStick_Click = 166, + XBox360_LeftStick_DPadNorth = 167, + XBox360_LeftStick_DPadSouth = 168, + XBox360_LeftStick_DPadWest = 169, + XBox360_LeftStick_DPadEast = 170, + XBox360_RightStick_Move = 171, + XBox360_RightStick_Click = 172, + XBox360_RightStick_DPadNorth = 173, + XBox360_RightStick_DPadSouth = 174, + XBox360_RightStick_DPadWest = 175, + XBox360_RightStick_DPadEast = 176, + XBox360_DPad_North = 177, + XBox360_DPad_South = 178, + XBox360_DPad_West = 179, + XBox360_DPad_East = 180, + XBox360_DPad_Move = 181, + XBox360_Reserved1 = 182, + XBox360_Reserved2 = 183, + XBox360_Reserved3 = 184, + XBox360_Reserved4 = 185, + XBox360_Reserved5 = 186, + XBox360_Reserved6 = 187, + XBox360_Reserved7 = 188, + XBox360_Reserved8 = 189, + XBox360_Reserved9 = 190, + XBox360_Reserved10 = 191, + Switch_A = 192, + Switch_B = 193, + Switch_X = 194, + Switch_Y = 195, + Switch_LeftBumper = 196, + Switch_RightBumper = 197, + Switch_Plus = 198, + Switch_Minus = 199, + Switch_Capture = 200, + Switch_LeftTrigger_Pull = 201, + Switch_LeftTrigger_Click = 202, + Switch_RightTrigger_Pull = 203, + Switch_RightTrigger_Click = 204, + Switch_LeftStick_Move = 205, + Switch_LeftStick_Click = 206, + Switch_LeftStick_DPadNorth = 207, + Switch_LeftStick_DPadSouth = 208, + Switch_LeftStick_DPadWest = 209, + Switch_LeftStick_DPadEast = 210, + Switch_RightStick_Move = 211, + Switch_RightStick_Click = 212, + Switch_RightStick_DPadNorth = 213, + Switch_RightStick_DPadSouth = 214, + Switch_RightStick_DPadWest = 215, + Switch_RightStick_DPadEast = 216, + Switch_DPad_North = 217, + Switch_DPad_South = 218, + Switch_DPad_West = 219, + Switch_DPad_East = 220, + Switch_ProGyro_Move = 221, + Switch_ProGyro_Pitch = 222, + Switch_ProGyro_Yaw = 223, + Switch_ProGyro_Roll = 224, + Switch_DPad_Move = 225, + Switch_Reserved1 = 226, + Switch_Reserved2 = 227, + Switch_Reserved3 = 228, + Switch_Reserved4 = 229, + Switch_Reserved5 = 230, + Switch_Reserved6 = 231, + Switch_Reserved7 = 232, + Switch_Reserved8 = 233, + Switch_Reserved9 = 234, + Switch_Reserved10 = 235, + Switch_RightGyro_Move = 236, + Switch_RightGyro_Pitch = 237, + Switch_RightGyro_Yaw = 238, + Switch_RightGyro_Roll = 239, + Switch_LeftGyro_Move = 240, + Switch_LeftGyro_Pitch = 241, + Switch_LeftGyro_Yaw = 242, + Switch_LeftGyro_Roll = 243, + Switch_LeftGrip_Lower = 244, + Switch_LeftGrip_Upper = 245, + Switch_RightGrip_Lower = 246, + Switch_RightGrip_Upper = 247, + Switch_Reserved11 = 248, + Switch_Reserved12 = 249, + Switch_Reserved13 = 250, + Switch_Reserved14 = 251, + Switch_Reserved15 = 252, + Switch_Reserved16 = 253, + Switch_Reserved17 = 254, + Switch_Reserved18 = 255, + Switch_Reserved19 = 256, + Switch_Reserved20 = 257, + Count = 258, + MaximumPossibleValue = 32767, + } + + // + // EXboxOrigin + // + internal enum XboxOrigin : int + { + A = 0, + B = 1, + X = 2, + Y = 3, + LeftBumper = 4, + RightBumper = 5, + Menu = 6, + View = 7, + LeftTrigger_Pull = 8, + LeftTrigger_Click = 9, + RightTrigger_Pull = 10, + RightTrigger_Click = 11, + LeftStick_Move = 12, + LeftStick_Click = 13, + LeftStick_DPadNorth = 14, + LeftStick_DPadSouth = 15, + LeftStick_DPadWest = 16, + LeftStick_DPadEast = 17, + RightStick_Move = 18, + RightStick_Click = 19, + RightStick_DPadNorth = 20, + RightStick_DPadSouth = 21, + RightStick_DPadWest = 22, + RightStick_DPadEast = 23, + DPad_North = 24, + DPad_South = 25, + DPad_West = 26, + DPad_East = 27, + Count = 28, + } + + // + // ESteamControllerPad + // + internal enum SteamControllerPad : int + { + Left = 0, + Right = 1, + } + + // + // ESteamInputType + // + public enum InputType : int + { + Unknown = 0, + SteamController = 1, + XBox360Controller = 2, + XBoxOneController = 3, + GenericGamepad = 4, + PS4Controller = 5, + AppleMFiController = 6, + AndroidController = 7, + SwitchJoyConPair = 8, + SwitchJoyConSingle = 9, + SwitchProController = 10, + MobileTouch = 11, + PS3Controller = 12, + Count = 13, + MaximumPossibleValue = 255, + } + + // + // ESteamInputLEDFlag + // + internal enum SteamInputLEDFlag : int + { + SetColor = 0, + RestoreUserDefault = 1, + } + + // + // EControllerActionOrigin + // + internal enum ControllerActionOrigin : int + { + None = 0, + A = 1, + B = 2, + X = 3, + Y = 4, + LeftBumper = 5, + RightBumper = 6, + LeftGrip = 7, + RightGrip = 8, + Start = 9, + Back = 10, + LeftPad_Touch = 11, + LeftPad_Swipe = 12, + LeftPad_Click = 13, + LeftPad_DPadNorth = 14, + LeftPad_DPadSouth = 15, + LeftPad_DPadWest = 16, + LeftPad_DPadEast = 17, + RightPad_Touch = 18, + RightPad_Swipe = 19, + RightPad_Click = 20, + RightPad_DPadNorth = 21, + RightPad_DPadSouth = 22, + RightPad_DPadWest = 23, + RightPad_DPadEast = 24, + LeftTrigger_Pull = 25, + LeftTrigger_Click = 26, + RightTrigger_Pull = 27, + RightTrigger_Click = 28, + LeftStick_Move = 29, + LeftStick_Click = 30, + LeftStick_DPadNorth = 31, + LeftStick_DPadSouth = 32, + LeftStick_DPadWest = 33, + LeftStick_DPadEast = 34, + Gyro_Move = 35, + Gyro_Pitch = 36, + Gyro_Yaw = 37, + Gyro_Roll = 38, + PS4_X = 39, + PS4_Circle = 40, + PS4_Triangle = 41, + PS4_Square = 42, + PS4_LeftBumper = 43, + PS4_RightBumper = 44, + PS4_Options = 45, + PS4_Share = 46, + PS4_LeftPad_Touch = 47, + PS4_LeftPad_Swipe = 48, + PS4_LeftPad_Click = 49, + PS4_LeftPad_DPadNorth = 50, + PS4_LeftPad_DPadSouth = 51, + PS4_LeftPad_DPadWest = 52, + PS4_LeftPad_DPadEast = 53, + PS4_RightPad_Touch = 54, + PS4_RightPad_Swipe = 55, + PS4_RightPad_Click = 56, + PS4_RightPad_DPadNorth = 57, + PS4_RightPad_DPadSouth = 58, + PS4_RightPad_DPadWest = 59, + PS4_RightPad_DPadEast = 60, + PS4_CenterPad_Touch = 61, + PS4_CenterPad_Swipe = 62, + PS4_CenterPad_Click = 63, + PS4_CenterPad_DPadNorth = 64, + PS4_CenterPad_DPadSouth = 65, + PS4_CenterPad_DPadWest = 66, + PS4_CenterPad_DPadEast = 67, + PS4_LeftTrigger_Pull = 68, + PS4_LeftTrigger_Click = 69, + PS4_RightTrigger_Pull = 70, + PS4_RightTrigger_Click = 71, + PS4_LeftStick_Move = 72, + PS4_LeftStick_Click = 73, + PS4_LeftStick_DPadNorth = 74, + PS4_LeftStick_DPadSouth = 75, + PS4_LeftStick_DPadWest = 76, + PS4_LeftStick_DPadEast = 77, + PS4_RightStick_Move = 78, + PS4_RightStick_Click = 79, + PS4_RightStick_DPadNorth = 80, + PS4_RightStick_DPadSouth = 81, + PS4_RightStick_DPadWest = 82, + PS4_RightStick_DPadEast = 83, + PS4_DPad_North = 84, + PS4_DPad_South = 85, + PS4_DPad_West = 86, + PS4_DPad_East = 87, + PS4_Gyro_Move = 88, + PS4_Gyro_Pitch = 89, + PS4_Gyro_Yaw = 90, + PS4_Gyro_Roll = 91, + XBoxOne_A = 92, + XBoxOne_B = 93, + XBoxOne_X = 94, + XBoxOne_Y = 95, + XBoxOne_LeftBumper = 96, + XBoxOne_RightBumper = 97, + XBoxOne_Menu = 98, + XBoxOne_View = 99, + XBoxOne_LeftTrigger_Pull = 100, + XBoxOne_LeftTrigger_Click = 101, + XBoxOne_RightTrigger_Pull = 102, + XBoxOne_RightTrigger_Click = 103, + XBoxOne_LeftStick_Move = 104, + XBoxOne_LeftStick_Click = 105, + XBoxOne_LeftStick_DPadNorth = 106, + XBoxOne_LeftStick_DPadSouth = 107, + XBoxOne_LeftStick_DPadWest = 108, + XBoxOne_LeftStick_DPadEast = 109, + XBoxOne_RightStick_Move = 110, + XBoxOne_RightStick_Click = 111, + XBoxOne_RightStick_DPadNorth = 112, + XBoxOne_RightStick_DPadSouth = 113, + XBoxOne_RightStick_DPadWest = 114, + XBoxOne_RightStick_DPadEast = 115, + XBoxOne_DPad_North = 116, + XBoxOne_DPad_South = 117, + XBoxOne_DPad_West = 118, + XBoxOne_DPad_East = 119, + XBox360_A = 120, + XBox360_B = 121, + XBox360_X = 122, + XBox360_Y = 123, + XBox360_LeftBumper = 124, + XBox360_RightBumper = 125, + XBox360_Start = 126, + XBox360_Back = 127, + XBox360_LeftTrigger_Pull = 128, + XBox360_LeftTrigger_Click = 129, + XBox360_RightTrigger_Pull = 130, + XBox360_RightTrigger_Click = 131, + XBox360_LeftStick_Move = 132, + XBox360_LeftStick_Click = 133, + XBox360_LeftStick_DPadNorth = 134, + XBox360_LeftStick_DPadSouth = 135, + XBox360_LeftStick_DPadWest = 136, + XBox360_LeftStick_DPadEast = 137, + XBox360_RightStick_Move = 138, + XBox360_RightStick_Click = 139, + XBox360_RightStick_DPadNorth = 140, + XBox360_RightStick_DPadSouth = 141, + XBox360_RightStick_DPadWest = 142, + XBox360_RightStick_DPadEast = 143, + XBox360_DPad_North = 144, + XBox360_DPad_South = 145, + XBox360_DPad_West = 146, + XBox360_DPad_East = 147, + SteamV2_A = 148, + SteamV2_B = 149, + SteamV2_X = 150, + SteamV2_Y = 151, + SteamV2_LeftBumper = 152, + SteamV2_RightBumper = 153, + SteamV2_LeftGrip_Lower = 154, + SteamV2_LeftGrip_Upper = 155, + SteamV2_RightGrip_Lower = 156, + SteamV2_RightGrip_Upper = 157, + SteamV2_LeftBumper_Pressure = 158, + SteamV2_RightBumper_Pressure = 159, + SteamV2_LeftGrip_Pressure = 160, + SteamV2_RightGrip_Pressure = 161, + SteamV2_LeftGrip_Upper_Pressure = 162, + SteamV2_RightGrip_Upper_Pressure = 163, + SteamV2_Start = 164, + SteamV2_Back = 165, + SteamV2_LeftPad_Touch = 166, + SteamV2_LeftPad_Swipe = 167, + SteamV2_LeftPad_Click = 168, + SteamV2_LeftPad_Pressure = 169, + SteamV2_LeftPad_DPadNorth = 170, + SteamV2_LeftPad_DPadSouth = 171, + SteamV2_LeftPad_DPadWest = 172, + SteamV2_LeftPad_DPadEast = 173, + SteamV2_RightPad_Touch = 174, + SteamV2_RightPad_Swipe = 175, + SteamV2_RightPad_Click = 176, + SteamV2_RightPad_Pressure = 177, + SteamV2_RightPad_DPadNorth = 178, + SteamV2_RightPad_DPadSouth = 179, + SteamV2_RightPad_DPadWest = 180, + SteamV2_RightPad_DPadEast = 181, + SteamV2_LeftTrigger_Pull = 182, + SteamV2_LeftTrigger_Click = 183, + SteamV2_RightTrigger_Pull = 184, + SteamV2_RightTrigger_Click = 185, + SteamV2_LeftStick_Move = 186, + SteamV2_LeftStick_Click = 187, + SteamV2_LeftStick_DPadNorth = 188, + SteamV2_LeftStick_DPadSouth = 189, + SteamV2_LeftStick_DPadWest = 190, + SteamV2_LeftStick_DPadEast = 191, + SteamV2_Gyro_Move = 192, + SteamV2_Gyro_Pitch = 193, + SteamV2_Gyro_Yaw = 194, + SteamV2_Gyro_Roll = 195, + Switch_A = 196, + Switch_B = 197, + Switch_X = 198, + Switch_Y = 199, + Switch_LeftBumper = 200, + Switch_RightBumper = 201, + Switch_Plus = 202, + Switch_Minus = 203, + Switch_Capture = 204, + Switch_LeftTrigger_Pull = 205, + Switch_LeftTrigger_Click = 206, + Switch_RightTrigger_Pull = 207, + Switch_RightTrigger_Click = 208, + Switch_LeftStick_Move = 209, + Switch_LeftStick_Click = 210, + Switch_LeftStick_DPadNorth = 211, + Switch_LeftStick_DPadSouth = 212, + Switch_LeftStick_DPadWest = 213, + Switch_LeftStick_DPadEast = 214, + Switch_RightStick_Move = 215, + Switch_RightStick_Click = 216, + Switch_RightStick_DPadNorth = 217, + Switch_RightStick_DPadSouth = 218, + Switch_RightStick_DPadWest = 219, + Switch_RightStick_DPadEast = 220, + Switch_DPad_North = 221, + Switch_DPad_South = 222, + Switch_DPad_West = 223, + Switch_DPad_East = 224, + Switch_ProGyro_Move = 225, + Switch_ProGyro_Pitch = 226, + Switch_ProGyro_Yaw = 227, + Switch_ProGyro_Roll = 228, + Switch_RightGyro_Move = 229, + Switch_RightGyro_Pitch = 230, + Switch_RightGyro_Yaw = 231, + Switch_RightGyro_Roll = 232, + Switch_LeftGyro_Move = 233, + Switch_LeftGyro_Pitch = 234, + Switch_LeftGyro_Yaw = 235, + Switch_LeftGyro_Roll = 236, + Switch_LeftGrip_Lower = 237, + Switch_LeftGrip_Upper = 238, + Switch_RightGrip_Lower = 239, + Switch_RightGrip_Upper = 240, + PS4_DPad_Move = 241, + XBoxOne_DPad_Move = 242, + XBox360_DPad_Move = 243, + Switch_DPad_Move = 244, + Count = 245, + MaximumPossibleValue = 32767, + } + + // + // ESteamControllerLEDFlag + // + internal enum SteamControllerLEDFlag : int + { + SetColor = 0, + RestoreUserDefault = 1, + } + + // + // EUGCMatchingUGCType + // + public enum UgcType : int + { + Items = 0, + Items_Mtx = 1, + Items_ReadyToUse = 2, + Collections = 3, + Artwork = 4, + Videos = 5, + Screenshots = 6, + AllGuides = 7, + WebGuides = 8, + IntegratedGuides = 9, + UsableInGame = 10, + ControllerBindings = 11, + GameManagedItems = 12, + All = -1, + } + + // + // EUserUGCList + // + internal enum UserUGCList : int + { + Published = 0, + VotedOn = 1, + VotedUp = 2, + VotedDown = 3, + WillVoteLater = 4, + Favorited = 5, + Subscribed = 6, + UsedOrPlayed = 7, + Followed = 8, + } + + // + // EUserUGCListSortOrder + // + internal enum UserUGCListSortOrder : int + { + CreationOrderDesc = 0, + CreationOrderAsc = 1, + TitleAsc = 2, + LastUpdatedDesc = 3, + SubscriptionDateDesc = 4, + VoteScoreDesc = 5, + ForModeration = 6, + } + + // + // EUGCQuery + // + internal enum UGCQuery : int + { + RankedByVote = 0, + RankedByPublicationDate = 1, + AcceptedForGameRankedByAcceptanceDate = 2, + RankedByTrend = 3, + FavoritedByFriendsRankedByPublicationDate = 4, + CreatedByFriendsRankedByPublicationDate = 5, + RankedByNumTimesReported = 6, + CreatedByFollowedUsersRankedByPublicationDate = 7, + NotYetRated = 8, + RankedByTotalVotesAsc = 9, + RankedByVotesUp = 10, + RankedByTextSearch = 11, + RankedByTotalUniqueSubscriptions = 12, + RankedByPlaytimeTrend = 13, + RankedByTotalPlaytime = 14, + RankedByAveragePlaytimeTrend = 15, + RankedByLifetimeAveragePlaytime = 16, + RankedByPlaytimeSessionsTrend = 17, + RankedByLifetimePlaytimeSessions = 18, + } + + // + // EItemUpdateStatus + // + internal enum ItemUpdateStatus : int + { + Invalid = 0, + PreparingConfig = 1, + PreparingContent = 2, + UploadingContent = 3, + UploadingPreviewFile = 4, + CommittingChanges = 5, + } + + // + // EItemState + // + internal enum ItemState : int + { + None = 0, + Subscribed = 1, + LegacyItem = 2, + Installed = 4, + NeedsUpdate = 8, + Downloading = 16, + DownloadPending = 32, + } + + // + // EItemStatistic + // + internal enum ItemStatistic : int + { + NumSubscriptions = 0, + NumFavorites = 1, + NumFollowers = 2, + NumUniqueSubscriptions = 3, + NumUniqueFavorites = 4, + NumUniqueFollowers = 5, + NumUniqueWebsiteViews = 6, + ReportScore = 7, + NumSecondsPlayed = 8, + NumPlaytimeSessions = 9, + NumComments = 10, + NumSecondsPlayedDuringTimePeriod = 11, + NumPlaytimeSessionsDuringTimePeriod = 12, + } + + // + // EItemPreviewType + // + internal enum ItemPreviewType : int + { + Image = 0, + YouTubeVideo = 1, + Sketchfab = 2, + EnvironmentMap_HorizontalCross = 3, + EnvironmentMap_LatLong = 4, + ReservedMax = 255, + } + + // + // ESteamItemFlags + // + internal enum SteamItemFlags : int + { + NoTrade = 1, + Removed = 256, + Consumed = 512, + } + + // + // ESteamTVRegionBehavior + // + internal enum SteamTVRegionBehavior : int + { + Invalid = -1, + Hover = 0, + ClickPopup = 1, + ClickSurroundingRegion = 2, + } + + // + // EParentalFeature + // + public enum ParentalFeature : int + { + Invalid = 0, + Store = 1, + Community = 2, + Profile = 3, + Friends = 4, + News = 5, + Trading = 6, + Settings = 7, + Console = 8, + Browser = 9, + ParentalSetup = 10, + Library = 11, + Test = 12, + SiteLicense = 13, + Max = 14, + } + + // + // ESteamDeviceFormFactor + // + public enum SteamDeviceFormFactor : int + { + Unknown = 0, + Phone = 1, + Tablet = 2, + Computer = 3, + TV = 4, + } + + // + // ESteamNetworkingAvailability + // + public enum SteamNetworkingAvailability : int + { + CannotTry = -102, + Failed = -101, + Previously = -100, + Retrying = -10, + NeverTried = 1, + Waiting = 2, + Attempting = 3, + Current = 100, + Unknown = 0, + Force32bit = 2147483647, + } + + // + // ESteamNetworkingIdentityType + // + internal enum NetIdentityType : int + { + Invalid = 0, + SteamID = 16, + XboxPairwiseID = 17, + IPAddress = 1, + GenericString = 2, + GenericBytes = 3, + UnknownType = 4, + Force32bit = 2147483647, + } + + // + // ESteamNetworkingConnectionState + // + public enum ConnectionState : int + { + None = 0, + Connecting = 1, + FindingRoute = 2, + Connected = 3, + ClosedByPeer = 4, + ProblemDetectedLocally = 5, + FinWait = -1, + Linger = -2, + Dead = -3, + } + + // + // ESteamNetConnectionEnd + // + public enum NetConnectionEnd : int + { + Invalid = 0, + App_Min = 1000, + App_Generic = 1000, + App_Max = 1999, + AppException_Min = 2000, + AppException_Generic = 2000, + AppException_Max = 2999, + Local_Min = 3000, + Local_OfflineMode = 3001, + Local_ManyRelayConnectivity = 3002, + Local_HostedServerPrimaryRelay = 3003, + Local_NetworkConfig = 3004, + Local_Rights = 3005, + Local_Max = 3999, + Remote_Min = 4000, + Remote_Timeout = 4001, + Remote_BadCrypt = 4002, + Remote_BadCert = 4003, + Remote_NotLoggedIn = 4004, + Remote_NotRunningApp = 4005, + Remote_BadProtocolVersion = 4006, + Remote_Max = 4999, + Misc_Min = 5000, + Misc_Generic = 5001, + Misc_InternalError = 5002, + Misc_Timeout = 5003, + Misc_RelayConnectivity = 5004, + Misc_SteamConnectivity = 5005, + Misc_NoRelaySessionsToClient = 5006, + Misc_Max = 5999, + } + + // + // ESteamNetworkingConfigScope + // + internal enum NetConfigScope : int + { + Global = 1, + SocketsInterface = 2, + ListenSocket = 3, + Connection = 4, + } + + // + // ESteamNetworkingConfigDataType + // + internal enum NetConfigType : int + { + Int32 = 1, + Int64 = 2, + Float = 3, + String = 4, + FunctionPtr = 5, + } + + // + // ESteamNetworkingConfigValue + // + internal enum NetConfig : int + { + Invalid = 0, + FakePacketLoss_Send = 2, + FakePacketLoss_Recv = 3, + FakePacketLag_Send = 4, + FakePacketLag_Recv = 5, + FakePacketReorder_Send = 6, + FakePacketReorder_Recv = 7, + FakePacketReorder_Time = 8, + FakePacketDup_Send = 26, + FakePacketDup_Recv = 27, + FakePacketDup_TimeMax = 28, + TimeoutInitial = 24, + TimeoutConnected = 25, + SendBufferSize = 9, + SendRateMin = 10, + SendRateMax = 11, + NagleTime = 12, + IP_AllowWithoutAuth = 23, + MTU_PacketSize = 32, + MTU_DataSize = 33, + Unencrypted = 34, + EnumerateDevVars = 35, + SDRClient_ConsecutitivePingTimeoutsFailInitial = 19, + SDRClient_ConsecutitivePingTimeoutsFail = 20, + SDRClient_MinPingsBeforePingAccurate = 21, + SDRClient_SingleSocket = 22, + SDRClient_ForceRelayCluster = 29, + SDRClient_DebugTicketAddress = 30, + SDRClient_ForceProxyAddr = 31, + SDRClient_FakeClusterPing = 36, + LogLevel_AckRTT = 13, + LogLevel_PacketDecode = 14, + LogLevel_Message = 15, + LogLevel_PacketGaps = 16, + LogLevel_P2PRendezvous = 17, + LogLevel_SDRRelayPings = 18, + } + + // + // ESteamNetworkingGetConfigValueResult + // + internal enum NetConfigResult : int + { + BadValue = -1, + BadScopeObj = -2, + BufferTooSmall = -3, + OK = 1, + OKInherited = 2, + } + + // + // ESteamNetworkingSocketsDebugOutputType + // + public enum NetDebugOutput : int + { + None = 0, + Bug = 1, + Error = 2, + Important = 3, + Warning = 4, + Msg = 5, + Verbose = 6, + Debug = 7, + Everything = 8, + } + + // + // EServerMode + // + internal enum ServerMode : int + { + Invalid = 0, + NoAuthentication = 1, + Authentication = 2, + AuthenticationAndSecure = 3, + } + +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/SteamStructFunctions.cs b/BoneSync/Facepunch.Steamworks/Generated/SteamStructFunctions.cs new file mode 100644 index 0000000..9516d38 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/SteamStructFunctions.cs @@ -0,0 +1,208 @@ +using System; +using System.Runtime.InteropServices; +using System.Linq; +using Facepunch.Steamworks.Data; +using System.Threading.Tasks; + +namespace Facepunch.Steamworks.Data +{ + internal partial struct gameserveritem_t + { + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_gameserveritem_t_Construct", CallingConvention = Platform.CC)] + internal static extern void InternalConstruct( ref gameserveritem_t self ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_gameserveritem_t_GetName", CallingConvention = Platform.CC)] + internal static extern Utf8StringPointer InternalGetName( ref gameserveritem_t self ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_gameserveritem_t_SetName", CallingConvention = Platform.CC)] + internal static extern void InternalSetName( ref gameserveritem_t self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pName ); + + } + + internal partial struct MatchMakingKeyValuePair + { + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_MatchMakingKeyValuePair_t_Construct", CallingConvention = Platform.CC)] + internal static extern void InternalConstruct( ref MatchMakingKeyValuePair self ); + + } + + internal partial struct servernetadr_t + { + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_servernetadr_t_Construct", CallingConvention = Platform.CC)] + internal static extern void InternalConstruct( ref servernetadr_t self ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_servernetadr_t_Init", CallingConvention = Platform.CC)] + internal static extern void InternalInit( ref servernetadr_t self, uint ip, ushort usQueryPort, ushort usConnectionPort ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_servernetadr_t_GetQueryPort", CallingConvention = Platform.CC)] + internal static extern ushort InternalGetQueryPort( ref servernetadr_t self ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_servernetadr_t_SetQueryPort", CallingConvention = Platform.CC)] + internal static extern void InternalSetQueryPort( ref servernetadr_t self, ushort usPort ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_servernetadr_t_GetConnectionPort", CallingConvention = Platform.CC)] + internal static extern ushort InternalGetConnectionPort( ref servernetadr_t self ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_servernetadr_t_SetConnectionPort", CallingConvention = Platform.CC)] + internal static extern void InternalSetConnectionPort( ref servernetadr_t self, ushort usPort ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_servernetadr_t_GetIP", CallingConvention = Platform.CC)] + internal static extern uint InternalGetIP( ref servernetadr_t self ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_servernetadr_t_SetIP", CallingConvention = Platform.CC)] + internal static extern void InternalSetIP( ref servernetadr_t self, uint unIP ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_servernetadr_t_GetConnectionAddressString", CallingConvention = Platform.CC)] + internal static extern Utf8StringPointer InternalGetConnectionAddressString( ref servernetadr_t self ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_servernetadr_t_GetQueryAddressString", CallingConvention = Platform.CC)] + internal static extern Utf8StringPointer InternalGetQueryAddressString( ref servernetadr_t self ); + + [return: MarshalAs( UnmanagedType.I1 )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_servernetadr_t_IsLessThan", CallingConvention = Platform.CC)] + internal static extern bool InternalIsLessThan( ref servernetadr_t self, ref servernetadr_t netadr ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_servernetadr_t_Assign", CallingConvention = Platform.CC)] + internal static extern void InternalAssign( ref servernetadr_t self, ref servernetadr_t that ); + + } + + internal partial struct SteamDatagramHostedAddress + { + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamDatagramHostedAddress_Clear", CallingConvention = Platform.CC)] + internal static extern void InternalClear( ref SteamDatagramHostedAddress self ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamDatagramHostedAddress_GetPopID", CallingConvention = Platform.CC)] + internal static extern SteamNetworkingPOPID InternalGetPopID( ref SteamDatagramHostedAddress self ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamDatagramHostedAddress_SetDevAddress", CallingConvention = Platform.CC)] + internal static extern void InternalSetDevAddress( ref SteamDatagramHostedAddress self, uint nIP, ushort nPort, SteamNetworkingPOPID popid ); + + } + + internal partial struct SteamIPAddress + { + [return: MarshalAs( UnmanagedType.I1 )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamIPAddress_t_IsSet", CallingConvention = Platform.CC)] + internal static extern bool InternalIsSet( ref SteamIPAddress self ); + + } + + public partial struct NetIdentity + { + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIdentity_Clear", CallingConvention = Platform.CC)] + internal static extern void InternalClear( ref NetIdentity self ); + + [return: MarshalAs( UnmanagedType.I1 )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIdentity_IsInvalid", CallingConvention = Platform.CC)] + internal static extern bool InternalIsInvalid( ref NetIdentity self ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIdentity_SetSteamID", CallingConvention = Platform.CC)] + internal static extern void InternalSetSteamID( ref NetIdentity self, SteamId steamID ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIdentity_GetSteamID", CallingConvention = Platform.CC)] + internal static extern SteamId InternalGetSteamID( ref NetIdentity self ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIdentity_SetSteamID64", CallingConvention = Platform.CC)] + internal static extern void InternalSetSteamID64( ref NetIdentity self, ulong steamID ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIdentity_GetSteamID64", CallingConvention = Platform.CC)] + internal static extern ulong InternalGetSteamID64( ref NetIdentity self ); + + [return: MarshalAs( UnmanagedType.I1 )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIdentity_SetXboxPairwiseID", CallingConvention = Platform.CC)] + internal static extern bool InternalSetXboxPairwiseID( ref NetIdentity self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszString ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIdentity_GetXboxPairwiseID", CallingConvention = Platform.CC)] + internal static extern Utf8StringPointer InternalGetXboxPairwiseID( ref NetIdentity self ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIdentity_SetIPAddr", CallingConvention = Platform.CC)] + internal static extern void InternalSetIPAddr( ref NetIdentity self, ref NetAddress addr ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIdentity_GetIPAddr", CallingConvention = Platform.CC)] + internal static extern IntPtr InternalGetIPAddr( ref NetIdentity self ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIdentity_SetLocalHost", CallingConvention = Platform.CC)] + internal static extern void InternalSetLocalHost( ref NetIdentity self ); + + [return: MarshalAs( UnmanagedType.I1 )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIdentity_IsLocalHost", CallingConvention = Platform.CC)] + internal static extern bool InternalIsLocalHost( ref NetIdentity self ); + + [return: MarshalAs( UnmanagedType.I1 )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIdentity_SetGenericString", CallingConvention = Platform.CC)] + internal static extern bool InternalSetGenericString( ref NetIdentity self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszString ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIdentity_GetGenericString", CallingConvention = Platform.CC)] + internal static extern Utf8StringPointer InternalGetGenericString( ref NetIdentity self ); + + [return: MarshalAs( UnmanagedType.I1 )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIdentity_SetGenericBytes", CallingConvention = Platform.CC)] + internal static extern bool InternalSetGenericBytes( ref NetIdentity self, IntPtr data, uint cbLen ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIdentity_GetGenericBytes", CallingConvention = Platform.CC)] + internal static extern byte InternalGetGenericBytes( ref NetIdentity self, ref int cbLen ); + + [return: MarshalAs( UnmanagedType.I1 )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIdentity_IsEqualTo", CallingConvention = Platform.CC)] + internal static extern bool InternalIsEqualTo( ref NetIdentity self, ref NetIdentity x ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIdentity_ToString", CallingConvention = Platform.CC)] + internal static extern void InternalToString( ref NetIdentity self, IntPtr buf, uint cbBuf ); + + [return: MarshalAs( UnmanagedType.I1 )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIdentity_ParseString", CallingConvention = Platform.CC)] + internal static extern bool InternalParseString( ref NetIdentity self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszStr ); + + } + + public partial struct NetAddress + { + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIPAddr_Clear", CallingConvention = Platform.CC)] + internal static extern void InternalClear( ref NetAddress self ); + + [return: MarshalAs( UnmanagedType.I1 )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIPAddr_IsIPv6AllZeros", CallingConvention = Platform.CC)] + internal static extern bool InternalIsIPv6AllZeros( ref NetAddress self ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIPAddr_SetIPv6", CallingConvention = Platform.CC)] + internal static extern void InternalSetIPv6( ref NetAddress self, ref byte ipv6, ushort nPort ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIPAddr_SetIPv4", CallingConvention = Platform.CC)] + internal static extern void InternalSetIPv4( ref NetAddress self, uint nIP, ushort nPort ); + + [return: MarshalAs( UnmanagedType.I1 )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIPAddr_IsIPv4", CallingConvention = Platform.CC)] + internal static extern bool InternalIsIPv4( ref NetAddress self ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIPAddr_GetIPv4", CallingConvention = Platform.CC)] + internal static extern uint InternalGetIPv4( ref NetAddress self ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIPAddr_SetIPv6LocalHost", CallingConvention = Platform.CC)] + internal static extern void InternalSetIPv6LocalHost( ref NetAddress self, ushort nPort ); + + [return: MarshalAs( UnmanagedType.I1 )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIPAddr_IsLocalHost", CallingConvention = Platform.CC)] + internal static extern bool InternalIsLocalHost( ref NetAddress self ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIPAddr_ToString", CallingConvention = Platform.CC)] + internal static extern void InternalToString( ref NetAddress self, IntPtr buf, uint cbBuf, [MarshalAs( UnmanagedType.U1 )] bool bWithPort ); + + [return: MarshalAs( UnmanagedType.I1 )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIPAddr_ParseString", CallingConvention = Platform.CC)] + internal static extern bool InternalParseString( ref NetAddress self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszStr ); + + [return: MarshalAs( UnmanagedType.I1 )] + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingIPAddr_IsEqualTo", CallingConvention = Platform.CC)] + internal static extern bool InternalIsEqualTo( ref NetAddress self, ref NetAddress x ); + + } + + internal partial struct NetMsg + { + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_SteamNetworkingMessage_t_Release", CallingConvention = Platform.CC)] + internal static unsafe extern void InternalRelease( NetMsg* self ); + + } + +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/SteamStructs.cs b/BoneSync/Facepunch.Steamworks/Generated/SteamStructs.cs new file mode 100644 index 0000000..bff0ba0 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/SteamStructs.cs @@ -0,0 +1,226 @@ +using System; +using System.Runtime.InteropServices; +using System.Linq; +using Facepunch.Steamworks.Data; +using System.Threading.Tasks; + +namespace Facepunch.Steamworks.Data +{ + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct FriendGameInfo_t + { + internal GameId GameID; // m_gameID CGameID + internal uint GameIP; // m_unGameIP uint32 + internal ushort GamePort; // m_usGamePort uint16 + internal ushort QueryPort; // m_usQueryPort uint16 + internal ulong SteamIDLobby; // m_steamIDLobby CSteamID + + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct FriendSessionStateInfo_t + { + internal uint IOnlineSessionInstances; // m_uiOnlineSessionInstances uint32 + internal byte IPublishedToFriendsSessionInstance; // m_uiPublishedToFriendsSessionInstance uint8 + + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal partial struct servernetadr_t + { + internal ushort ConnectionPort; // m_usConnectionPort uint16 + internal ushort QueryPort; // m_usQueryPort uint16 + internal uint IP; // m_unIP uint32 + + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal partial struct gameserveritem_t + { + internal servernetadr_t NetAdr; // m_NetAdr servernetadr_t + internal int Ping; // m_nPing int + [MarshalAs(UnmanagedType.I1)] + internal bool HadSuccessfulResponse; // m_bHadSuccessfulResponse bool + [MarshalAs(UnmanagedType.I1)] + internal bool DoNotRefresh; // m_bDoNotRefresh bool + internal string GameDirUTF8() => System.Text.Encoding.UTF8.GetString( GameDir, 0, System.Array.IndexOf( GameDir, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] // byte[] m_szGameDir + internal byte[] GameDir; // m_szGameDir char [32] + internal string MapUTF8() => System.Text.Encoding.UTF8.GetString( Map, 0, System.Array.IndexOf( Map, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] // byte[] m_szMap + internal byte[] Map; // m_szMap char [32] + internal string GameDescriptionUTF8() => System.Text.Encoding.UTF8.GetString( GameDescription, 0, System.Array.IndexOf( GameDescription, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] // byte[] m_szGameDescription + internal byte[] GameDescription; // m_szGameDescription char [64] + internal uint AppID; // m_nAppID uint32 + internal int Players; // m_nPlayers int + internal int MaxPlayers; // m_nMaxPlayers int + internal int BotPlayers; // m_nBotPlayers int + [MarshalAs(UnmanagedType.I1)] + internal bool Password; // m_bPassword bool + [MarshalAs(UnmanagedType.I1)] + internal bool Secure; // m_bSecure bool + internal uint TimeLastPlayed; // m_ulTimeLastPlayed uint32 + internal int ServerVersion; // m_nServerVersion int + internal string ServerNameUTF8() => System.Text.Encoding.UTF8.GetString( ServerName, 0, System.Array.IndexOf( ServerName, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] // byte[] m_szServerName + internal byte[] ServerName; // m_szServerName char [64] + internal string GameTagsUTF8() => System.Text.Encoding.UTF8.GetString( GameTags, 0, System.Array.IndexOf( GameTags, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] // byte[] m_szGameTags + internal byte[] GameTags; // m_szGameTags char [128] + internal ulong SteamID; // m_steamID CSteamID + + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamPartyBeaconLocation_t + { + internal SteamPartyBeaconLocationType Type; // m_eType ESteamPartyBeaconLocationType + internal ulong LocationID; // m_ulLocationID uint64 + + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamParamStringArray_t + { + internal IntPtr Strings; // m_ppStrings const char ** + internal int NumStrings; // m_nNumStrings int32 + + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LeaderboardEntry_t + { + internal ulong SteamIDUser; // m_steamIDUser CSteamID + internal int GlobalRank; // m_nGlobalRank int32 + internal int Score; // m_nScore int32 + internal int CDetails; // m_cDetails int32 + internal ulong UGC; // m_hUGC UGCHandle_t + + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct P2PSessionState_t + { + internal byte ConnectionActive; // m_bConnectionActive uint8 + internal byte Connecting; // m_bConnecting uint8 + internal byte P2PSessionError; // m_eP2PSessionError uint8 + internal byte UsingRelay; // m_bUsingRelay uint8 + internal int BytesQueuedForSend; // m_nBytesQueuedForSend int32 + internal int PacketsQueuedForSend; // m_nPacketsQueuedForSend int32 + internal uint RemoteIP; // m_nRemoteIP uint32 + internal ushort RemotePort; // m_nRemotePort uint16 + + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamUGCDetails_t + { + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal Result Result; // m_eResult EResult + internal WorkshopFileType FileType; // m_eFileType EWorkshopFileType + internal AppId CreatorAppID; // m_nCreatorAppID AppId_t + internal AppId ConsumerAppID; // m_nConsumerAppID AppId_t + internal string TitleUTF8() => System.Text.Encoding.UTF8.GetString( Title, 0, System.Array.IndexOf( Title, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 129)] // byte[] m_rgchTitle + internal byte[] Title; // m_rgchTitle char [129] + internal string DescriptionUTF8() => System.Text.Encoding.UTF8.GetString( Description, 0, System.Array.IndexOf( Description, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8000)] // byte[] m_rgchDescription + internal byte[] Description; // m_rgchDescription char [8000] + internal ulong SteamIDOwner; // m_ulSteamIDOwner uint64 + internal uint TimeCreated; // m_rtimeCreated uint32 + internal uint TimeUpdated; // m_rtimeUpdated uint32 + internal uint TimeAddedToUserList; // m_rtimeAddedToUserList uint32 + internal RemoteStoragePublishedFileVisibility Visibility; // m_eVisibility ERemoteStoragePublishedFileVisibility + [MarshalAs(UnmanagedType.I1)] + internal bool Banned; // m_bBanned bool + [MarshalAs(UnmanagedType.I1)] + internal bool AcceptedForUse; // m_bAcceptedForUse bool + [MarshalAs(UnmanagedType.I1)] + internal bool TagsTruncated; // m_bTagsTruncated bool + internal string TagsUTF8() => System.Text.Encoding.UTF8.GetString( Tags, 0, System.Array.IndexOf( Tags, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1025)] // byte[] m_rgchTags + internal byte[] Tags; // m_rgchTags char [1025] + internal ulong File; // m_hFile UGCHandle_t + internal ulong PreviewFile; // m_hPreviewFile UGCHandle_t + internal string PchFileNameUTF8() => System.Text.Encoding.UTF8.GetString( PchFileName, 0, System.Array.IndexOf( PchFileName, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 260)] // byte[] m_pchFileName + internal byte[] PchFileName; // m_pchFileName char [260] + internal int FileSize; // m_nFileSize int32 + internal int PreviewFileSize; // m_nPreviewFileSize int32 + internal string URLUTF8() => System.Text.Encoding.UTF8.GetString( URL, 0, System.Array.IndexOf( URL, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] // byte[] m_rgchURL + internal byte[] URL; // m_rgchURL char [256] + internal uint VotesUp; // m_unVotesUp uint32 + internal uint VotesDown; // m_unVotesDown uint32 + internal float Score; // m_flScore float + internal uint NumChildren; // m_unNumChildren uint32 + + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamItemDetails_t + { + internal InventoryItemId ItemId; // m_itemId SteamItemInstanceID_t + internal InventoryDefId Definition; // m_iDefinition SteamItemDef_t + internal ushort Quantity; // m_unQuantity uint16 + internal ushort Flags; // m_unFlags uint16 + + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamTVRegion_t + { + internal uint UnMinX; // unMinX uint32 + internal uint UnMinY; // unMinY uint32 + internal uint UnMaxX; // unMaxX uint32 + internal uint UnMaxY; // unMaxY uint32 + + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamNetworkingQuickConnectionStatus + { + internal ConnectionState State; // m_eState ESteamNetworkingConnectionState + internal int Ping; // m_nPing int + internal float ConnectionQualityLocal; // m_flConnectionQualityLocal float + internal float ConnectionQualityRemote; // m_flConnectionQualityRemote float + internal float OutPacketsPerSec; // m_flOutPacketsPerSec float + internal float OutBytesPerSec; // m_flOutBytesPerSec float + internal float InPacketsPerSec; // m_flInPacketsPerSec float + internal float InBytesPerSec; // m_flInBytesPerSec float + internal int SendRateBytesPerSecond; // m_nSendRateBytesPerSecond int + internal int CbPendingUnreliable; // m_cbPendingUnreliable int + internal int CbPendingReliable; // m_cbPendingReliable int + internal int CbSentUnackedReliable; // m_cbSentUnackedReliable int + internal long EcQueueTime; // m_usecQueueTime SteamNetworkingMicroseconds + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16, ArraySubType = UnmanagedType.U4)] + internal uint[] Reserved; // reserved uint32 [16] + + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal partial struct SteamDatagramHostedAddress + { + internal int CbSize; // m_cbSize int + internal string DataUTF8() => System.Text.Encoding.UTF8.GetString( Data, 0, System.Array.IndexOf( Data, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] // byte[] m_data + internal byte[] Data; // m_data char [128] + + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamDatagramGameCoordinatorServerLogin + { + internal NetIdentity Dentity; // m_identity SteamNetworkingIdentity + internal SteamDatagramHostedAddress Outing; // m_routing SteamDatagramHostedAddress + internal AppId AppID; // m_nAppID AppId_t + internal uint Time; // m_rtime RTime32 + internal int CbAppData; // m_cbAppData int + internal string AppDataUTF8() => System.Text.Encoding.UTF8.GetString( AppData, 0, System.Array.IndexOf( AppData, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2048)] // byte[] m_appData + internal byte[] AppData; // m_appData char [2048] + + } + +} diff --git a/BoneSync/Facepunch.Steamworks/Generated/SteamTypes.cs b/BoneSync/Facepunch.Steamworks/Generated/SteamTypes.cs new file mode 100644 index 0000000..376c2e7 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Generated/SteamTypes.cs @@ -0,0 +1,841 @@ +using System; +using System.Runtime.InteropServices; +using System.Linq; +using Facepunch.Steamworks.Data; +using System.Threading.Tasks; + +namespace Facepunch.Steamworks.Data +{ + internal struct GID_t : IEquatable, IComparable + { + // Name: GID_t, Type: unsigned long long + public ulong Value; + + public static implicit operator GID_t( ulong value ) => new GID_t(){ Value = value }; + public static implicit operator ulong( GID_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (GID_t) p ); + public bool Equals( GID_t p ) => p.Value == Value; + public static bool operator ==( GID_t a, GID_t b ) => a.Equals( b ); + public static bool operator !=( GID_t a, GID_t b ) => !a.Equals( b ); + public int CompareTo( GID_t other ) => Value.CompareTo( other.Value ); + } + + internal struct JobID_t : IEquatable, IComparable + { + // Name: JobID_t, Type: unsigned long long + public ulong Value; + + public static implicit operator JobID_t( ulong value ) => new JobID_t(){ Value = value }; + public static implicit operator ulong( JobID_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (JobID_t) p ); + public bool Equals( JobID_t p ) => p.Value == Value; + public static bool operator ==( JobID_t a, JobID_t b ) => a.Equals( b ); + public static bool operator !=( JobID_t a, JobID_t b ) => !a.Equals( b ); + public int CompareTo( JobID_t other ) => Value.CompareTo( other.Value ); + } + + internal struct TxnID_t : IEquatable, IComparable + { + // Name: TxnID_t, Type: unsigned long long + public ulong Value; + + public static implicit operator TxnID_t( ulong value ) => new TxnID_t(){ Value = value }; + public static implicit operator ulong( TxnID_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (TxnID_t) p ); + public bool Equals( TxnID_t p ) => p.Value == Value; + public static bool operator ==( TxnID_t a, TxnID_t b ) => a.Equals( b ); + public static bool operator !=( TxnID_t a, TxnID_t b ) => !a.Equals( b ); + public int CompareTo( TxnID_t other ) => Value.CompareTo( other.Value ); + } + + internal struct PackageId_t : IEquatable, IComparable + { + // Name: PackageId_t, Type: unsigned int + public uint Value; + + public static implicit operator PackageId_t( uint value ) => new PackageId_t(){ Value = value }; + public static implicit operator uint( PackageId_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (PackageId_t) p ); + public bool Equals( PackageId_t p ) => p.Value == Value; + public static bool operator ==( PackageId_t a, PackageId_t b ) => a.Equals( b ); + public static bool operator !=( PackageId_t a, PackageId_t b ) => !a.Equals( b ); + public int CompareTo( PackageId_t other ) => Value.CompareTo( other.Value ); + } + + internal struct BundleId_t : IEquatable, IComparable + { + // Name: BundleId_t, Type: unsigned int + public uint Value; + + public static implicit operator BundleId_t( uint value ) => new BundleId_t(){ Value = value }; + public static implicit operator uint( BundleId_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (BundleId_t) p ); + public bool Equals( BundleId_t p ) => p.Value == Value; + public static bool operator ==( BundleId_t a, BundleId_t b ) => a.Equals( b ); + public static bool operator !=( BundleId_t a, BundleId_t b ) => !a.Equals( b ); + public int CompareTo( BundleId_t other ) => Value.CompareTo( other.Value ); + } + + internal struct AssetClassId_t : IEquatable, IComparable + { + // Name: AssetClassId_t, Type: unsigned long long + public ulong Value; + + public static implicit operator AssetClassId_t( ulong value ) => new AssetClassId_t(){ Value = value }; + public static implicit operator ulong( AssetClassId_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (AssetClassId_t) p ); + public bool Equals( AssetClassId_t p ) => p.Value == Value; + public static bool operator ==( AssetClassId_t a, AssetClassId_t b ) => a.Equals( b ); + public static bool operator !=( AssetClassId_t a, AssetClassId_t b ) => !a.Equals( b ); + public int CompareTo( AssetClassId_t other ) => Value.CompareTo( other.Value ); + } + + internal struct PhysicalItemId_t : IEquatable, IComparable + { + // Name: PhysicalItemId_t, Type: unsigned int + public uint Value; + + public static implicit operator PhysicalItemId_t( uint value ) => new PhysicalItemId_t(){ Value = value }; + public static implicit operator uint( PhysicalItemId_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (PhysicalItemId_t) p ); + public bool Equals( PhysicalItemId_t p ) => p.Value == Value; + public static bool operator ==( PhysicalItemId_t a, PhysicalItemId_t b ) => a.Equals( b ); + public static bool operator !=( PhysicalItemId_t a, PhysicalItemId_t b ) => !a.Equals( b ); + public int CompareTo( PhysicalItemId_t other ) => Value.CompareTo( other.Value ); + } + + internal struct DepotId_t : IEquatable, IComparable + { + // Name: DepotId_t, Type: unsigned int + public uint Value; + + public static implicit operator DepotId_t( uint value ) => new DepotId_t(){ Value = value }; + public static implicit operator uint( DepotId_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (DepotId_t) p ); + public bool Equals( DepotId_t p ) => p.Value == Value; + public static bool operator ==( DepotId_t a, DepotId_t b ) => a.Equals( b ); + public static bool operator !=( DepotId_t a, DepotId_t b ) => !a.Equals( b ); + public int CompareTo( DepotId_t other ) => Value.CompareTo( other.Value ); + } + + internal struct RTime32 : IEquatable, IComparable + { + // Name: RTime32, Type: unsigned int + public uint Value; + + public static implicit operator RTime32( uint value ) => new RTime32(){ Value = value }; + public static implicit operator uint( RTime32 value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (RTime32) p ); + public bool Equals( RTime32 p ) => p.Value == Value; + public static bool operator ==( RTime32 a, RTime32 b ) => a.Equals( b ); + public static bool operator !=( RTime32 a, RTime32 b ) => !a.Equals( b ); + public int CompareTo( RTime32 other ) => Value.CompareTo( other.Value ); + } + + internal struct CellID_t : IEquatable, IComparable + { + // Name: CellID_t, Type: unsigned int + public uint Value; + + public static implicit operator CellID_t( uint value ) => new CellID_t(){ Value = value }; + public static implicit operator uint( CellID_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (CellID_t) p ); + public bool Equals( CellID_t p ) => p.Value == Value; + public static bool operator ==( CellID_t a, CellID_t b ) => a.Equals( b ); + public static bool operator !=( CellID_t a, CellID_t b ) => !a.Equals( b ); + public int CompareTo( CellID_t other ) => Value.CompareTo( other.Value ); + } + + internal struct SteamAPICall_t : IEquatable, IComparable + { + // Name: SteamAPICall_t, Type: unsigned long long + public ulong Value; + + public static implicit operator SteamAPICall_t( ulong value ) => new SteamAPICall_t(){ Value = value }; + public static implicit operator ulong( SteamAPICall_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (SteamAPICall_t) p ); + public bool Equals( SteamAPICall_t p ) => p.Value == Value; + public static bool operator ==( SteamAPICall_t a, SteamAPICall_t b ) => a.Equals( b ); + public static bool operator !=( SteamAPICall_t a, SteamAPICall_t b ) => !a.Equals( b ); + public int CompareTo( SteamAPICall_t other ) => Value.CompareTo( other.Value ); + } + + internal struct AccountID_t : IEquatable, IComparable + { + // Name: AccountID_t, Type: unsigned int + public uint Value; + + public static implicit operator AccountID_t( uint value ) => new AccountID_t(){ Value = value }; + public static implicit operator uint( AccountID_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (AccountID_t) p ); + public bool Equals( AccountID_t p ) => p.Value == Value; + public static bool operator ==( AccountID_t a, AccountID_t b ) => a.Equals( b ); + public static bool operator !=( AccountID_t a, AccountID_t b ) => !a.Equals( b ); + public int CompareTo( AccountID_t other ) => Value.CompareTo( other.Value ); + } + + internal struct PartnerId_t : IEquatable, IComparable + { + // Name: PartnerId_t, Type: unsigned int + public uint Value; + + public static implicit operator PartnerId_t( uint value ) => new PartnerId_t(){ Value = value }; + public static implicit operator uint( PartnerId_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (PartnerId_t) p ); + public bool Equals( PartnerId_t p ) => p.Value == Value; + public static bool operator ==( PartnerId_t a, PartnerId_t b ) => a.Equals( b ); + public static bool operator !=( PartnerId_t a, PartnerId_t b ) => !a.Equals( b ); + public int CompareTo( PartnerId_t other ) => Value.CompareTo( other.Value ); + } + + internal struct ManifestId_t : IEquatable, IComparable + { + // Name: ManifestId_t, Type: unsigned long long + public ulong Value; + + public static implicit operator ManifestId_t( ulong value ) => new ManifestId_t(){ Value = value }; + public static implicit operator ulong( ManifestId_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (ManifestId_t) p ); + public bool Equals( ManifestId_t p ) => p.Value == Value; + public static bool operator ==( ManifestId_t a, ManifestId_t b ) => a.Equals( b ); + public static bool operator !=( ManifestId_t a, ManifestId_t b ) => !a.Equals( b ); + public int CompareTo( ManifestId_t other ) => Value.CompareTo( other.Value ); + } + + internal struct SiteId_t : IEquatable, IComparable + { + // Name: SiteId_t, Type: unsigned long long + public ulong Value; + + public static implicit operator SiteId_t( ulong value ) => new SiteId_t(){ Value = value }; + public static implicit operator ulong( SiteId_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (SiteId_t) p ); + public bool Equals( SiteId_t p ) => p.Value == Value; + public static bool operator ==( SiteId_t a, SiteId_t b ) => a.Equals( b ); + public static bool operator !=( SiteId_t a, SiteId_t b ) => !a.Equals( b ); + public int CompareTo( SiteId_t other ) => Value.CompareTo( other.Value ); + } + + internal struct PartyBeaconID_t : IEquatable, IComparable + { + // Name: PartyBeaconID_t, Type: unsigned long long + public ulong Value; + + public static implicit operator PartyBeaconID_t( ulong value ) => new PartyBeaconID_t(){ Value = value }; + public static implicit operator ulong( PartyBeaconID_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (PartyBeaconID_t) p ); + public bool Equals( PartyBeaconID_t p ) => p.Value == Value; + public static bool operator ==( PartyBeaconID_t a, PartyBeaconID_t b ) => a.Equals( b ); + public static bool operator !=( PartyBeaconID_t a, PartyBeaconID_t b ) => !a.Equals( b ); + public int CompareTo( PartyBeaconID_t other ) => Value.CompareTo( other.Value ); + } + + internal struct HAuthTicket : IEquatable, IComparable + { + // Name: HAuthTicket, Type: unsigned int + public uint Value; + + public static implicit operator HAuthTicket( uint value ) => new HAuthTicket(){ Value = value }; + public static implicit operator uint( HAuthTicket value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (HAuthTicket) p ); + public bool Equals( HAuthTicket p ) => p.Value == Value; + public static bool operator ==( HAuthTicket a, HAuthTicket b ) => a.Equals( b ); + public static bool operator !=( HAuthTicket a, HAuthTicket b ) => !a.Equals( b ); + public int CompareTo( HAuthTicket other ) => Value.CompareTo( other.Value ); + } + + internal struct BREAKPAD_HANDLE : IEquatable, IComparable + { + // Name: BREAKPAD_HANDLE, Type: void * + public IntPtr Value; + + public static implicit operator BREAKPAD_HANDLE( IntPtr value ) => new BREAKPAD_HANDLE(){ Value = value }; + public static implicit operator IntPtr( BREAKPAD_HANDLE value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (BREAKPAD_HANDLE) p ); + public bool Equals( BREAKPAD_HANDLE p ) => p.Value == Value; + public static bool operator ==( BREAKPAD_HANDLE a, BREAKPAD_HANDLE b ) => a.Equals( b ); + public static bool operator !=( BREAKPAD_HANDLE a, BREAKPAD_HANDLE b ) => !a.Equals( b ); + public int CompareTo( BREAKPAD_HANDLE other ) => Value.ToInt64().CompareTo( other.Value.ToInt64() ); + } + + internal struct HSteamPipe : IEquatable, IComparable + { + // Name: HSteamPipe, Type: int + public int Value; + + public static implicit operator HSteamPipe( int value ) => new HSteamPipe(){ Value = value }; + public static implicit operator int( HSteamPipe value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (HSteamPipe) p ); + public bool Equals( HSteamPipe p ) => p.Value == Value; + public static bool operator ==( HSteamPipe a, HSteamPipe b ) => a.Equals( b ); + public static bool operator !=( HSteamPipe a, HSteamPipe b ) => !a.Equals( b ); + public int CompareTo( HSteamPipe other ) => Value.CompareTo( other.Value ); + } + + internal struct HSteamUser : IEquatable, IComparable + { + // Name: HSteamUser, Type: int + public int Value; + + public static implicit operator HSteamUser( int value ) => new HSteamUser(){ Value = value }; + public static implicit operator int( HSteamUser value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (HSteamUser) p ); + public bool Equals( HSteamUser p ) => p.Value == Value; + public static bool operator ==( HSteamUser a, HSteamUser b ) => a.Equals( b ); + public static bool operator !=( HSteamUser a, HSteamUser b ) => !a.Equals( b ); + public int CompareTo( HSteamUser other ) => Value.CompareTo( other.Value ); + } + + internal struct FriendsGroupID_t : IEquatable, IComparable + { + // Name: FriendsGroupID_t, Type: short + public short Value; + + public static implicit operator FriendsGroupID_t( short value ) => new FriendsGroupID_t(){ Value = value }; + public static implicit operator short( FriendsGroupID_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (FriendsGroupID_t) p ); + public bool Equals( FriendsGroupID_t p ) => p.Value == Value; + public static bool operator ==( FriendsGroupID_t a, FriendsGroupID_t b ) => a.Equals( b ); + public static bool operator !=( FriendsGroupID_t a, FriendsGroupID_t b ) => !a.Equals( b ); + public int CompareTo( FriendsGroupID_t other ) => Value.CompareTo( other.Value ); + } + + internal struct HServerListRequest : IEquatable, IComparable + { + // Name: HServerListRequest, Type: void * + public IntPtr Value; + + public static implicit operator HServerListRequest( IntPtr value ) => new HServerListRequest(){ Value = value }; + public static implicit operator IntPtr( HServerListRequest value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (HServerListRequest) p ); + public bool Equals( HServerListRequest p ) => p.Value == Value; + public static bool operator ==( HServerListRequest a, HServerListRequest b ) => a.Equals( b ); + public static bool operator !=( HServerListRequest a, HServerListRequest b ) => !a.Equals( b ); + public int CompareTo( HServerListRequest other ) => Value.ToInt64().CompareTo( other.Value.ToInt64() ); + } + + internal struct HServerQuery : IEquatable, IComparable + { + // Name: HServerQuery, Type: int + public int Value; + + public static implicit operator HServerQuery( int value ) => new HServerQuery(){ Value = value }; + public static implicit operator int( HServerQuery value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (HServerQuery) p ); + public bool Equals( HServerQuery p ) => p.Value == Value; + public static bool operator ==( HServerQuery a, HServerQuery b ) => a.Equals( b ); + public static bool operator !=( HServerQuery a, HServerQuery b ) => !a.Equals( b ); + public int CompareTo( HServerQuery other ) => Value.CompareTo( other.Value ); + } + + internal struct UGCHandle_t : IEquatable, IComparable + { + // Name: UGCHandle_t, Type: unsigned long long + public ulong Value; + + public static implicit operator UGCHandle_t( ulong value ) => new UGCHandle_t(){ Value = value }; + public static implicit operator ulong( UGCHandle_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (UGCHandle_t) p ); + public bool Equals( UGCHandle_t p ) => p.Value == Value; + public static bool operator ==( UGCHandle_t a, UGCHandle_t b ) => a.Equals( b ); + public static bool operator !=( UGCHandle_t a, UGCHandle_t b ) => !a.Equals( b ); + public int CompareTo( UGCHandle_t other ) => Value.CompareTo( other.Value ); + } + + internal struct PublishedFileUpdateHandle_t : IEquatable, IComparable + { + // Name: PublishedFileUpdateHandle_t, Type: unsigned long long + public ulong Value; + + public static implicit operator PublishedFileUpdateHandle_t( ulong value ) => new PublishedFileUpdateHandle_t(){ Value = value }; + public static implicit operator ulong( PublishedFileUpdateHandle_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (PublishedFileUpdateHandle_t) p ); + public bool Equals( PublishedFileUpdateHandle_t p ) => p.Value == Value; + public static bool operator ==( PublishedFileUpdateHandle_t a, PublishedFileUpdateHandle_t b ) => a.Equals( b ); + public static bool operator !=( PublishedFileUpdateHandle_t a, PublishedFileUpdateHandle_t b ) => !a.Equals( b ); + public int CompareTo( PublishedFileUpdateHandle_t other ) => Value.CompareTo( other.Value ); + } + + public struct PublishedFileId : IEquatable, IComparable + { + // Name: PublishedFileId_t, Type: unsigned long long + public ulong Value; + + public static implicit operator PublishedFileId( ulong value ) => new PublishedFileId(){ Value = value }; + public static implicit operator ulong( PublishedFileId value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (PublishedFileId) p ); + public bool Equals( PublishedFileId p ) => p.Value == Value; + public static bool operator ==( PublishedFileId a, PublishedFileId b ) => a.Equals( b ); + public static bool operator !=( PublishedFileId a, PublishedFileId b ) => !a.Equals( b ); + public int CompareTo( PublishedFileId other ) => Value.CompareTo( other.Value ); + } + + internal struct UGCFileWriteStreamHandle_t : IEquatable, IComparable + { + // Name: UGCFileWriteStreamHandle_t, Type: unsigned long long + public ulong Value; + + public static implicit operator UGCFileWriteStreamHandle_t( ulong value ) => new UGCFileWriteStreamHandle_t(){ Value = value }; + public static implicit operator ulong( UGCFileWriteStreamHandle_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (UGCFileWriteStreamHandle_t) p ); + public bool Equals( UGCFileWriteStreamHandle_t p ) => p.Value == Value; + public static bool operator ==( UGCFileWriteStreamHandle_t a, UGCFileWriteStreamHandle_t b ) => a.Equals( b ); + public static bool operator !=( UGCFileWriteStreamHandle_t a, UGCFileWriteStreamHandle_t b ) => !a.Equals( b ); + public int CompareTo( UGCFileWriteStreamHandle_t other ) => Value.CompareTo( other.Value ); + } + + internal struct SteamLeaderboard_t : IEquatable, IComparable + { + // Name: SteamLeaderboard_t, Type: unsigned long long + public ulong Value; + + public static implicit operator SteamLeaderboard_t( ulong value ) => new SteamLeaderboard_t(){ Value = value }; + public static implicit operator ulong( SteamLeaderboard_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (SteamLeaderboard_t) p ); + public bool Equals( SteamLeaderboard_t p ) => p.Value == Value; + public static bool operator ==( SteamLeaderboard_t a, SteamLeaderboard_t b ) => a.Equals( b ); + public static bool operator !=( SteamLeaderboard_t a, SteamLeaderboard_t b ) => !a.Equals( b ); + public int CompareTo( SteamLeaderboard_t other ) => Value.CompareTo( other.Value ); + } + + internal struct SteamLeaderboardEntries_t : IEquatable, IComparable + { + // Name: SteamLeaderboardEntries_t, Type: unsigned long long + public ulong Value; + + public static implicit operator SteamLeaderboardEntries_t( ulong value ) => new SteamLeaderboardEntries_t(){ Value = value }; + public static implicit operator ulong( SteamLeaderboardEntries_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (SteamLeaderboardEntries_t) p ); + public bool Equals( SteamLeaderboardEntries_t p ) => p.Value == Value; + public static bool operator ==( SteamLeaderboardEntries_t a, SteamLeaderboardEntries_t b ) => a.Equals( b ); + public static bool operator !=( SteamLeaderboardEntries_t a, SteamLeaderboardEntries_t b ) => !a.Equals( b ); + public int CompareTo( SteamLeaderboardEntries_t other ) => Value.CompareTo( other.Value ); + } + + internal struct SNetSocket_t : IEquatable, IComparable + { + // Name: SNetSocket_t, Type: unsigned int + public uint Value; + + public static implicit operator SNetSocket_t( uint value ) => new SNetSocket_t(){ Value = value }; + public static implicit operator uint( SNetSocket_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (SNetSocket_t) p ); + public bool Equals( SNetSocket_t p ) => p.Value == Value; + public static bool operator ==( SNetSocket_t a, SNetSocket_t b ) => a.Equals( b ); + public static bool operator !=( SNetSocket_t a, SNetSocket_t b ) => !a.Equals( b ); + public int CompareTo( SNetSocket_t other ) => Value.CompareTo( other.Value ); + } + + internal struct SNetListenSocket_t : IEquatable, IComparable + { + // Name: SNetListenSocket_t, Type: unsigned int + public uint Value; + + public static implicit operator SNetListenSocket_t( uint value ) => new SNetListenSocket_t(){ Value = value }; + public static implicit operator uint( SNetListenSocket_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (SNetListenSocket_t) p ); + public bool Equals( SNetListenSocket_t p ) => p.Value == Value; + public static bool operator ==( SNetListenSocket_t a, SNetListenSocket_t b ) => a.Equals( b ); + public static bool operator !=( SNetListenSocket_t a, SNetListenSocket_t b ) => !a.Equals( b ); + public int CompareTo( SNetListenSocket_t other ) => Value.CompareTo( other.Value ); + } + + internal struct ScreenshotHandle : IEquatable, IComparable + { + // Name: ScreenshotHandle, Type: unsigned int + public uint Value; + + public static implicit operator ScreenshotHandle( uint value ) => new ScreenshotHandle(){ Value = value }; + public static implicit operator uint( ScreenshotHandle value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (ScreenshotHandle) p ); + public bool Equals( ScreenshotHandle p ) => p.Value == Value; + public static bool operator ==( ScreenshotHandle a, ScreenshotHandle b ) => a.Equals( b ); + public static bool operator !=( ScreenshotHandle a, ScreenshotHandle b ) => !a.Equals( b ); + public int CompareTo( ScreenshotHandle other ) => Value.CompareTo( other.Value ); + } + + internal struct HTTPRequestHandle : IEquatable, IComparable + { + // Name: HTTPRequestHandle, Type: unsigned int + public uint Value; + + public static implicit operator HTTPRequestHandle( uint value ) => new HTTPRequestHandle(){ Value = value }; + public static implicit operator uint( HTTPRequestHandle value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (HTTPRequestHandle) p ); + public bool Equals( HTTPRequestHandle p ) => p.Value == Value; + public static bool operator ==( HTTPRequestHandle a, HTTPRequestHandle b ) => a.Equals( b ); + public static bool operator !=( HTTPRequestHandle a, HTTPRequestHandle b ) => !a.Equals( b ); + public int CompareTo( HTTPRequestHandle other ) => Value.CompareTo( other.Value ); + } + + internal struct HTTPCookieContainerHandle : IEquatable, IComparable + { + // Name: HTTPCookieContainerHandle, Type: unsigned int + public uint Value; + + public static implicit operator HTTPCookieContainerHandle( uint value ) => new HTTPCookieContainerHandle(){ Value = value }; + public static implicit operator uint( HTTPCookieContainerHandle value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (HTTPCookieContainerHandle) p ); + public bool Equals( HTTPCookieContainerHandle p ) => p.Value == Value; + public static bool operator ==( HTTPCookieContainerHandle a, HTTPCookieContainerHandle b ) => a.Equals( b ); + public static bool operator !=( HTTPCookieContainerHandle a, HTTPCookieContainerHandle b ) => !a.Equals( b ); + public int CompareTo( HTTPCookieContainerHandle other ) => Value.CompareTo( other.Value ); + } + + internal struct InputHandle_t : IEquatable, IComparable + { + // Name: InputHandle_t, Type: unsigned long long + public ulong Value; + + public static implicit operator InputHandle_t( ulong value ) => new InputHandle_t(){ Value = value }; + public static implicit operator ulong( InputHandle_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (InputHandle_t) p ); + public bool Equals( InputHandle_t p ) => p.Value == Value; + public static bool operator ==( InputHandle_t a, InputHandle_t b ) => a.Equals( b ); + public static bool operator !=( InputHandle_t a, InputHandle_t b ) => !a.Equals( b ); + public int CompareTo( InputHandle_t other ) => Value.CompareTo( other.Value ); + } + + internal struct InputActionSetHandle_t : IEquatable, IComparable + { + // Name: InputActionSetHandle_t, Type: unsigned long long + public ulong Value; + + public static implicit operator InputActionSetHandle_t( ulong value ) => new InputActionSetHandle_t(){ Value = value }; + public static implicit operator ulong( InputActionSetHandle_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (InputActionSetHandle_t) p ); + public bool Equals( InputActionSetHandle_t p ) => p.Value == Value; + public static bool operator ==( InputActionSetHandle_t a, InputActionSetHandle_t b ) => a.Equals( b ); + public static bool operator !=( InputActionSetHandle_t a, InputActionSetHandle_t b ) => !a.Equals( b ); + public int CompareTo( InputActionSetHandle_t other ) => Value.CompareTo( other.Value ); + } + + internal struct InputDigitalActionHandle_t : IEquatable, IComparable + { + // Name: InputDigitalActionHandle_t, Type: unsigned long long + public ulong Value; + + public static implicit operator InputDigitalActionHandle_t( ulong value ) => new InputDigitalActionHandle_t(){ Value = value }; + public static implicit operator ulong( InputDigitalActionHandle_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (InputDigitalActionHandle_t) p ); + public bool Equals( InputDigitalActionHandle_t p ) => p.Value == Value; + public static bool operator ==( InputDigitalActionHandle_t a, InputDigitalActionHandle_t b ) => a.Equals( b ); + public static bool operator !=( InputDigitalActionHandle_t a, InputDigitalActionHandle_t b ) => !a.Equals( b ); + public int CompareTo( InputDigitalActionHandle_t other ) => Value.CompareTo( other.Value ); + } + + internal struct InputAnalogActionHandle_t : IEquatable, IComparable + { + // Name: InputAnalogActionHandle_t, Type: unsigned long long + public ulong Value; + + public static implicit operator InputAnalogActionHandle_t( ulong value ) => new InputAnalogActionHandle_t(){ Value = value }; + public static implicit operator ulong( InputAnalogActionHandle_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (InputAnalogActionHandle_t) p ); + public bool Equals( InputAnalogActionHandle_t p ) => p.Value == Value; + public static bool operator ==( InputAnalogActionHandle_t a, InputAnalogActionHandle_t b ) => a.Equals( b ); + public static bool operator !=( InputAnalogActionHandle_t a, InputAnalogActionHandle_t b ) => !a.Equals( b ); + public int CompareTo( InputAnalogActionHandle_t other ) => Value.CompareTo( other.Value ); + } + + internal struct ControllerHandle_t : IEquatable, IComparable + { + // Name: ControllerHandle_t, Type: unsigned long long + public ulong Value; + + public static implicit operator ControllerHandle_t( ulong value ) => new ControllerHandle_t(){ Value = value }; + public static implicit operator ulong( ControllerHandle_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (ControllerHandle_t) p ); + public bool Equals( ControllerHandle_t p ) => p.Value == Value; + public static bool operator ==( ControllerHandle_t a, ControllerHandle_t b ) => a.Equals( b ); + public static bool operator !=( ControllerHandle_t a, ControllerHandle_t b ) => !a.Equals( b ); + public int CompareTo( ControllerHandle_t other ) => Value.CompareTo( other.Value ); + } + + internal struct ControllerActionSetHandle_t : IEquatable, IComparable + { + // Name: ControllerActionSetHandle_t, Type: unsigned long long + public ulong Value; + + public static implicit operator ControllerActionSetHandle_t( ulong value ) => new ControllerActionSetHandle_t(){ Value = value }; + public static implicit operator ulong( ControllerActionSetHandle_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (ControllerActionSetHandle_t) p ); + public bool Equals( ControllerActionSetHandle_t p ) => p.Value == Value; + public static bool operator ==( ControllerActionSetHandle_t a, ControllerActionSetHandle_t b ) => a.Equals( b ); + public static bool operator !=( ControllerActionSetHandle_t a, ControllerActionSetHandle_t b ) => !a.Equals( b ); + public int CompareTo( ControllerActionSetHandle_t other ) => Value.CompareTo( other.Value ); + } + + internal struct ControllerDigitalActionHandle_t : IEquatable, IComparable + { + // Name: ControllerDigitalActionHandle_t, Type: unsigned long long + public ulong Value; + + public static implicit operator ControllerDigitalActionHandle_t( ulong value ) => new ControllerDigitalActionHandle_t(){ Value = value }; + public static implicit operator ulong( ControllerDigitalActionHandle_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (ControllerDigitalActionHandle_t) p ); + public bool Equals( ControllerDigitalActionHandle_t p ) => p.Value == Value; + public static bool operator ==( ControllerDigitalActionHandle_t a, ControllerDigitalActionHandle_t b ) => a.Equals( b ); + public static bool operator !=( ControllerDigitalActionHandle_t a, ControllerDigitalActionHandle_t b ) => !a.Equals( b ); + public int CompareTo( ControllerDigitalActionHandle_t other ) => Value.CompareTo( other.Value ); + } + + internal struct ControllerAnalogActionHandle_t : IEquatable, IComparable + { + // Name: ControllerAnalogActionHandle_t, Type: unsigned long long + public ulong Value; + + public static implicit operator ControllerAnalogActionHandle_t( ulong value ) => new ControllerAnalogActionHandle_t(){ Value = value }; + public static implicit operator ulong( ControllerAnalogActionHandle_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (ControllerAnalogActionHandle_t) p ); + public bool Equals( ControllerAnalogActionHandle_t p ) => p.Value == Value; + public static bool operator ==( ControllerAnalogActionHandle_t a, ControllerAnalogActionHandle_t b ) => a.Equals( b ); + public static bool operator !=( ControllerAnalogActionHandle_t a, ControllerAnalogActionHandle_t b ) => !a.Equals( b ); + public int CompareTo( ControllerAnalogActionHandle_t other ) => Value.CompareTo( other.Value ); + } + + internal struct UGCQueryHandle_t : IEquatable, IComparable + { + // Name: UGCQueryHandle_t, Type: unsigned long long + public ulong Value; + + public static implicit operator UGCQueryHandle_t( ulong value ) => new UGCQueryHandle_t(){ Value = value }; + public static implicit operator ulong( UGCQueryHandle_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (UGCQueryHandle_t) p ); + public bool Equals( UGCQueryHandle_t p ) => p.Value == Value; + public static bool operator ==( UGCQueryHandle_t a, UGCQueryHandle_t b ) => a.Equals( b ); + public static bool operator !=( UGCQueryHandle_t a, UGCQueryHandle_t b ) => !a.Equals( b ); + public int CompareTo( UGCQueryHandle_t other ) => Value.CompareTo( other.Value ); + } + + internal struct UGCUpdateHandle_t : IEquatable, IComparable + { + // Name: UGCUpdateHandle_t, Type: unsigned long long + public ulong Value; + + public static implicit operator UGCUpdateHandle_t( ulong value ) => new UGCUpdateHandle_t(){ Value = value }; + public static implicit operator ulong( UGCUpdateHandle_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (UGCUpdateHandle_t) p ); + public bool Equals( UGCUpdateHandle_t p ) => p.Value == Value; + public static bool operator ==( UGCUpdateHandle_t a, UGCUpdateHandle_t b ) => a.Equals( b ); + public static bool operator !=( UGCUpdateHandle_t a, UGCUpdateHandle_t b ) => !a.Equals( b ); + public int CompareTo( UGCUpdateHandle_t other ) => Value.CompareTo( other.Value ); + } + + internal struct HHTMLBrowser : IEquatable, IComparable + { + // Name: HHTMLBrowser, Type: unsigned int + public uint Value; + + public static implicit operator HHTMLBrowser( uint value ) => new HHTMLBrowser(){ Value = value }; + public static implicit operator uint( HHTMLBrowser value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (HHTMLBrowser) p ); + public bool Equals( HHTMLBrowser p ) => p.Value == Value; + public static bool operator ==( HHTMLBrowser a, HHTMLBrowser b ) => a.Equals( b ); + public static bool operator !=( HHTMLBrowser a, HHTMLBrowser b ) => !a.Equals( b ); + public int CompareTo( HHTMLBrowser other ) => Value.CompareTo( other.Value ); + } + + public struct InventoryItemId : IEquatable, IComparable + { + // Name: SteamItemInstanceID_t, Type: unsigned long long + public ulong Value; + + public static implicit operator InventoryItemId( ulong value ) => new InventoryItemId(){ Value = value }; + public static implicit operator ulong( InventoryItemId value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (InventoryItemId) p ); + public bool Equals( InventoryItemId p ) => p.Value == Value; + public static bool operator ==( InventoryItemId a, InventoryItemId b ) => a.Equals( b ); + public static bool operator !=( InventoryItemId a, InventoryItemId b ) => !a.Equals( b ); + public int CompareTo( InventoryItemId other ) => Value.CompareTo( other.Value ); + } + + public struct InventoryDefId : IEquatable, IComparable + { + // Name: SteamItemDef_t, Type: int + public int Value; + + public static implicit operator InventoryDefId( int value ) => new InventoryDefId(){ Value = value }; + public static implicit operator int( InventoryDefId value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (InventoryDefId) p ); + public bool Equals( InventoryDefId p ) => p.Value == Value; + public static bool operator ==( InventoryDefId a, InventoryDefId b ) => a.Equals( b ); + public static bool operator !=( InventoryDefId a, InventoryDefId b ) => !a.Equals( b ); + public int CompareTo( InventoryDefId other ) => Value.CompareTo( other.Value ); + } + + internal struct SteamInventoryResult_t : IEquatable, IComparable + { + // Name: SteamInventoryResult_t, Type: int + public int Value; + + public static implicit operator SteamInventoryResult_t( int value ) => new SteamInventoryResult_t(){ Value = value }; + public static implicit operator int( SteamInventoryResult_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (SteamInventoryResult_t) p ); + public bool Equals( SteamInventoryResult_t p ) => p.Value == Value; + public static bool operator ==( SteamInventoryResult_t a, SteamInventoryResult_t b ) => a.Equals( b ); + public static bool operator !=( SteamInventoryResult_t a, SteamInventoryResult_t b ) => !a.Equals( b ); + public int CompareTo( SteamInventoryResult_t other ) => Value.CompareTo( other.Value ); + } + + internal struct SteamInventoryUpdateHandle_t : IEquatable, IComparable + { + // Name: SteamInventoryUpdateHandle_t, Type: unsigned long long + public ulong Value; + + public static implicit operator SteamInventoryUpdateHandle_t( ulong value ) => new SteamInventoryUpdateHandle_t(){ Value = value }; + public static implicit operator ulong( SteamInventoryUpdateHandle_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (SteamInventoryUpdateHandle_t) p ); + public bool Equals( SteamInventoryUpdateHandle_t p ) => p.Value == Value; + public static bool operator ==( SteamInventoryUpdateHandle_t a, SteamInventoryUpdateHandle_t b ) => a.Equals( b ); + public static bool operator !=( SteamInventoryUpdateHandle_t a, SteamInventoryUpdateHandle_t b ) => !a.Equals( b ); + public int CompareTo( SteamInventoryUpdateHandle_t other ) => Value.CompareTo( other.Value ); + } + + internal struct RemotePlaySessionID_t : IEquatable, IComparable + { + // Name: RemotePlaySessionID_t, Type: unsigned int + public uint Value; + + public static implicit operator RemotePlaySessionID_t( uint value ) => new RemotePlaySessionID_t(){ Value = value }; + public static implicit operator uint( RemotePlaySessionID_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (RemotePlaySessionID_t) p ); + public bool Equals( RemotePlaySessionID_t p ) => p.Value == Value; + public static bool operator ==( RemotePlaySessionID_t a, RemotePlaySessionID_t b ) => a.Equals( b ); + public static bool operator !=( RemotePlaySessionID_t a, RemotePlaySessionID_t b ) => !a.Equals( b ); + public int CompareTo( RemotePlaySessionID_t other ) => Value.CompareTo( other.Value ); + } + + internal struct HSteamNetPollGroup : IEquatable, IComparable + { + // Name: HSteamNetPollGroup, Type: unsigned int + public uint Value; + + public static implicit operator HSteamNetPollGroup( uint value ) => new HSteamNetPollGroup(){ Value = value }; + public static implicit operator uint( HSteamNetPollGroup value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (HSteamNetPollGroup) p ); + public bool Equals( HSteamNetPollGroup p ) => p.Value == Value; + public static bool operator ==( HSteamNetPollGroup a, HSteamNetPollGroup b ) => a.Equals( b ); + public static bool operator !=( HSteamNetPollGroup a, HSteamNetPollGroup b ) => !a.Equals( b ); + public int CompareTo( HSteamNetPollGroup other ) => Value.CompareTo( other.Value ); + } + + internal struct SteamNetworkingPOPID : IEquatable, IComparable + { + // Name: SteamNetworkingPOPID, Type: unsigned int + public uint Value; + + public static implicit operator SteamNetworkingPOPID( uint value ) => new SteamNetworkingPOPID(){ Value = value }; + public static implicit operator uint( SteamNetworkingPOPID value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (SteamNetworkingPOPID) p ); + public bool Equals( SteamNetworkingPOPID p ) => p.Value == Value; + public static bool operator ==( SteamNetworkingPOPID a, SteamNetworkingPOPID b ) => a.Equals( b ); + public static bool operator !=( SteamNetworkingPOPID a, SteamNetworkingPOPID b ) => !a.Equals( b ); + public int CompareTo( SteamNetworkingPOPID other ) => Value.CompareTo( other.Value ); + } + +} diff --git a/BoneSync/Facepunch.Steamworks/Networking/Connection.cs b/BoneSync/Facepunch.Steamworks/Networking/Connection.cs new file mode 100644 index 0000000..3f49139 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Networking/Connection.cs @@ -0,0 +1,125 @@ +using System; +using System.Collections.Generic; + +namespace Facepunch.Steamworks.Data +{ + + /// + /// Used as a base to create your client connection. This creates a socket + /// to a single connection. + /// + /// You can override all the virtual functions to turn it into what you + /// want it to do. + /// + public struct Connection + { + public uint Id { get; set; } + + public override string ToString() => Id.ToString(); + public static implicit operator Connection( uint value ) => new Connection() { Id = value }; + public static implicit operator uint( Connection value ) => value.Id; + + /// + /// Accept an incoming connection that has been received on a listen socket. + /// + public Result Accept() + { + return SteamNetworkingSockets.Internal.AcceptConnection( this ); + } + + /// + /// Disconnects from the remote host and invalidates the connection handle. Any unread data on the connection is discarded.. + /// reasonCode is defined and used by you. + /// + public bool Close( bool linger = false, int reasonCode = 0, string debugString = "Closing Connection" ) + { + return SteamNetworkingSockets.Internal.CloseConnection( this, reasonCode, debugString, linger ); + } + + /// + /// Get/Set connection user data + /// + public long UserData + { + get => SteamNetworkingSockets.Internal.GetConnectionUserData( this ); + set => SteamNetworkingSockets.Internal.SetConnectionUserData( this, value ); + } + + /// + /// A name for the connection, used mostly for debugging + /// + public string ConnectionName + { + get + { + if ( !SteamNetworkingSockets.Internal.GetConnectionName( this, out var strVal ) ) + return "ERROR"; + + return strVal; + } + + set => SteamNetworkingSockets.Internal.SetConnectionName( this, value ); + } + + /// + /// This is the best version to use. + /// + public Result SendMessage( IntPtr ptr, int size, SendType sendType = SendType.Reliable ) + { + long messageNumber = 0; + return SteamNetworkingSockets.Internal.SendMessageToConnection( this, ptr, (uint) size, (int)sendType, ref messageNumber ); + } + + /// + /// Ideally should be using an IntPtr version unless you're being really careful with the byte[] array and + /// you're not creating a new one every frame (like using .ToArray()) + /// + public unsafe Result SendMessage( byte[] data, SendType sendType = SendType.Reliable ) + { + fixed ( byte* ptr = data ) + { + return SendMessage( (IntPtr)ptr, data.Length, sendType ); + } + } + + /// + /// Ideally should be using an IntPtr version unless you're being really careful with the byte[] array and + /// you're not creating a new one every frame (like using .ToArray()) + /// + public unsafe Result SendMessage( byte[] data, int offset, int length, SendType sendType = SendType.Reliable ) + { + fixed ( byte* ptr = data ) + { + return SendMessage( (IntPtr)ptr + offset, length, sendType ); + } + } + + /// + /// This creates a ton of garbage - so don't do anything with this beyond testing! + /// + public unsafe Result SendMessage( string str, SendType sendType = SendType.Reliable ) + { + var bytes = System.Text.Encoding.UTF8.GetBytes( str ); + return SendMessage( bytes, sendType ); + } + + /// + /// Flush any messages waiting on the Nagle timer and send them at the next transmission + /// opportunity (often that means right now). + /// + public Result Flush() => SteamNetworkingSockets.Internal.FlushMessagesOnConnection( this ); + + /// + /// Returns detailed connection stats in text format. Useful + /// for dumping to a log, etc. + /// + /// Plain text connection info + public string DetailedStatus() + { + if ( SteamNetworkingSockets.Internal.GetDetailedConnectionStatus( this, out var strVal ) != 0 ) + return null; + + return strVal; + } + } +} diff --git a/BoneSync/Facepunch.Steamworks/Networking/ConnectionInfo.cs b/BoneSync/Facepunch.Steamworks/Networking/ConnectionInfo.cs new file mode 100644 index 0000000..1a1b687 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Networking/ConnectionInfo.cs @@ -0,0 +1,45 @@ +using System.Runtime.InteropServices; + +namespace Facepunch.Steamworks.Data +{ + /// + /// Describe the state of a connection + /// + [StructLayout( LayoutKind.Sequential, Size = 696 )] + public struct ConnectionInfo + { + internal NetIdentity identity; + internal long userData; + internal Socket listenSocket; + internal NetAddress address; + internal ushort pad; + internal SteamNetworkingPOPID popRemote; + internal SteamNetworkingPOPID popRelay; + internal ConnectionState state; + internal int endReason; + [MarshalAs( UnmanagedType.ByValTStr, SizeConst = 128 )] + internal string endDebug; + [MarshalAs( UnmanagedType.ByValTStr, SizeConst = 128 )] + internal string connectionDescription; + + /// + /// High level state of the connection + /// + public ConnectionState State => state; + + /// + /// Remote address. Might be all 0's if we don't know it, or if this is N/A. + /// + public NetAddress Address => address; + + /// + /// Who is on the other end? Depending on the connection type and phase of the connection, we might not know + /// + public NetIdentity Identity => identity; + + /// + /// Basic cause of the connection termination or problem. + /// + public NetConnectionEnd EndReason => (NetConnectionEnd)endReason; + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Networking/ConnectionManager.cs b/BoneSync/Facepunch.Steamworks/Networking/ConnectionManager.cs new file mode 100644 index 0000000..ded3035 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Networking/ConnectionManager.cs @@ -0,0 +1,142 @@ +using Facepunch.Steamworks.Data; +using System; +using System.Runtime.InteropServices; + +namespace Facepunch.Steamworks +{ + public class ConnectionManager + { + /// + /// An optional interface to use instead of deriving + /// + public IConnectionManager Interface { get; set; } + + /// + /// The actual connection we're managing + /// + public Connection Connection; + + /// + /// The last received ConnectionInfo + /// + public ConnectionInfo ConnectionInfo { get; internal set; } + + public bool Connected = false; + public bool Connecting = true; + + public string ConnectionName + { + get => Connection.ConnectionName; + set => Connection.ConnectionName = value; + } + + public long UserData + { + get => Connection.UserData; + set => Connection.UserData = value; + } + + public void Close() => Connection.Close(); + + public override string ToString() => Connection.ToString(); + + public virtual void OnConnectionChanged( ConnectionInfo info ) + { + ConnectionInfo = info; + + switch ( info.State ) + { + case ConnectionState.Connecting: + OnConnecting( info ); + break; + case ConnectionState.Connected: + OnConnected( info ); + break; + case ConnectionState.ClosedByPeer: + case ConnectionState.ProblemDetectedLocally: + case ConnectionState.None: + OnDisconnected( info ); + break; + } + } + + /// + /// We're trying to connect! + /// + public virtual void OnConnecting( ConnectionInfo info ) + { + Interface?.OnConnecting( info ); + + Connecting = true; + } + + /// + /// Client is connected. They move from connecting to Connections + /// + public virtual void OnConnected( ConnectionInfo info ) + { + Interface?.OnConnected( info ); + + Connected = true; + Connecting = false; + } + + /// + /// The connection has been closed remotely or disconnected locally. Check data.State for details. + /// + public virtual void OnDisconnected( ConnectionInfo info ) + { + Interface?.OnDisconnected( info ); + + Connected = false; + Connecting = false; + } + + public void Receive( int bufferSize = 32 ) + { + int processed = 0; + IntPtr messageBuffer = Marshal.AllocHGlobal( IntPtr.Size * bufferSize ); + + try + { + processed = SteamNetworkingSockets.Internal.ReceiveMessagesOnConnection( Connection, messageBuffer, bufferSize ); + + for ( int i = 0; i < processed; i++ ) + { + ReceiveMessage( Marshal.ReadIntPtr( messageBuffer, i * IntPtr.Size ) ); + } + } + finally + { + Marshal.FreeHGlobal( messageBuffer ); + } + + // + // Overwhelmed our buffer, keep going + // + if ( processed == bufferSize ) + Receive( bufferSize ); + } + + internal unsafe void ReceiveMessage( IntPtr msgPtr ) + { + var msg = Marshal.PtrToStructure( msgPtr ); + try + { + OnMessage( msg.DataPtr, msg.DataSize, msg.RecvTime, msg.MessageNumber, msg.Channel ); + } + finally + { + // + // Releases the message + // + NetMsg.InternalRelease( (NetMsg*) msgPtr ); + } + } + + public virtual void OnMessage( IntPtr data, int size, long messageNum, long recvTime, int channel ) + { + Interface?.OnMessage( data, size, messageNum, recvTime, channel ); + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Networking/IConnectionManager.cs b/BoneSync/Facepunch.Steamworks/Networking/IConnectionManager.cs new file mode 100644 index 0000000..abeac3c --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Networking/IConnectionManager.cs @@ -0,0 +1,28 @@ +using System; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + public interface IConnectionManager + { + /// + /// We started connecting to this guy + /// + void OnConnecting( ConnectionInfo info ); + + /// + /// Called when the connection is fully connected and can start being communicated with + /// + void OnConnected( ConnectionInfo info ); + + /// + /// We got disconnected + /// + void OnDisconnected( ConnectionInfo info ); + + /// + /// Received a message + /// + void OnMessage( IntPtr data, int size, long messageNum, long recvTime, int channel ); + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Networking/ISocketManager.cs b/BoneSync/Facepunch.Steamworks/Networking/ISocketManager.cs new file mode 100644 index 0000000..f3dfd05 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Networking/ISocketManager.cs @@ -0,0 +1,28 @@ +using System; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + public interface ISocketManager + { + /// + /// Must call Accept or Close on the connection within a second or so + /// + void OnConnecting( Connection connection, ConnectionInfo info ); + + /// + /// Called when the connection is fully connected and can start being communicated with + /// + void OnConnected( Connection connection, ConnectionInfo info ); + + /// + /// Called when the connection leaves + /// + void OnDisconnected( Connection connection, ConnectionInfo info ); + + /// + /// Received a message from a connection + /// + void OnMessage( Connection connection, NetIdentity identity, IntPtr data, int size, long messageNum, long recvTime, int channel ); + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Networking/NetAddress.cs b/BoneSync/Facepunch.Steamworks/Networking/NetAddress.cs new file mode 100644 index 0000000..bb5bbd4 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Networking/NetAddress.cs @@ -0,0 +1,156 @@ +using System.Net; +using System.Runtime.InteropServices; + +namespace Facepunch.Steamworks.Data +{ + [StructLayout( LayoutKind.Explicit, Size = 18, Pack = 1 )] + public partial struct NetAddress + { + [FieldOffset( 0 )] + internal IPV4 ip; + + [FieldOffset( 16 )] + internal ushort port; + + internal struct IPV4 + { + internal ulong m_8zeros; + internal ushort m_0000; + internal ushort m_ffff; + internal byte ip0; + internal byte ip1; + internal byte ip2; + internal byte ip3; + } + + /// + /// The Port. This is redundant documentation. + /// + public ushort Port => port; + + /// + /// Any IP, specific port + /// + public static NetAddress AnyIp( ushort port ) + { + var addr = Cleared; + addr.port = port; + return addr; + } + + /// + /// Localhost IP, specific port + /// + public static NetAddress LocalHost( ushort port ) + { + var local = Cleared; + InternalSetIPv6LocalHost( ref local, port ); + return local; + } + + /// + /// Specific IP, specific port + /// + public static NetAddress From( string addrStr, ushort port ) + { + return From( IPAddress.Parse( addrStr ), port ); + } + + /// + /// Specific IP, specific port + /// + public static NetAddress From( IPAddress address, ushort port ) + { + var addr = address.GetAddressBytes(); + + if ( address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork ) + { + var local = Cleared; + InternalSetIPv4( ref local, Utility.IpToInt32( address ), port ); + return local; + } + + throw new System.NotImplementedException( "Oops - no IPV6 support yet?" ); + } + + /// + /// Set everything to zero + /// + public static NetAddress Cleared + { + get + { + NetAddress self = default; + InternalClear( ref self ); + return self; + } + } + + /// + /// Return true if the IP is ::0. (Doesn't check port.) + /// + public bool IsIPv6AllZeros + { + get + { + NetAddress self = this; + return InternalIsIPv6AllZeros( ref self ); + } + } + + /// + /// Return true if IP is mapped IPv4 + /// + public bool IsIPv4 + { + get + { + NetAddress self = this; + return InternalIsIPv4( ref self ); + } + } + + /// + /// Return true if this identity is localhost. (Either IPv6 ::1, or IPv4 127.0.0.1) + /// + public bool IsLocalHost + { + get + { + NetAddress self = this; + return InternalIsLocalHost( ref self ); + } + } + + /// + /// Get the Address section + /// + public IPAddress Address + { + get + { + if ( IsIPv4 ) + { + NetAddress self = this; + var ip = InternalGetIPv4( ref self ); + return Utility.Int32ToIp( ip ); + } + + if ( IsIPv6AllZeros ) + { + return IPAddress.IPv6Loopback; + } + + throw new System.NotImplementedException( "Oops - no IPV6 support yet?" ); + } + } + + public override string ToString() + { + var ptr = Helpers.TakeMemory(); + var self = this; + InternalToString( ref self, ptr, Helpers.MemoryBufferSize, true ); + return Helpers.MemoryToString( ptr ); + } + } +} diff --git a/BoneSync/Facepunch.Steamworks/Networking/NetDebugFunc.cs b/BoneSync/Facepunch.Steamworks/Networking/NetDebugFunc.cs new file mode 100644 index 0000000..33a0362 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Networking/NetDebugFunc.cs @@ -0,0 +1,9 @@ +using Facepunch.Steamworks.Data; +using System; +using System.Runtime.InteropServices; + +namespace Facepunch.Steamworks.Data +{ + [UnmanagedFunctionPointer( Platform.CC )] + delegate void NetDebugFunc( [In] NetDebugOutput nType, [In] IntPtr pszMsg ); +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Networking/NetErrorMessage.cs b/BoneSync/Facepunch.Steamworks/Networking/NetErrorMessage.cs new file mode 100644 index 0000000..ee45388 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Networking/NetErrorMessage.cs @@ -0,0 +1,10 @@ + +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks.Data +{ + internal unsafe struct NetErrorMessage + { + public fixed char Value[1024]; + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Networking/NetIdentity.cs b/BoneSync/Facepunch.Steamworks/Networking/NetIdentity.cs new file mode 100644 index 0000000..911ab62 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Networking/NetIdentity.cs @@ -0,0 +1,126 @@ +using System.Runtime.InteropServices; + +namespace Facepunch.Steamworks.Data +{ + [StructLayout( LayoutKind.Explicit, Size = 136, Pack = 1 )] + public partial struct NetIdentity + { + [FieldOffset( 0 )] + internal IdentityType type; + + [FieldOffset( 4 )] + internal int size; + + [FieldOffset( 8 )] + internal ulong steamid; + + [FieldOffset( 8 )] + internal NetAddress netaddress; + + /// + /// Return a NetIdentity that represents LocalHost + /// + public static NetIdentity LocalHost + { + get + { + NetIdentity id = default; + InternalSetLocalHost( ref id ); + return id; + } + } + + + public bool IsSteamId => type == IdentityType.SteamID; + public bool IsIpAddress => type == IdentityType.IPAddress; + + /// + /// Return true if this identity is localhost + /// + public bool IsLocalHost + { + get + { + NetIdentity id = default; + return InternalIsLocalHost( ref id ); + } + } + + /// + /// Convert to a SteamId + /// + /// + public static implicit operator NetIdentity( SteamId value ) + { + NetIdentity id = default; + InternalSetSteamID( ref id, value ); + return id; + } + + /// + /// Set the specified Address + /// + public static implicit operator NetIdentity( NetAddress address ) + { + NetIdentity id = default; + InternalSetIPAddr( ref id, ref address ); + return id; + } + + /// + /// Automatically convert to a SteamId + /// + /// + public static implicit operator SteamId( NetIdentity value ) + { + return value.SteamId; + } + + /// + /// Returns NULL if we're not a SteamId + /// + public SteamId SteamId + { + get + { + if ( type != IdentityType.SteamID ) return default; + var id = this; + return InternalGetSteamID( ref id ); + } + } + + /// + /// Returns NULL if we're not a NetAddress + /// + public NetAddress Address + { + get + { + if ( type != IdentityType.IPAddress ) return default; + var id = this; + + var addrptr = InternalGetIPAddr( ref id ); + return addrptr.ToType(); + } + } + + /// + /// We override tostring to provide a sensible representation + /// + public override string ToString() + { + var id = this; + SteamNetworkingUtils.Internal.SteamNetworkingIdentity_ToString( ref id, out var str ); + return str; + } + + internal enum IdentityType + { + Invalid = 0, + IPAddress = 1, + GenericString = 2, + GenericBytes = 3, + SteamID = 16 + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Networking/NetKeyValue.cs b/BoneSync/Facepunch.Steamworks/Networking/NetKeyValue.cs new file mode 100644 index 0000000..dfedd06 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Networking/NetKeyValue.cs @@ -0,0 +1,31 @@ +using Facepunch.Steamworks.Data; +using System; +using System.Runtime.InteropServices; + +namespace Facepunch.Steamworks.Data +{ + [StructLayout( LayoutKind.Explicit, Pack = Platform.StructPlatformPackSize )] + internal struct NetKeyValue + { + [FieldOffset(0)] + internal NetConfig Value; // m_eValue ESteamNetworkingConfigValue + + [FieldOffset( 4 )] + internal NetConfigType DataType; // m_eDataType ESteamNetworkingConfigDataType + + [FieldOffset( 8 )] + internal long Int64Value; // m_int64 int64_t + + [FieldOffset( 8 )] + internal int Int32Value; // m_val_int32 int32_t + + [FieldOffset( 8 )] + internal float FloatValue; // m_val_float float + + [FieldOffset( 8 )] + internal IntPtr PointerValue; // m_val_functionPtr void * + + + // TODO - support strings, maybe + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Networking/NetMsg.cs b/BoneSync/Facepunch.Steamworks/Networking/NetMsg.cs new file mode 100644 index 0000000..bb5b170 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Networking/NetMsg.cs @@ -0,0 +1,21 @@ +using Facepunch.Steamworks.Data; +using System; +using System.Runtime.InteropServices; + +namespace Facepunch.Steamworks.Data +{ + [StructLayout( LayoutKind.Sequential )] + internal partial struct NetMsg + { + internal IntPtr DataPtr; + internal int DataSize; + internal Connection Connection; + internal NetIdentity Identity; + internal long ConnectionUserData; + internal long RecvTime; + internal long MessageNumber; + internal IntPtr FreeDataPtr; + internal IntPtr ReleasePtr; + internal int Channel; + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Networking/NetPingLocation.cs b/BoneSync/Facepunch.Steamworks/Networking/NetPingLocation.cs new file mode 100644 index 0000000..27053b1 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Networking/NetPingLocation.cs @@ -0,0 +1,67 @@ +using System.Runtime.InteropServices; + +namespace Facepunch.Steamworks.Data +{ + /// + /// + /// Object that describes a "location" on the Internet with sufficient + /// detail that we can reasonably estimate an upper bound on the ping between + /// the two hosts, even if a direct route between the hosts is not possible, + /// and the connection must be routed through the Steam Datagram Relay network. + /// This does not contain any information that identifies the host. Indeed, + /// if two hosts are in the same building or otherwise have nearly identical + /// networking characteristics, then it's valid to use the same location + /// object for both of them. + /// + /// NOTE: This object should only be used in the same process! Do not serialize it, + /// send it over the wire, or persist it in a file or database! If you need + /// to do that, convert it to a string representation using the methods in + /// ISteamNetworkingUtils(). + /// + /// + [StructLayout( LayoutKind.Explicit, Size = 512 )] + public struct NetPingLocation + { + public static NetPingLocation? TryParseFromString( string str ) + { + var result = default( NetPingLocation ); + if ( !SteamNetworkingUtils.Internal.ParsePingLocationString( str, ref result ) ) + return null; + + return result; + } + + public override string ToString() + { + SteamNetworkingUtils.Internal.ConvertPingLocationToString( ref this, out var strVal ); + return strVal; + } + + /// Estimate the round-trip latency between two arbitrary locations, in + /// milliseconds. This is a conservative estimate, based on routing through + /// the relay network. For most basic relayed connections, this ping time + /// will be pretty accurate, since it will be based on the route likely to + /// be actually used. + /// + /// If a direct IP route is used (perhaps via NAT traversal), then the route + /// will be different, and the ping time might be better. Or it might actually + /// be a bit worse! Standard IP routing is frequently suboptimal! + /// + /// But even in this case, the estimate obtained using this method is a + /// reasonable upper bound on the ping time. (Also it has the advantage + /// of returning immediately and not sending any packets.) + /// + /// In a few cases we might not able to estimate the route. In this case + /// a negative value is returned. k_nSteamNetworkingPing_Failed means + /// the reason was because of some networking difficulty. (Failure to + /// ping, etc) k_nSteamNetworkingPing_Unknown is returned if we cannot + /// currently answer the question for some other reason. + /// + /// Do you need to be able to do this from a backend/matchmaking server? + /// You are looking for the "ticketgen" library. + public int EstimatePingTo( NetPingLocation target ) + { + return SteamNetworkingUtils.Internal.EstimatePingTimeBetweenTwoLocations( ref this, ref target ); + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Networking/Socket.cs b/BoneSync/Facepunch.Steamworks/Networking/Socket.cs new file mode 100644 index 0000000..0ae18e0 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Networking/Socket.cs @@ -0,0 +1,29 @@ + +using System.Runtime.InteropServices; + +namespace Facepunch.Steamworks.Data +{ + [StructLayout( LayoutKind.Sequential )] + public struct Socket + { + internal uint Id; + public override string ToString() => Id.ToString(); + public static implicit operator Socket( uint value ) => new Socket() { Id = value }; + public static implicit operator uint( Socket value ) => value.Id; + + /// + /// Destroy a listen socket. All the connections that were accepting on the listen + /// socket are closed ungracefully. + /// + public bool Close() + { + return SteamNetworkingSockets.Internal.CloseListenSocket( Id ); + } + + public SocketManager Manager + { + get => SteamNetworkingSockets.GetSocketManager( Id ); + set => SteamNetworkingSockets.SetSocketManager( Id, value ); + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Networking/SocketManager.cs b/BoneSync/Facepunch.Steamworks/Networking/SocketManager.cs new file mode 100644 index 0000000..63ba4fb --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Networking/SocketManager.cs @@ -0,0 +1,165 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + /// + /// Used as a base to create your networking server. This creates a socket + /// and listens/communicates with multiple queries. + /// + /// You can override all the virtual functions to turn it into what you + /// want it to do. + /// + public partial class SocketManager + { + public ISocketManager Interface { get; set; } + + public List Connecting = new List(); + public List Connected = new List(); + public Socket Socket { get; internal set; } + + public override string ToString() => Socket.ToString(); + + internal HSteamNetPollGroup pollGroup; + + internal void Initialize() + { + pollGroup = SteamNetworkingSockets.Internal.CreatePollGroup(); + } + + public bool Close() + { + if ( SteamNetworkingSockets.Internal.IsValid ) + { + SteamNetworkingSockets.Internal.DestroyPollGroup( pollGroup ); + Socket.Close(); + } + + pollGroup = 0; + Socket = 0; + return true; + } + + public virtual void OnConnectionChanged( Connection connection, ConnectionInfo info ) + { + switch ( info.State ) + { + case ConnectionState.Connecting: + if ( !Connecting.Contains( connection ) ) + { + Connecting.Add( connection ); + OnConnecting( connection, info ); + } + break; + case ConnectionState.Connected: + if ( !Connected.Contains( connection ) ) + { + Connecting.Remove( connection ); + Connected.Add( connection ); + + OnConnected( connection, info ); + } + break; + case ConnectionState.ClosedByPeer: + case ConnectionState.ProblemDetectedLocally: + case ConnectionState.None: + if ( Connecting.Contains( connection ) || Connected.Contains( connection ) ) + { + OnDisconnected( connection, info ); + } + break; + } + } + + /// + /// Default behaviour is to accept every connection + /// + public virtual void OnConnecting( Connection connection, ConnectionInfo info ) + { + if ( Interface != null ) + { + Interface.OnConnecting( connection, info ); + return; + } + else + { + connection.Accept(); + } + } + + /// + /// Client is connected. They move from connecting to Connections + /// + public virtual void OnConnected( Connection connection, ConnectionInfo info ) + { + SteamNetworkingSockets.Internal.SetConnectionPollGroup( connection, pollGroup ); + + Interface?.OnConnected( connection, info ); + } + + /// + /// The connection has been closed remotely or disconnected locally. Check data.State for details. + /// + public virtual void OnDisconnected( Connection connection, ConnectionInfo info ) + { + SteamNetworkingSockets.Internal.SetConnectionPollGroup( connection, 0 ); + + connection.Close(); + + Connecting.Remove( connection ); + Connected.Remove( connection ); + + Interface?.OnDisconnected( connection, info ); + } + + public void Receive( int bufferSize = 32 ) + { + int processed = 0; + IntPtr messageBuffer = Marshal.AllocHGlobal( IntPtr.Size * bufferSize ); + + try + { + processed = SteamNetworkingSockets.Internal.ReceiveMessagesOnPollGroup( pollGroup, messageBuffer, bufferSize ); + + for ( int i = 0; i < processed; i++ ) + { + ReceiveMessage( Marshal.ReadIntPtr( messageBuffer, i * IntPtr.Size ) ); + } + } + finally + { + Marshal.FreeHGlobal( messageBuffer ); + } + + + // + // Overwhelmed our buffer, keep going + // + if ( processed == bufferSize ) + Receive( bufferSize ); + } + + internal unsafe void ReceiveMessage( IntPtr msgPtr ) + { + var msg = Marshal.PtrToStructure( msgPtr ); + try + { + OnMessage( msg.Connection, msg.Identity, msg.DataPtr, msg.DataSize, msg.RecvTime, msg.MessageNumber, msg.Channel ); + } + finally + { + // + // Releases the message + // + NetMsg.InternalRelease( (NetMsg*) msgPtr ); + } + } + + public virtual void OnMessage( Connection connection, NetIdentity identity, IntPtr data, int size, long messageNum, long recvTime, int channel ) + { + Interface?.OnMessage( connection, identity, data, size, messageNum, recvTime, channel ); + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Networking/SteamDatagramRelayAuthTicket.cs b/BoneSync/Facepunch.Steamworks/Networking/SteamDatagramRelayAuthTicket.cs new file mode 100644 index 0000000..adc8b28 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Networking/SteamDatagramRelayAuthTicket.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + +namespace Facepunch.Steamworks.Data +{ + struct SteamDatagramRelayAuthTicket + { + // Not implemented, not used + }; +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/ServerList/Base.cs b/BoneSync/Facepunch.Steamworks/ServerList/Base.cs new file mode 100644 index 0000000..7137697 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/ServerList/Base.cs @@ -0,0 +1,197 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks.ServerList +{ + public abstract class Base : IDisposable + { + + #region ISteamMatchmakingServers + internal static ISteamMatchmakingServers Internal => SteamMatchmakingServers.Internal; + #endregion + + + /// + /// Which app we're querying. Defaults to the current app. + /// + public AppId AppId { get; set; } + + /// + /// When a new server is added, this function will get called + /// + public event Action OnChanges; + + /// + /// Called for every responsive server + /// + public event Action OnResponsiveServer; + + /// + /// A list of servers that responded. If you're only interested in servers that responded since you + /// last updated, then simply clear this list. + /// + public List Responsive = new List(); + + /// + /// A list of servers that were in the master list but didn't respond. + /// + public List Unresponsive = new List(); + + + public Base() + { + AppId = SteamClient.AppId; // Default AppId is this + } + + /// + /// Query the server list. Task result will be true when finished + /// + /// + public virtual async Task RunQueryAsync( float timeoutSeconds = 10 ) + { + var stopwatch = System.Diagnostics.Stopwatch.StartNew(); + + Reset(); + LaunchQuery(); + + var thisRequest = request; + + while ( IsRefreshing ) + { + await Task.Delay( 33 ); + + // + // The request has been cancelled or changed in some way + // + if ( request.Value == IntPtr.Zero || thisRequest.Value != request.Value ) + return false; + + if ( !SteamClient.IsValid ) + return false; + + var r = Responsive.Count; + + UpdatePending(); + UpdateResponsive(); + + if ( r != Responsive.Count ) + { + InvokeChanges(); + } + + if ( stopwatch.Elapsed.TotalSeconds > timeoutSeconds ) + break; + } + + MovePendingToUnresponsive(); + InvokeChanges(); + + return true; + } + + public virtual void Cancel() => Internal.CancelQuery( request ); + + // Overrides + internal abstract void LaunchQuery(); + + internal HServerListRequest request; + + #region Filters + + internal List filters = new List(); + internal virtual MatchMakingKeyValuePair[] GetFilters() => filters.ToArray(); + + public void AddFilter( string key, string value ) + { + filters.Add( new MatchMakingKeyValuePair { Key = key, Value = value } ); + } + + #endregion + + internal int Count => Internal.GetServerCount( request ); + internal bool IsRefreshing => request.Value != IntPtr.Zero && Internal.IsRefreshing( request ); + internal List watchList = new List(); + internal int LastCount = 0; + + void Reset() + { + ReleaseQuery(); + LastCount = 0; + watchList.Clear(); + } + + void ReleaseQuery() + { + if ( request.Value != IntPtr.Zero ) + { + Cancel(); + Internal.ReleaseRequest( request ); + request = IntPtr.Zero; + } + } + + public void Dispose() + { + ReleaseQuery(); + } + + internal void InvokeChanges() + { + OnChanges?.Invoke(); + } + + void UpdatePending() + { + var count = Count; + if ( count == LastCount ) return; + + for ( int i = LastCount; i < count; i++ ) + { + watchList.Add( i ); + } + + LastCount = count; + } + + public void UpdateResponsive() + { + watchList.RemoveAll( x => + { + var info = Internal.GetServerDetails( request, x ); + if ( info.HadSuccessfulResponse ) + { + OnServer( ServerInfo.From( info ), info.HadSuccessfulResponse ); + return true; + } + + return false; + } ); + } + + void MovePendingToUnresponsive() + { + watchList.RemoveAll( x => + { + var info = Internal.GetServerDetails( request, x ); + OnServer( ServerInfo.From( info ), info.HadSuccessfulResponse ); + return true; + } ); + } + + private void OnServer( ServerInfo serverInfo, bool responded ) + { + if ( responded ) + { + Responsive.Add( serverInfo ); + OnResponsiveServer?.Invoke( serverInfo ); + return; + } + + Unresponsive.Add( serverInfo ); + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/ServerList/Favourites.cs b/BoneSync/Facepunch.Steamworks/ServerList/Favourites.cs new file mode 100644 index 0000000..6768040 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/ServerList/Favourites.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Facepunch.Steamworks.ServerList +{ + public class Favourites : Base + { + internal override void LaunchQuery() + { + var filters = GetFilters(); + request = Internal.RequestFavoritesServerList( AppId.Value, ref filters, (uint)filters.Length, IntPtr.Zero ); + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/ServerList/Friends.cs b/BoneSync/Facepunch.Steamworks/ServerList/Friends.cs new file mode 100644 index 0000000..774670e --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/ServerList/Friends.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Facepunch.Steamworks.ServerList +{ + public class Friends : Base + { + internal override void LaunchQuery() + { + var filters = GetFilters(); + request = Internal.RequestFriendsServerList( AppId.Value, ref filters, (uint)filters.Length, IntPtr.Zero ); + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/ServerList/History.cs b/BoneSync/Facepunch.Steamworks/ServerList/History.cs new file mode 100644 index 0000000..0bee0be --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/ServerList/History.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Facepunch.Steamworks.ServerList +{ + public class History : Base + { + internal override void LaunchQuery() + { + var filters = GetFilters(); + request = Internal.RequestHistoryServerList( AppId.Value, ref filters, (uint)filters.Length, IntPtr.Zero ); + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/ServerList/Internet.cs b/BoneSync/Facepunch.Steamworks/ServerList/Internet.cs new file mode 100644 index 0000000..ccb6849 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/ServerList/Internet.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Facepunch.Steamworks.ServerList +{ + public class Internet : Base + { + internal override void LaunchQuery() + { + var filters = GetFilters(); + + request = Internal.RequestInternetServerList( AppId.Value, ref filters, (uint)filters.Length, IntPtr.Zero ); + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/ServerList/IpList.cs b/BoneSync/Facepunch.Steamworks/ServerList/IpList.cs new file mode 100644 index 0000000..f8aca9d --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/ServerList/IpList.cs @@ -0,0 +1,72 @@ +using Facepunch.Steamworks.Data; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Facepunch.Steamworks.ServerList +{ + public class IpList : Internet + { + public List Ips = new List(); + bool wantsCancel; + + public IpList( IEnumerable list ) + { + Ips.AddRange( list ); + } + + public IpList( params string[] list ) + { + Ips.AddRange( list ); + } + + public override async Task RunQueryAsync( float timeoutSeconds = 10 ) + { + int blockSize = 16; + int pointer = 0; + + var ips = Ips.ToArray(); + + while ( true ) + { + var sublist = ips.Skip( pointer ).Take( blockSize ); + if ( sublist.Count() == 0 ) + break; + + using ( var list = new ServerList.Internet() ) + { + list.AddFilter( "or", sublist.Count().ToString() ); + + foreach ( var server in sublist ) + { + list.AddFilter( "gameaddr", server ); + } + + await list.RunQueryAsync( timeoutSeconds ); + + if ( wantsCancel ) + return false; + + Responsive.AddRange( list.Responsive ); + Responsive = Responsive.Distinct().ToList(); + Unresponsive.AddRange( list.Unresponsive ); + Unresponsive = Unresponsive.Distinct().ToList(); + } + + pointer += sublist.Count(); + + InvokeChanges(); + } + + return true; + } + + public override void Cancel() + { + wantsCancel = true; + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/ServerList/LocalNetwork.cs b/BoneSync/Facepunch.Steamworks/ServerList/LocalNetwork.cs new file mode 100644 index 0000000..da1ba56 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/ServerList/LocalNetwork.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Facepunch.Steamworks.ServerList +{ + public class LocalNetwork : Base + { + internal override void LaunchQuery() + { + request = Internal.RequestLANServerList( AppId.Value, IntPtr.Zero ); + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/SteamApps.cs b/BoneSync/Facepunch.Steamworks/SteamApps.cs new file mode 100644 index 0000000..d938711 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/SteamApps.cs @@ -0,0 +1,270 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + /// + /// Exposes a wide range of information and actions for applications and Downloadable Content (DLC). + /// + public class SteamApps : SteamSharedClass + { + internal static ISteamApps Internal => Interface as ISteamApps; + + internal override void InitializeInterface( bool server ) + { + SetInterface( server, new ISteamApps( server ) ); + } + + internal static void InstallEvents() + { + Dispatch.Install( x => OnDlcInstalled?.Invoke( x.AppID ) ); + Dispatch.Install( x => OnNewLaunchParameters?.Invoke() ); + } + + /// + /// posted after the user gains ownership of DLC and that DLC is installed + /// + public static event Action OnDlcInstalled; + + /// + /// posted after the user gains executes a Steam URL with command line or query parameters + /// such as steam://run/appid//-commandline/?param1=value1(and)param2=value2(and)param3=value3 etc + /// while the game is already running. The new params can be queried + /// with GetLaunchQueryParam and GetLaunchCommandLine + /// + public static event Action OnNewLaunchParameters; + + /// + /// Checks if the active user is subscribed to the current App ID + /// + public static bool IsSubscribed => Internal.BIsSubscribed(); + + /// + /// Check if user borrowed this game via Family Sharing, If true, call GetAppOwner() to get the lender SteamID + /// + public static bool IsSubscribedFromFamilySharing => Internal.BIsSubscribedFromFamilySharing(); + + /// + /// Checks if the license owned by the user provides low violence depots. + /// Low violence depots are useful for copies sold in countries that have content restrictions + /// + public static bool IsLowVoilence => Internal.BIsLowViolence(); + + /// + /// Checks whether the current App ID license is for Cyber Cafes. + /// + public static bool IsCybercafe => Internal.BIsCybercafe(); + + /// + /// CChecks if the user has a VAC ban on their account + /// + public static bool IsVACBanned => Internal.BIsVACBanned(); + + /// + /// Gets the current language that the user has set. + /// This falls back to the Steam UI language if the user hasn't explicitly picked a language for the title. + /// + public static string GameLanguage => Internal.GetCurrentGameLanguage(); + + /// + /// Gets a list of the languages the current app supports. + /// + public static string[] AvailableLanguages => Internal.GetAvailableGameLanguages().Split( new[] { ',' }, StringSplitOptions.RemoveEmptyEntries ); + + /// + /// Checks if the active user is subscribed to a specified AppId. + /// Only use this if you need to check ownership of another game related to yours, a demo for example. + /// + public static bool IsSubscribedToApp( AppId appid ) => Internal.BIsSubscribedApp( appid.Value ); + + /// + /// Checks if the user owns a specific DLC and if the DLC is installed + /// + public static bool IsDlcInstalled( AppId appid ) => Internal.BIsDlcInstalled( appid.Value ); + + /// + /// Returns the time of the purchase of the app + /// + public static DateTime PurchaseTime( AppId appid = default ) + { + if ( appid == 0 ) + appid = SteamClient.AppId; + + return Epoch.ToDateTime(Internal.GetEarliestPurchaseUnixTime(appid.Value ) ); + } + + /// + /// Checks if the user is subscribed to the current app through a free weekend + /// This function will return false for users who have a retail or other type of license + /// Before using, please ask your Valve technical contact how to package and secure your free weekened + /// + public static bool IsSubscribedFromFreeWeekend => Internal.BIsSubscribedFromFreeWeekend(); + + /// + /// Returns metadata for all available DLC + /// + public static IEnumerable DlcInformation() + { + var appid = default( AppId ); + var available = false; + + for ( int i = 0; i < Internal.GetDLCCount(); i++ ) + { + if ( !Internal.BGetDLCDataByIndex( i, ref appid, ref available, out var strVal ) ) + continue; + + yield return new DlcInformation + { + AppId = appid.Value, + Name = strVal, + Available = available + }; + } + } + + /// + /// Install/Uninstall control for optional DLC + /// + public static void InstallDlc( AppId appid ) => Internal.InstallDLC( appid.Value ); + + /// + /// Install/Uninstall control for optional DLC + /// + public static void UninstallDlc( AppId appid ) => Internal.UninstallDLC( appid.Value ); + + /// + /// Returns null if we're not on a beta branch, else the name of the branch + /// + public static string CurrentBetaName + { + get + { + if ( !Internal.GetCurrentBetaName( out var strVal ) ) + return null; + + return strVal; + } + } + + /// + /// Allows you to force verify game content on next launch. + /// + /// If you detect the game is out-of-date(for example, by having the client detect a version mismatch with a server), + /// you can call use MarkContentCorrupt to force a verify, show a message to the user, and then quit. + /// + public static void MarkContentCorrupt( bool missingFilesOnly ) => Internal.MarkContentCorrupt( missingFilesOnly ); + + /// + /// Gets a list of all installed depots for a given App ID in mount order + /// + public static IEnumerable InstalledDepots( AppId appid = default ) + { + if ( appid == 0 ) + appid = SteamClient.AppId; + + var depots = new DepotId_t[32]; + uint count = Internal.GetInstalledDepots( appid.Value, depots, (uint) depots.Length ); + + for ( int i = 0; i < count; i++ ) + { + yield return new DepotId { Value = depots[i].Value }; + } + } + + /// + /// Gets the install folder for a specific AppID. + /// This works even if the application is not installed, based on where the game would be installed with the default Steam library location. + /// + public static string AppInstallDir( AppId appid = default ) + { + if ( appid == 0 ) + appid = SteamClient.AppId; + + if ( Internal.GetAppInstallDir( appid.Value, out var strVal ) == 0 ) + return null; + + return strVal; + } + + /// + /// The app may not actually be owned by the current user, they may have it left over from a free weekend, etc. + /// + public static bool IsAppInstalled( AppId appid ) => Internal.BIsAppInstalled( appid.Value ); + + /// + /// Gets the Steam ID of the original owner of the current app. If it's different from the current user then it is borrowed.. + /// + public static SteamId AppOwner => Internal.GetAppOwner().Value; + + /// + /// Gets the associated launch parameter if the game is run via steam://run/appid/?param1=value1;param2=value2;param3=value3 etc. + /// Parameter names starting with the character '@' are reserved for internal use and will always return an empty string. + /// Parameter names starting with an underscore '_' are reserved for steam features -- they can be queried by the game, + /// but it is advised that you not param names beginning with an underscore for your own features. + /// + public static string GetLaunchParam( string param ) => Internal.GetLaunchQueryParam( param ); + + /// + /// Gets the download progress for optional DLC. + /// + public static DownloadProgress DlcDownloadProgress( AppId appid ) + { + ulong punBytesDownloaded = 0; + ulong punBytesTotal = 0; + + if ( !Internal.GetDlcDownloadProgress( appid.Value, ref punBytesDownloaded, ref punBytesTotal ) ) + return default; + + return new DownloadProgress { BytesDownloaded = punBytesDownloaded, BytesTotal = punBytesTotal, Active = true }; + } + + /// + /// Gets the buildid of this app, may change at any time based on backend updates to the game. + /// Defaults to 0 if you're not running a build downloaded from steam. + /// + public static int BuildId => Internal.GetAppBuildId(); + + + /// + /// Asynchronously retrieves metadata details about a specific file in the depot manifest. + /// Currently provides: + /// + public static async Task GetFileDetailsAsync( string filename ) + { + var r = await Internal.GetFileDetails( filename ); + + if ( !r.HasValue || r.Value.Result != Result.OK ) + return null; + + return new FileDetails + { + SizeInBytes = r.Value.FileSize, + Flags = r.Value.Flags, + Sha1 = string.Join( "", r.Value.FileSHA.Select( x => x.ToString( "x" ) ) ) + }; + } + + /// + /// Get command line if game was launched via Steam URL, e.g. steam://run/appid//command line/. + /// This method of passing a connect string (used when joining via rich presence, accepting an + /// invite, etc) is preferable to passing the connect string on the operating system command + /// line, which is a security risk. In order for rich presence joins to go through this + /// path and not be placed on the OS command line, you must set a value in your app's + /// configuration on Steam. Ask Valve for help with this. + /// + public static string CommandLine + { + get + { + Internal.GetLaunchCommandLine( out var strVal ); + return strVal; + } + } + + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/SteamClient.cs b/BoneSync/Facepunch.Steamworks/SteamClient.cs new file mode 100644 index 0000000..943af41 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/SteamClient.cs @@ -0,0 +1,181 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + public static class SteamClient + { + static bool initialized; + + /// + /// Initialize the steam client. + /// If asyncCallbacks is false you need to call RunCallbacks manually every frame. + /// + public static void Init( uint appid, bool asyncCallbacks = true ) + { + if ( initialized ) + throw new System.Exception( "Calling SteamClient.Init but is already initialized" ); + + System.Environment.SetEnvironmentVariable( "SteamAppId", appid.ToString() ); + System.Environment.SetEnvironmentVariable( "SteamGameId", appid.ToString() ); + + if ( !SteamAPI.Init() ) + { + throw new System.Exception( "SteamApi_Init returned false. Steam isn't running, couldn't find Steam, AppId is ureleased, Don't own AppId." ); + } + + AppId = appid; + + initialized = true; + + // + // Dispatch is responsible for pumping the + // event loop. + // + Dispatch.Init(); + Dispatch.ClientPipe = SteamAPI.GetHSteamPipe(); + + AddInterface(); + AddInterface(); + AddInterface(); + AddInterface(); + AddInterface(); + AddInterface(); + AddInterface(); + AddInterface(); + AddInterface(); + AddInterface(); + AddInterface(); + AddInterface(); + AddInterface(); + AddInterface(); + AddInterface(); + AddInterface(); + AddInterface(); + AddInterface(); + AddInterface(); + AddInterface(); + + if ( asyncCallbacks ) + { + // + // This will keep looping in the background every 16 ms + // until we shut down. + // + Dispatch.LoopClientAsync(); + } + } + + internal static void AddInterface() where T : SteamClass, new() + { + var t = new T(); + t.InitializeInterface( false ); + openInterfaces.Add( t ); + } + + static readonly List openInterfaces = new List(); + + internal static void ShutdownInterfaces() + { + foreach ( var e in openInterfaces ) + { + e.DestroyInterface( false ); + } + + openInterfaces.Clear(); + } + + public static bool IsValid => initialized; + + public static void Shutdown() + { + if ( !IsValid ) return; + + Cleanup(); + + SteamAPI.Shutdown(); + } + + internal static void Cleanup() + { + Dispatch.ShutdownClient(); + + initialized = false; + ShutdownInterfaces(); + } + + public static void RunCallbacks() + { + if ( Dispatch.ClientPipe != 0 ) + Dispatch.Frame( Dispatch.ClientPipe ); + } + + /// + /// Checks if the current user's Steam client is connected to the Steam servers. + /// If it's not then no real-time services provided by the Steamworks API will be enabled. The Steam + /// client will automatically be trying to recreate the connection as often as possible. When the + /// connection is restored a SteamServersConnected_t callback will be posted. + /// You usually don't need to check for this yourself. All of the API calls that rely on this will + /// check internally. Forcefully disabling stuff when the player loses access is usually not a + /// very good experience for the player and you could be preventing them from accessing APIs that do not + /// need a live connection to Steam. + /// + public static bool IsLoggedOn => SteamUser.Internal.BLoggedOn(); + + /// + /// Gets the Steam ID of the account currently logged into the Steam client. This is + /// commonly called the 'current user', or 'local user'. + /// A Steam ID is a unique identifier for a Steam accounts, Steam groups, Lobbies and Chat + /// rooms, and used to differentiate users in all parts of the Steamworks API. + /// + public static SteamId SteamId => SteamUser.Internal.GetSteamID(); + + /// + /// returns the local players name - guaranteed to not be NULL. + /// this is the same name as on the users community profile page + /// + public static string Name => SteamFriends.Internal.GetPersonaName(); + + /// + /// gets the status of the current user + /// + public static FriendState State => SteamFriends.Internal.GetPersonaState(); + + /// + /// returns the appID of the current process + /// + public static AppId AppId { get; internal set; } + + /// + /// Checks if your executable was launched through Steam and relaunches it through Steam if it wasn't + /// this returns true then it starts the Steam client if required and launches your game again through it, + /// and you should quit your process as soon as possible. This effectively runs steam://run/AppId so it + /// may not relaunch the exact executable that called it, as it will always relaunch from the version + /// installed in your Steam library folder/ + /// Note that during development, when not launching via Steam, this might always return true. + /// + public static bool RestartAppIfNecessary( uint appid ) + { + // Having these here would probably mean it always returns false? + + //System.Environment.SetEnvironmentVariable( "SteamAppId", appid.ToString() ); + //System.Environment.SetEnvironmentVariable( "SteamGameId", appid.ToString() ); + + return SteamAPI.RestartAppIfNecessary( appid ); + } + + /// + /// Called in interfaces that rely on this being initialized + /// + internal static void ValidCheck() + { + if ( !IsValid ) + throw new System.Exception( "SteamClient isn't initialized" ); + } + + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/SteamFriends.cs b/BoneSync/Facepunch.Steamworks/SteamFriends.cs new file mode 100644 index 0000000..1bb4824 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/SteamFriends.cs @@ -0,0 +1,338 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + /// + /// Undocumented Parental Settings + /// + public class SteamFriends : SteamClientClass + { + internal static ISteamFriends Internal => Interface as ISteamFriends; + + internal override void InitializeInterface( bool server ) + { + SetInterface( server, new ISteamFriends( server ) ); + + richPresence = new Dictionary(); + + InstallEvents(); + } + + static Dictionary richPresence; + + internal void InstallEvents() + { + Dispatch.Install( x => OnPersonaStateChange?.Invoke( new Friend( x.SteamID ) ) ); + Dispatch.Install( x => OnGameRichPresenceJoinRequested?.Invoke( new Friend( x.SteamIDFriend), x.ConnectUTF8() ) ); + Dispatch.Install( OnFriendChatMessage ); + Dispatch.Install( x => OnGameOverlayActivated?.Invoke( x.Active != 0 ) ); + Dispatch.Install( x => OnGameServerChangeRequested?.Invoke( x.ServerUTF8(), x.PasswordUTF8() ) ); + Dispatch.Install( x => OnGameLobbyJoinRequested?.Invoke( new Lobby( x.SteamIDLobby ), x.SteamIDFriend ) ); + Dispatch.Install( x => OnFriendRichPresenceUpdate?.Invoke( new Friend( x.SteamIDFriend ) ) ); + } + + /// + /// Called when chat message has been received from a friend. You'll need to turn on + /// ListenForFriendsMessages to recieve this. (friend, msgtype, message) + /// + public static event Action OnChatMessage; + + /// + /// called when a friends' status changes + /// + public static event Action OnPersonaStateChange; + + + /// + /// Called when the user tries to join a game from their friends list + /// rich presence will have been set with the "connect" key which is set here + /// + public static event Action OnGameRichPresenceJoinRequested; + + /// + /// Posted when game overlay activates or deactivates + /// the game can use this to be pause or resume single player games + /// + public static event Action OnGameOverlayActivated; + + /// + /// Called when the user tries to join a different game server from their friends list + /// game client should attempt to connect to specified server when this is received + /// + public static event Action OnGameServerChangeRequested; + + /// + /// Called when the user tries to join a lobby from their friends list + /// game client should attempt to connect to specified lobby when this is received + /// + public static event Action OnGameLobbyJoinRequested; + + /// + /// Callback indicating updated data about friends rich presence information + /// + public static event Action OnFriendRichPresenceUpdate; + + static unsafe void OnFriendChatMessage( GameConnectedFriendChatMsg_t data ) + { + if ( OnChatMessage == null ) return; + + var friend = new Friend( data.SteamIDUser ); + + var buffer = Helpers.TakeMemory(); + var type = ChatEntryType.ChatMsg; + + var len = Internal.GetFriendMessage( data.SteamIDUser, data.MessageID, buffer, Helpers.MemoryBufferSize, ref type ); + + if ( len == 0 && type == ChatEntryType.Invalid ) + return; + + var typeName = type.ToString(); + var message = Helpers.MemoryToString( buffer ); + + OnChatMessage( friend, typeName, message ); + } + + private static IEnumerable GetFriendsWithFlag(FriendFlags flag) + { + for ( int i=0; i GetFriends() + { + return GetFriendsWithFlag(FriendFlags.Immediate); + } + + public static IEnumerable GetBlocked() + { + return GetFriendsWithFlag(FriendFlags.Blocked); + } + + public static IEnumerable GetFriendsRequested() + { + return GetFriendsWithFlag( FriendFlags.FriendshipRequested ); + } + + public static IEnumerable GetFriendsClanMembers() + { + return GetFriendsWithFlag( FriendFlags.ClanMember ); + } + + public static IEnumerable GetFriendsOnGameServer() + { + return GetFriendsWithFlag( FriendFlags.OnGameServer ); + } + + public static IEnumerable GetFriendsRequestingFriendship() + { + return GetFriendsWithFlag( FriendFlags.RequestingFriendship ); + } + + public static IEnumerable GetPlayedWith() + { + for ( int i = 0; i < Internal.GetCoplayFriendCount(); i++ ) + { + yield return new Friend( Internal.GetCoplayFriend( i ) ); + } + } + + public static IEnumerable GetFromSource( SteamId steamid ) + { + for ( int i = 0; i < Internal.GetFriendCountFromSource( steamid ); i++ ) + { + yield return new Friend( Internal.GetFriendFromSourceByIndex( steamid, i ) ); + } + } + + /// + /// The dialog to open. Valid options are: + /// "friends", + /// "community", + /// "players", + /// "settings", + /// "officialgamegroup", + /// "stats", + /// "achievements". + /// + public static void OpenOverlay( string type ) => Internal.ActivateGameOverlay( type ); + + /// + /// "steamid" - Opens the overlay web browser to the specified user or groups profile. + /// "chat" - Opens a chat window to the specified user, or joins the group chat. + /// "jointrade" - Opens a window to a Steam Trading session that was started with the ISteamEconomy/StartTrade Web API. + /// "stats" - Opens the overlay web browser to the specified user's stats. + /// "achievements" - Opens the overlay web browser to the specified user's achievements. + /// "friendadd" - Opens the overlay in minimal mode prompting the user to add the target user as a friend. + /// "friendremove" - Opens the overlay in minimal mode prompting the user to remove the target friend. + /// "friendrequestaccept" - Opens the overlay in minimal mode prompting the user to accept an incoming friend invite. + /// "friendrequestignore" - Opens the overlay in minimal mode prompting the user to ignore an incoming friend invite. + /// + public static void OpenUserOverlay( SteamId id, string type ) => Internal.ActivateGameOverlayToUser( type, id ); + + /// + /// Activates the Steam Overlay to the Steam store page for the provided app. + /// + public static void OpenStoreOverlay( AppId id ) => Internal.ActivateGameOverlayToStore( id.Value, OverlayToStoreFlag.None ); + + /// + /// Activates Steam Overlay web browser directly to the specified URL. + /// + public static void OpenWebOverlay( string url, bool modal = false ) => Internal.ActivateGameOverlayToWebPage( url, modal ? ActivateGameOverlayToWebPageMode.Modal : ActivateGameOverlayToWebPageMode.Default ); + + /// + /// Activates the Steam Overlay to open the invite dialog. Invitations sent from this dialog will be for the provided lobby. + /// + public static void OpenGameInviteOverlay( SteamId lobby ) => Internal.ActivateGameOverlayInviteDialog( lobby ); + + /// + /// Mark a target user as 'played with'. + /// NOTE: The current user must be in game with the other player for the association to work. + /// + public static void SetPlayedWith( SteamId steamid ) => Internal.SetPlayedWith( steamid ); + + /// + /// Requests the persona name and optionally the avatar of a specified user. + /// NOTE: It's a lot slower to download avatars and churns the local cache, so if you don't need avatars, don't request them. + /// returns true if we're fetching the data, false if we already have it + /// + public static bool RequestUserInformation( SteamId steamid, bool nameonly = true ) => Internal.RequestUserInformation( steamid, nameonly ); + + + internal static async Task CacheUserInformationAsync( SteamId steamid, bool nameonly ) + { + // Got it straight away, skip any waiting. + if ( !RequestUserInformation( steamid, nameonly ) ) + return; + + await Task.Delay( 100 ); + + while ( RequestUserInformation( steamid, nameonly ) ) + { + await Task.Delay( 50 ); + } + + // + // And extra wait here seems to solve avatars loading as [?] + // + await Task.Delay( 500 ); + } + + public static async Task GetSmallAvatarAsync( SteamId steamid ) + { + await CacheUserInformationAsync( steamid, false ); + return SteamUtils.GetImage( Internal.GetSmallFriendAvatar( steamid ) ); + } + + public static async Task GetMediumAvatarAsync( SteamId steamid ) + { + await CacheUserInformationAsync( steamid, false ); + return SteamUtils.GetImage( Internal.GetMediumFriendAvatar( steamid ) ); + } + + public static async Task GetLargeAvatarAsync( SteamId steamid ) + { + await CacheUserInformationAsync( steamid, false ); + + var imageid = Internal.GetLargeFriendAvatar( steamid ); + + // Wait for the image to download + while ( imageid == -1 ) + { + await Task.Delay( 50 ); + imageid = Internal.GetLargeFriendAvatar( steamid ); + } + + return SteamUtils.GetImage( imageid ); + } + + /// + /// Find a rich presence value by key for current user. Will be null if not found. + /// + public static string GetRichPresence( string key ) + { + if ( richPresence.TryGetValue( key, out var val ) ) + return val; + + return null; + } + + /// + /// Sets a rich presence value by key for current user. + /// + public static bool SetRichPresence( string key, string value ) + { + bool success = Internal.SetRichPresence( key, value ); + + if ( success ) + richPresence[key] = value; + + return success; + } + + /// + /// Clears all of the current user's rich presence data. + /// + public static void ClearRichPresence() + { + richPresence.Clear(); + Internal.ClearRichPresence(); + } + + static bool _listenForFriendsMessages; + + /// + /// Listens for Steam friends chat messages. + /// You can then show these chats inline in the game. For example with a Blizzard style chat message system or the chat system in Dota 2. + /// After enabling this you will receive callbacks when ever the user receives a chat message. + /// + public static bool ListenForFriendsMessages + { + get => _listenForFriendsMessages; + + set + { + _listenForFriendsMessages = value; + Internal.SetListenForFriendsMessages( value ); + } + } + + public static async Task IsFollowing(SteamId steamID) + { + var r = await Internal.IsFollowing(steamID); + return r.Value.IsFollowing; + } + + public static async Task GetFollowerCount(SteamId steamID) + { + var r = await Internal.GetFollowerCount(steamID); + return r.Value.Count; + } + + public static async Task GetFollowingList() + { + int resultCount = 0; + var steamIds = new List(); + + FriendsEnumerateFollowingList_t? result; + + do + { + if ( (result = await Internal.EnumerateFollowingList((uint)resultCount)) != null) + { + resultCount += result.Value.ResultsReturned; + + Array.ForEach(result.Value.GSteamID, id => { if (id > 0) steamIds.Add(id); }); + } + } while (result != null && resultCount < result.Value.TotalResultCount); + + return steamIds.ToArray(); + } + } +} diff --git a/BoneSync/Facepunch.Steamworks/SteamInput.cs b/BoneSync/Facepunch.Steamworks/SteamInput.cs new file mode 100644 index 0000000..66fa31b --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/SteamInput.cs @@ -0,0 +1,102 @@ +using Facepunch.Steamworks.Data; +using System.Collections.Generic; + +namespace Facepunch.Steamworks +{ + public class SteamInput : SteamClientClass + { + internal static ISteamInput Internal => Interface as ISteamInput; + + internal override void InitializeInterface( bool server ) + { + SetInterface( server, new ISteamInput( server ) ); + } + + internal const int STEAM_CONTROLLER_MAX_COUNT = 16; + + + /// + /// You shouldn't really need to call this because it get called by RunCallbacks on SteamClient + /// but Valve think it might be a nice idea if you call it right before you get input info - + /// just to make sure the info you're getting is 100% up to date. + /// + public static void RunFrame() + { + Internal.RunFrame(); + } + + static readonly InputHandle_t[] queryArray = new InputHandle_t[STEAM_CONTROLLER_MAX_COUNT]; + + /// + /// Return a list of connected controllers. + /// + public static IEnumerable Controllers + { + get + { + var num = Internal.GetConnectedControllers( queryArray ); + + for ( int i = 0; i < num; i++ ) + { + yield return new Controller( queryArray[i] ); + } + } + } + + + /// + /// Return an absolute path to the PNG image glyph for the provided digital action name. The current + /// action set in use for the controller will be used for the lookup. You should cache the result and + /// maintain your own list of loaded PNG assets. + /// + /// + /// + /// + public static string GetDigitalActionGlyph( Controller controller, string action ) + { + InputActionOrigin origin = InputActionOrigin.None; + + Internal.GetDigitalActionOrigins( + controller.Handle, + Internal.GetCurrentActionSet(controller.Handle), + GetDigitalActionHandle(action), + ref origin + ); + + return Internal.GetGlyphForActionOrigin(origin); + } + + internal static Dictionary DigitalHandles = new Dictionary(); + internal static InputDigitalActionHandle_t GetDigitalActionHandle( string name ) + { + if ( DigitalHandles.TryGetValue( name, out var val ) ) + return val; + + val = Internal.GetDigitalActionHandle( name ); + DigitalHandles.Add( name, val ); + return val; + } + + internal static Dictionary AnalogHandles = new Dictionary(); + internal static InputAnalogActionHandle_t GetAnalogActionHandle( string name ) + { + if ( AnalogHandles.TryGetValue( name, out var val ) ) + return val; + + val = Internal.GetAnalogActionHandle( name ); + AnalogHandles.Add( name, val ); + return val; + } + + internal static Dictionary ActionSets = new Dictionary(); + internal static InputActionSetHandle_t GetActionSetHandle( string name ) + { + if ( ActionSets.TryGetValue( name, out var val ) ) + return val; + + val = Internal.GetActionSetHandle( name ); + ActionSets.Add( name, val ); + return val; + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/SteamInventory.cs b/BoneSync/Facepunch.Steamworks/SteamInventory.cs new file mode 100644 index 0000000..6c55700 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/SteamInventory.cs @@ -0,0 +1,365 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + /// + /// Undocumented Parental Settings + /// + public class SteamInventory : SteamSharedClass + { + internal static ISteamInventory Internal => Interface as ISteamInventory; + + internal override void InitializeInterface( bool server ) + { + SetInterface( server, new ISteamInventory( server ) ); + + InstallEvents( server ); + } + + internal static void InstallEvents( bool server ) + { + if ( !server ) + { + Dispatch.Install( x => InventoryUpdated( x ) ); + } + + Dispatch.Install( x => LoadDefinitions(), server ); + } + + private static void InventoryUpdated( SteamInventoryFullUpdate_t x ) + { + var r = new InventoryResult( x.Handle, false ); + Items = r.GetItems( false ); + + OnInventoryUpdated?.Invoke( r ); + } + + public static event Action OnInventoryUpdated; + public static event Action OnDefinitionsUpdated; + + static void LoadDefinitions() + { + Definitions = GetDefinitions(); + + if ( Definitions == null ) + return; + + _defMap = new Dictionary(); + + foreach ( var d in Definitions ) + { + _defMap[d.Id] = d; + } + + OnDefinitionsUpdated?.Invoke(); + } + + + /// + /// Call this if you're going to want to access definition information. You should be able to get + /// away with calling this once at the start if your game, assuming your items don't change all the time. + /// This will trigger OnDefinitionsUpdated at which point Definitions should be set. + /// + public static void LoadItemDefinitions() + { + // If they're null, try to load them immediately + // my hunch is that this loads a disk cached version + // but waiting for LoadItemDefinitions downloads a new copy + // from Steam's servers. So this will give us immediate data + // where as Steam's inventory servers could be slow/down + if ( Definitions == null ) + { + LoadDefinitions(); + } + + Internal.LoadItemDefinitions(); + } + + /// + /// Will call LoadItemDefinitions and wait until Definitions is not null + /// + public static async Task WaitForDefinitions( float timeoutSeconds = 30 ) + { + if ( Definitions != null ) + return true; + + LoadDefinitions(); + LoadItemDefinitions(); + + if ( Definitions != null ) + return true; + + var sw = Stopwatch.StartNew(); + + while ( Definitions == null ) + { + if ( sw.Elapsed.TotalSeconds > timeoutSeconds ) + return false; + + await Task.Delay( 10 ); + } + + return true; + } + + /// + /// Try to find the definition that matches this definition ID. + /// Uses a dictionary so should be about as fast as possible. + /// + public static InventoryDef FindDefinition( InventoryDefId defId ) + { + if ( _defMap == null ) + return null; + + if ( _defMap.TryGetValue( defId, out var val ) ) + return val; + + return null; + } + + public static string Currency { get; internal set; } + + public static async Task GetDefinitionsWithPricesAsync() + { + var priceRequest = await Internal.RequestPrices(); + if ( !priceRequest.HasValue || priceRequest.Value.Result != Result.OK ) + return null; + + Currency = priceRequest?.CurrencyUTF8(); + + var num = Internal.GetNumItemsWithPrices(); + + if ( num <= 0 ) + return null; + + var defs = new InventoryDefId[num]; + var currentPrices = new ulong[num]; + var baseprices = new ulong[num]; + + var gotPrices = Internal.GetItemsWithPrices( defs, currentPrices, baseprices, num ); + if ( !gotPrices ) + return null; + + return defs.Select( x => new InventoryDef( x ) ).ToArray(); + } + + /// + /// We will try to keep this list of your items automatically up to date. + /// + public static InventoryItem[] Items { get; internal set; } + + public static InventoryDef[] Definitions { get; internal set; } + static Dictionary _defMap; + + internal static InventoryDef[] GetDefinitions() + { + uint num = 0; + if ( !Internal.GetItemDefinitionIDs( null, ref num ) ) + return null; + + var defs = new InventoryDefId[num]; + + if ( !Internal.GetItemDefinitionIDs( defs, ref num ) ) + return null; + + return defs.Select( x => new InventoryDef( x ) ).ToArray(); + } + + /// + /// Update the list of Items[] + /// + public static bool GetAllItems() + { + var sresult = Defines.k_SteamInventoryResultInvalid; + return Internal.GetAllItems( ref sresult ); + } + + /// + /// Get all items and return the InventoryResult + /// + public static async Task GetAllItemsAsync() + { + var sresult = Defines.k_SteamInventoryResultInvalid; + + if ( !Internal.GetAllItems( ref sresult ) ) + return null; + + return await InventoryResult.GetAsync( sresult ); + } + + /// + /// This is used to grant a specific item to the user. This should + /// only be used for development prototyping, from a trusted server, + /// or if you don't care about hacked clients granting arbitrary items. + /// This call can be disabled by a setting on Steamworks. + /// + public static async Task GenerateItemAsync( InventoryDef target, int amount ) + { + var sresult = Defines.k_SteamInventoryResultInvalid; + + var defs = new InventoryDefId[] { target.Id }; + var cnts = new uint[] { (uint)amount }; + + if ( !Internal.GenerateItems( ref sresult, defs, cnts, 1 ) ) + return null; + + return await InventoryResult.GetAsync( sresult ); + } + + /// + /// Crafting! Uses the passed items to buy the target item. + /// You need to have set up the appropriate exchange rules in your item + /// definitions. This assumes all the items passed in aren't stacked. + /// + public static async Task CraftItemAsync( InventoryItem[] list, InventoryDef target ) + { + var sresult = Defines.k_SteamInventoryResultInvalid; + + var give = new InventoryDefId[] { target.Id }; + var givec = new uint[] { 1 }; + + var sell = list.Select( x => x.Id ).ToArray(); + var sellc = list.Select( x => (uint)1 ).ToArray(); + + if ( !Internal.ExchangeItems( ref sresult, give, givec, 1, sell, sellc, (uint)sell.Length ) ) + return null; + + return await InventoryResult.GetAsync( sresult ); + } + + /// + /// Crafting! Uses the passed items to buy the target item. + /// You need to have set up the appropriate exchange rules in your item + /// definitions. This assumes all the items passed in aren't stacked. + /// + public static async Task CraftItemAsync( InventoryItem.Amount[] list, InventoryDef target ) + { + var sresult = Defines.k_SteamInventoryResultInvalid; + + var give = new InventoryDefId[] { target.Id }; + var givec = new uint[] { 1 }; + + var sell = list.Select( x => x.Item.Id ).ToArray(); + var sellc = list.Select( x => (uint) x.Quantity ).ToArray(); + + if ( !Internal.ExchangeItems( ref sresult, give, givec, 1, sell, sellc, (uint)sell.Length ) ) + return null; + + return await InventoryResult.GetAsync( sresult ); + } + + /// + /// Deserializes a result set and verifies the signature bytes. + /// This call has a potential soft-failure mode where the Result is expired, it will + /// still succeed in this mode.The "expired" + /// result could indicate that the data may be out of date - not just due to timed + /// expiration( one hour ), but also because one of the items in the result set may + /// have been traded or consumed since the result set was generated.You could compare + /// the timestamp from GetResultTimestamp to ISteamUtils::GetServerRealTime to determine + /// how old the data is. You could simply ignore the "expired" result code and + /// continue as normal, or you could request the player with expired data to send + /// an updated result set. + /// You should call CheckResultSteamID on the result handle when it completes to verify + /// that a remote player is not pretending to have a different user's inventory. + /// + public static async Task DeserializeAsync( byte[] data, int dataLength = -1 ) + { + if ( data == null ) + throw new ArgumentException( "data should not be null" ); + + if ( dataLength == -1 ) + dataLength = data.Length; + + var ptr = Marshal.AllocHGlobal( dataLength ); + + try + { + Marshal.Copy( data, 0, ptr, dataLength ); + + var sresult = Defines.k_SteamInventoryResultInvalid; + + if ( !Internal.DeserializeResult( ref sresult, (IntPtr)ptr, (uint)dataLength, false ) ) + return null; + + + + return await InventoryResult.GetAsync( sresult.Value ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + + + /// + /// Grant all promotional items the user is eligible for + /// + public static async Task GrantPromoItemsAsync() + { + var sresult = Defines.k_SteamInventoryResultInvalid; + + if ( !Internal.GrantPromoItems( ref sresult ) ) + return null; + + return await InventoryResult.GetAsync( sresult ); + } + + + /// + /// Trigger an item drop for this user. This is for timed drops. + /// + public static async Task TriggerItemDropAsync( InventoryDefId id ) + { + var sresult = Defines.k_SteamInventoryResultInvalid; + + if ( !Internal.TriggerItemDrop( ref sresult, id ) ) + return null; + + return await InventoryResult.GetAsync( sresult ); + } + + /// + /// Trigger a promo item drop. You can call this at startup, it won't + /// give users multiple promo drops. + /// + public static async Task AddPromoItemAsync( InventoryDefId id ) + { + var sresult = Defines.k_SteamInventoryResultInvalid; + + if ( !Internal.AddPromoItem( ref sresult, id ) ) + return null; + + return await InventoryResult.GetAsync( sresult ); + } + + + /// + /// Start buying a cart load of items. This will return a positive result is the purchase has + /// begun. You should listen out for SteamUser.OnMicroTxnAuthorizationResponse for a success. + /// + public static async Task StartPurchaseAsync( InventoryDef[] items ) + { + var item_i = items.Select( x => x._id ).ToArray(); + var item_q = items.Select( x => (uint)1 ).ToArray(); + + var r = await Internal.StartPurchase( item_i, item_q, (uint)item_i.Length ); + if ( !r.HasValue ) return null; + + return new InventoryPurchaseResult + { + Result = r.Value.Result, + OrderID = r.Value.OrderID, + TransID = r.Value.TransID + }; + } + + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/SteamMatchmaking.cs b/BoneSync/Facepunch.Steamworks/SteamMatchmaking.cs new file mode 100644 index 0000000..764f6e7 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/SteamMatchmaking.cs @@ -0,0 +1,218 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + /// + /// Functions for clients to access matchmaking services, favorites, and to operate on game lobbies + /// + public class SteamMatchmaking : SteamClientClass + { + internal static ISteamMatchmaking Internal => Interface as ISteamMatchmaking; + + internal override void InitializeInterface( bool server ) + { + SetInterface( server, new ISteamMatchmaking( server ) ); + + InstallEvents(); + } + + /// + /// Maximum number of characters a lobby metadata key can be + /// + internal static int MaxLobbyKeyLength => 255; + + + internal static void InstallEvents() + { + Dispatch.Install( x => OnLobbyInvite?.Invoke( new Friend( x.SteamIDUser ), new Lobby( x.SteamIDLobby ) ) ); + + Dispatch.Install( x => OnLobbyEntered?.Invoke( new Lobby( x.SteamIDLobby ) ) ); + + Dispatch.Install( x => OnLobbyCreated?.Invoke( x.Result, new Lobby( x.SteamIDLobby ) ) ); + + Dispatch.Install( x => OnLobbyGameCreated?.Invoke( new Lobby( x.SteamIDLobby ), x.IP, x.Port, x.SteamIDGameServer ) ); + + Dispatch.Install( x => + { + if ( x.Success == 0 ) return; + + if ( x.SteamIDLobby == x.SteamIDMember ) + OnLobbyDataChanged?.Invoke( new Lobby( x.SteamIDLobby ) ); + else + OnLobbyMemberDataChanged?.Invoke( new Lobby( x.SteamIDLobby ), new Friend( x.SteamIDMember ) ); + } ); + + Dispatch.Install( x => + { + if ( (x.GfChatMemberStateChange & (int)ChatMemberStateChange.Entered) != 0 ) + OnLobbyMemberJoined?.Invoke( new Lobby( x.SteamIDLobby ), new Friend( x.SteamIDUserChanged ) ); + + if ( (x.GfChatMemberStateChange & (int)ChatMemberStateChange.Left) != 0 ) + OnLobbyMemberLeave?.Invoke( new Lobby( x.SteamIDLobby ), new Friend( x.SteamIDUserChanged ) ); + + if ( (x.GfChatMemberStateChange & (int)ChatMemberStateChange.Disconnected) != 0 ) + OnLobbyMemberDisconnected?.Invoke( new Lobby( x.SteamIDLobby ), new Friend( x.SteamIDUserChanged ) ); + + if ( (x.GfChatMemberStateChange & (int)ChatMemberStateChange.Kicked) != 0 ) + OnLobbyMemberKicked?.Invoke( new Lobby( x.SteamIDLobby ), new Friend( x.SteamIDUserChanged ), new Friend( x.SteamIDMakingChange ) ); + + if ( (x.GfChatMemberStateChange & (int)ChatMemberStateChange.Banned) != 0 ) + OnLobbyMemberBanned?.Invoke( new Lobby( x.SteamIDLobby ), new Friend( x.SteamIDUserChanged ), new Friend( x.SteamIDMakingChange ) ); + } ); + + Dispatch.Install( OnLobbyChatMessageRecievedAPI ); + } + + static private unsafe void OnLobbyChatMessageRecievedAPI( LobbyChatMsg_t callback ) + { + SteamId steamid = default; + ChatEntryType chatEntryType = default; + var buffer = Helpers.TakeMemory(); + + var readData = Internal.GetLobbyChatEntry( callback.SteamIDLobby, (int)callback.ChatID, ref steamid, buffer, Helpers.MemoryBufferSize, ref chatEntryType ); + + if ( readData > 0 ) + { + OnChatMessage?.Invoke( new Lobby( callback.SteamIDLobby ), new Friend( steamid ), Helpers.MemoryToString( buffer ) ); + } + } + + /// + /// Someone invited you to a lobby + /// + public static event Action OnLobbyInvite; + + /// + /// You joined a lobby + /// + public static event Action OnLobbyEntered; + + /// + /// You created a lobby + /// + public static event Action OnLobbyCreated; + + /// + /// A game server has been associated with the lobby + /// + public static event Action OnLobbyGameCreated; + + /// + /// The lobby metadata has changed + /// + public static event Action OnLobbyDataChanged; + + /// + /// The lobby member metadata has changed + /// + public static event Action OnLobbyMemberDataChanged; + + /// + /// The lobby member joined + /// + public static event Action OnLobbyMemberJoined; + + /// + /// The lobby member left the room + /// + public static event Action OnLobbyMemberLeave; + + /// + /// The lobby member left the room + /// + public static event Action OnLobbyMemberDisconnected; + + /// + /// The lobby member was kicked. The 3rd param is the user that kicked them. + /// + public static event Action OnLobbyMemberKicked; + + /// + /// The lobby member was banned. The 3rd param is the user that banned them. + /// + public static event Action OnLobbyMemberBanned; + + /// + /// A chat message was recieved from a member of a lobby + /// + public static event Action OnChatMessage; + + public static LobbyQuery LobbyList => new LobbyQuery(); + + /// + /// Creates a new invisible lobby. Call lobby.SetPublic to take it online. + /// + public static async Task CreateLobbyAsync( int maxMembers = 100 ) + { + var lobby = await Internal.CreateLobby( LobbyType.Invisible, maxMembers ); + if ( !lobby.HasValue || lobby.Value.Result != Result.OK ) return null; + + return new Lobby { Id = lobby.Value.SteamIDLobby }; + } + + /// + /// Attempts to directly join the specified lobby + /// + public static async Task JoinLobbyAsync( SteamId lobbyId ) + { + var lobby = await Internal.JoinLobby( lobbyId ); + if ( !lobby.HasValue ) return null; + + return new Lobby { Id = lobby.Value.SteamIDLobby }; + } + + /// + /// Get a list of servers that are on your favorites list + /// + public static IEnumerable GetFavoriteServers() + { + var count = Internal.GetFavoriteGameCount(); + + for( int i=0; i + /// Get a list of servers that you have added to your play history + /// + public static IEnumerable GetHistoryServers() + { + var count = Internal.GetFavoriteGameCount(); + + for ( int i = 0; i < count; i++ ) + { + uint timeplayed = 0; + uint flags = 0; + ushort qport = 0; + ushort cport = 0; + uint ip = 0; + AppId appid = default; + + if ( Internal.GetFavoriteGame( i, ref appid, ref ip, ref cport, ref qport, ref flags, ref timeplayed ) ) + { + if ( (flags & ServerInfo.k_unFavoriteFlagHistory) == 0 ) continue; + yield return new ServerInfo( ip, cport, qport, timeplayed ); + } + } + } + + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/SteamMatchmakingServers.cs b/BoneSync/Facepunch.Steamworks/SteamMatchmakingServers.cs new file mode 100644 index 0000000..c8c4af9 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/SteamMatchmakingServers.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + /// + /// Functions for clients to access matchmaking services, favorites, and to operate on game lobbies + /// + internal class SteamMatchmakingServers : SteamClientClass + { + internal static ISteamMatchmakingServers Internal => Interface as ISteamMatchmakingServers; + + internal override void InitializeInterface( bool server ) + { + SetInterface( server, new ISteamMatchmakingServers( server ) ); + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/SteamMusic.cs b/BoneSync/Facepunch.Steamworks/SteamMusic.cs new file mode 100644 index 0000000..af25790 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/SteamMusic.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + /// + /// Functions to control music playback in the steam client. + /// This gives games the opportunity to do things like pause the music or lower the volume, + /// when an important cut scene is shown, and start playing afterwards. + /// Nothing uses Steam Music though so this can probably get fucked + /// + public class SteamMusic : SteamClientClass + { + internal static ISteamMusic Internal => Interface as ISteamMusic; + + internal override void InitializeInterface( bool server ) + { + SetInterface( server, new ISteamMusic( server ) ); + + InstallEvents(); + } + + internal static void InstallEvents() + { + Dispatch.Install( x => OnPlaybackChanged?.Invoke() ); + Dispatch.Install( x => OnVolumeChanged?.Invoke( x.NewVolume ) ); + } + + /// + /// Playback status changed + /// + public static event Action OnPlaybackChanged; + + /// + /// Volume changed, parameter is new volume + /// + public static event Action OnVolumeChanged; + + /// + /// Checks if Steam Music is enabled + /// + public static bool IsEnabled => Internal.BIsEnabled(); + + /// + /// true if a song is currently playing, paused, or queued up to play; otherwise false. + /// + public static bool IsPlaying => Internal.BIsPlaying(); + + /// + /// Gets the current status of the Steam Music player + /// + public static MusicStatus Status => Internal.GetPlaybackStatus(); + + + public static void Play() => Internal.Play(); + + public static void Pause() => Internal.Pause(); + + /// + /// Have the Steam Music player play the previous song. + /// + public static void PlayPrevious() => Internal.PlayPrevious(); + + /// + /// Have the Steam Music player skip to the next song + /// + public static void PlayNext() => Internal.PlayNext(); + + /// + /// Gets/Sets the current volume of the Steam Music player + /// + public static float Volume + { + get => Internal.GetVolume(); + set => Internal.SetVolume( value ); + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/SteamNetworking.cs b/BoneSync/Facepunch.Steamworks/SteamNetworking.cs new file mode 100644 index 0000000..890ebf2 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/SteamNetworking.cs @@ -0,0 +1,144 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + public class SteamNetworking : SteamSharedClass + { + internal static ISteamNetworking Internal => Interface as ISteamNetworking; + + internal override void InitializeInterface( bool server ) + { + SetInterface( server, new ISteamNetworking( server ) ); + + InstallEvents( server ); + } + + internal static void InstallEvents( bool server ) + { + Dispatch.Install( x => OnP2PSessionRequest?.Invoke( x.SteamIDRemote ), server ); + Dispatch.Install( x => OnP2PConnectionFailed?.Invoke( x.SteamIDRemote, (P2PSessionError) x.P2PSessionError ), server ); + } + + /// + /// This SteamId wants to send you a message. You should respond by calling AcceptP2PSessionWithUser + /// if you want to recieve their messages + /// + public static Action OnP2PSessionRequest; + + /// + /// Called when packets can't get through to the specified user. + /// All queued packets unsent at this point will be dropped, further attempts + /// to send will retry making the connection (but will be dropped if we fail again). + /// + public static Action OnP2PConnectionFailed; + + /// + /// This should be called in response to a OnP2PSessionRequest + /// + public static bool AcceptP2PSessionWithUser( SteamId user ) => Internal.AcceptP2PSessionWithUser( user ); + + /// + /// Allow or disallow P2P connects to fall back on Steam server relay if direct + /// connection or NAT traversal can't be established. Applies to connections + /// created after setting or old connections that need to reconnect. + /// + public static bool AllowP2PPacketRelay( bool allow ) => Internal.AllowP2PPacketRelay( allow ); + + /// + /// This should be called when you're done communicating with a user, as this will + /// free up all of the resources allocated for the connection under-the-hood. + /// If the remote user tries to send data to you again, a new OnP2PSessionRequest + /// callback will be posted + /// + public static bool CloseP2PSessionWithUser( SteamId user ) => Internal.CloseP2PSessionWithUser( user ); + + /// + /// Checks if a P2P packet is available to read, and gets the size of the message if there is one. + /// + public static bool IsP2PPacketAvailable( int channel = 0 ) + { + uint _ = 0; + return Internal.IsP2PPacketAvailable( ref _, channel ); + } + + /// + /// Reads in a packet that has been sent from another user via SendP2PPacket.. + /// + public unsafe static P2Packet? ReadP2PPacket( int channel = 0 ) + { + uint size = 0; + + if ( !Internal.IsP2PPacketAvailable( ref size, channel ) ) + return null; + + var buffer = Helpers.TakeBuffer( (int) size ); + + fixed ( byte* p = buffer ) + { + SteamId steamid = 1; + if ( !Internal.ReadP2PPacket( (IntPtr)p, (uint) buffer.Length, ref size, ref steamid, channel ) || size == 0 ) + return null; + + var data = new byte[size]; + Array.Copy( buffer, 0, data, 0, size ); + + return new P2Packet + { + SteamId = steamid, + Data = data + }; + } + } + + /// + /// Reads in a packet that has been sent from another user via SendP2PPacket.. + /// + public unsafe static bool ReadP2PPacket( byte[] buffer, ref uint size, ref SteamId steamid, int channel = 0 ) + { + fixed (byte* p = buffer) { + return Internal.ReadP2PPacket( (IntPtr)p, (uint)buffer.Length, ref size, ref steamid, channel ); + } + } + + /// + /// Reads in a packet that has been sent from another user via SendP2PPacket.. + /// + public unsafe static bool ReadP2PPacket( byte* buffer, uint cbuf, ref uint size, ref SteamId steamid, int channel = 0 ) + { + return Internal.ReadP2PPacket( (IntPtr)buffer, cbuf, ref size, ref steamid, channel ); + } + + /// + /// Sends a P2P packet to the specified user. + /// This is a session-less API which automatically establishes NAT-traversing or Steam relay server connections. + /// NOTE: The first packet send may be delayed as the NAT-traversal code runs. + /// + public static unsafe bool SendP2PPacket( SteamId steamid, byte[] data, int length = -1, int nChannel = 0, P2PSend sendType = P2PSend.Reliable ) + { + if ( length <= 0 ) + length = data.Length; + + fixed ( byte* p = data ) + { + return Internal.SendP2PPacket( steamid, (IntPtr)p, (uint)length, (P2PSend)sendType, nChannel ); + } + } + + /// + /// Sends a P2P packet to the specified user. + /// This is a session-less API which automatically establishes NAT-traversing or Steam relay server connections. + /// NOTE: The first packet send may be delayed as the NAT-traversal code runs. + /// + public static unsafe bool SendP2PPacket( SteamId steamid, byte* data, uint length, int nChannel = 1, P2PSend sendType = P2PSend.Reliable ) + { + return Internal.SendP2PPacket( steamid, (IntPtr)data, (uint)length, (P2PSend)sendType, nChannel ); + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/SteamNetworkingSockets.cs b/BoneSync/Facepunch.Steamworks/SteamNetworkingSockets.cs new file mode 100644 index 0000000..63b2492 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/SteamNetworkingSockets.cs @@ -0,0 +1,194 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + public class SteamNetworkingSockets : SteamSharedClass + { + internal static ISteamNetworkingSockets Internal => Interface as ISteamNetworkingSockets; + + internal override void InitializeInterface( bool server ) + { + SetInterface( server, new ISteamNetworkingSockets( server ) ); + InstallEvents( server ); + } + +#region SocketInterface + + static readonly Dictionary SocketInterfaces = new Dictionary(); + + internal static SocketManager GetSocketManager( uint id ) + { + if ( SocketInterfaces == null ) return null; + if ( id == 0 ) throw new System.ArgumentException( "Invalid Socket" ); + + if ( SocketInterfaces.TryGetValue( id, out var isocket ) ) + return isocket; + + return null; + } + + internal static void SetSocketManager( uint id, SocketManager manager ) + { + if ( id == 0 ) throw new System.ArgumentException( "Invalid Socket" ); + SocketInterfaces[id] = manager; + } +#endregion + +#region ConnectionInterface + static readonly Dictionary ConnectionInterfaces = new Dictionary(); + + internal static ConnectionManager GetConnectionManager( uint id ) + { + if ( ConnectionInterfaces == null ) return null; + if ( id == 0 ) return null; + + if ( ConnectionInterfaces.TryGetValue( id, out var iconnection ) ) + return iconnection; + + return null; + } + + internal static void SetConnectionManager( uint id, ConnectionManager manager ) + { + if ( id == 0 ) throw new System.ArgumentException( "Invalid Connection" ); + ConnectionInterfaces[id] = manager; + } +#endregion + + + + internal void InstallEvents( bool server ) + { + Dispatch.Install( ConnectionStatusChanged, server ); + } + + + private static void ConnectionStatusChanged( SteamNetConnectionStatusChangedCallback_t data ) + { + // + // This is a message from/to a listen socket + // + if ( data.Nfo.listenSocket.Id > 0 ) + { + var iface = GetSocketManager( data.Nfo.listenSocket.Id ); + iface?.OnConnectionChanged( data.Conn, data.Nfo ); + } + else + { + var iface = GetConnectionManager( data.Conn.Id ); + iface?.OnConnectionChanged( data.Nfo ); + } + + OnConnectionStatusChanged?.Invoke( data.Conn, data.Nfo ); + } + + public static event Action OnConnectionStatusChanged; + + + /// + /// Creates a "server" socket that listens for clients to connect to by calling + /// Connect, over ordinary UDP (IPv4 or IPv6) + /// + /// To use this derive a class from SocketManager and override as much as you want. + /// + /// + public static T CreateNormalSocket( NetAddress address ) where T : SocketManager, new() + { + var t = new T(); + var options = Array.Empty(); + t.Socket = Internal.CreateListenSocketIP( ref address, options.Length, options ); + t.Initialize(); + + SetSocketManager( t.Socket.Id, t ); + return t; + } + + /// + /// Creates a "server" socket that listens for clients to connect to by calling + /// Connect, over ordinary UDP (IPv4 or IPv6). + /// + /// To use this you should pass a class that inherits ISocketManager. You can use + /// SocketManager to get connections and send messages, but the ISocketManager class + /// will received all the appropriate callbacks. + /// + /// + public static SocketManager CreateNormalSocket( NetAddress address, ISocketManager intrface ) + { + var options = Array.Empty(); + var socket = Internal.CreateListenSocketIP( ref address, options.Length, options ); + + var t = new SocketManager + { + Socket = socket, + Interface = intrface + }; + + t.Initialize(); + + SetSocketManager( t.Socket.Id, t ); + return t; + } + + /// + /// Connect to a socket created via CreateListenSocketIP + /// + public static T ConnectNormal( NetAddress address ) where T : ConnectionManager, new() + { + var t = new T(); + var options = Array.Empty(); + t.Connection = Internal.ConnectByIPAddress( ref address, options.Length, options ); + SetConnectionManager( t.Connection.Id, t ); + return t; + } + + /// + /// Connect to a socket created via CreateListenSocketIP + /// + public static ConnectionManager ConnectNormal( NetAddress address, IConnectionManager iface ) + { + var options = Array.Empty(); + var connection = Internal.ConnectByIPAddress( ref address, options.Length, options ); + + var t = new ConnectionManager + { + Connection = connection, + Interface = iface + }; + + SetConnectionManager( t.Connection.Id, t ); + return t; + } + + /// + /// Creates a server that will be relayed via Valve's network (hiding the IP and improving ping) + /// + public static T CreateRelaySocket( int virtualport = 0 ) where T : SocketManager, new() + { + var t = new T(); + var options = Array.Empty(); + t.Socket = Internal.CreateListenSocketP2P( virtualport, options.Length, options ); + t.Initialize(); + SetSocketManager( t.Socket.Id, t ); + return t; + } + + /// + /// Connect to a relay server + /// + public static T ConnectRelay( SteamId serverId, int virtualport = 0 ) where T : ConnectionManager, new() + { + var t = new T(); + NetIdentity identity = serverId; + var options = Array.Empty(); + t.Connection = Internal.ConnectP2P( ref identity, virtualport, options.Length, options ); + SetConnectionManager( t.Connection.Id, t ); + return t; + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/SteamNetworkingUtils.cs b/BoneSync/Facepunch.Steamworks/SteamNetworkingUtils.cs new file mode 100644 index 0000000..a2dbbf8 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/SteamNetworkingUtils.cs @@ -0,0 +1,352 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + /// + /// Undocumented Parental Settings + /// + public class SteamNetworkingUtils : SteamSharedClass + { + internal static ISteamNetworkingUtils Internal => Interface as ISteamNetworkingUtils; + + internal override void InitializeInterface( bool server ) + { + SetInterface( server, new ISteamNetworkingUtils( server ) ); + InstallCallbacks( server ); + } + + static void InstallCallbacks( bool server ) + { + Dispatch.Install( x => + { + Status = x.Avail; + }, server ); + } + + /// + /// A function to receive debug network information on. This will do nothing + /// unless you set DebugLevel to something other than None. + /// + /// You should set this to an appropriate level instead of setting it to the highest + /// and then filtering it by hand because a lot of energy is used by creating the strings + /// and your frame rate will tank and you won't know why. + /// + + public static event Action OnDebugOutput; + + /// + /// The latest available status gathered from the SteamRelayNetworkStatus callback + /// + public static SteamNetworkingAvailability Status { get; private set; } + + /// + /// If you know that you are going to be using the relay network (for example, + /// because you anticipate making P2P connections), call this to initialize the + /// relay network. If you do not call this, the initialization will + /// be delayed until the first time you use a feature that requires access + /// to the relay network, which will delay that first access. + /// + /// You can also call this to force a retry if the previous attempt has failed. + /// Performing any action that requires access to the relay network will also + /// trigger a retry, and so calling this function is never strictly necessary, + /// but it can be useful to call it a program launch time, if access to the + /// relay network is anticipated. + /// + /// Use GetRelayNetworkStatus or listen for SteamRelayNetworkStatus_t + /// callbacks to know when initialization has completed. + /// Typically initialization completes in a few seconds. + /// + /// Note: dedicated servers hosted in known data centers do *not* need + /// to call this, since they do not make routing decisions. However, if + /// the dedicated server will be using P2P functionality, it will act as + /// a "client" and this should be called. + /// + public static void InitRelayNetworkAccess() + { + Internal.InitRelayNetworkAccess(); + } + + /// + /// Return location info for the current host. + /// + /// It takes a few seconds to initialize access to the relay network. If + /// you call this very soon after startup the data may not be available yet. + /// + /// This always return the most up-to-date information we have available + /// right now, even if we are in the middle of re-calculating ping times. + /// + public static NetPingLocation? LocalPingLocation + { + get + { + NetPingLocation location = default; + var age = Internal.GetLocalPingLocation( ref location ); + if ( age < 0 ) + return null; + + return location; + } + } + + /// + /// Same as PingLocation.EstimatePingTo, but assumes that one location is the local host. + /// This is a bit faster, especially if you need to calculate a bunch of + /// these in a loop to find the fastest one. + /// + public static int EstimatePingTo( NetPingLocation target ) + { + return Internal.EstimatePingTimeFromLocalHost( ref target ); + } + + /// + /// If you need ping information straight away, wait on this. It will return + /// immediately if you already have up to date ping data + /// + public static async Task WaitForPingDataAsync( float maxAgeInSeconds = 60 * 5 ) + { + if ( Internal.CheckPingDataUpToDate( maxAgeInSeconds ) ) + return; + + SteamRelayNetworkStatus_t status = default; + + while ( Internal.GetRelayNetworkStatus( ref status ) != SteamNetworkingAvailability.Current ) + { + await Task.Delay( 10 ); + } + } + + public static long LocalTimestamp => Internal.GetLocalTimestamp(); + + + /// + /// [0 - 100] - Randomly discard N pct of packets + /// + public static float FakeSendPacketLoss + { + get => GetConfigFloat( NetConfig.FakePacketLoss_Send ); + set => SetConfigFloat( NetConfig.FakePacketLoss_Send, value ); + } + + /// + /// [0 - 100] - Randomly discard N pct of packets + /// + public static float FakeRecvPacketLoss + { + get => GetConfigFloat( NetConfig.FakePacketLoss_Recv ); + set => SetConfigFloat( NetConfig.FakePacketLoss_Recv, value ); + } + + /// + /// Delay all packets by N ms + /// + public static float FakeSendPacketLag + { + get => GetConfigFloat( NetConfig.FakePacketLag_Send ); + set => SetConfigFloat( NetConfig.FakePacketLag_Send, value ); + } + + /// + /// Delay all packets by N ms + /// + public static float FakeRecvPacketLag + { + get => GetConfigFloat( NetConfig.FakePacketLag_Recv ); + set => SetConfigFloat( NetConfig.FakePacketLag_Recv, value ); + } + + /// + /// Timeout value (in ms) to use when first connecting + /// + public static int ConnectionTimeout + { + get => GetConfigInt( NetConfig.TimeoutInitial ); + set => SetConfigInt( NetConfig.TimeoutInitial, value ); + } + + /// + /// Timeout value (in ms) to use after connection is established + /// + public static int Timeout + { + get => GetConfigInt( NetConfig.TimeoutConnected ); + set => SetConfigInt( NetConfig.TimeoutConnected, value ); + } + + /// + /// Upper limit of buffered pending bytes to be sent. + /// If this is reached SendMessage will return LimitExceeded. + /// Default is 524288 bytes (512k) + /// + public static int SendBufferSize + { + get => GetConfigInt( NetConfig.SendBufferSize ); + set => SetConfigInt( NetConfig.SendBufferSize, value ); + } + + + /// + /// Get Debug Information via OnDebugOutput event + /// + /// Except when debugging, you should only use NetDebugOutput.Msg + /// or NetDebugOutput.Warning. For best performance, do NOT + /// request a high detail level and then filter out messages in the callback. + /// + /// This incurs all of the expense of formatting the messages, which are then discarded. + /// Setting a high priority value (low numeric value) here allows the library to avoid + /// doing this work. + /// + public static NetDebugOutput DebugLevel + { + get => _debugLevel; + set + { + _debugLevel = value; + _debugFunc = new NetDebugFunc( OnDebugMessage ); + + Internal.SetDebugOutputFunction( value, _debugFunc ); + } + } + + /// + /// So we can remember and provide a Get for DebugLEvel + /// + private static NetDebugOutput _debugLevel; + + /// + /// We need to keep the delegate around until it's not used anymore + /// + static NetDebugFunc _debugFunc; + + struct DebugMessage + { + public NetDebugOutput Type; + public string Msg; + } + + private static System.Collections.Concurrent.ConcurrentQueue debugMessages = new System.Collections.Concurrent.ConcurrentQueue(); + + /// + /// This can be called from other threads - so we're going to queue these up and process them in a safe place. + /// + [MonoPInvokeCallback] + private static void OnDebugMessage( NetDebugOutput nType, IntPtr str ) + { + debugMessages.Enqueue( new DebugMessage { Type = nType, Msg = Helpers.MemoryToString( str ) } ); + } + + /// + /// Called regularly from the Dispatch loop so we can provide a timely + /// stream of messages. + /// + internal static void OutputDebugMessages() + { + if ( debugMessages.IsEmpty ) + return; + + while ( debugMessages.TryDequeue( out var result ) ) + { + OnDebugOutput?.Invoke( result.Type, result.Msg ); + } + } + + #region Config Internals + + internal unsafe static bool SetConfigInt( NetConfig type, int value ) + { + int* ptr = &value; + return Internal.SetConfigValue( type, NetConfigScope.Global, IntPtr.Zero, NetConfigType.Int32, (IntPtr)ptr ); + } + + internal unsafe static int GetConfigInt( NetConfig type ) + { + int value = 0; + NetConfigType dtype = NetConfigType.Int32; + int* ptr = &value; + UIntPtr size = new UIntPtr( sizeof( int ) ); + var result = Internal.GetConfigValue( type, NetConfigScope.Global, IntPtr.Zero, ref dtype, (IntPtr) ptr, ref size ); + if ( result != NetConfigResult.OK ) + return 0; + + return value; + } + + internal unsafe static bool SetConfigFloat( NetConfig type, float value ) + { + float* ptr = &value; + return Internal.SetConfigValue( type, NetConfigScope.Global, IntPtr.Zero, NetConfigType.Float, (IntPtr)ptr ); + } + + internal unsafe static float GetConfigFloat( NetConfig type ) + { + float value = 0; + NetConfigType dtype = NetConfigType.Float; + float* ptr = &value; + UIntPtr size = new UIntPtr( sizeof( float ) ); + var result = Internal.GetConfigValue( type, NetConfigScope.Global, IntPtr.Zero, ref dtype, (IntPtr)ptr, ref size ); + if ( result != NetConfigResult.OK ) + return 0; + + return value; + } + + internal unsafe static bool SetConfigString( NetConfig type, string value ) + { + var bytes = Encoding.UTF8.GetBytes( value ); + + fixed ( byte* ptr = bytes ) + { + return Internal.SetConfigValue( type, NetConfigScope.Global, IntPtr.Zero, NetConfigType.String, (IntPtr)ptr ); + } + } + + /* + internal unsafe static float GetConfigString( NetConfig type ) + { + + float value = 0; + NetConfigType dtype = NetConfigType.Float; + float* ptr = &value; + ulong size = sizeof( float ); + var result = Internal.GetConfigValue( type, NetScope.Global, 0, ref dtype, (IntPtr)ptr, ref size ); + if ( result != SteamNetworkingGetConfigValueResult.OK ) + return 0; + + return value; + } + */ + + + /* + + TODO - Connection object + + internal unsafe static bool SetConnectionConfig( uint con, NetConfig type, int value ) + { + int* ptr = &value; + return Internal.SetConfigValue( type, NetScope.Connection, con, NetConfigType.Int32, (IntPtr)ptr ); + } + + internal unsafe static bool SetConnectionConfig( uint con, NetConfig type, float value ) + { + float* ptr = &value; + return Internal.SetConfigValue( type, NetScope.Connection, con, NetConfigType.Float, (IntPtr)ptr ); + } + + internal unsafe static bool SetConnectionConfig( uint con, NetConfig type, string value ) + { + var bytes = Encoding.UTF8.GetBytes( value ); + + fixed ( byte* ptr = bytes ) + { + return Internal.SetConfigValue( type, NetScope.Connection, con, NetConfigType.String, (IntPtr)ptr ); + } + }*/ + +#endregion + } +} diff --git a/BoneSync/Facepunch.Steamworks/SteamParental.cs b/BoneSync/Facepunch.Steamworks/SteamParental.cs new file mode 100644 index 0000000..82c54d7 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/SteamParental.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + /// + /// Undocumented Parental Settings + /// + public class SteamParental : SteamSharedClass + { + internal static ISteamParentalSettings Internal => Interface as ISteamParentalSettings; + + internal override void InitializeInterface( bool server ) + { + SetInterface( server, new ISteamParentalSettings( server ) ); + InstallEvents( server ); + } + + internal static void InstallEvents( bool server ) + { + Dispatch.Install( x => OnSettingsChanged?.Invoke(), server ); + } + + /// + /// Parental Settings Changed + /// + public static event Action OnSettingsChanged; + + + /// + /// + /// + public static bool IsParentalLockEnabled => Internal.BIsParentalLockEnabled(); + + /// + /// + /// + public static bool IsParentalLockLocked => Internal.BIsParentalLockLocked(); + + /// + /// + /// + public static bool IsAppBlocked( AppId app ) => Internal.BIsAppBlocked( app.Value ); + + /// + /// + /// + public static bool BIsAppInBlockList( AppId app ) => Internal.BIsAppInBlockList( app.Value ); + + /// + /// + /// + public static bool IsFeatureBlocked( ParentalFeature feature ) => Internal.BIsFeatureBlocked( feature ); + + /// + /// + /// + public static bool BIsFeatureInBlockList( ParentalFeature feature ) => Internal.BIsFeatureInBlockList( feature ); + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/SteamParties.cs b/BoneSync/Facepunch.Steamworks/SteamParties.cs new file mode 100644 index 0000000..3cffc5d --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/SteamParties.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + /// + /// This API can be used to selectively advertise your multiplayer game session in a Steam chat room group. + /// Tell Steam the number of player spots that are available for your party, and a join-game string, and it + /// will show a beacon in the selected group and allow that many users to “follow” the beacon to your party. + /// Adjust the number of open slots if other players join through alternate matchmaking methods. + /// + public class SteamParties : SteamClientClass + { + internal static ISteamParties Internal => Interface as ISteamParties; + + internal override void InitializeInterface( bool server ) + { + SetInterface( server, new ISteamParties( server ) ); + InstallEvents( server ); + } + + internal void InstallEvents( bool server ) + { + Dispatch.Install( x => OnBeaconLocationsUpdated?.Invoke(), server ); + Dispatch.Install( x => OnActiveBeaconsUpdated?.Invoke(), server ); + } + + /// + /// The list of possible Party beacon locations has changed + /// + public static event Action OnBeaconLocationsUpdated; + + /// + /// The list of active beacons may have changed + /// + public static event Action OnActiveBeaconsUpdated; + + + public static int ActiveBeaconCount => (int) Internal.GetNumActiveBeacons(); + + public static IEnumerable ActiveBeacons + { + get + { + for ( uint i = 0; i < ActiveBeaconCount; i++ ) + { + yield return new PartyBeacon + { + Id = Internal.GetBeaconByIndex( i ) + }; + } + } + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/SteamRemotePlay.cs b/BoneSync/Facepunch.Steamworks/SteamRemotePlay.cs new file mode 100644 index 0000000..9863781 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/SteamRemotePlay.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + /// + /// Functions that provide information about Steam Remote Play sessions, streaming your game content to another computer or to a Steam Link app or hardware. + /// + public class SteamRemotePlay : SteamClientClass + { + internal static ISteamRemotePlay Internal => Interface as ISteamRemotePlay; + + internal override void InitializeInterface( bool server ) + { + SetInterface( server, new ISteamRemotePlay( server ) ); + + InstallEvents( server ); + } + + internal void InstallEvents( bool server ) + { + Dispatch.Install( x => OnSessionConnected?.Invoke( x.SessionID ), server ); + Dispatch.Install( x => OnSessionDisconnected?.Invoke( x.SessionID ), server ); + } + + /// + /// Called when a session is connected + /// + public static event Action OnSessionConnected; + + /// + /// Called when a session becomes disconnected + /// + public static event Action OnSessionDisconnected; + + /// + /// Get the number of currently connected Steam Remote Play sessions + /// + public static int SessionCount => (int) Internal.GetSessionCount(); + + /// + /// Get the currently connected Steam Remote Play session ID at the specified index. + /// IsValid will return false if it's out of bounds + /// + public static RemotePlaySession GetSession( int index ) => (RemotePlaySession) Internal.GetSessionID( index ).Value; + + + /// + /// Invite a friend to Remote Play Together + /// This returns false if the invite can't be sent + /// + public static bool SendInvite( SteamId steamid ) => Internal.BSendRemotePlayTogetherInvite( steamid ); + } +} diff --git a/BoneSync/Facepunch.Steamworks/SteamRemoteStorage.cs b/BoneSync/Facepunch.Steamworks/SteamRemoteStorage.cs new file mode 100644 index 0000000..29f6aa4 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/SteamRemoteStorage.cs @@ -0,0 +1,168 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + /// + /// Undocumented Parental Settings + /// + public class SteamRemoteStorage : SteamClientClass + { + internal static ISteamRemoteStorage Internal => Interface as ISteamRemoteStorage; + + internal override void InitializeInterface( bool server ) + { + SetInterface( server, new ISteamRemoteStorage( server ) ); + } + + + /// + /// Creates a new file, writes the bytes to the file, and then closes the file. + /// If the target file already exists, it is overwritten + /// + public unsafe static bool FileWrite( string filename, byte[] data ) + { + fixed ( byte* ptr = data ) + { + return Internal.FileWrite( filename, (IntPtr) ptr, data.Length ); + } + } + + /// + /// Opens a binary file, reads the contents of the file into a byte array, and then closes the file. + /// + public unsafe static byte[] FileRead( string filename ) + { + var size = FileSize( filename ); + if ( size <= 0 ) return null; + var buffer = new byte[size]; + + fixed ( byte* ptr = buffer ) + { + var readsize = Internal.FileRead( filename, (IntPtr)ptr, size ); + return buffer; + } + } + + /// + /// Checks whether the specified file exists. + /// + public static bool FileExists( string filename ) => Internal.FileExists( filename ); + + /// + /// Checks if a specific file is persisted in the steam cloud. + /// + public static bool FilePersisted( string filename ) => Internal.FilePersisted( filename ); + + /// + /// Gets the specified file's last modified date/time. + /// + public static DateTime FileTime( string filename ) => Epoch.ToDateTime( Internal.GetFileTimestamp( filename ) ); + + /// + /// Gets the specified files size in bytes. 0 if not exists. + /// + public static int FileSize( string filename ) => Internal.GetFileSize( filename ); + + /// + /// Deletes the file from remote storage, but leaves it on the local disk and remains accessible from the API. + /// + public static bool FileForget( string filename ) => Internal.FileForget( filename ); + + /// + /// Deletes a file from the local disk, and propagates that delete to the cloud. + /// + public static bool FileDelete( string filename ) => Internal.FileDelete( filename ); + + + /// + /// Number of bytes total + /// + public static ulong QuotaBytes + { + get + { + ulong t = 0, a = 0; + Internal.GetQuota( ref t, ref a ); + return t; + } + } + + /// + /// Number of bytes used + /// + public static ulong QuotaUsedBytes + { + get + { + ulong t = 0, a = 0; + Internal.GetQuota( ref t, ref a ); + return t - a; + } + } + + /// + /// Number of bytes remaining until your quota is used + /// + public static ulong QuotaRemainingBytes + { + get + { + ulong t = 0, a = 0; + Internal.GetQuota( ref t, ref a ); + return a; + } + } + + /// + /// returns true if IsCloudEnabledForAccount AND IsCloudEnabledForApp + /// + public static bool IsCloudEnabled => IsCloudEnabledForAccount && IsCloudEnabledForApp; + + /// + /// Checks if the account wide Steam Cloud setting is enabled for this user + /// or if they disabled it in the Settings->Cloud dialog. + /// + public static bool IsCloudEnabledForAccount => Internal.IsCloudEnabledForAccount(); + + /// + /// Checks if the per game Steam Cloud setting is enabled for this user + /// or if they disabled it in the Game Properties->Update dialog. + /// + /// This must only ever be set as the direct result of the user explicitly + /// requesting that it's enabled or not. This is typically accomplished with + /// a checkbox within your in-game options + /// + public static bool IsCloudEnabledForApp + { + get => Internal.IsCloudEnabledForApp(); + set => Internal.SetCloudEnabledForApp( value ); + } + + /// + /// Gets the total number of local files synchronized by Steam Cloud. + /// + public static int FileCount => Internal.GetFileCount(); + + /// + /// Get a list of filenames synchronized by Steam Cloud + /// + public static IEnumerable Files + { + get + { + int _ = 0; + for( int i=0; i + /// Undocumented Parental Settings + /// + public class SteamScreenshots : SteamClientClass + { + internal static ISteamScreenshots Internal => Interface as ISteamScreenshots; + + internal override void InitializeInterface( bool server ) + { + SetInterface( server, new ISteamScreenshots( server ) ); + InstallEvents(); + } + + internal static void InstallEvents() + { + Dispatch.Install( x => OnScreenshotRequested?.Invoke() ); + Dispatch.Install( x => + { + if ( x.Result != Result.OK ) + OnScreenshotFailed?.Invoke( x.Result ); + else + OnScreenshotReady?.Invoke( new Screenshot { Value = x.Local } ); + } ); + } + + /// + /// A screenshot has been requested by the user from the Steam screenshot hotkey. + /// This will only be called if Hooked is true, in which case Steam + /// will not take the screenshot itself. + /// + public static event Action OnScreenshotRequested; + + /// + /// A screenshot successfully written or otherwise added to the library and can now be tagged. + /// + public static event Action OnScreenshotReady; + + /// + /// A screenshot attempt failed + /// + public static event Action OnScreenshotFailed; + + /// + /// Writes a screenshot to the user's screenshot library given the raw image data, which must be in RGB format. + /// The return value is a handle that is valid for the duration of the game process and can be used to apply tags. + /// + public unsafe static Screenshot? WriteScreenshot( byte[] data, int width, int height ) + { + fixed ( byte* ptr = data ) + { + var handle = Internal.WriteScreenshot( (IntPtr)ptr, (uint)data.Length, width, height ); + if ( handle.Value == 0 ) return null; + + return new Screenshot { Value = handle }; + } + } + + /// + /// Adds a screenshot to the user's screenshot library from disk. If a thumbnail is provided, it must be 200 pixels wide and the same aspect ratio + /// as the screenshot, otherwise a thumbnail will be generated if the user uploads the screenshot. The screenshots must be in either JPEG or TGA format. + /// The return value is a handle that is valid for the duration of the game process and can be used to apply tags. + /// JPEG, TGA, and PNG formats are supported. + /// + public unsafe static Screenshot? AddScreenshot( string filename, string thumbnail, int width, int height ) + { + var handle = Internal.AddScreenshotToLibrary( filename, thumbnail, width, height ); + if ( handle.Value == 0 ) return null; + + return new Screenshot { Value = handle }; + } + + /// + /// Causes the Steam overlay to take a screenshot. + /// If screenshots are being hooked by the game then a + /// ScreenshotRequested callback is sent back to the game instead. + /// + public static void TriggerScreenshot() => Internal.TriggerScreenshot(); + + /// + /// Toggles whether the overlay handles screenshots when the user presses the screenshot hotkey, or if the game handles them. + /// Hooking is disabled by default, and only ever enabled if you do so with this function. + /// If the hooking is enabled, then the ScreenshotRequested_t callback will be sent if the user presses the hotkey or + /// when TriggerScreenshot is called, and then the game is expected to call WriteScreenshot or AddScreenshotToLibrary in response. + /// + public static bool Hooked + { + get => Internal.IsScreenshotsHooked(); + set => Internal.HookScreenshots( value ); + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/SteamServer.cs b/BoneSync/Facepunch.Steamworks/SteamServer.cs new file mode 100644 index 0000000..58972f5 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/SteamServer.cs @@ -0,0 +1,460 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + /// + /// Provides the core of the Steam Game Servers API + /// + public partial class SteamServer : SteamServerClass + { + internal static ISteamGameServer Internal => Interface as ISteamGameServer; + + internal override void InitializeInterface( bool server ) + { + SetInterface( server, new ISteamGameServer( server ) ); + InstallEvents(); + } + + public static bool IsValid => Internal != null && Internal.IsValid; + + internal static void InstallEvents() + { + Dispatch.Install( x => OnValidateAuthTicketResponse?.Invoke( x.SteamID, x.OwnerSteamID, x.AuthSessionResponse ), true ); + Dispatch.Install( x => OnSteamServersConnected?.Invoke(), true ); + Dispatch.Install( x => OnSteamServerConnectFailure?.Invoke( x.Result, x.StillRetrying ), true ); + Dispatch.Install( x => OnSteamServersDisconnected?.Invoke( x.Result ), true ); + Dispatch.Install(x => OnSteamNetAuthenticationStatus?.Invoke(x.Avail), true); + } + + /// + /// User has been authed or rejected + /// + public static event Action OnValidateAuthTicketResponse; + + /// + /// Called when a connections to the Steam back-end has been established. + /// This means the server now is logged on and has a working connection to the Steam master server. + /// + public static event Action OnSteamServersConnected; + + /// + /// This will occur periodically if the Steam client is not connected, and has failed when retrying to establish a connection (result, stilltrying) + /// + public static event Action OnSteamServerConnectFailure; + + /// + /// Disconnected from Steam + /// + public static event Action OnSteamServersDisconnected; + + /// + /// Called when authentication status changes, useful for grabbing SteamId once aavailability is current + /// + public static event Action OnSteamNetAuthenticationStatus; + + + /// + /// Initialize the steam server. + /// If asyncCallbacks is false you need to call RunCallbacks manually every frame. + /// + public static void Init( AppId appid, SteamServerInit init, bool asyncCallbacks = true ) + { + if ( IsValid ) + throw new System.Exception( "Calling SteamServer.Init but is already initialized" ); + + uint ipaddress = 0; // Any Port + + if ( init.SteamPort == 0 ) + init = init.WithRandomSteamPort(); + + if ( init.IpAddress != null ) + ipaddress = Utility.IpToInt32( init.IpAddress ); + + System.Environment.SetEnvironmentVariable( "SteamAppId", appid.ToString() ); + System.Environment.SetEnvironmentVariable( "SteamGameId", appid.ToString() ); + var secure = (int)(init.Secure ? 3 : 2); + + // + // Get other interfaces + // + if ( !SteamInternal.GameServer_Init( ipaddress, init.SteamPort, init.GamePort, init.QueryPort, secure, init.VersionString ) ) + { + throw new System.Exception( $"InitGameServer returned false ({ipaddress},{init.SteamPort},{init.GamePort},{init.QueryPort},{secure},\"{init.VersionString}\")" ); + } + + // + // Dispatch is responsible for pumping the + // event loop. + // + Dispatch.Init(); + Dispatch.ServerPipe = SteamGameServer.GetHSteamPipe(); + + AddInterface(); + AddInterface(); + AddInterface(); + AddInterface(); + //AddInterface(); + AddInterface(); + AddInterface(); + AddInterface(); + + AddInterface(); + AddInterface(); + + // + // Initial settings + // + AutomaticHeartbeats = true; + MaxPlayers = 32; + BotCount = 0; + Product = $"{appid.Value}"; + ModDir = init.ModDir; + GameDescription = init.GameDescription; + Passworded = false; + DedicatedServer = init.DedicatedServer; + + if ( asyncCallbacks ) + { + // + // This will keep looping in the background every 16 ms + // until we shut down. + // + Dispatch.LoopServerAsync(); + } + } + + internal static void AddInterface() where T : SteamClass, new() + { + var t = new T(); + t.InitializeInterface( true ); + openInterfaces.Add( t ); + } + + static readonly List openInterfaces = new List(); + + internal static void ShutdownInterfaces() + { + foreach ( var e in openInterfaces ) + { + e.DestroyInterface( true ); + } + + openInterfaces.Clear(); + } + + public static void Shutdown() + { + Dispatch.ShutdownServer(); + + ShutdownInterfaces(); + SteamGameServer.Shutdown(); + } + + /// + /// Run the callbacks. This is also called in Async callbacks. + /// + public static void RunCallbacks() + { + if ( Dispatch.ServerPipe != 0 ) + { + Dispatch.Frame( Dispatch.ServerPipe ); + } + } + + /// + /// Sets whether this should be marked as a dedicated server. + /// If not, it is assumed to be a listen server. + /// + public static bool DedicatedServer + { + get => _dedicatedServer; + set { if ( _dedicatedServer == value ) return; Internal.SetDedicatedServer( value ); _dedicatedServer = value; } + } + private static bool _dedicatedServer; + + /// + /// Gets or sets the current MaxPlayers. + /// This doesn't enforce any kind of limit, it just updates the master server. + /// + public static int MaxPlayers + { + get => _maxplayers; + set { if ( _maxplayers == value ) return; Internal.SetMaxPlayerCount( value ); _maxplayers = value; } + } + private static int _maxplayers = 0; + + /// + /// Gets or sets the current BotCount. + /// This doesn't enforce any kind of limit, it just updates the master server. + /// + public static int BotCount + { + get => _botcount; + set { if ( _botcount == value ) return; Internal.SetBotPlayerCount( value ); _botcount = value; } + } + private static int _botcount = 0; + + /// + /// Gets or sets the current Map Name. + /// + public static string MapName + { + get => _mapname; + set { if ( _mapname == value ) return; Internal.SetMapName( value ); _mapname = value; } + } + private static string _mapname; + + /// + /// Gets or sets the current ModDir + /// + public static string ModDir + { + get => _modDir; + internal set { if ( _modDir == value ) return; Internal.SetModDir( value ); _modDir = value; } + } + private static string _modDir = ""; + + /// + /// Gets the current product + /// + public static string Product + { + get => _product; + internal set { if ( _product == value ) return; Internal.SetProduct( value ); _product = value; } + } + private static string _product = ""; + + /// + /// Gets or sets the current Product + /// + public static string GameDescription + { + get => _gameDescription; + internal set { if ( _gameDescription == value ) return; Internal.SetGameDescription( value ); _gameDescription = value; } + } + private static string _gameDescription = ""; + + /// + /// Gets or sets the current ServerName + /// + public static string ServerName + { + get => _serverName; + set { if ( _serverName == value ) return; Internal.SetServerName( value ); _serverName = value; } + } + private static string _serverName = ""; + + /// + /// Set whether the server should report itself as passworded + /// + public static bool Passworded + { + get => _passworded; + set { if ( _passworded == value ) return; Internal.SetPasswordProtected( value ); _passworded = value; } + } + private static bool _passworded; + + /// + /// Gets or sets the current GameTags. This is a comma seperated list of tags for this server. + /// When querying the server list you can filter by these tags. + /// + public static string GameTags + { + get => _gametags; + set + { + if ( _gametags == value ) return; + Internal.SetGameTags( value ); + _gametags = value; + } + } + private static string _gametags = ""; + + public static SteamId SteamId => Internal.GetSteamID(); + + /// + /// Log onto Steam anonymously. + /// + public static void LogOnAnonymous() + { + Internal.LogOnAnonymous(); + ForceHeartbeat(); + } + + /// + /// Log onto Steam anonymously. + /// + public static void LogOff() + { + Internal.LogOff(); + } + + /// + /// Returns true if the server is connected and registered with the Steam master server + /// You should have called LogOnAnonymous etc on startup. + /// + public static bool LoggedOn => Internal.BLoggedOn(); + + /// + /// To the best of its ability this tries to get the server's + /// current public ip address. Be aware that this is likely to return + /// null for the first few seconds after initialization. + /// + public static System.Net.IPAddress PublicIp => Internal.GetPublicIP(); + + /// + /// Enable or disable heartbeats, which are sent regularly to the master server. + /// Enabled by default. + /// + public static bool AutomaticHeartbeats + { + set { Internal.EnableHeartbeats( value ); } + } + + /// + /// Set heartbeat interval, if automatic heartbeats are enabled. + /// You can leave this at the default. + /// + public static int AutomaticHeartbeatRate + { + set { Internal.SetHeartbeatInterval( value ); } + } + + /// + /// Force send a heartbeat to the master server instead of waiting + /// for the next automatic update (if you've left them enabled) + /// + public static void ForceHeartbeat() + { + Internal.ForceHeartbeat(); + } + + /// + /// Update this connected player's information. You should really call this + /// any time a player's name or score changes. This keeps the information shown + /// to server queries up to date. + /// + public static void UpdatePlayer( SteamId steamid, string name, int score ) + { + Internal.BUpdateUserData( steamid, name, (uint)score ); + } + + static Dictionary KeyValue = new Dictionary(); + + /// + /// Sets a Key Value. These can be anything you like, and are accessible + /// when querying servers from the server list. + /// + /// Information describing gamemodes are common here. + /// + public static void SetKey( string Key, string Value ) + { + if ( KeyValue.ContainsKey( Key ) ) + { + if ( KeyValue[Key] == Value ) + return; + + KeyValue[Key] = Value; + } + else + { + KeyValue.Add( Key, Value ); + } + + Internal.SetKeyValue( Key, Value ); + } + + /// + /// Remove all key values + /// + public static void ClearKeys() + { + KeyValue.Clear(); + Internal.ClearAllKeyValues(); + } + + /// + /// Start authorizing a ticket. This user isn't authorized yet. Wait for a call to OnAuthChange. + /// + public static unsafe bool BeginAuthSession( byte[] data, SteamId steamid ) + { + fixed ( byte* p = data ) + { + var result = Internal.BeginAuthSession( (IntPtr)p, data.Length, steamid ); + + if ( result == BeginAuthResult.OK ) + return true; + + return false; + } + } + + /// + /// Forget this guy. They're no longer in the game. + /// + public static void EndSession( SteamId steamid ) + { + Internal.EndAuthSession( steamid ); + } + + /// + /// If true, Steam wants to send a packet. You should respond by sending + /// this packet in an unconnected way to the returned Address and Port. + /// + /// Packet to send. The Data passed is pooled - so use it immediately. + /// True if we want to send a packet + public static unsafe bool GetOutgoingPacket( out OutgoingPacket packet ) + { + var buffer = Helpers.TakeBuffer( 1024 * 32 ); + packet = new OutgoingPacket(); + + fixed ( byte* ptr = buffer ) + { + uint addr = 0; + ushort port = 0; + + var size = Internal.GetNextOutgoingPacket( (IntPtr)ptr, buffer.Length, ref addr, ref port ); + if ( size == 0 ) + return false; + + packet.Size = size; + packet.Data = buffer; + packet.Address = addr; + packet.Port = port; + return true; + } + } + + /// + /// We have received a server query on our game port. Pass it to Steam to handle. + /// + public static unsafe void HandleIncomingPacket( byte[] data, int size, uint address, ushort port ) + { + fixed ( byte* ptr = data ) + { + HandleIncomingPacket( (IntPtr)ptr, size, address, port ); + } + } + + /// + /// We have received a server query on our game port. Pass it to Steam to handle. + /// + public static unsafe void HandleIncomingPacket( IntPtr ptr, int size, uint address, ushort port ) + { + Internal.HandleIncomingPacket( ptr, size, address, port ); + } + + /// + /// Does the user own this app (which could be DLC) + /// + public static UserHasLicenseForAppResult UserHasLicenseForApp( SteamId steamid, AppId appid ) + { + return Internal.UserHasLicenseForApp( steamid, appid ); + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/SteamServerStats.cs b/BoneSync/Facepunch.Steamworks/SteamServerStats.cs new file mode 100644 index 0000000..3c9352e --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/SteamServerStats.cs @@ -0,0 +1,123 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + public class SteamServerStats : SteamServerClass + { + internal static ISteamGameServerStats Internal => Interface as ISteamGameServerStats; + + internal override void InitializeInterface( bool server ) + { + SetInterface( server, new ISteamGameServerStats( server ) ); + } + + + /// + /// Downloads stats for the user + /// If the user has no stats will return fail + /// these stats will only be auto-updated for clients playing on the server + /// + public static async Task RequestUserStatsAsync( SteamId steamid ) + { + var r = await Internal.RequestUserStats( steamid ); + if ( !r.HasValue ) return Result.Fail; + return r.Value.Result; + } + + /// + /// Set the named stat for this user. Setting stats should follow the rules + /// you defined in Steamworks. + /// + public static bool SetInt( SteamId steamid, string name, int stat ) + { + return Internal.SetUserStat( steamid, name, stat ); + } + + /// + /// Set the named stat for this user. Setting stats should follow the rules + /// you defined in Steamworks. + /// + public static bool SetFloat( SteamId steamid, string name, float stat ) + { + return Internal.SetUserStat( steamid, name, stat ); + } + + /// + /// Get the named stat for this user. If getting the stat failed, will return + /// defaultValue. You should have called Refresh for this userid - which downloads + /// the stats from the backend. If you didn't call it this will always return defaultValue. + /// + public static int GetInt( SteamId steamid, string name, int defaultValue = 0 ) + { + int data = defaultValue; + + if ( !Internal.GetUserStat( steamid, name, ref data ) ) + return defaultValue; + + return data; + } + + /// + /// Get the named stat for this user. If getting the stat failed, will return + /// defaultValue. You should have called Refresh for this userid - which downloads + /// the stats from the backend. If you didn't call it this will always return defaultValue. + /// + public static float GetFloat( SteamId steamid, string name, float defaultValue = 0 ) + { + float data = defaultValue; + + if ( !Internal.GetUserStat( steamid, name, ref data ) ) + return defaultValue; + + return data; + } + + /// + /// Unlocks the specified achievement for the specified user. Must have called Refresh on a steamid first. + /// Remember to use Commit after use. + /// + public static bool SetAchievement( SteamId steamid, string name ) + { + return Internal.SetUserAchievement( steamid, name ); + } + + /// + /// Resets the unlock status of an achievement for the specified user. Must have called Refresh on a steamid first. + /// Remember to use Commit after use. + /// + public static bool ClearAchievement( SteamId steamid, string name ) + { + return Internal.ClearUserAchievement( steamid, name ); + } + + /// + /// Return true if available, exists and unlocked + /// + public static bool GetAchievement( SteamId steamid, string name ) + { + bool achieved = false; + + if ( !Internal.GetUserAchievement( steamid, name, ref achieved ) ) + return false; + + return achieved; + } + + /// + /// Once you've set a stat change on a user you need to commit your changes. + /// You can do that using this function. The callback will let you know if + /// your action succeeded, but most of the time you can fire and forget. + /// + public static async Task StoreUserStats( SteamId steamid ) + { + var r = await Internal.StoreUserStats( steamid ); + if ( !r.HasValue ) return Result.Fail; + return r.Value.Result; + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/SteamUgc.cs b/BoneSync/Facepunch.Steamworks/SteamUgc.cs new file mode 100644 index 0000000..32141fc --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/SteamUgc.cs @@ -0,0 +1,165 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + /// + /// Functions for accessing and manipulating Steam user information. + /// This is also where the APIs for Steam Voice are exposed. + /// + public class SteamUGC : SteamSharedClass + { + internal static ISteamUGC Internal => Interface as ISteamUGC; + + internal override void InitializeInterface( bool server ) + { + SetInterface( server, new ISteamUGC( server ) ); + InstallEvents( server ); + } + + internal static void InstallEvents( bool server ) + { + Dispatch.Install( x => OnDownloadItemResult?.Invoke( x.Result ), server ); + } + + /// + /// Posted after Download call + /// + public static event Action OnDownloadItemResult; + + public static async Task DeleteFileAsync( PublishedFileId fileId ) + { + var r = await Internal.DeleteItem( fileId ); + return r?.Result == Result.OK; + } + + /// + /// Start downloading this item. You'll get notified of completion via OnDownloadItemResult. + /// + /// The ID of the file you want to download + /// If true this should go straight to the top of the download list + /// true if nothing went wrong and the download is started + public static bool Download( PublishedFileId fileId, bool highPriority = false ) + { + return Internal.DownloadItem( fileId, highPriority ); + } + + /// + /// Will attempt to download this item asyncronously - allowing you to instantly react to its installation + /// + /// The ID of the file you want to download + /// An optional callback + /// Allows you to send a message to cancel the download anywhere during the process + /// How often to call the progress function + /// true if downloaded and installed correctly + public static async Task DownloadAsync( PublishedFileId fileId, Action progress = null, int milisecondsUpdateDelay = 60, CancellationToken ct = default ) + { + var item = new Steamworks.Ugc.Item( fileId ); + + if ( ct == default ) + ct = new CancellationTokenSource( TimeSpan.FromSeconds( 60 ) ).Token; + + progress?.Invoke( 0.0f ); + + if ( Download( fileId, true ) == false ) + return item.IsInstalled; + + // Steam docs about Download: + // If the return value is true then register and wait + // for the Callback DownloadItemResult_t before calling + // GetItemInstallInfo or accessing the workshop item on disk. + + // Wait for DownloadItemResult_t + { + Action onDownloadStarted = null; + + try + { + var downloadStarted = false; + + onDownloadStarted = r => downloadStarted = true; + OnDownloadItemResult += onDownloadStarted; + + while ( downloadStarted == false ) + { + if ( ct.IsCancellationRequested ) + break; + + await Task.Delay( milisecondsUpdateDelay ); + } + } + finally + { + OnDownloadItemResult -= onDownloadStarted; + } + } + + progress?.Invoke( 0.2f ); + await Task.Delay( milisecondsUpdateDelay ); + + //Wait for downloading completion + { + while ( true ) + { + if ( ct.IsCancellationRequested ) + break; + + progress?.Invoke( 0.2f + item.DownloadAmount * 0.8f ); + + if ( !item.IsDownloading && item.IsInstalled ) + break; + + await Task.Delay( milisecondsUpdateDelay ); + } + } + + progress?.Invoke( 1.0f ); + + return item.IsInstalled; + } + + /// + /// Utility function to fetch a single item. Internally this uses Ugc.FileQuery - + /// which you can use to query multiple items if you need to. + /// + public static async Task QueryFileAsync( PublishedFileId fileId ) + { + var result = await Ugc.Query.All + .WithFileId( fileId ) + .GetPageAsync( 1 ); + + if ( !result.HasValue || result.Value.ResultCount != 1 ) + return null; + + var item = result.Value.Entries.First(); + + result.Value.Dispose(); + + return item; + } + + public static async Task StartPlaytimeTracking(PublishedFileId fileId) + { + var result = await Internal.StartPlaytimeTracking(new[] {fileId}, 1); + return result.Value.Result == Result.OK; + } + + public static async Task StopPlaytimeTracking(PublishedFileId fileId) + { + var result = await Internal.StopPlaytimeTracking(new[] {fileId}, 1); + return result.Value.Result == Result.OK; + } + + public static async Task StopPlaytimeTrackingForAllItems() + { + var result = await Internal.StopPlaytimeTrackingForAllItems(); + return result.Value.Result == Result.OK; + } + } +} diff --git a/BoneSync/Facepunch.Steamworks/SteamUser.cs b/BoneSync/Facepunch.Steamworks/SteamUser.cs new file mode 100644 index 0000000..8f343f8 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/SteamUser.cs @@ -0,0 +1,493 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + /// + /// Functions for accessing and manipulating Steam user information. + /// This is also where the APIs for Steam Voice are exposed. + /// + public class SteamUser : SteamClientClass + { + internal static ISteamUser Internal => Interface as ISteamUser; + + internal override void InitializeInterface( bool server ) + { + SetInterface( server, new ISteamUser( server ) ); + InstallEvents(); + + richPresence = new Dictionary(); + SampleRate = OptimalSampleRate; + } + + static Dictionary richPresence; + + internal static void InstallEvents() + { + Dispatch.Install( x => OnSteamServersConnected?.Invoke() ); + Dispatch.Install( x => OnSteamServerConnectFailure?.Invoke() ); + Dispatch.Install( x => OnSteamServersDisconnected?.Invoke() ); + Dispatch.Install( x => OnClientGameServerDeny?.Invoke() ); + Dispatch.Install( x => OnLicensesUpdated?.Invoke() ); + Dispatch.Install( x => OnValidateAuthTicketResponse?.Invoke( x.SteamID, x.OwnerSteamID, x.AuthSessionResponse ) ); + Dispatch.Install( x => OnMicroTxnAuthorizationResponse?.Invoke( x.AppID, x.OrderID, x.Authorized != 0 ) ); + Dispatch.Install( x => OnGameWebCallback?.Invoke( x.URLUTF8() ) ); + Dispatch.Install( x => OnGetAuthSessionTicketResponse?.Invoke( x ) ); + Dispatch.Install( x => OnDurationControl?.Invoke( new DurationControl { _inner = x } ) ); + } + + /// + /// Called when a connections to the Steam back-end has been established. + /// This means the Steam client now has a working connection to the Steam servers. + /// Usually this will have occurred before the game has launched, and should only be seen if the + /// user has dropped connection due to a networking issue or a Steam server update. + /// + public static event Action OnSteamServersConnected; + + /// + /// Called when a connection attempt has failed. + /// This will occur periodically if the Steam client is not connected, + /// and has failed when retrying to establish a connection. + /// + public static event Action OnSteamServerConnectFailure; + + /// + /// Called if the client has lost connection to the Steam servers. + /// Real-time services will be disabled until a matching OnSteamServersConnected has been posted. + /// + public static event Action OnSteamServersDisconnected; + + /// + /// Sent by the Steam server to the client telling it to disconnect from the specified game server, + /// which it may be in the process of or already connected to. + /// The game client should immediately disconnect upon receiving this message. + /// This can usually occur if the user doesn't have rights to play on the game server. + /// + public static event Action OnClientGameServerDeny; + + /// + /// Called whenever the users licenses (owned packages) changes. + /// + public static event Action OnLicensesUpdated; + + /// + /// Called when an auth ticket has been validated. + /// The first parameter is the steamid of this user + /// The second is the Steam ID that owns the game, this will be different from the first + /// if the game is being borrowed via Steam Family Sharing + /// + public static event Action OnValidateAuthTicketResponse; + + /// + /// Used internally for GetAuthSessionTicketAsync + /// + internal static event Action OnGetAuthSessionTicketResponse; + + /// + /// Called when a user has responded to a microtransaction authorization request. + /// ( appid, orderid, user authorized ) + /// + public static event Action OnMicroTxnAuthorizationResponse; + + /// + /// Sent to your game in response to a steam://gamewebcallback/ command from a user clicking a link in the Steam overlay browser. + /// You can use this to add support for external site signups where you want to pop back into the browser after some web page + /// signup sequence, and optionally get back some detail about that. + /// + public static event Action OnGameWebCallback; + + /// + /// Sent for games with enabled anti indulgence / duration control, for enabled users. + /// Lets the game know whether persistent rewards or XP should be granted at normal rate, + /// half rate, or zero rate. + /// + public static event Action OnDurationControl; + + + + + static bool _recordingVoice; + + /// + /// Starts/Stops voice recording. + /// Once started, use GetAvailableVoice and GetVoice to get the data, and then call StopVoiceRecording + /// when the user has released their push-to-talk hotkey or the game session has completed. + /// + + public static bool VoiceRecord + { + get => _recordingVoice; + set + { + _recordingVoice = value; + if ( value ) Internal.StartVoiceRecording(); + else Internal.StopVoiceRecording(); + } + } + + + /// + /// Returns true if we have voice data waiting to be read + /// + public static bool HasVoiceData + { + get + { + uint szCompressed = 0, deprecated = 0; + + if ( Internal.GetAvailableVoice( ref szCompressed, ref deprecated, 0 ) != VoiceResult.OK ) + return false; + + return szCompressed > 0; + } + } + + static byte[] readBuffer = new byte[1024*128]; + + /// + /// Reads the voice data and returns the number of bytes written. + /// The compressed data can be transmitted by your application and decoded back into raw audio data using + /// DecompressVoice on the other side. The compressed data provided is in an arbitrary format and is not meant to be played directly. + /// This should be called once per frame, and at worst no more than four times a second to keep the microphone input delay as low as + /// possible. Calling this any less may result in gaps in the returned stream. + /// + public static unsafe int ReadVoiceData( System.IO.Stream stream ) + { + if ( !HasVoiceData ) + return 0; + + uint szWritten = 0; + uint deprecated = 0; + + fixed ( byte* b = readBuffer ) + { + if ( Internal.GetVoice( true, (IntPtr)b, (uint)readBuffer.Length, ref szWritten, false, IntPtr.Zero, 0, ref deprecated, 0 ) != VoiceResult.OK ) + return 0; + } + + if ( szWritten == 0 ) + return 0; + + stream.Write( readBuffer, 0, (int) szWritten ); + + return (int) szWritten; + } + + /// + /// Reads the voice data and returns the bytes. You should obviously ideally be using + /// ReadVoiceData because it won't be creating a new byte array every call. But this + /// makes it easier to get it working, so let the babies have their bottle. + /// + public static unsafe byte[] ReadVoiceDataBytes() + { + if ( !HasVoiceData ) + return null; + + uint szWritten = 0; + uint deprecated = 0; + + fixed ( byte* b = readBuffer ) + { + if ( Internal.GetVoice( true, (IntPtr)b, (uint)readBuffer.Length, ref szWritten, false, IntPtr.Zero, 0, ref deprecated, 0 ) != VoiceResult.OK ) + return null; + } + + if ( szWritten == 0 ) + return null; + + var arry = new byte[szWritten]; + Array.Copy( readBuffer, 0, arry, 0, szWritten ); + return arry; + } + + static uint sampleRate = 48000; + + public static uint SampleRate + { + get => sampleRate; + + set + { + if ( SampleRate < 11025 ) throw new System.Exception( "Sample Rate must be between 11025 and 48000" ); + if ( SampleRate > 48000 ) throw new System.Exception( "Sample Rate must be between 11025 and 48000" ); + + sampleRate = value; + } + } + + public static uint OptimalSampleRate => Internal.GetVoiceOptimalSampleRate(); + + + /// + /// Decodes the compressed voice data returned by GetVoice. + /// The output data is raw single-channel 16-bit PCM audio.The decoder supports any sample rate from 11025 to 48000. + /// + public static unsafe int DecompressVoice( System.IO.Stream input, int length, System.IO.Stream output ) + { + var from = Helpers.TakeBuffer( length ); + var to = Helpers.TakeBuffer( 1024 * 64 ); + + // + // Copy from input stream to a pinnable buffer + // + using ( var s = new System.IO.MemoryStream( from ) ) + { + input.CopyTo( s ); + } + + uint szWritten = 0; + + fixed ( byte* frm = from ) + fixed ( byte* dst = to ) + { + if ( Internal.DecompressVoice( (IntPtr) frm, (uint) length, (IntPtr)dst, (uint)to.Length, ref szWritten, SampleRate ) != VoiceResult.OK ) + return 0; + } + + if ( szWritten == 0 ) + return 0; + + // + // Copy to output buffer + // + output.Write( to, 0, (int)szWritten ); + return (int)szWritten; + } + + public static unsafe int DecompressVoice( byte[] from, System.IO.Stream output ) + { + var to = Helpers.TakeBuffer( 1024 * 64 ); + + uint szWritten = 0; + + fixed ( byte* frm = from ) + fixed ( byte* dst = to ) + { + if ( Internal.DecompressVoice( (IntPtr)frm, (uint)from.Length, (IntPtr)dst, (uint)to.Length, ref szWritten, SampleRate ) != VoiceResult.OK ) + return 0; + } + + if ( szWritten == 0 ) + return 0; + + // + // Copy to output buffer + // + output.Write( to, 0, (int)szWritten ); + return (int)szWritten; + } + + /// + /// Retrieve a authentication ticket to be sent to the entity who wishes to authenticate you. + /// + public static unsafe AuthTicket GetAuthSessionTicket() + { + var data = Helpers.TakeBuffer( 1024 ); + + fixed ( byte* b = data ) + { + uint ticketLength = 0; + uint ticket = Internal.GetAuthSessionTicket( (IntPtr)b, data.Length, ref ticketLength ); + + if ( ticket == 0 ) + return null; + + return new AuthTicket() + { + Data = data.Take( (int)ticketLength ).ToArray(), + Handle = ticket + }; + } + } + + /// + /// Retrieve a authentication ticket to be sent to the entity who wishes to authenticate you. + /// This waits for a positive response from the backend before returning the ticket. This means + /// the ticket is definitely ready to go as soon as it returns. Will return null if the callback + /// times out or returns negatively. + /// + public static async Task GetAuthSessionTicketAsync( double timeoutSeconds = 10.0f ) + { + var result = Result.Pending; + AuthTicket ticket = null; + var stopwatch = Stopwatch.StartNew(); + + void f( GetAuthSessionTicketResponse_t t ) + { + if ( t.AuthTicket != ticket.Handle ) return; + result = t.Result; + } + + OnGetAuthSessionTicketResponse += f; + + try + { + ticket = GetAuthSessionTicket(); + if ( ticket == null ) + return null; + + while ( result == Result.Pending ) + { + await Task.Delay( 10 ); + + if ( stopwatch.Elapsed.TotalSeconds > timeoutSeconds ) + { + ticket.Cancel(); + return null; + } + } + + if ( result == Result.OK ) + return ticket; + + ticket.Cancel(); + return null; + } + finally + { + OnGetAuthSessionTicketResponse -= f; + } + } + + public static unsafe BeginAuthResult BeginAuthSession( byte[] ticketData, SteamId steamid ) + { + fixed ( byte* ptr = ticketData ) + { + return Internal.BeginAuthSession( (IntPtr) ptr, ticketData.Length, steamid ); + } + } + + public static void EndAuthSession( SteamId steamid ) => Internal.EndAuthSession( steamid ); + + + // UserHasLicenseForApp - SERVER VERSION ( DLC CHECKING ) + + /// + /// Checks if the current users looks like they are behind a NAT device. + /// This is only valid if the user is connected to the Steam servers and may not catch all forms of NAT. + /// + public static bool IsBehindNAT => Internal.BIsBehindNAT(); + + /// + /// Gets the Steam level of the user, as shown on their Steam community profile. + /// + public static int SteamLevel => Internal.GetPlayerSteamLevel(); + + /// + /// Requests a URL which authenticates an in-game browser for store check-out, and then redirects to the specified URL. + /// As long as the in-game browser accepts and handles session cookies, Steam microtransaction checkout pages will automatically recognize the user instead of presenting a login page. + /// NOTE: The URL has a very short lifetime to prevent history-snooping attacks, so you should only call this API when you are about to launch the browser, or else immediately navigate to the result URL using a hidden browser window. + /// NOTE: The resulting authorization cookie has an expiration time of one day, so it would be a good idea to request and visit a new auth URL every 12 hours. + /// + public static async Task GetStoreAuthUrlAsync( string url ) + { + var response = await Internal.RequestStoreAuthURL( url ); + if ( !response.HasValue ) + return null; + + return response.Value.URLUTF8(); + } + + /// + /// Checks whether the current user has verified their phone number. + /// + public static bool IsPhoneVerified => Internal.BIsPhoneVerified(); + + /// + /// Checks whether the current user has Steam Guard two factor authentication enabled on their account. + /// + public static bool IsTwoFactorEnabled => Internal.BIsTwoFactorEnabled(); + + /// + /// Checks whether the user's phone number is used to uniquely identify them. + /// + public static bool IsPhoneIdentifying => Internal.BIsPhoneIdentifying(); + + /// + /// Checks whether the current user's phone number is awaiting (re)verification. + /// + public static bool IsPhoneRequiringVerification => Internal.BIsPhoneRequiringVerification(); + + /// + /// Requests an application ticket encrypted with the secret "encrypted app ticket key". + /// The encryption key can be obtained from the Encrypted App Ticket Key page on the App Admin for your app. + /// There can only be one call pending, and this call is subject to a 60 second rate limit. + /// If you get a null result from this it's probably because you're calling it too often. + /// This can fail if you don't have an encrypted ticket set for your app here https://partner.steamgames.com/apps/sdkauth/ + /// + public static async Task RequestEncryptedAppTicketAsync( byte[] dataToInclude ) + { + var dataPtr = Marshal.AllocHGlobal( dataToInclude.Length ); + Marshal.Copy( dataToInclude, 0, dataPtr, dataToInclude.Length ); + + try + { + var result = await Internal.RequestEncryptedAppTicket( dataPtr, dataToInclude.Length ); + if ( !result.HasValue || result.Value.Result != Result.OK ) return null; + + var ticketData = Marshal.AllocHGlobal( 1024 ); + uint outSize = 0; + byte[] data = null; + + if ( Internal.GetEncryptedAppTicket( ticketData, 1024, ref outSize ) ) + { + data = new byte[outSize]; + Marshal.Copy( ticketData, data, 0, (int) outSize ); + } + + Marshal.FreeHGlobal( ticketData ); + + return data; + } + finally + { + Marshal.FreeHGlobal( dataPtr ); + } + } + + /// + /// Requests an application ticket encrypted with the secret "encrypted app ticket key". + /// The encryption key can be obtained from the Encrypted App Ticket Key page on the App Admin for your app. + /// There can only be one call pending, and this call is subject to a 60 second rate limit. + /// This can fail if you don't have an encrypted ticket set for your app here https://partner.steamgames.com/apps/sdkauth/ + /// + public static async Task RequestEncryptedAppTicketAsync() + { + var result = await Internal.RequestEncryptedAppTicket( IntPtr.Zero, 0 ); + if ( !result.HasValue || result.Value.Result != Result.OK ) return null; + + var ticketData = Marshal.AllocHGlobal( 1024 ); + uint outSize = 0; + byte[] data = null; + + if ( Internal.GetEncryptedAppTicket( ticketData, 1024, ref outSize ) ) + { + data = new byte[outSize]; + Marshal.Copy( ticketData, data, 0, (int)outSize ); + } + + Marshal.FreeHGlobal( ticketData ); + + return data; + + } + + + /// + /// Get anti indulgence / duration control + /// + public static async Task GetDurationControl() + { + var response = await Internal.GetDurationControl(); + if ( !response.HasValue ) return default; + + return new DurationControl { _inner = response.Value }; + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/SteamUserStats.cs b/BoneSync/Facepunch.Steamworks/SteamUserStats.cs new file mode 100644 index 0000000..be51eb8 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/SteamUserStats.cs @@ -0,0 +1,256 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + public class SteamUserStats : SteamClientClass + { + internal static ISteamUserStats Internal => Interface as ISteamUserStats; + + internal override void InitializeInterface( bool server ) + { + SetInterface( server, new ISteamUserStats( server ) ); + InstallEvents(); + RequestCurrentStats(); + } + + public static bool StatsRecieved { get; internal set; } + + internal static void InstallEvents() + { + Dispatch.Install( x => + { + if ( x.SteamIDUser == SteamClient.SteamId ) + StatsRecieved = true; + + OnUserStatsReceived?.Invoke( x.SteamIDUser, x.Result ); + } ); + + Dispatch.Install( x => OnUserStatsStored?.Invoke( x.Result ) ); + Dispatch.Install( x => OnAchievementProgress?.Invoke( new Achievement( x.AchievementNameUTF8() ), (int) x.CurProgress, (int)x.MaxProgress ) ); + Dispatch.Install( x => OnUserStatsUnloaded?.Invoke( x.SteamIDUser ) ); + Dispatch.Install( x => OnAchievementIconFetched?.Invoke( x.AchievementNameUTF8(), x.IconHandle ) ); + } + + + /// + /// called when the achivement icon is loaded + /// + internal static event Action OnAchievementIconFetched; + + /// + /// called when the latests stats and achievements have been received + /// from the server + /// + public static event Action OnUserStatsReceived; + + /// + /// result of a request to store the user stats for a game + /// + public static event Action OnUserStatsStored; + + /// + /// result of a request to store the achievements for a game, or an + /// "indicate progress" call. If both m_nCurProgress and m_nMaxProgress + /// are zero, that means the achievement has been fully unlocked + /// + public static event Action OnAchievementProgress; + + + /// + /// Callback indicating that a user's stats have been unloaded + /// + public static event Action OnUserStatsUnloaded; + + /// + /// Get the available achievements + /// + public static IEnumerable Achievements + { + get + { + for( int i=0; i< Internal.GetNumAchievements(); i++ ) + { + yield return new Achievement( Internal.GetAchievementName( (uint) i ) ); + } + } + } + + /// + /// Show the user a pop-up notification with the current progress toward an achievement. + /// Will return false if RequestCurrentStats has not completed and successfully returned + /// its callback, if the achievement doesn't exist/has unpublished changes in the app's + /// Steamworks Admin page, or if the achievement is unlocked. + /// + public static bool IndicateAchievementProgress( string achName, int curProg, int maxProg ) + { + if ( string.IsNullOrEmpty( achName ) ) + throw new ArgumentNullException( "Achievement string is null or empty" ); + + if ( curProg >= maxProg ) + throw new ArgumentException( $" Current progress [{curProg}] arguement toward achievement greater than or equal to max [{maxProg}]" ); + + return Internal.IndicateAchievementProgress( achName, (uint)curProg, (uint)maxProg ); + } + + /// + /// Tries to get the number of players currently playing this game. + /// Or -1 if failed. + /// + public static async Task PlayerCountAsync() + { + var result = await Internal.GetNumberOfCurrentPlayers(); + if ( !result.HasValue || result.Value.Success == 0 ) + return -1; + + return result.Value.CPlayers; + } + + /// + /// Send the changed stats and achievements data to the server for permanent storage. + /// If this fails then nothing is sent to the server. It's advisable to keep trying until the call is successful. + /// This call can be rate limited. Call frequency should be on the order of minutes, rather than seconds.You should only be calling this during major state changes such as the end of a round, the map changing, or the user leaving a server. This call is required to display the achievement unlock notification dialog though, so if you have called SetAchievement then it's advisable to call this soon after that. + /// If you have stats or achievements that you have saved locally but haven't uploaded with this function when your application process ends then this function will automatically be called. + /// You can find additional debug information written to the %steam_install%\logs\stats_log.txt file. + /// This function returns true upon success if : + /// RequestCurrentStats has completed and successfully returned its callback AND + /// the current game has stats associated with it in the Steamworks Partner backend, and those stats are published. + /// + public static bool StoreStats() + { + return Internal.StoreStats(); + } + + /// + /// Asynchronously request the user's current stats and achievements from the server. + /// You must always call this first to get the initial status of stats and achievements. + /// Only after the resulting callback comes back can you start calling the rest of the stats + /// and achievement functions for the current user. + /// + public static bool RequestCurrentStats() + { + return Internal.RequestCurrentStats(); + } + + /// + /// Asynchronously fetches global stats data, which is available for stats marked as + /// "aggregated" in the App Admin panel of the Steamworks website. + /// You must have called RequestCurrentStats and it needs to return successfully via + /// its callback prior to calling this. + /// + /// How many days of day-by-day history to retrieve in addition to the overall totals. The limit is 60. + /// OK indicates success, InvalidState means you need to call RequestCurrentStats first, Fail means the remote call failed + public static async Task RequestGlobalStatsAsync( int days ) + { + var result = await SteamUserStats.Internal.RequestGlobalStats( days ); + if ( !result.HasValue ) return Result.Fail; + return result.Value.Result; + } + + + /// + /// Gets a leaderboard by name, it will create it if it's not yet created. + /// Leaderboards created with this function will not automatically show up in the Steam Community. + /// You must manually set the Community Name field in the App Admin panel of the Steamworks website. + /// As such it's generally recommended to prefer creating the leaderboards in the App Admin panel on + /// the Steamworks website and using FindLeaderboard unless you're expected to have a large amount of + /// dynamically created leaderboards. + /// + public static async Task FindOrCreateLeaderboardAsync( string name, LeaderboardSort sort, LeaderboardDisplay display ) + { + var result = await Internal.FindOrCreateLeaderboard( name, sort, display ); + if ( !result.HasValue || result.Value.LeaderboardFound == 0 ) + return null; + + return new Leaderboard { Id = result.Value.SteamLeaderboard }; + } + + + public static async Task FindLeaderboardAsync( string name ) + { + var result = await Internal.FindLeaderboard( name ); + if ( !result.HasValue || result.Value.LeaderboardFound == 0 ) + return null; + + return new Leaderboard { Id = result.Value.SteamLeaderboard }; + } + + + + /// + /// Adds this amount to the named stat. Internally this calls Get() and adds + /// to that value. Steam doesn't provide a mechanism for atomically increasing + /// stats like this, this functionality is added here as a convenience. + /// + public static bool AddStat( string name, int amount = 1 ) + { + var val = GetStatInt( name ); + val += amount; + return SetStat( name, val ); + } + + /// + /// Adds this amount to the named stat. Internally this calls Get() and adds + /// to that value. Steam doesn't provide a mechanism for atomically increasing + /// stats like this, this functionality is added here as a convenience. + /// + public static bool AddStat( string name, float amount = 1.0f ) + { + var val = GetStatFloat( name ); + val += amount; + return SetStat( name, val ); + } + + /// + /// Set a stat value. This will automatically call StoreStats() after a successful call + /// unless you pass false as the last argument. + /// + public static bool SetStat( string name, int value ) + { + return Internal.SetStat( name, value ); + } + + /// + /// Set a stat value. This will automatically call StoreStats() after a successful call + /// unless you pass false as the last argument. + /// + public static bool SetStat( string name, float value ) + { + return Internal.SetStat( name, value ); + } + + /// + /// Get a Int stat value + /// + public static int GetStatInt( string name ) + { + int data = 0; + Internal.GetStat( name, ref data ); + return data; + } + + /// + /// Get a float stat value + /// + public static float GetStatFloat( string name ) + { + float data = 0; + Internal.GetStat( name, ref data ); + return data; + } + + /// + /// Practically wipes the slate clean for this user. If includeAchievements is true, will wipe + /// any achievements too. + /// + /// + public static bool ResetAll( bool includeAchievements ) + { + return Internal.ResetAllStats( includeAchievements ); + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/SteamUtils.cs b/BoneSync/Facepunch.Steamworks/SteamUtils.cs new file mode 100644 index 0000000..a226394 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/SteamUtils.cs @@ -0,0 +1,265 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + /// + /// Interface which provides access to a range of miscellaneous utility functions + /// + public class SteamUtils : SteamSharedClass + { + internal static ISteamUtils Internal => Interface as ISteamUtils; + + internal override void InitializeInterface( bool server ) + { + SetInterface( server, new ISteamUtils( server ) ); + InstallEvents( server ); + } + + internal static void InstallEvents( bool server ) + { + Dispatch.Install( x => OnIpCountryChanged?.Invoke(), server ); + Dispatch.Install( x => OnLowBatteryPower?.Invoke( x.MinutesBatteryLeft ), server ); + Dispatch.Install( x => SteamClosed(), server ); + Dispatch.Install( x => OnGamepadTextInputDismissed?.Invoke( x.Submitted ), server ); + } + + private static void SteamClosed() + { + SteamClient.Cleanup(); + + OnSteamShutdown?.Invoke(); + } + + /// + /// The country of the user changed + /// + public static event Action OnIpCountryChanged; + + /// + /// Fired when running on a laptop and less than 10 minutes of battery is left, fires then every minute + /// The parameter is the number of minutes left + /// + public static event Action OnLowBatteryPower; + + /// + /// Called when Steam wants to shutdown + /// + public static event Action OnSteamShutdown; + + /// + /// Big Picture gamepad text input has been closed. Parameter is true if text was submitted, false if cancelled etc. + /// + public static event Action OnGamepadTextInputDismissed; + + /// + /// Returns the number of seconds since the application was active + /// + public static uint SecondsSinceAppActive => Internal.GetSecondsSinceAppActive(); + + /// + /// Returns the number of seconds since the user last moved the mouse etc + /// + public static uint SecondsSinceComputerActive => Internal.GetSecondsSinceComputerActive(); + + // the universe this client is connecting to + public static Universe ConnectedUniverse => Internal.GetConnectedUniverse(); + + /// + /// Steam server time. Number of seconds since January 1, 1970, GMT (i.e unix time) + /// + public static DateTime SteamServerTime => Epoch.ToDateTime( Internal.GetServerRealTime() ); + + /// + /// returns the 2 digit ISO 3166-1-alpha-2 format country code this client is running in (as looked up via an IP-to-location database) + /// e.g "US" or "UK". + /// + public static string IpCountry => Internal.GetIPCountry(); + + /// + /// returns true if the image exists, and the buffer was successfully filled out + /// results are returned in RGBA format + /// the destination buffer size should be 4 * height * width * sizeof(char) + /// + public static bool GetImageSize( int image, out uint width, out uint height ) + { + width = 0; + height = 0; + return Internal.GetImageSize( image, ref width, ref height ); + } + + /// + /// returns the image in RGBA format + /// + public static Data.Image? GetImage( int image ) + { + if ( image == -1 ) return null; + if ( image == 0 ) return null; + + var i = new Data.Image(); + + if ( !GetImageSize( image, out i.Width, out i.Height ) ) + return null; + + var size = i.Width * i.Height * 4; + + var buf = Helpers.TakeBuffer( (int) size ); + + if ( !Internal.GetImageRGBA( image, buf, (int)size ) ) + return null; + + i.Data = new byte[size]; + Array.Copy( buf, 0, i.Data, 0, size ); + return i; + } + + /// + /// Returns true if we're using a battery (ie, a laptop not plugged in) + /// + public static bool UsingBatteryPower => Internal.GetCurrentBatteryPower() != 255; + + /// + /// Returns battery power [0-1] + /// + public static float CurrentBatteryPower => Math.Min( Internal.GetCurrentBatteryPower() / 100, 1.0f ); + + static NotificationPosition overlayNotificationPosition = NotificationPosition.BottomRight; + + /// + /// Sets the position where the overlay instance for the currently calling game should show notifications. + /// This position is per-game and if this function is called from outside of a game context it will do nothing. + /// + public static NotificationPosition OverlayNotificationPosition + { + get => overlayNotificationPosition; + + set + { + overlayNotificationPosition = value; + Internal.SetOverlayNotificationPosition( value ); + } + } + + /// + /// Returns true if the overlay is running and the user can access it. The overlay process could take a few seconds to + /// start and hook the game process, so this function will initially return false while the overlay is loading. + /// + public static bool IsOverlayEnabled => Internal.IsOverlayEnabled(); + + /// + /// Normally this call is unneeded if your game has a constantly running frame loop that calls the + /// D3D Present API, or OGL SwapBuffers API every frame. + /// + /// However, if you have a game that only refreshes the screen on an event driven basis then that can break + /// the overlay, as it uses your Present/SwapBuffers calls to drive it's internal frame loop and it may also + /// need to Present() to the screen any time an even needing a notification happens or when the overlay is + /// brought up over the game by a user. You can use this API to ask the overlay if it currently need a present + /// in that case, and then you can check for this periodically (roughly 33hz is desirable) and make sure you + /// refresh the screen with Present or SwapBuffers to allow the overlay to do it's work. + /// + public static bool DoesOverlayNeedPresent => Internal.BOverlayNeedsPresent(); + + /// + /// Asynchronous call to check if an executable file has been signed using the public key set on the signing tab + /// of the partner site, for example to refuse to load modified executable files. + /// + public static async Task CheckFileSignatureAsync( string filename ) + { + var r = await Internal.CheckFileSignature( filename ); + + if ( !r.HasValue ) + { + throw new System.Exception( "Something went wrong" ); + } + + return r.Value.CheckFileSignature; + } + + /// + /// Activates the Big Picture text input dialog which only supports gamepad input + /// + public static bool ShowGamepadTextInput( GamepadTextInputMode inputMode, GamepadTextInputLineMode lineInputMode, string description, int maxChars, string existingText = "" ) + { + return Internal.ShowGamepadTextInput( inputMode, lineInputMode, description, (uint)maxChars, existingText ); + } + + /// + /// Returns previously entered text + /// + public static string GetEnteredGamepadText() + { + var len = Internal.GetEnteredGamepadTextLength(); + if ( len == 0 ) return string.Empty; + + if ( !Internal.GetEnteredGamepadTextInput( out var strVal ) ) + return string.Empty; + + return strVal; + } + + /// + /// returns the language the steam client is running in, you probably want + /// Apps.CurrentGameLanguage instead, this is for very special usage cases + /// + public static string SteamUILanguage => Internal.GetSteamUILanguage(); + + /// + /// returns true if Steam itself is running in VR mode + /// + public static bool IsSteamRunningInVR => Internal.IsSteamRunningInVR(); + + /// + /// Sets the inset of the overlay notification from the corner specified by SetOverlayNotificationPosition + /// + public static void SetOverlayNotificationInset( int x, int y ) + { + Internal.SetOverlayNotificationInset( x, y ); + } + + /// + /// returns true if Steam and the Steam Overlay are running in Big Picture mode + /// Games much be launched through the Steam client to enable the Big Picture overlay. During development, + /// a game can be added as a non-steam game to the developers library to test this feature + /// + public static bool IsSteamInBigPictureMode => Internal.IsSteamInBigPictureMode(); + + + /// + /// ask SteamUI to create and render its OpenVR dashboard + /// + public static void StartVRDashboard() => Internal.StartVRDashboard(); + + /// + /// Set whether the HMD content will be streamed via Steam In-Home Streaming + /// If this is set to true, then the scene in the HMD headset will be streamed, and remote input will not be allowed. + /// If this is set to false, then the application window will be streamed instead, and remote input will be allowed. + /// The default is true unless "VRHeadsetStreaming" "0" is in the extended appinfo for a game. + /// (this is useful for games that have asymmetric multiplayer gameplay) + /// + public static bool VrHeadsetStreaming + { + get => Internal.IsVRHeadsetStreamingEnabled(); + + set + { + Internal.SetVRHeadsetStreamingEnabled( value ); + } + } + + internal static bool IsCallComplete( SteamAPICall_t call, out bool failed ) + { + failed = false; + return Internal.IsAPICallCompleted( call, ref failed ); + } + + + /// + /// Returns whether this steam client is a Steam China specific client, vs the global client + /// + public static bool IsSteamChinaLauncher => Internal.IsSteamChinaLauncher(); + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/SteamVideo.cs b/BoneSync/Facepunch.Steamworks/SteamVideo.cs new file mode 100644 index 0000000..ba471de --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/SteamVideo.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + /// + /// Undocumented Parental Settings + /// + public class SteamVideo : SteamClientClass + { + internal static ISteamVideo Internal => Interface as ISteamVideo; + + internal override void InitializeInterface( bool server ) + { + SetInterface( server, new ISteamVideo( server ) ); + InstallEvents(); + } + + internal static void InstallEvents() + { + Dispatch.Install( x => OnBroadcastStarted?.Invoke() ); + Dispatch.Install( x => OnBroadcastStopped?.Invoke( x.Result ) ); + } + + public static event Action OnBroadcastStarted; + public static event Action OnBroadcastStopped; + + /// + /// Return true if currently using Steam's live broadcasting + /// + public static bool IsBroadcasting + { + get + { + int viewers = 0; + return Internal.IsBroadcasting( ref viewers ); + } + } + + /// + /// If we're broadcasting, will return the number of live viewers + /// + public static int NumViewers + { + get + { + int viewers = 0; + + if ( !Internal.IsBroadcasting( ref viewers ) ) + return 0; + + return viewers; + } + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/Achievement.cs b/BoneSync/Facepunch.Steamworks/Structs/Achievement.cs new file mode 100644 index 0000000..45fd0bd --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/Achievement.cs @@ -0,0 +1,148 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Facepunch.Steamworks.Data +{ + public struct Achievement + { + internal string Value; + + public Achievement( string name ) + { + Value = name; + } + + public override string ToString() => Value; + + /// + /// True if unlocked + /// + public bool State + { + get + { + var state = false; + SteamUserStats.Internal.GetAchievement( Value, ref state ); + return state; + } + } + + public string Identifier => Value; + + public string Name => SteamUserStats.Internal.GetAchievementDisplayAttribute( Value, "name" ); + + public string Description => SteamUserStats.Internal.GetAchievementDisplayAttribute( Value, "desc" ); + + + /// + /// Should hold the unlock time if State is true + /// + public DateTime? UnlockTime + { + get + { + var state = false; + uint time = 0; + + if ( !SteamUserStats.Internal.GetAchievementAndUnlockTime( Value, ref state, ref time ) || !state ) + return null; + + return Epoch.ToDateTime( time ); + } + } + + /// + /// Gets the icon of the achievement. This can return a null image even though the image exists if the image + /// hasn't been downloaded by Steam yet. You can use GetIconAsync if you want to wait for the image to be downloaded. + /// + public Image? GetIcon() + { + return SteamUtils.GetImage( SteamUserStats.Internal.GetAchievementIcon( Value ) ); + } + + + /// + /// Gets the icon of the achievement, waits for it to load if we have to + /// + public async Task GetIconAsync( int timeout = 5000 ) + { + var i = SteamUserStats.Internal.GetAchievementIcon( Value ); + if ( i != 0 ) return SteamUtils.GetImage( i ); + + var ident = Identifier; + bool gotCallback = false; + + void f( string x, int icon ) + { + if ( x != ident ) return; + i = icon; + gotCallback = true; + } + + try + { + SteamUserStats.OnAchievementIconFetched += f; + + int waited = 0; + while ( !gotCallback ) + { + await Task.Delay( 10 ); + waited += 10; + + // Time out after x milliseconds + if ( waited > timeout ) + return null; + } + + if ( i == 0 ) return null; + return SteamUtils.GetImage( i ); + } + finally + { + SteamUserStats.OnAchievementIconFetched -= f; + } + } + + /// + /// Returns the fraction (0-1) of users who have unlocked the specified achievement, or -1 if no data available. + /// + public float GlobalUnlocked + { + get + { + float pct = 0; + + if ( !SteamUserStats.Internal.GetAchievementAchievedPercent( Value, ref pct ) ) + return -1.0f; + + return pct / 100.0f; + } + } + + /// + /// Make this achievement earned + /// + public bool Trigger( bool apply = true ) + { + var r = SteamUserStats.Internal.SetAchievement( Value ); + + if ( apply && r ) + { + SteamUserStats.Internal.StoreStats(); + } + + return r; + } + + /// + /// Reset this achievement to not achieved + /// + public bool Clear() + { + return SteamUserStats.Internal.ClearAchievement( Value ); + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/AppId.cs b/BoneSync/Facepunch.Steamworks/Structs/AppId.cs new file mode 100644 index 0000000..937ba89 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/AppId.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + + +namespace Facepunch.Steamworks +{ + public struct AppId + { + public uint Value; + + public override string ToString() => Value.ToString(); + + public static implicit operator AppId( uint value ) + { + return new AppId{ Value = value }; + } + + public static implicit operator AppId( int value ) + { + return new AppId { Value = (uint) value }; + } + + public static implicit operator uint( AppId value ) + { + return value.Value; + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/Controller.cs b/BoneSync/Facepunch.Steamworks/Structs/Controller.cs new file mode 100644 index 0000000..5a526c3 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/Controller.cs @@ -0,0 +1,97 @@ +using Facepunch.Steamworks.Data; +using System.Collections.Generic; +using System.Runtime.InteropServices; + +namespace Facepunch.Steamworks +{ + public struct Controller + { + internal InputHandle_t Handle; + + internal Controller( InputHandle_t inputHandle_t ) + { + this.Handle = inputHandle_t; + } + + public ulong Id => Handle.Value; + public InputType InputType => SteamInput.Internal.GetInputTypeForHandle( Handle ); + + /// + /// Reconfigure the controller to use the specified action set (ie 'Menu', 'Walk' or 'Drive') + /// This is cheap, and can be safely called repeatedly. It's often easier to repeatedly call it in + /// our state loops, instead of trying to place it in all of your state transitions. + /// + public string ActionSet + { + set => SteamInput.Internal.ActivateActionSet( Handle, SteamInput.Internal.GetActionSetHandle( value ) ); + } + + public void DeactivateLayer( string layer ) => SteamInput.Internal.DeactivateActionSetLayer( Handle, SteamInput.Internal.GetActionSetHandle( layer ) ); + public void ActivateLayer( string layer ) => SteamInput.Internal.ActivateActionSetLayer( Handle, SteamInput.Internal.GetActionSetHandle( layer ) ); + public void ClearLayers() => SteamInput.Internal.DeactivateAllActionSetLayers( Handle ); + + + /// + /// Returns the current state of the supplied digital game action + /// + public DigitalState GetDigitalState( string actionName ) + { + return SteamInput.Internal.GetDigitalActionData( Handle, SteamInput.GetDigitalActionHandle( actionName ) ); + } + + /// + /// Returns the current state of these supplied analog game action + /// + public AnalogState GetAnalogState( string actionName ) + { + return SteamInput.Internal.GetAnalogActionData( Handle, SteamInput.GetAnalogActionHandle( actionName ) ); + } + + + public override string ToString() => $"{InputType}.{Handle.Value}"; + + + public static bool operator ==( Controller a, Controller b ) => a.Equals( b ); + public static bool operator !=( Controller a, Controller b ) => !(a == b); + public override bool Equals( object p ) => this.Equals( (Controller)p ); + public override int GetHashCode() => Handle.GetHashCode(); + public bool Equals( Controller p ) => p.Handle == Handle; + } + + [StructLayout( LayoutKind.Sequential, Pack = 1 )] + public struct AnalogState + { + public InputSourceMode EMode; // eMode EInputSourceMode + public float X; // x float + public float Y; // y float + internal byte BActive; // bActive byte + public bool Active => BActive != 0; + } + + [StructLayout( LayoutKind.Sequential, Pack = 1 )] + internal struct MotionState + { + public float RotQuatX; // rotQuatX float + public float RotQuatY; // rotQuatY float + public float RotQuatZ; // rotQuatZ float + public float RotQuatW; // rotQuatW float + public float PosAccelX; // posAccelX float + public float PosAccelY; // posAccelY float + public float PosAccelZ; // posAccelZ float + public float RotVelX; // rotVelX float + public float RotVelY; // rotVelY float + public float RotVelZ; // rotVelZ float + } + + [StructLayout( LayoutKind.Sequential, Pack = 1 )] + public struct DigitalState + { + [MarshalAs( UnmanagedType.I1 )] + internal byte BState; // bState byte + [MarshalAs( UnmanagedType.I1 )] + internal byte BActive; // bActive byte + + public bool Pressed => BState != 0; + public bool Active => BActive != 0; + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/DepotId.cs b/BoneSync/Facepunch.Steamworks/Structs/DepotId.cs new file mode 100644 index 0000000..532a603 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/DepotId.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + + +namespace Facepunch.Steamworks.Data +{ + public struct DepotId + { + public uint Value; + + public static implicit operator DepotId( uint value ) + { + return new DepotId { Value = value }; + } + + public static implicit operator DepotId( int value ) + { + return new DepotId { Value = (uint) value }; + } + + public static implicit operator uint( DepotId value ) + { + return value.Value; + } + + public override string ToString() => Value.ToString(); + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/DlcInformation.cs b/BoneSync/Facepunch.Steamworks/Structs/DlcInformation.cs new file mode 100644 index 0000000..9c1750c --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/DlcInformation.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + + +namespace Facepunch.Steamworks.Data +{ + public struct DlcInformation + { + public AppId AppId { get; internal set; } + public string Name { get; internal set; } + public bool Available { get; internal set; } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/DownloadProgress.cs b/BoneSync/Facepunch.Steamworks/Structs/DownloadProgress.cs new file mode 100644 index 0000000..2ec927b --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/DownloadProgress.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + + +namespace Facepunch.Steamworks.Data +{ + public struct DownloadProgress + { + public bool Active; + public ulong BytesDownloaded; + public ulong BytesTotal; + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/DurationControl.cs b/BoneSync/Facepunch.Steamworks/Structs/DurationControl.cs new file mode 100644 index 0000000..31723aa --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/DurationControl.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + + +namespace Facepunch.Steamworks.Data +{ + /// + /// Sent for games with enabled anti indulgence / duration control, for enabled users. + /// Lets the game know whether persistent rewards or XP should be granted at normal rate, half rate, or zero rate. + /// + public struct DurationControl + { + internal DurationControl_t _inner; + + /// + /// appid generating playtime + /// + public AppId Appid => _inner.Appid; + + /// + /// is duration control applicable to user + game combination + /// + public bool Applicable => _inner.Applicable; + + /// + /// playtime since most recent 5 hour gap in playtime, only counting up to regulatory limit of playtime, in seconds + /// + internal TimeSpan PlaytimeInLastFiveHours => TimeSpan.FromSeconds( _inner.CsecsLast5h ); + + /// + /// playtime on current calendar day + /// + internal TimeSpan PlaytimeToday => TimeSpan.FromSeconds( _inner.CsecsLast5h ); + + /// + /// recommended progress + /// + internal DurationControlProgress Progress => _inner.Progress; + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/FileDetails.cs b/BoneSync/Facepunch.Steamworks/Structs/FileDetails.cs new file mode 100644 index 0000000..827eee6 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/FileDetails.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + + +namespace Facepunch.Steamworks.Data +{ + public struct FileDetails + { + public ulong SizeInBytes; + public string Sha1; + public uint Flags; + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/Friend.cs b/BoneSync/Facepunch.Steamworks/Structs/Friend.cs new file mode 100644 index 0000000..01a9bf1 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/Friend.cs @@ -0,0 +1,263 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + public struct Friend + { + public SteamId Id; + + public Friend( SteamId steamid ) + { + Id = steamid; + } + + public override string ToString() + { + return $"{Name} ({Id.ToString()})"; + } + + + /// + /// Returns true if this is the local user + /// + public bool IsMe => Id == SteamClient.SteamId; + + /// + /// Return true if this is a friend + /// + public bool IsFriend => Relationship == Relationship.Friend; + + /// + /// Returns true if you have this user blocked + /// + public bool IsBlocked => Relationship == Relationship.Blocked; + + /// + /// Return true if this user is playing the game we're running + /// + public bool IsPlayingThisGame => GameInfo?.GameID == SteamClient.AppId; + + /// + /// Returns true if this friend is online + /// + public bool IsOnline => State != FriendState.Offline; + + /// + /// Sometimes we don't know the user's name. This will wait until we have + /// downloaded the information on this user. + /// + public async Task RequestInfoAsync() + { + await SteamFriends.CacheUserInformationAsync( Id, true ); + } + + /// + /// Returns true if this friend is marked as away + /// + public bool IsAway => State == FriendState.Away; + + /// + /// Returns true if this friend is marked as busy + /// + public bool IsBusy => State == FriendState.Busy; + + /// + /// Returns true if this friend is marked as snoozing + /// + public bool IsSnoozing => State == FriendState.Snooze; + + + + public Relationship Relationship => SteamFriends.Internal.GetFriendRelationship( Id ); + public FriendState State => SteamFriends.Internal.GetFriendPersonaState( Id ); + public string Name => SteamFriends.Internal.GetFriendPersonaName( Id ); + public IEnumerable NameHistory + { + get + { + for( int i=0; i<32; i++ ) + { + var n = SteamFriends.Internal.GetFriendPersonaNameHistory( Id, i ); + if ( string.IsNullOrEmpty( n ) ) + break; + + yield return n; + } + } + } + + public int SteamLevel => SteamFriends.Internal.GetFriendSteamLevel( Id ); + + + + public FriendGameInfo? GameInfo + { + get + { + FriendGameInfo_t gameInfo = default; + if ( !SteamFriends.Internal.GetFriendGamePlayed( Id, ref gameInfo ) ) + return null; + + return FriendGameInfo.From( gameInfo ); + } + } + + public bool IsIn( SteamId group_or_room ) + { + return SteamFriends.Internal.IsUserInSource( Id, group_or_room ); + } + + public struct FriendGameInfo + { + internal ulong GameID; // m_gameID class CGameID + internal uint GameIP; // m_unGameIP uint32 + internal ulong SteamIDLobby; // m_steamIDLobby class CSteamID + + public int ConnectionPort; + public int QueryPort; + + public uint IpAddressRaw => GameIP; + public System.Net.IPAddress IpAddress => Utility.Int32ToIp( GameIP ); + + public Lobby? Lobby + { + get + { + if ( SteamIDLobby == 0 ) return null; + return new Lobby( SteamIDLobby ); + } + } + + internal static FriendGameInfo From( FriendGameInfo_t i ) + { + return new FriendGameInfo + { + GameID = i.GameID, + GameIP = i.GameIP, + ConnectionPort = i.GamePort, + QueryPort = i.QueryPort, + SteamIDLobby = i.SteamIDLobby, + }; + } + } + + public async Task GetSmallAvatarAsync() + { + return await SteamFriends.GetSmallAvatarAsync( Id ); + } + + public async Task GetMediumAvatarAsync() + { + return await SteamFriends.GetMediumAvatarAsync( Id ); + } + + public async Task GetLargeAvatarAsync() + { + return await SteamFriends.GetLargeAvatarAsync( Id ); + } + + public string GetRichPresence( string key ) + { + var val = SteamFriends.Internal.GetFriendRichPresence( Id, key ); + if ( string.IsNullOrEmpty( val ) ) return null; + return val; + } + + /// + /// Invite this friend to the game that we are playing + /// + public bool InviteToGame( string Text ) + { + return SteamFriends.Internal.InviteUserToGame( Id, Text ); + } + + /// + /// Sends a message to a Steam friend. Returns true if success + /// + public bool SendMessage( string message ) + { + return SteamFriends.Internal.ReplyToFriendMessage( Id, message ); + } + + + /// + /// Tries to get download the latest user stats + /// + /// True if successful, False if failure + public async Task RequestUserStatsAsync() + { + var result = await SteamUserStats.Internal.RequestUserStats( Id ); + return result.HasValue && result.Value.Result == Result.OK; + } + + /// + /// Gets a user stat. Must call RequestUserStats first. + /// + /// The name of the stat you want to get + /// Will return this value if not available + /// The value, or defult if not available + public float GetStatFloat( string statName, float defult = 0 ) + { + var val = defult; + + if ( !SteamUserStats.Internal.GetUserStat( Id, statName, ref val ) ) + return defult; + + return val; + } + + /// + /// Gets a user stat. Must call RequestUserStats first. + /// + /// The name of the stat you want to get + /// Will return this value if not available + /// The value, or defult if not available + public int GetStatInt( string statName, int defult = 0 ) + { + var val = defult; + + if ( !SteamUserStats.Internal.GetUserStat( Id, statName, ref val ) ) + return defult; + + return val; + } + + /// + /// Gets a user achievement state. Must call RequestUserStats first. + /// + /// The name of the achievement you want to get + /// Will return this value if not available + /// The value, or defult if not available + public bool GetAchievement( string statName, bool defult = false ) + { + var val = defult; + + if ( !SteamUserStats.Internal.GetUserAchievement( Id, statName, ref val ) ) + return defult; + + return val; + } + + /// + /// Gets a the time this achievement was unlocked. + /// + /// The name of the achievement you want to get + /// The time unlocked. If it wasn't unlocked, or you haven't downloaded the stats yet - will return DateTime.MinValue + public DateTime GetAchievementUnlockTime( string statName ) + { + bool val = false; + uint time = 0; + + if ( !SteamUserStats.Internal.GetUserAchievementAndUnlockTime( Id, statName, ref val, ref time ) || !val ) + return DateTime.MinValue; + + return Epoch.ToDateTime( time ); + } + + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/GameId.cs b/BoneSync/Facepunch.Steamworks/Structs/GameId.cs new file mode 100644 index 0000000..ab7f68b --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/GameId.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + + +namespace Facepunch.Steamworks.Data +{ + public struct GameId + { + // TODO - Be able to access these vars + + /* + + enum EGameIDType + { + k_EGameIDTypeApp = 0, + k_EGameIDTypeGameMod = 1, + k_EGameIDTypeShortcut = 2, + k_EGameIDTypeP2P = 3, + }; + + # ifdef VALVE_BIG_ENDIAN + unsigned int m_nModID : 32; + unsigned int m_nType : 8; + unsigned int m_nAppID : 24; + #else + unsigned int m_nAppID : 24; + unsigned int m_nType : 8; + unsigned int m_nModID : 32; + #endif + */ + public ulong Value; + + public static implicit operator GameId( ulong value ) + { + return new GameId { Value = value }; + } + + public static implicit operator ulong( GameId value ) + { + return value.Value; + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/Image.cs b/BoneSync/Facepunch.Steamworks/Structs/Image.cs new file mode 100644 index 0000000..6c3b796 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/Image.cs @@ -0,0 +1,37 @@ + +namespace Facepunch.Steamworks.Data +{ + public struct Image + { + public uint Width; + public uint Height; + public byte[] Data; + + public Color GetPixel( int x, int y ) + { + if ( x < 0 || x >= Width ) throw new System.Exception( "x out of bounds" ); + if ( y < 0 || y >= Height ) throw new System.Exception( "y out of bounds" ); + + Color c = new Color(); + + var i = (y * Width + x) * 4; + + c.r = Data[i + 0]; + c.g = Data[i + 1]; + c.b = Data[i + 2]; + c.a = Data[i + 3]; + + return c; + } + + public override string ToString() + { + return $"{Width}x{Height} ({Data.Length}bytes)"; + } + } + + public struct Color + { + public byte r, g, b, a; + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/InventoryDef.cs b/BoneSync/Facepunch.Steamworks/Structs/InventoryDef.cs new file mode 100644 index 0000000..8599f02 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/InventoryDef.cs @@ -0,0 +1,241 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + public class InventoryDef : IEquatable + { + internal InventoryDefId _id; + internal Dictionary _properties; + + public InventoryDef( InventoryDefId defId ) + { + _id = defId; + } + + public int Id => _id.Value; + + /// + /// Shortcut to call GetProperty( "name" ) + /// + public string Name => GetProperty( "name" ); + + /// + /// Shortcut to call GetProperty( "description" ) + /// + public string Description => GetProperty( "description" ); + + /// + /// Shortcut to call GetProperty( "icon_url" ) + /// + public string IconUrl => GetProperty( "icon_url" ); + + /// + /// Shortcut to call GetProperty( "icon_url_large" ) + /// + public string IconUrlLarge => GetProperty( "icon_url_large" ); + + /// + /// Shortcut to call GetProperty( "price_category" ) + /// + public string PriceCategory => GetProperty( "price_category" ); + + /// + /// Shortcut to call GetProperty( "type" ) + /// + public string Type => GetProperty( "type" ); + + /// + /// Returns true if this is an item that generates an item, rather + /// than something that is actual an item + /// + public bool IsGenerator => Type == "generator"; + + /// + /// Shortcut to call GetProperty( "exchange" ) + /// + public string ExchangeSchema => GetProperty( "exchange" ); + + /// + /// Get a list of exchanges that are available to make this item + /// + public InventoryRecipe[] GetRecipes() + { + if ( string.IsNullOrEmpty( ExchangeSchema ) ) return null; + + var parts = ExchangeSchema.Split( new[] { ';' }, StringSplitOptions.RemoveEmptyEntries ); + + return parts.Select( x => InventoryRecipe.FromString( x, this ) ).ToArray(); + } + + /// + /// Shortcut to call GetBoolProperty( "marketable" ) + /// + public bool Marketable => GetBoolProperty( "marketable" ); + + /// + /// Shortcut to call GetBoolProperty( "tradable" ) + /// + public bool Tradable => GetBoolProperty( "tradable" ); + + /// + /// Gets the property timestamp + /// + public DateTime Created => GetProperty( "timestamp" ); + + /// + /// Gets the property modified + /// + public DateTime Modified => GetProperty( "modified" ); + + /// + /// Get a specific property by name + /// + public string GetProperty( string name ) + { + if ( _properties!= null && _properties.TryGetValue( name, out string val ) ) + return val; + + uint _ = (uint)Helpers.MemoryBufferSize; + + if ( !SteamInventory.Internal.GetItemDefinitionProperty( Id, name, out var vl, ref _ ) ) + return null; + + if (name == null) //return keys string + return vl; + + if ( _properties == null ) + _properties = new Dictionary(); + + _properties[name] = vl; + + return vl; + } + + /// + /// Read a raw property from the definition schema + /// + public bool GetBoolProperty( string name ) + { + string val = GetProperty( name ); + + if ( val.Length == 0 ) return false; + if ( val[0] == '0' || val[0] == 'F' || val[0] == 'f' ) return false; + + return true; + } + + /// + /// Read a raw property from the definition schema + /// + public T GetProperty( string name ) + { + string val = GetProperty( name ); + + if ( string.IsNullOrEmpty( val ) ) + return default; + + try + { + return (T)Convert.ChangeType( val, typeof( T ) ); + } + catch ( System.Exception ) + { + return default; + } + } + + /// + /// Gets a list of all properties on this item + /// + public IEnumerable> Properties + { + get + { + var list = GetProperty( null ); + var keys = list.Split( ',' ); + + foreach ( var key in keys ) + { + yield return new KeyValuePair( key, GetProperty( key ) ); + } + } + } + + /// + /// Returns the price of this item in the local currency (SteamInventory.Currency) + /// + public int LocalPrice + { + get + { + ulong curprice = 0; + ulong baseprice = 0; + + if ( !SteamInventory.Internal.GetItemPrice( Id, ref curprice, ref baseprice ) ) + return 0; + + return (int) curprice; + } + } + + public string LocalPriceFormatted => Utility.FormatPrice( SteamInventory.Currency, LocalPrice / 100.0 ); + + /// + /// If the price has been discounted, LocalPrice will differ from LocalBasePrice + /// (assumed, this isn't documented) + /// + public int LocalBasePrice + { + get + { + ulong curprice = 0; + ulong baseprice = 0; + + if ( !SteamInventory.Internal.GetItemPrice( Id, ref curprice, ref baseprice ) ) + return 0; + + return (int)baseprice; + } + } + + public string LocalBasePriceFormatted => Utility.FormatPrice( SteamInventory.Currency, LocalPrice / 100.0 ); + + InventoryRecipe[] _recContaining; + + /// + /// Return a list of recepies that contain this item + /// + public InventoryRecipe[] GetRecipesContainingThis() + { + if ( _recContaining != null ) return _recContaining; + + var allRec = SteamInventory.Definitions + .Select( x => x.GetRecipes() ) + .Where( x => x != null ) + .SelectMany( x => x ); + + _recContaining = allRec.Where( x => x.ContainsIngredient( this ) ).ToArray(); + return _recContaining; + } + + public static bool operator ==( InventoryDef a, InventoryDef b ) + { + if ( Object.ReferenceEquals( a, null ) ) + return Object.ReferenceEquals( b, null ); + + return a.Equals( b ); + } + public static bool operator !=( InventoryDef a, InventoryDef b ) => !(a == b); + public override bool Equals( object p ) => this.Equals( (InventoryDef)p ); + public override int GetHashCode() => Id.GetHashCode(); + public bool Equals( InventoryDef p ) + { + if ( p == null ) return false; + return p.Id == Id; + } + + } +} diff --git a/BoneSync/Facepunch.Steamworks/Structs/InventoryItem.cs b/BoneSync/Facepunch.Steamworks/Structs/InventoryItem.cs new file mode 100644 index 0000000..86ffb43 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/InventoryItem.cs @@ -0,0 +1,182 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + public struct InventoryItem : IEquatable + { + internal InventoryItemId _id; + internal InventoryDefId _def; + internal SteamItemFlags _flags; + internal ushort _quantity; + internal Dictionary _properties; + + public InventoryItemId Id => _id; + + public InventoryDefId DefId => _def; + + public int Quantity => _quantity; + + public InventoryDef Def => SteamInventory.FindDefinition( DefId ); + + + /// + /// Only available if the result set was created with the getproperties + /// + public Dictionary Properties => _properties; + + /// + /// This item is account-locked and cannot be traded or given away. + /// This is an item status flag which is permanently attached to specific item instances + /// + public bool IsNoTrade => _flags.HasFlag( SteamItemFlags.NoTrade ); + + /// + /// The item has been destroyed, traded away, expired, or otherwise invalidated. + /// This is an action confirmation flag which is only set one time, as part of a result set. + /// + public bool IsRemoved => _flags.HasFlag( SteamItemFlags.Removed ); + + /// + /// The item quantity has been decreased by 1 via ConsumeItem API. + /// This is an action confirmation flag which is only set one time, as part of a result set. + /// + public bool IsConsumed => _flags.HasFlag( SteamItemFlags.Consumed ); + + /// + /// Consumes items from a user's inventory. If the quantity of the given item goes to zero, it is permanently removed. + /// Once an item is removed it cannot be recovered.This is not for the faint of heart - if your game implements item removal at all, + /// a high-friction UI confirmation process is highly recommended.ConsumeItem can be restricted to certain item definitions or fully + /// blocked via the Steamworks website to minimize support/abuse issues such as the classic "my brother borrowed my laptop and deleted all of my rare items". + /// + public async Task ConsumeAsync( int amount = 1 ) + { + var sresult = Defines.k_SteamInventoryResultInvalid; + if ( !SteamInventory.Internal.ConsumeItem( ref sresult, Id, (uint)amount ) ) + return null; + + return await InventoryResult.GetAsync( sresult ); + } + + /// + /// Split stack into two items + /// + public async Task SplitStackAsync( int quantity = 1 ) + { + var sresult = Defines.k_SteamInventoryResultInvalid; + if ( !SteamInventory.Internal.TransferItemQuantity( ref sresult, Id, (uint)quantity, ulong.MaxValue ) ) + return null; + + return await InventoryResult.GetAsync( sresult ); + } + + /// + /// Add x units of the target item to this item + /// + public async Task AddAsync( InventoryItem add, int quantity = 1 ) + { + var sresult = Defines.k_SteamInventoryResultInvalid; + if ( !SteamInventory.Internal.TransferItemQuantity( ref sresult, add.Id, (uint)quantity, Id ) ) + return null; + + return await InventoryResult.GetAsync( sresult ); + } + + + internal static InventoryItem From( SteamItemDetails_t details ) + { + var i = new InventoryItem + { + _id = details.ItemId, + _def = details.Definition, + _flags = (SteamItemFlags) details.Flags, + _quantity = details.Quantity + }; + + return i; + } + + internal static Dictionary GetProperties( SteamInventoryResult_t result, int index ) + { + var strlen = (uint) Helpers.MemoryBufferSize; + + if ( !SteamInventory.Internal.GetResultItemProperty( result, (uint)index, null, out var propNames, ref strlen ) ) + return null; + + var props = new Dictionary(); + + foreach ( var propertyName in propNames.Split( ',' ) ) + { + strlen = (uint)Helpers.MemoryBufferSize; + + if ( SteamInventory.Internal.GetResultItemProperty( result, (uint)index, propertyName, out var strVal, ref strlen ) ) + { + props.Add( propertyName, strVal ); + } + } + + return props; + } + + /// + /// Will try to return the date that this item was aquired. You need to have for the items + /// with their properties for this to work. + /// + public DateTime Acquired + { + get + { + if ( Properties == null ) return DateTime.UtcNow; + + if ( Properties.TryGetValue( "acquired", out var str ) ) + { + var y = int.Parse( str.Substring( 0, 4 ) ); + var m = int.Parse( str.Substring( 4, 2 ) ); + var d = int.Parse( str.Substring( 6, 2 ) ); + + var h = int.Parse( str.Substring( 9, 2 ) ); + var mn = int.Parse( str.Substring( 11, 2 ) ); + var s = int.Parse( str.Substring( 13, 2 ) ); + + return new DateTime( y, m, d, h, mn, s, DateTimeKind.Utc ); + } + + return DateTime.UtcNow; + } + } + + /// + /// Tries to get the origin property. Need properties for this to work. + /// Will return a string like "market" + /// + public string Origin + { + get + { + if ( Properties == null ) return null; + + if ( Properties.TryGetValue( "origin", out var str ) ) + return str; + + return null; + } + } + + /// + /// Small utility class to describe an item with a quantity + /// + public struct Amount + { + public InventoryItem Item; + public int Quantity; + } + + public static bool operator ==( InventoryItem a, InventoryItem b ) => a._id == b._id; + public static bool operator !=( InventoryItem a, InventoryItem b ) => a._id != b._id; + public override bool Equals( object p ) => this.Equals( (InventoryItem)p ); + public override int GetHashCode() => _id.GetHashCode(); + public bool Equals( InventoryItem p ) => p._id == _id; + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/InventoryPurchaseResult.cs b/BoneSync/Facepunch.Steamworks/Structs/InventoryPurchaseResult.cs new file mode 100644 index 0000000..99fdaf7 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/InventoryPurchaseResult.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Facepunch.Steamworks.Data +{ + public struct InventoryPurchaseResult + { + public Result Result; + public ulong OrderID; + public ulong TransID; + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/InventoryRecipe.cs b/BoneSync/Facepunch.Steamworks/Structs/InventoryRecipe.cs new file mode 100644 index 0000000..312d383 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/InventoryRecipe.cs @@ -0,0 +1,104 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + /// + /// A structured description of an item exchange + /// + public struct InventoryRecipe : IEquatable + { + public struct Ingredient + { + /// + /// The definition ID of the ingredient. + /// + public int DefinitionId; + + /// + /// If we don't know about this item definition this might be null. + /// In which case, DefinitionId should still hold the correct id. + /// + public InventoryDef Definition; + + /// + /// The amount of this item needed. Generally this will be 1. + /// + public int Count; + + internal static Ingredient FromString( string part ) + { + var i = new Ingredient(); + i.Count = 1; + + try + { + if ( part.Contains( "x" ) ) + { + var idx = part.IndexOf( 'x' ); + + int count = 0; + if ( int.TryParse( part.Substring( idx + 1 ), out count ) ) + i.Count = count; + + part = part.Substring( 0, idx ); + } + + i.DefinitionId = int.Parse( part ); + i.Definition = SteamInventory.FindDefinition( i.DefinitionId ); + + } + catch ( System.Exception ) + { + return i; + } + + return i; + } + } + + /// + /// The item that this will create. + /// + public InventoryDef Result; + + /// + /// The items, with quantity required to create this item. + /// + public Ingredient[] Ingredients; + + public string Source; + + internal static InventoryRecipe FromString( string part, InventoryDef Result ) + { + var r = new InventoryRecipe + { + Result = Result, + Source = part + }; + + var parts = part.Split( new[] { ',' }, StringSplitOptions.RemoveEmptyEntries ); + + r.Ingredients = parts.Select( x => Ingredient.FromString( x ) ).Where( x => x.DefinitionId != 0 ).ToArray(); + return r; + } + + internal bool ContainsIngredient( InventoryDef inventoryDef ) + { + return Ingredients.Any( x => x.DefinitionId == inventoryDef.Id ); + } + + public static bool operator ==( InventoryRecipe a, InventoryRecipe b ) => a.GetHashCode() == b.GetHashCode(); + public static bool operator !=( InventoryRecipe a, InventoryRecipe b ) => a.GetHashCode() != b.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (InventoryRecipe)p ); + public override int GetHashCode() + { + return Source.GetHashCode(); + } + + public bool Equals( InventoryRecipe p ) => p.GetHashCode() == GetHashCode(); + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/InventoryResult.cs b/BoneSync/Facepunch.Steamworks/Structs/InventoryResult.cs new file mode 100644 index 0000000..38d27a2 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/InventoryResult.cs @@ -0,0 +1,118 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + public struct InventoryResult : IDisposable + { + internal SteamInventoryResult_t _id; + + public bool Expired { get; internal set; } + + internal InventoryResult( SteamInventoryResult_t id, bool expired ) + { + _id = id; + Expired = expired; + } + + public int ItemCount + { + get + { + uint cnt = 0; + + if ( !SteamInventory.Internal.GetResultItems( _id, null, ref cnt ) ) + return 0; + + return (int) cnt; + } + } + + /// + /// Checks whether an inventory result handle belongs to the specified Steam ID. + /// This is important when using Deserialize, to verify that a remote player is not pretending to have a different user's inventory + /// + public bool BelongsTo( SteamId steamId ) + { + return SteamInventory.Internal.CheckResultSteamID( _id, steamId ); + } + + public InventoryItem[] GetItems( bool includeProperties = false ) + { + uint cnt = (uint) ItemCount; + if ( cnt <= 0 ) return null; + + var pOutItemsArray = new SteamItemDetails_t[cnt]; + + if ( !SteamInventory.Internal.GetResultItems( _id, pOutItemsArray, ref cnt ) ) + return null; + + var items = new InventoryItem[cnt]; + + for( int i=0; i< cnt; i++ ) + { + var item = InventoryItem.From( pOutItemsArray[i] ); + + if ( includeProperties ) + item._properties = InventoryItem.GetProperties( _id, i ); + + items[i] = item; + } + + + return items; + } + + public void Dispose() + { + if ( _id.Value == -1 ) return; + + SteamInventory.Internal.DestroyResult( _id ); + } + + internal static async Task GetAsync( SteamInventoryResult_t sresult ) + { + var _result = Result.Pending; + while ( _result == Result.Pending ) + { + _result = SteamInventory.Internal.GetResultStatus( sresult ); + await Task.Delay( 10 ); + } + + if ( _result != Result.OK && _result != Result.Expired ) + return null; + + return new InventoryResult( sresult, _result == Result.Expired ); + } + + /// + /// Serialized result sets contain a short signature which can't be forged or replayed across different game sessions. + /// A result set can be serialized on the local client, transmitted to other players via your game networking, and + /// deserialized by the remote players.This is a secure way of preventing hackers from lying about posessing + /// rare/high-value items. Serializes a result set with signature bytes to an output buffer.The size of a serialized + /// result depends on the number items which are being serialized.When securely transmitting items to other players, + /// it is recommended to use GetItemsByID first to create a minimal result set. + /// Results have a built-in timestamp which will be considered "expired" after an hour has elapsed.See DeserializeResult + /// for expiration handling. + /// + public unsafe byte[] Serialize() + { + uint size = 0; + + if ( !SteamInventory.Internal.SerializeResult( _id, IntPtr.Zero, ref size ) ) + return null; + + var data = new byte[size]; + + fixed ( byte* ptr = data ) + { + if ( !SteamInventory.Internal.SerializeResult( _id, (IntPtr)ptr, ref size ) ) + return null; + } + + return data; + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/Leaderboard.cs b/BoneSync/Facepunch.Steamworks/Structs/Leaderboard.cs new file mode 100644 index 0000000..827d128 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/Leaderboard.cs @@ -0,0 +1,145 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Facepunch.Steamworks.Data +{ + public struct Leaderboard + { + internal SteamLeaderboard_t Id; + + /// + /// the name of a leaderboard + /// + public string Name => SteamUserStats.Internal.GetLeaderboardName( Id ); + public LeaderboardSort Sort => SteamUserStats.Internal.GetLeaderboardSortMethod( Id ); + public LeaderboardDisplay Display => SteamUserStats.Internal.GetLeaderboardDisplayType( Id ); + public int EntryCount => SteamUserStats.Internal.GetLeaderboardEntryCount(Id); + + static int[] detailsBuffer = new int[64]; + static int[] noDetails = Array.Empty(); + + /// + /// Submit your score and replace your old score even if it was better + /// + public async Task ReplaceScore( int score, int[] details = null ) + { + if ( details == null ) details = noDetails; + + var r = await SteamUserStats.Internal.UploadLeaderboardScore( Id, LeaderboardUploadScoreMethod.ForceUpdate, score, details, details.Length ); + if ( !r.HasValue ) return null; + + return LeaderboardUpdate.From( r.Value ); + } + + /// + /// Submit your new score, but won't replace your high score if it's lower + /// + public async Task SubmitScoreAsync( int score, int[] details = null ) + { + if ( details == null ) details = noDetails; + + var r = await SteamUserStats.Internal.UploadLeaderboardScore( Id, LeaderboardUploadScoreMethod.KeepBest, score, details, details.Length ); + if ( !r.HasValue ) return null; + + return LeaderboardUpdate.From( r.Value ); + } + + /// + /// Attaches a piece of user generated content the user's entry on a leaderboard + /// + public async Task AttachUgc( Ugc file ) + { + var r = await SteamUserStats.Internal.AttachLeaderboardUGC( Id, file.Handle ); + if ( !r.HasValue ) return Result.Fail; + + return r.Value.Result; + } + + /// + /// Used to query for a sequential range of leaderboard entries by leaderboard Sort. + /// + public async Task GetScoresAsync( int count, int offset = 1 ) + { + if ( offset <= 0 ) throw new System.ArgumentException( "Should be 1+", nameof( offset ) ); + + var r = await SteamUserStats.Internal.DownloadLeaderboardEntries( Id, LeaderboardDataRequest.Global, offset, offset + count ); + if ( !r.HasValue ) + return null; + + return await LeaderboardResultToEntries( r.Value ); + } + + /// + /// Used to retrieve leaderboard entries relative a user's entry. If there are not enough entries in the leaderboard + /// before or after the user's entry, Steam will adjust the range to try to return the number of entries requested. + /// For example, if the user is #1 on the leaderboard and start is set to -2, end is set to 2, Steam will return the first + /// 5 entries in the leaderboard. If The current user has no entry, this will return null. + /// + public async Task GetScoresAroundUserAsync( int start = -10, int end = 10 ) + { + var r = await SteamUserStats.Internal.DownloadLeaderboardEntries( Id, LeaderboardDataRequest.GlobalAroundUser, start, end ); + if ( !r.HasValue ) + return null; + + return await LeaderboardResultToEntries( r.Value ); + } + + /// + /// Used to retrieve all leaderboard entries for friends of the current user + /// + public async Task GetScoresFromFriendsAsync() + { + var r = await SteamUserStats.Internal.DownloadLeaderboardEntries( Id, LeaderboardDataRequest.Friends, 0, 0 ); + if ( !r.HasValue ) + return null; + + return await LeaderboardResultToEntries( r.Value ); + } + + #region util + internal async Task LeaderboardResultToEntries( LeaderboardScoresDownloaded_t r ) + { + if ( r.CEntryCount <= 0 ) + return null; + + var output = new LeaderboardEntry[r.CEntryCount]; + var e = default( LeaderboardEntry_t ); + + for ( int i = 0; i < output.Length; i++ ) + { + if ( SteamUserStats.Internal.GetDownloadedLeaderboardEntry( r.SteamLeaderboardEntries, i, ref e, detailsBuffer, detailsBuffer.Length ) ) + { + output[i] = LeaderboardEntry.From( e, detailsBuffer ); + } + } + + await WaitForUserNames( output ); + + return output; + } + + internal static async Task WaitForUserNames( LeaderboardEntry[] entries) + { + bool gotAll = false; + while ( !gotAll ) + { + gotAll = true; + + foreach ( var entry in entries ) + { + if ( entry.User.Id == 0 ) continue; + if ( !SteamFriends.Internal.RequestUserInformation( entry.User.Id, true ) ) continue; + + gotAll = false; + } + + await Task.Delay( 1 ); + } + } + #endregion + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/LeaderboardEntry.cs b/BoneSync/Facepunch.Steamworks/Structs/LeaderboardEntry.cs new file mode 100644 index 0000000..91200bc --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/LeaderboardEntry.cs @@ -0,0 +1,31 @@ +using System.Linq; + +namespace Facepunch.Steamworks.Data +{ + public struct LeaderboardEntry + { + public Friend User; + public int GlobalRank; + public int Score; + public int[] Details; + // UGCHandle_t m_hUGC + + internal static LeaderboardEntry From( LeaderboardEntry_t e, int[] detailsBuffer ) + { + var r = new LeaderboardEntry + { + User = new Friend( e.SteamIDUser ), + GlobalRank = e.GlobalRank, + Score = e.Score, + Details = null + }; + + if ( e.CDetails > 0 ) + { + r.Details = detailsBuffer.Take( e.CDetails ).ToArray(); + } + + return r; + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/LeaderboardUpdate.cs b/BoneSync/Facepunch.Steamworks/Structs/LeaderboardUpdate.cs new file mode 100644 index 0000000..33c2472 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/LeaderboardUpdate.cs @@ -0,0 +1,22 @@ +using System.Linq; + +namespace Facepunch.Steamworks.Data +{ + public struct LeaderboardUpdate + { + public int Score; + public bool Changed; + public int NewGlobalRank; + public int OldGlobalRank; + public int RankChange => NewGlobalRank - OldGlobalRank; + + internal static LeaderboardUpdate From( LeaderboardScoreUploaded_t e ) => + new LeaderboardUpdate + { + Score = e.Score, + Changed = e.ScoreChanged == 1, + NewGlobalRank = e.GlobalRankNew, + OldGlobalRank = e.GlobalRankPrevious + }; + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/Lobby.cs b/BoneSync/Facepunch.Steamworks/Structs/Lobby.cs new file mode 100644 index 0000000..cad1908 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/Lobby.cs @@ -0,0 +1,251 @@ +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; + +namespace Facepunch.Steamworks.Data +{ + public struct Lobby + { + public SteamId Id { get; internal set; } + + + public Lobby( SteamId id ) + { + Id = id; + } + + /// + /// Try to join this room. Will return RoomEnter.Success on success, + /// and anything else is a failure + /// + public async Task Join() + { + var result = await SteamMatchmaking.Internal.JoinLobby( Id ); + if ( !result.HasValue ) return RoomEnter.Error; + + return (RoomEnter) result.Value.EChatRoomEnterResponse; + } + + /// + /// Leave a lobby; this will take effect immediately on the client side + /// other users in the lobby will be notified by a LobbyChatUpdate_t callback + /// + public void Leave() + { + SteamMatchmaking.Internal.LeaveLobby( Id ); + } + + /// + /// Invite another user to the lobby + /// will return true if the invite is successfully sent, whether or not the target responds + /// returns false if the local user is not connected to the Steam servers + /// + public bool InviteFriend( SteamId steamid ) + { + return SteamMatchmaking.Internal.InviteUserToLobby( Id, steamid ); + } + + /// + /// returns the number of users in the specified lobby + /// + public int MemberCount => SteamMatchmaking.Internal.GetNumLobbyMembers( Id ); + + /// + /// Returns current members. Need to be in the lobby to see the users. + /// + public IEnumerable Members + { + get + { + for( int i = 0; i < MemberCount; i++ ) + { + yield return new Friend( SteamMatchmaking.Internal.GetLobbyMemberByIndex( Id, i ) ); + } + } + } + + + /// + /// Get data associated with this lobby + /// + public string GetData( string key ) + { + return SteamMatchmaking.Internal.GetLobbyData( Id, key ); + } + + /// + /// Get data associated with this lobby + /// + public bool SetData( string key, string value ) + { + if ( key.Length > 255 ) throw new System.ArgumentException( "Key should be < 255 chars", nameof( key ) ); + if ( value.Length > 8192 ) throw new System.ArgumentException( "Value should be < 8192 chars", nameof( key ) ); + + return SteamMatchmaking.Internal.SetLobbyData( Id, key, value ); + } + + /// + /// Removes a metadata key from the lobby + /// + public bool DeleteData( string key ) + { + return SteamMatchmaking.Internal.DeleteLobbyData( Id, key ); + } + + /// + /// Get all data for this lobby + /// + public IEnumerable> Data + { + get + { + var cnt = SteamMatchmaking.Internal.GetLobbyDataCount( Id ); + + for ( int i =0; i( a, b ); + } + } + } + } + + /// + /// Gets per-user metadata for someone in this lobby + /// + public string GetMemberData( Friend member, string key ) + { + return SteamMatchmaking.Internal.GetLobbyMemberData( Id, member.Id, key ); + } + + /// + /// Sets per-user metadata (for the local user implicitly) + /// + public void SetMemberData( string key, string value ) + { + SteamMatchmaking.Internal.SetLobbyMemberData( Id, key, value ); + } + + /// + /// Sends a string to the chat room + /// + public bool SendChatString( string message ) + { + var data = System.Text.Encoding.UTF8.GetBytes( message ); + return SendChatBytes( data ); + } + + /// + /// Sends bytes the the chat room + /// this isn't exposed because there's no way to read raw bytes atm, + /// and I figure people can send json if they want something more advanced + /// + internal unsafe bool SendChatBytes( byte[] data ) + { + fixed ( byte* ptr = data ) + { + return SteamMatchmaking.Internal.SendLobbyChatMsg( Id, (IntPtr)ptr, data.Length ); + } + } + + /// + /// Refreshes metadata for a lobby you're not necessarily in right now + /// you never do this for lobbies you're a member of, only if your + /// this will send down all the metadata associated with a lobby + /// this is an asynchronous call + /// returns false if the local user is not connected to the Steam servers + /// results will be returned by a LobbyDataUpdate_t callback + /// if the specified lobby doesn't exist, LobbyDataUpdate_t::m_bSuccess will be set to false + /// + public bool Refresh() + { + return SteamMatchmaking.Internal.RequestLobbyData( Id ); + } + + /// + /// Max members able to join this lobby. Cannot be over 250. + /// Can only be set by the owner + /// + public int MaxMembers + { + get => SteamMatchmaking.Internal.GetLobbyMemberLimit( Id ); + set => SteamMatchmaking.Internal.SetLobbyMemberLimit( Id, value ); + } + + public bool SetPublic() + { + return SteamMatchmaking.Internal.SetLobbyType( Id, LobbyType.Public ); + } + + public bool SetPrivate() + { + return SteamMatchmaking.Internal.SetLobbyType( Id, LobbyType.Private ); + } + + public bool SetInvisible() + { + return SteamMatchmaking.Internal.SetLobbyType( Id, LobbyType.Invisible ); + } + + public bool SetFriendsOnly() + { + return SteamMatchmaking.Internal.SetLobbyType( Id, LobbyType.FriendsOnly ); + } + + public bool SetJoinable( bool b ) + { + return SteamMatchmaking.Internal.SetLobbyJoinable( Id, b ); + } + + /// + /// [SteamID variant] + /// Allows the owner to set the game server associated with the lobby. Triggers the + /// Steammatchmaking.OnLobbyGameCreated event. + /// + public void SetGameServer( SteamId steamServer ) + { + if ( !steamServer.IsValid ) + throw new ArgumentException( $"SteamId for server is invalid" ); + + SteamMatchmaking.Internal.SetLobbyGameServer( Id, 0, 0, steamServer ); + } + + /// + /// [IP/Port variant] + /// Allows the owner to set the game server associated with the lobby. Triggers the + /// Steammatchmaking.OnLobbyGameCreated event. + /// + public void SetGameServer( string ip, ushort port ) + { + if ( !IPAddress.TryParse( ip, out IPAddress add ) ) + throw new ArgumentException( $"IP address for server is invalid" ); + + SteamMatchmaking.Internal.SetLobbyGameServer( Id, add.IpToInt32(), port, new SteamId() ); + } + + /// + /// Gets the details of the lobby's game server, if set. Returns true if the lobby is + /// valid and has a server set, otherwise returns false. + /// + public bool GetGameServer( ref uint ip, ref ushort port, ref SteamId serverId ) + { + return SteamMatchmaking.Internal.GetLobbyGameServer( Id, ref ip, ref port, ref serverId ); + } + + /// + /// You must be the lobby owner to set the owner + /// + public Friend Owner + { + get => new Friend( SteamMatchmaking.Internal.GetLobbyOwner( Id ) ); + set => SteamMatchmaking.Internal.SetLobbyOwner( Id, value.Id ); + } + + /// + /// Check if the specified SteamId owns the lobby + /// + public bool IsOwnedBy( SteamId k ) => Owner.Id == k; + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/LobbyQuery.cs b/BoneSync/Facepunch.Steamworks/Structs/LobbyQuery.cs new file mode 100644 index 0000000..f12a46b --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/LobbyQuery.cs @@ -0,0 +1,240 @@ +using System.Threading.Tasks; +using System.Collections.Generic; + +namespace Facepunch.Steamworks.Data +{ + public struct LobbyQuery + { + // TODO FILTERS + // AddRequestLobbyListStringFilter + // - WithoutKeyValue + + #region Distance Filter + internal LobbyDistanceFilter? distance; + + /// + /// only lobbies in the same immediate region will be returned + /// + public LobbyQuery FilterDistanceClose() + { + distance = LobbyDistanceFilter.Close; + return this; + } + + /// + /// only lobbies in the same immediate region will be returned + /// + public LobbyQuery FilterDistanceFar() + { + distance = LobbyDistanceFilter.Far; + return this; + } + + /// + /// only lobbies in the same immediate region will be returned + /// + public LobbyQuery FilterDistanceWorldwide() + { + distance = LobbyDistanceFilter.Worldwide; + return this; + } + #endregion + + #region String key/value filter + internal Dictionary stringFilters; + + /// + /// Filter by specified key/value pair; string parameters + /// + public LobbyQuery WithKeyValue( string key, string value ) + { + if ( string.IsNullOrEmpty( key ) ) + throw new System.ArgumentException( "Key string provided for LobbyQuery filter is null or empty", nameof( key ) ); + + if ( key.Length > SteamMatchmaking.MaxLobbyKeyLength ) + throw new System.ArgumentException( $"Key length is longer than {SteamMatchmaking.MaxLobbyKeyLength}", nameof( key ) ); + + if ( stringFilters == null ) + stringFilters = new Dictionary(); + + stringFilters.Add( key, value ); + + return this; + } + #endregion + + #region Numerical filters + internal List numericalFilters; + + /// + /// Numerical filter where value is less than the value provided + /// + public LobbyQuery WithLower( string key, int value ) + { + AddNumericalFilter( key, value, LobbyComparison.LessThan ); + return this; + } + + /// + /// Numerical filter where value is greater than the value provided + /// + public LobbyQuery WithHigher( string key, int value ) + { + AddNumericalFilter( key, value, LobbyComparison.GreaterThan ); + return this; + } + + /// + /// Numerical filter where value must be equal to the value provided + /// + public LobbyQuery WithEqual( string key, int value ) + { + AddNumericalFilter( key, value, LobbyComparison.Equal ); + return this; + } + + /// + /// Numerical filter where value must not equal the value provided + /// + public LobbyQuery WithNotEqual( string key, int value ) + { + AddNumericalFilter( key, value, LobbyComparison.NotEqual ); + return this; + } + + /// + /// Test key, initialize numerical filter list if necessary, then add new numerical filter + /// + internal void AddNumericalFilter( string key, int value, LobbyComparison compare ) + { + if ( string.IsNullOrEmpty( key ) ) + throw new System.ArgumentException( "Key string provided for LobbyQuery filter is null or empty", nameof( key ) ); + + if ( key.Length > SteamMatchmaking.MaxLobbyKeyLength ) + throw new System.ArgumentException( $"Key length is longer than {SteamMatchmaking.MaxLobbyKeyLength}", nameof( key ) ); + + if ( numericalFilters == null ) + numericalFilters = new List(); + + numericalFilters.Add( new NumericalFilter( key, value, compare ) ); + } + #endregion + + #region Near value filter + internal Dictionary nearValFilters; + + /// + /// Order filtered results according to key/values nearest the provided key/value pair. + /// Can specify multiple near value filters; each successive filter is lower priority than the previous. + /// + public LobbyQuery OrderByNear( string key, int value ) + { + if ( string.IsNullOrEmpty( key ) ) + throw new System.ArgumentException( "Key string provided for LobbyQuery filter is null or empty", nameof( key ) ); + + if ( key.Length > SteamMatchmaking.MaxLobbyKeyLength ) + throw new System.ArgumentException( $"Key length is longer than {SteamMatchmaking.MaxLobbyKeyLength}", nameof( key ) ); + + if ( nearValFilters == null ) + nearValFilters = new Dictionary(); + + nearValFilters.Add( key, value ); + + return this; + } + #endregion + + #region Slots Filter + internal int? slotsAvailable; + + /// + /// returns only lobbies with the specified number of slots available + /// + public LobbyQuery WithSlotsAvailable( int minSlots ) + { + slotsAvailable = minSlots; + return this; + } + + #endregion + + #region Max results filter + internal int? maxResults; + + /// + /// sets how many results to return, the lower the count the faster it is to download the lobby results + /// + public LobbyQuery WithMaxResults( int max ) + { + maxResults = max; + return this; + } + + #endregion + + void ApplyFilters() + { + if ( distance.HasValue ) + { + SteamMatchmaking.Internal.AddRequestLobbyListDistanceFilter( distance.Value ); + } + + if ( slotsAvailable.HasValue ) + { + SteamMatchmaking.Internal.AddRequestLobbyListFilterSlotsAvailable( slotsAvailable.Value ); + } + + if ( maxResults.HasValue ) + { + SteamMatchmaking.Internal.AddRequestLobbyListResultCountFilter( maxResults.Value ); + } + + if ( stringFilters != null ) + { + foreach ( var k in stringFilters ) + { + SteamMatchmaking.Internal.AddRequestLobbyListStringFilter( k.Key, k.Value, LobbyComparison.Equal ); + } + } + + if( numericalFilters != null ) + { + foreach ( var n in numericalFilters ) + { + SteamMatchmaking.Internal.AddRequestLobbyListNumericalFilter( n.Key, n.Value, n.Comparer ); + } + } + + if( nearValFilters != null ) + { + foreach (var v in nearValFilters ) + { + SteamMatchmaking.Internal.AddRequestLobbyListNearValueFilter( v.Key, v.Value ); + } + } + } + + /// + /// Run the query, get the matching lobbies + /// + public async Task RequestAsync() + { + ApplyFilters(); + + LobbyMatchList_t? list = await SteamMatchmaking.Internal.RequestLobbyList(); + if ( !list.HasValue || list.Value.LobbiesMatching == 0 ) + { + return null; + } + + Lobby[] lobbies = new Lobby[list.Value.LobbiesMatching]; + + for ( int i = 0; i < list.Value.LobbiesMatching; i++ ) + { + lobbies[i] = new Lobby { Id = SteamMatchmaking.Internal.GetLobbyByIndex( i ) }; + } + + return lobbies; + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/MatchMakingKeyValuePair.cs b/BoneSync/Facepunch.Steamworks/Structs/MatchMakingKeyValuePair.cs new file mode 100644 index 0000000..228d486 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/MatchMakingKeyValuePair.cs @@ -0,0 +1,16 @@ +using System; +using System.Runtime.InteropServices; + +namespace Facepunch.Steamworks.Data +{ + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal partial struct MatchMakingKeyValuePair + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + internal string Key; + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + internal string Value; + } + +} diff --git a/BoneSync/Facepunch.Steamworks/Structs/NumericalFilter.cs b/BoneSync/Facepunch.Steamworks/Structs/NumericalFilter.cs new file mode 100644 index 0000000..dc841c5 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/NumericalFilter.cs @@ -0,0 +1,16 @@ +namespace Facepunch.Steamworks.Data +{ + struct NumericalFilter + { + public string Key { get; internal set; } + public int Value { get; internal set; } + public LobbyComparison Comparer { get; internal set; } + + internal NumericalFilter ( string k, int v, LobbyComparison c ) + { + Key = k; + Value = v; + Comparer = c; + } + } +} diff --git a/BoneSync/Facepunch.Steamworks/Structs/OutgoingPacket.cs b/BoneSync/Facepunch.Steamworks/Structs/OutgoingPacket.cs new file mode 100644 index 0000000..305a7f8 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/OutgoingPacket.cs @@ -0,0 +1,30 @@ +namespace Facepunch.Steamworks.Data +{ + /// + /// A server query packet. + /// + public struct OutgoingPacket + { + /// + /// Target IP address + /// + public uint Address { get; internal set; } + + /// + /// Target port + /// + public ushort Port { get; internal set; } + + /// + /// This data is pooled. Make a copy if you don't use it immediately. + /// This buffer is also quite large - so pay attention to Size. + /// + public byte[] Data { get; internal set; } + + /// + /// Size of the data + /// + public int Size { get; internal set; } + } + +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/P2Packet.cs b/BoneSync/Facepunch.Steamworks/Structs/P2Packet.cs new file mode 100644 index 0000000..c15345c --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/P2Packet.cs @@ -0,0 +1,8 @@ +namespace Facepunch.Steamworks.Data +{ + public struct P2Packet + { + public SteamId SteamId; + public byte[] Data; + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/PartyBeacon.cs b/BoneSync/Facepunch.Steamworks/Structs/PartyBeacon.cs new file mode 100644 index 0000000..4ebfcfd --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/PartyBeacon.cs @@ -0,0 +1,80 @@ +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + public struct PartyBeacon + { + static ISteamParties Internal => SteamParties.Internal; + + internal PartyBeaconID_t Id; + + /// + /// Creator of the beacon + /// + public SteamId Owner + { + get + { + var owner = default( SteamId ); + var location = default( SteamPartyBeaconLocation_t ); + Internal.GetBeaconDetails( Id, ref owner, ref location, out _ ); + return owner; + } + } + + /// + /// Creator of the beacon + /// + public string MetaData + { + get + { + var owner = default( SteamId ); + var location = default( SteamPartyBeaconLocation_t ); + _ = Internal.GetBeaconDetails( Id, ref owner, ref location, out var strVal ); + return strVal; + } + } + + /// + /// Will attempt to join the party. If successful will return a connection string. + /// If failed, will return null + /// + public async Task JoinAsync() + { + var result = await Internal.JoinParty( Id ); + if ( !result.HasValue || result.Value.Result != Result.OK ) + return null; + + return result.Value.ConnectStringUTF8(); + } + + /// + /// When a user follows your beacon, Steam will reserve one of the open party slots for them, and send your game a ReservationNotification callback. + /// When that user joins your party, call OnReservationCompleted to notify Steam that the user has joined successfully + /// + public void OnReservationCompleted( SteamId steamid ) + { + Internal.OnReservationCompleted( Id, steamid ); + } + + /// + /// To cancel a reservation (due to timeout or user input), call this. + /// Steam will open a new reservation slot. + /// Note: The user may already be in-flight to your game, so it's possible they will still connect and try to join your party. + /// + public void CancelReservation( SteamId steamid ) + { + Internal.CancelReservation( Id, steamid ); + } + + /// + /// Turn off the beacon + /// + public bool Destroy() + { + return Internal.DestroyBeacon( Id ); + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/RemotePlaySession.cs b/BoneSync/Facepunch.Steamworks/Structs/RemotePlaySession.cs new file mode 100644 index 0000000..605d558 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/RemotePlaySession.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace Facepunch.Steamworks.Data +{ + /// + /// Represents a RemotePlaySession from the SteamRemotePlay interface + /// + public struct RemotePlaySession + { + public uint Id { get; set; } + + public override string ToString() => Id.ToString(); + public static implicit operator RemotePlaySession( uint value ) => new RemotePlaySession() { Id = value }; + public static implicit operator uint( RemotePlaySession value ) => value.Id; + + /// + /// Returns true if this session was valid when created. This will stay true even + /// after disconnection - so be sure to watch SteamRemotePlay.OnSessionDisconnected + /// + public bool IsValid => Id > 0; + + /// + /// Get the SteamID of the connected user + /// + public SteamId SteamId => SteamRemotePlay.Internal.GetSessionSteamID( Id ); + + /// + /// Get the name of the session client device + /// + public string ClientName => SteamRemotePlay.Internal.GetSessionClientName( Id ); + + /// + /// Get the name of the session client device + /// + public SteamDeviceFormFactor FormFactor => SteamRemotePlay.Internal.GetSessionClientFormFactor( Id ); + } +} diff --git a/BoneSync/Facepunch.Steamworks/Structs/Screenshot.cs b/BoneSync/Facepunch.Steamworks/Structs/Screenshot.cs new file mode 100644 index 0000000..1588f89 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/Screenshot.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + + +namespace Facepunch.Steamworks.Data +{ + public struct Screenshot + { + internal ScreenshotHandle Value; + + /// + /// Tags a user as being visible in the screenshot + /// + public bool TagUser( SteamId user ) + { + return SteamScreenshots.Internal.TagUser( Value, user ); + } + + /// + /// Tags a user as being visible in the screenshot + /// + public bool SetLocation( string location ) + { + return SteamScreenshots.Internal.SetLocation( Value, location ); + } + + /// + /// Tags a user as being visible in the screenshot + /// + public bool TagPublishedFile( PublishedFileId file ) + { + return SteamScreenshots.Internal.TagPublishedFile( Value, file ); + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/Server.cs b/BoneSync/Facepunch.Steamworks/Structs/Server.cs new file mode 100644 index 0000000..4f39047 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/Server.cs @@ -0,0 +1,145 @@ +using System; +using System.Collections.Generic; +using System.Net; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Facepunch.Steamworks.Data +{ + public struct ServerInfo : IEquatable + { + public string Name { get; set; } + public int Ping { get; set; } + public string GameDir { get; set; } + public string Map { get; set; } + public string Description { get; set; } + public uint AppId { get; set; } + public int Players { get; set; } + public int MaxPlayers { get; set; } + public int BotPlayers { get; set; } + public bool Passworded { get; set; } + public bool Secure { get; set; } + public uint LastTimePlayed { get; set; } + public int Version { get; set; } + public string TagString { get; set; } + public ulong SteamId { get; set; } + public uint AddressRaw { get; set; } + public IPAddress Address { get; set; } + public int ConnectionPort { get; set; } + public int QueryPort { get; set; } + + string[] _tags; + + /// + /// Gets the individual tags for this server + /// + public string[] Tags + { + get + { + if ( _tags == null ) + { + if ( !string.IsNullOrEmpty( TagString ) ) + { + _tags = TagString.Split( ',' ); + } + } + + return _tags; + } + } + + internal static ServerInfo From( gameserveritem_t item ) + { + return new ServerInfo() + { + AddressRaw = item.NetAdr.IP, + Address = Utility.Int32ToIp( item.NetAdr.IP ), + ConnectionPort = item.NetAdr.ConnectionPort, + QueryPort = item.NetAdr.QueryPort, + Name = item.ServerNameUTF8(), + Ping = item.Ping, + GameDir = item.GameDirUTF8(), + Map = item.MapUTF8(), + Description = item.GameDescriptionUTF8(), + AppId = item.AppID, + Players = item.Players, + MaxPlayers = item.MaxPlayers, + BotPlayers = item.BotPlayers, + Passworded = item.Password, + Secure = item.Secure, + LastTimePlayed = item.TimeLastPlayed, + Version = item.ServerVersion, + TagString = item.GameTagsUTF8(), + SteamId = item.SteamID + }; + } + + public ServerInfo( uint ip, ushort cport, ushort qport, uint timeplayed ) : this() + { + AddressRaw = ip; + Address = Utility.Int32ToIp( ip ); + ConnectionPort = cport; + QueryPort = qport; + LastTimePlayed = timeplayed; + } + + internal const uint k_unFavoriteFlagNone = 0x00; + internal const uint k_unFavoriteFlagFavorite = 0x01; // this game favorite entry is for the favorites list + internal const uint k_unFavoriteFlagHistory = 0x02; // this game favorite entry is for the history list + + + + /// + /// Add this server to our history list + /// If we're already in the history list, weill set the last played time to now + /// + public void AddToHistory() + { + SteamMatchmaking.Internal.AddFavoriteGame( SteamClient.AppId, AddressRaw, (ushort)ConnectionPort, (ushort)QueryPort, k_unFavoriteFlagHistory, (uint)Epoch.Current ); + } + + /// + /// If this server responds to source engine style queries, we'll be able to get a list of rules here + /// + public async Task> QueryRulesAsync() + { + return await SourceServerQuery.GetRules( this ); + } + + /// + /// Remove this server from our history list + /// + public void RemoveFromHistory() + { + SteamMatchmaking.Internal.RemoveFavoriteGame( SteamClient.AppId, AddressRaw, (ushort)ConnectionPort, (ushort)QueryPort, k_unFavoriteFlagHistory ); + } + + /// + /// Add this server to our favourite list + /// + public void AddToFavourites() + { + SteamMatchmaking.Internal.AddFavoriteGame( SteamClient.AppId, AddressRaw, (ushort)ConnectionPort, (ushort)QueryPort, k_unFavoriteFlagFavorite, (uint)Epoch.Current ); + } + + /// + /// Remove this server from our favourite list + /// + public void RemoveFromFavourites() + { + SteamMatchmaking.Internal.RemoveFavoriteGame( SteamClient.AppId, AddressRaw, (ushort)ConnectionPort, (ushort)QueryPort, k_unFavoriteFlagFavorite ); + } + + public bool Equals( ServerInfo other ) + { + return this.GetHashCode() == other.GetHashCode(); + } + + public override int GetHashCode() + { + return Address.GetHashCode() + SteamId.GetHashCode() + ConnectionPort.GetHashCode() + QueryPort.GetHashCode(); + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/ServerInit.cs b/BoneSync/Facepunch.Steamworks/Structs/ServerInit.cs new file mode 100644 index 0000000..ec44c63 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/ServerInit.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Runtime.InteropServices; +using System.Text; + +namespace Facepunch.Steamworks +{ + /// + /// Used to set up the server. + /// The variables in here are all required to be set, and can't be changed once the server is created. + /// + public struct SteamServerInit + { + public IPAddress IpAddress; + public ushort SteamPort; + public ushort GamePort; + public ushort QueryPort; + public bool Secure; + + /// + /// The version string is usually in the form x.x.x.x, and is used by the master server to detect when the server is out of date. + /// If you go into the dedicated server tab on steamworks you'll be able to server the latest version. If this version number is + /// less than that latest version then your server won't show. + /// + public string VersionString; + + /// + /// This should be the same directory game where gets installed into. Just the folder name, not the whole path. I.e. "Rust", "Garrysmod". + /// + public string ModDir; + + /// + /// The game description. Setting this to the full name of your game is recommended. + /// + public string GameDescription; + + /// + /// Is a dedicated server + /// + public bool DedicatedServer; + + + public SteamServerInit( string modDir, string gameDesc ) + { + DedicatedServer = true; + ModDir = modDir; + GameDescription = gameDesc; + GamePort = 27015; + QueryPort = 27016; + Secure = true; + VersionString = "1.0.0.0"; + IpAddress = null; + SteamPort = 0; + } + + /// + /// Set the Steam quert port + /// + public SteamServerInit WithRandomSteamPort() + { + SteamPort = (ushort)new Random().Next( 10000, 60000 ); + return this; + } + + /// + /// If you pass MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE into usQueryPort, then it causes the game server API to use + /// "GameSocketShare" mode, which means that the game is responsible for sending and receiving UDP packets for the master + /// server updater. + /// + /// More info about this here: https://partner.steamgames.com/doc/api/ISteamGameServer#HandleIncomingPacket + /// + public SteamServerInit WithQueryShareGamePort() + { + QueryPort = 0xFFFF; + return this; + } + } +} diff --git a/BoneSync/Facepunch.Steamworks/Structs/Stat.cs b/BoneSync/Facepunch.Steamworks/Structs/Stat.cs new file mode 100644 index 0000000..2dc8b6c --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/Stat.cs @@ -0,0 +1,150 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Facepunch.Steamworks.Data +{ + public struct Stat + { + public string Name { get; internal set; } + public SteamId UserId { get; internal set; } + + public Stat( string name ) + { + Name = name; + UserId = 0; + } + + public Stat( string name, SteamId user ) + { + Name = name; + UserId = user; + } + + internal void LocalUserOnly( [CallerMemberName] string caller = null ) + { + if ( UserId == 0 ) return; + throw new System.Exception( $"Stat.{caller} can only be called for the local user" ); + } + + public double GetGlobalFloat() + { + double val = 0.0; + + if ( SteamUserStats.Internal.GetGlobalStat( Name, ref val ) ) + return val; + + return 0; + } + + public long GetGlobalInt() + { + long val = 0; + SteamUserStats.Internal.GetGlobalStat( Name, ref val ); + return val; + } + + public async Task GetGlobalIntDaysAsync( int days ) + { + var result = await SteamUserStats.Internal.RequestGlobalStats( days ); + if ( result?.Result != Result.OK ) return null; + + var r = new long[days]; + + var rows = SteamUserStats.Internal.GetGlobalStatHistory( Name, r, (uint) r.Length * sizeof(long) ); + + if ( days != rows ) + r = r.Take( rows ).ToArray(); + + return r; + } + + public async Task GetGlobalFloatDays( int days ) + { + var result = await SteamUserStats.Internal.RequestGlobalStats( days ); + if ( result?.Result != Result.OK ) return null; + + var r = new double[days]; + + var rows = SteamUserStats.Internal.GetGlobalStatHistory( Name, r, (uint)r.Length * sizeof( double ) ); + + if ( days != rows ) + r = r.Take( rows ).ToArray(); + + return r; + } + + public float GetFloat() + { + float val = 0.0f; + + if ( UserId > 0 ) + { + SteamUserStats.Internal.GetUserStat( UserId, Name, ref val ); + } + else + { + SteamUserStats.Internal.GetStat( Name, ref val ); + } + + return 0; + } + + public int GetInt() + { + int val = 0; + + if ( UserId > 0 ) + { + SteamUserStats.Internal.GetUserStat( UserId, Name, ref val ); + } + else + { + SteamUserStats.Internal.GetStat( Name, ref val ); + } + + return val; + } + + public bool Set( int val ) + { + LocalUserOnly(); + return SteamUserStats.Internal.SetStat( Name, val ); + } + + public bool Set( float val ) + { + LocalUserOnly(); + return SteamUserStats.Internal.SetStat( Name, val ); + } + + public bool Add( int val ) + { + LocalUserOnly(); + return Set( GetInt() + val ); + } + + public bool Add( float val ) + { + LocalUserOnly(); + return Set( GetFloat() + val ); + } + + public bool UpdateAverageRate( float count, float sessionlength ) + { + LocalUserOnly(); + return SteamUserStats.Internal.UpdateAvgRateStat( Name, count, sessionlength ); + } + + public bool Store() + { + LocalUserOnly(); + return SteamUserStats.Internal.StoreStats(); + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/SteamId.cs b/BoneSync/Facepunch.Steamworks/Structs/SteamId.cs new file mode 100644 index 0000000..d66fbff --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/SteamId.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + + +namespace Facepunch.Steamworks +{ + public struct SteamId + { + public ulong Value; + + public static implicit operator SteamId( ulong value ) + { + return new SteamId { Value = value }; + } + + public static implicit operator ulong( SteamId value ) + { + return value.Value; + } + + public override string ToString() => Value.ToString(); + + public uint AccountId => (uint) (Value & 0xFFFFFFFFul); + + public bool IsValid => Value != default; + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/SteamIpAddress.cs b/BoneSync/Facepunch.Steamworks/Structs/SteamIpAddress.cs new file mode 100644 index 0000000..7040892 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/SteamIpAddress.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + + +namespace Facepunch.Steamworks.Data +{ + [StructLayout( LayoutKind.Explicit, Pack = Platform.StructPlatformPackSize )] + internal partial struct SteamIPAddress + { + [FieldOffset( 0 )] + public uint Ip4Address; // Host Order + + [FieldOffset( 16 )] + internal SteamIPType Type; // m_eType ESteamIPType + + public static implicit operator System.Net.IPAddress( SteamIPAddress value ) + { + if ( value.Type == SteamIPType.Type4 ) + return Utility.Int32ToIp( value.Ip4Address ); + + throw new System.Exception( $"Oops - can't convert SteamIPAddress to System.Net.IPAddress because no-one coded support for {value.Type} yet" ); + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/SteamParamStringArray.cs b/BoneSync/Facepunch.Steamworks/Structs/SteamParamStringArray.cs new file mode 100644 index 0000000..5759320 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/SteamParamStringArray.cs @@ -0,0 +1,45 @@ +using System; +using System.Runtime.InteropServices; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks.Ugc +{ + internal struct SteamParamStringArray : IDisposable + { + public SteamParamStringArray_t Value; + + IntPtr[] NativeStrings; + IntPtr NativeArray; + + public static SteamParamStringArray From( string[] array ) + { + var a = new SteamParamStringArray(); + + a.NativeStrings = new IntPtr[array.Length]; + for ( int i = 0; i < a.NativeStrings.Length; i++ ) + { + a.NativeStrings[i] = Marshal.StringToHGlobalAnsi( array[i] ); + } + + var size = Marshal.SizeOf( typeof( IntPtr ) ) * a.NativeStrings.Length; + a.NativeArray = Marshal.AllocHGlobal( size ); + Marshal.Copy( a.NativeStrings, 0, a.NativeArray, a.NativeStrings.Length ); + + a.Value = new SteamParamStringArray_t + { + Strings = a.NativeArray, + NumStrings = array.Length + }; + + return a; + } + + public void Dispose() + { + foreach ( var x in NativeStrings ) + Marshal.FreeHGlobal( x ); + + Marshal.FreeHGlobal( NativeArray ); + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/Ugc.cs b/BoneSync/Facepunch.Steamworks/Structs/Ugc.cs new file mode 100644 index 0000000..9d71e47 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/Ugc.cs @@ -0,0 +1,13 @@ +using System.Linq; + +#pragma warning disable 649 + +namespace Facepunch.Steamworks.Data +{ + public struct Ugc + { + internal UGCHandle_t Handle; + } +} + +#pragma warning restore 649 diff --git a/BoneSync/Facepunch.Steamworks/Structs/UgcEditor.cs b/BoneSync/Facepunch.Steamworks/Structs/UgcEditor.cs new file mode 100644 index 0000000..4ae533b --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/UgcEditor.cs @@ -0,0 +1,237 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +using QueryType = Facepunch.Steamworks.Ugc.Query; + +namespace Facepunch.Steamworks.Ugc +{ + public struct Editor + { + PublishedFileId fileId; + + bool creatingNew; + WorkshopFileType creatingType; + AppId consumerAppId; + + internal Editor( WorkshopFileType filetype ) : this() + { + this.creatingNew = true; + this.creatingType = filetype; + } + + public Editor( PublishedFileId fileId ) : this() + { + this.fileId = fileId; + } + + /// + /// Create a Normal Workshop item that can be subscribed to + /// + public static Editor NewCommunityFile => new Editor( WorkshopFileType.Community ); + + /// + /// Workshop item that is meant to be voted on for the purpose of selling in-game + /// + public static Editor NewMicrotransactionFile => new Editor( WorkshopFileType.Microtransaction ); + + public Editor ForAppId( AppId id ) { this.consumerAppId = id; return this; } + + string Title; + public Editor WithTitle( string t ) { this.Title = t; return this; } + + string Description; + public Editor WithDescription( string t ) { this.Description = t; return this; } + + string MetaData; + public Editor WithMetaData( string t ) { this.MetaData = t; return this; } + + string ChangeLog; + public Editor WithChangeLog( string t ) { this.ChangeLog = t; return this; } + + string Language; + public Editor InLanguage( string t ) { this.Language = t; return this; } + + string PreviewFile; + public Editor WithPreviewFile( string t ) { this.PreviewFile = t; return this; } + + System.IO.DirectoryInfo ContentFolder; + public Editor WithContent( System.IO.DirectoryInfo t ) { this.ContentFolder = t; return this; } + public Editor WithContent( string folderName ) { return WithContent( new System.IO.DirectoryInfo( folderName ) ); } + + RemoteStoragePublishedFileVisibility? Visibility; + + public Editor WithPublicVisibility() { Visibility = RemoteStoragePublishedFileVisibility.Public; return this; } + public Editor WithFriendsOnlyVisibility() { Visibility = RemoteStoragePublishedFileVisibility.FriendsOnly; return this; } + public Editor WithPrivateVisibility() { Visibility = RemoteStoragePublishedFileVisibility.Private; return this; } + + List Tags; + Dictionary KeyValueTags; + + public Editor WithTag( string tag ) + { + if ( Tags == null ) Tags = new List(); + + Tags.Add( tag ); + + return this; + } + + public Editor AddKeyValueTag(string key, string value) + { + if (KeyValueTags == null) KeyValueTags = new Dictionary(); + KeyValueTags.Add(key, value); + return this; + } + + public async Task SubmitAsync( IProgress progress = null ) + { + var result = default( PublishResult ); + + progress?.Report( 0 ); + + if ( consumerAppId == 0 ) + consumerAppId = SteamClient.AppId; + + // + // Item Create + // + if ( creatingNew ) + { + result.Result = Steamworks.Result.Fail; + + var created = await SteamUGC.Internal.CreateItem( consumerAppId, creatingType ); + if ( !created.HasValue ) return result; + + result.Result = created.Value.Result; + + if ( result.Result != Steamworks.Result.OK ) + return result; + + fileId = created.Value.PublishedFileId; + result.NeedsWorkshopAgreement = created.Value.UserNeedsToAcceptWorkshopLegalAgreement; + result.FileId = fileId; + } + + + result.FileId = fileId; + + // + // Item Update + // + { + var handle = SteamUGC.Internal.StartItemUpdate( consumerAppId, fileId ); + if ( handle == 0xffffffffffffffff ) + return result; + + if ( Title != null ) SteamUGC.Internal.SetItemTitle( handle, Title ); + if ( Description != null ) SteamUGC.Internal.SetItemDescription( handle, Description ); + if ( MetaData != null ) SteamUGC.Internal.SetItemMetadata( handle, MetaData ); + if ( Language != null ) SteamUGC.Internal.SetItemUpdateLanguage( handle, Language ); + if ( ContentFolder != null ) SteamUGC.Internal.SetItemContent( handle, ContentFolder.FullName ); + if ( PreviewFile != null ) SteamUGC.Internal.SetItemPreview( handle, PreviewFile ); + if ( Visibility.HasValue ) SteamUGC.Internal.SetItemVisibility( handle, Visibility.Value ); + if ( Tags != null && Tags.Count > 0 ) + { + using ( var a = SteamParamStringArray.From( Tags.ToArray() ) ) + { + var val = a.Value; + SteamUGC.Internal.SetItemTags( handle, ref val ); + } + } + + if (KeyValueTags != null && KeyValueTags.Count > 0) + { + foreach (var keyValueTag in KeyValueTags) + { + SteamUGC.Internal.AddItemKeyValueTag(handle, keyValueTag.Key, keyValueTag.Value); + } + } + + result.Result = Steamworks.Result.Fail; + + if ( ChangeLog == null ) + ChangeLog = ""; + + var updating = SteamUGC.Internal.SubmitItemUpdate( handle, ChangeLog ); + + while ( !updating.IsCompleted ) + { + if ( progress != null ) + { + ulong total = 0; + ulong processed = 0; + + var r = SteamUGC.Internal.GetItemUpdateProgress( handle, ref processed, ref total ); + + switch ( r ) + { + case ItemUpdateStatus.PreparingConfig: + { + progress?.Report( 0.1f ); + break; + } + + case ItemUpdateStatus.PreparingContent: + { + progress?.Report( 0.2f ); + break; + } + case ItemUpdateStatus.UploadingContent: + { + var uploaded = total > 0 ? ((float)processed / (float)total) : 0.0f; + progress?.Report( 0.2f + uploaded * 0.7f ); + break; + } + case ItemUpdateStatus.UploadingPreviewFile: + { + progress?.Report( 0.8f ); + break; + } + case ItemUpdateStatus.CommittingChanges: + { + progress?.Report( 1 ); + break; + } + } + } + + await Task.Delay( 1000 / 60 ); + } + + progress?.Report( 1 ); + + var updated = updating.GetResult(); + + if ( !updated.HasValue ) return result; + + result.Result = updated.Value.Result; + + if ( result.Result != Steamworks.Result.OK ) + return result; + + result.NeedsWorkshopAgreement = updated.Value.UserNeedsToAcceptWorkshopLegalAgreement; + result.FileId = fileId; + + } + + return result; + } + } + + public struct PublishResult + { + public bool Success => Result == Steamworks.Result.OK; + + public Steamworks.Result Result; + public PublishedFileId FileId; + + /// + /// https://partner.steamgames.com/doc/features/workshop/implementation#Legal + /// + public bool NeedsWorkshopAgreement; + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/UgcItem.cs b/BoneSync/Facepunch.Steamworks/Structs/UgcItem.cs new file mode 100644 index 0000000..43f6039 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/UgcItem.cs @@ -0,0 +1,375 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +using QueryType = Facepunch.Steamworks.Ugc.Query; + +namespace Facepunch.Steamworks.Ugc +{ + public struct Item + { + internal SteamUGCDetails_t details; + internal PublishedFileId _id; + + public Item( PublishedFileId id ) : this() + { + _id = id; + } + + /// + /// The actual ID of this file + /// + public PublishedFileId Id => _id; + + /// + /// The given title of this item + /// + public string Title { get; internal set; } + + /// + /// The description of this item, in your local language if available + /// + public string Description { get; internal set; } + + /// + /// A list of tags for this item, all lowercase + /// + public string[] Tags { get; internal set; } + + /// + /// App Id of the app that created this item + /// + public AppId CreatorApp => details.CreatorAppID; + + /// + /// App Id of the app that will consume this item. + /// + public AppId ConsumerApp => details.ConsumerAppID; + + /// + /// User who created this content + /// + public Friend Owner => new Friend( details.SteamIDOwner ); + + /// + /// The bayesian average for up votes / total votes, between [0,1] + /// + public float Score => details.Score; + + /// + /// Time when the published item was created + /// + public DateTime Created => Epoch.ToDateTime( details.TimeCreated ); + + /// + /// Time when the published item was last updated + /// + public DateTime Updated => Epoch.ToDateTime( details.TimeUpdated ); + + /// + /// True if this is publically visible + /// + public bool IsPublic => details.Visibility == RemoteStoragePublishedFileVisibility.Public; + + /// + /// True if this item is only visible by friends of the creator + /// + public bool IsFriendsOnly => details.Visibility == RemoteStoragePublishedFileVisibility.FriendsOnly; + + /// + /// True if this is only visible to the creator + /// + public bool IsPrivate => details.Visibility == RemoteStoragePublishedFileVisibility.Private; + + /// + /// True if this item has been banned + /// + public bool IsBanned => details.Banned; + + /// + /// Whether the developer of this app has specifically flagged this item as accepted in the Workshop + /// + public bool IsAcceptedForUse => details.AcceptedForUse; + + /// + /// The number of upvotes of this item + /// + public uint VotesUp => details.VotesUp; + + /// + /// The number of downvotes of this item + /// + public uint VotesDown => details.VotesDown; + + public bool IsInstalled => (State & ItemState.Installed) == ItemState.Installed; + public bool IsDownloading => (State & ItemState.Downloading) == ItemState.Downloading; + public bool IsDownloadPending => (State & ItemState.DownloadPending) == ItemState.DownloadPending; + public bool IsSubscribed => (State & ItemState.Subscribed) == ItemState.Subscribed; + public bool NeedsUpdate => (State & ItemState.NeedsUpdate) == ItemState.NeedsUpdate; + + public string Directory + { + get + { + ulong size = 0; + uint ts = 0; + + if ( !SteamUGC.Internal.GetItemInstallInfo( Id, ref size, out var strVal, ref ts ) ) + return null; + + return strVal; + } + } + + /// + /// Start downloading this item. + /// If this returns false the item isn't getting downloaded. + /// + public bool Download( bool highPriority = false ) + { + return SteamUGC.Download( Id, highPriority ); + } + + /// + /// If we're downloading, how big the total download is + /// + public long DownloadBytesTotal + { + get + { + if ( !NeedsUpdate ) + return SizeBytes; + + ulong downloaded = 0; + ulong total = 0; + if ( SteamUGC.Internal.GetItemDownloadInfo( Id, ref downloaded, ref total ) ) + return (long) total; + + return -1; + } + } + + /// + /// If we're downloading, how much we've downloaded + /// + public long DownloadBytesDownloaded + { + get + { + if ( !NeedsUpdate ) + return SizeBytes; + + ulong downloaded = 0; + ulong total = 0; + if ( SteamUGC.Internal.GetItemDownloadInfo( Id, ref downloaded, ref total ) ) + return (long)downloaded; + + return -1; + } + } + + /// + /// If we're installed, how big is the install + /// + public long SizeBytes + { + get + { + if ( NeedsUpdate ) + return DownloadBytesDownloaded; + + ulong size = 0; + uint ts = 0; + if ( !SteamUGC.Internal.GetItemInstallInfo( Id, ref size, out _, ref ts ) ) + return 0; + + return (long) size; + } + } + + /// + /// If we're downloading our current progress as a delta betwen 0-1 + /// + public float DownloadAmount + { + get + { + //changed from NeedsUpdate as it's false when validating and redownloading ugc + //possibly similar properties should also be changed + if ( !IsDownloading ) return 1; + + ulong downloaded = 0; + ulong total = 0; + if ( SteamUGC.Internal.GetItemDownloadInfo( Id, ref downloaded, ref total ) && total > 0 ) + return (float)((double)downloaded / (double)total); + + if ( NeedsUpdate || !IsInstalled || IsDownloading ) + return 0; + + return 1; + } + } + + private ItemState State => (ItemState) SteamUGC.Internal.GetItemState( Id ); + + public static async Task GetAsync( PublishedFileId id, int maxageseconds = 60 * 30 ) + { + var file = await Steamworks.Ugc.Query.All + .WithFileId( id ) + .WithLongDescription( true ) + .GetPageAsync( 1 ); + + if ( !file.HasValue ) return null; + if ( file.Value.ResultCount == 0 ) return null; + + return file.Value.Entries.First(); + } + + internal static Item From( SteamUGCDetails_t details ) + { + var d = new Item + { + _id = details.PublishedFileId, + details = details, + Title = details.TitleUTF8(), + Description = details.DescriptionUTF8(), + Tags = details.TagsUTF8().ToLower().Split( new[] { ',' }, StringSplitOptions.RemoveEmptyEntries ) + }; + + return d; + } + + /// + /// A case insensitive check for tag + /// + public bool HasTag( string find ) + { + if ( Tags.Length == 0 ) return false; + + return Tags.Contains( find, StringComparer.OrdinalIgnoreCase ); + } + + /// + /// Allows the user to subscribe to this item + /// + public async Task Subscribe () + { + var result = await SteamUGC.Internal.SubscribeItem( _id ); + return result?.Result == Result.OK; + } + + /// + /// Allows the user to subscribe to download this item asyncronously + /// If CancellationToken is default then there is 60 seconds timeout + /// Progress will be set to 0-1 + /// + public async Task DownloadAsync( Action progress = null, int milisecondsUpdateDelay = 60, CancellationToken ct = default ) + { + return await SteamUGC.DownloadAsync( Id, progress, milisecondsUpdateDelay, ct ); + } + + /// + /// Allows the user to unsubscribe from this item + /// + public async Task Unsubscribe () + { + var result = await SteamUGC.Internal.UnsubscribeItem( _id ); + return result?.Result == Result.OK; + } + + /// + /// Adds item to user favorite list + /// + public async Task AddFavorite() + { + var result = await SteamUGC.Internal.AddItemToFavorites(details.ConsumerAppID, _id); + return result?.Result == Result.OK; + } + + /// + /// Removes item from user favorite list + /// + public async Task RemoveFavorite() + { + var result = await SteamUGC.Internal.RemoveItemFromFavorites(details.ConsumerAppID, _id); + return result?.Result == Result.OK; + } + + /// + /// Allows the user to rate a workshop item up or down. + /// + public async Task Vote( bool up ) + { + var r = await SteamUGC.Internal.SetUserItemVote( Id, up ); + return r?.Result; + } + + /// + /// Gets the current users vote on the item + /// + public async Task GetUserVote() + { + var result = await SteamUGC.Internal.GetUserItemVote(_id); + if (!result.HasValue) + return null; + return UserItemVote.From(result.Value); + } + + /// + /// Return a URL to view this item online + /// + public string Url => $"http://steamcommunity.com/sharedfiles/filedetails/?source=Facepunch.Steamworks&id={Id}"; + + /// + /// The URl to view this item's changelog + /// + public string ChangelogUrl => $"http://steamcommunity.com/sharedfiles/filedetails/changelog/{Id}"; + + /// + /// The URL to view the comments on this item + /// + public string CommentsUrl => $"http://steamcommunity.com/sharedfiles/filedetails/comments/{Id}"; + + /// + /// The URL to discuss this item + /// + public string DiscussUrl => $"http://steamcommunity.com/sharedfiles/filedetails/discussions/{Id}"; + + /// + /// The URL to view this items stats online + /// + public string StatsUrl => $"http://steamcommunity.com/sharedfiles/filedetails/stats/{Id}"; + + public ulong NumSubscriptions { get; internal set; } + public ulong NumFavorites { get; internal set; } + public ulong NumFollowers { get; internal set; } + public ulong NumUniqueSubscriptions { get; internal set; } + public ulong NumUniqueFavorites { get; internal set; } + public ulong NumUniqueFollowers { get; internal set; } + public ulong NumUniqueWebsiteViews { get; internal set; } + public ulong ReportScore { get; internal set; } + public ulong NumSecondsPlayed { get; internal set; } + public ulong NumPlaytimeSessions { get; internal set; } + public ulong NumComments { get; internal set; } + public ulong NumSecondsPlayedDuringTimePeriod { get; internal set; } + public ulong NumPlaytimeSessionsDuringTimePeriod { get; internal set; } + + /// + /// The URL to the preview image for this item + /// + public string PreviewImageUrl { get; internal set; } + + /// + /// Edit this item + /// + public Ugc.Editor Edit() + { + return new Ugc.Editor( Id ); + } + + public Result Result => details.Result; + } +} diff --git a/BoneSync/Facepunch.Steamworks/Structs/UgcQuery.cs b/BoneSync/Facepunch.Steamworks/Structs/UgcQuery.cs new file mode 100644 index 0000000..754deaf --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/UgcQuery.cs @@ -0,0 +1,303 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +using QueryType = Facepunch.Steamworks.Ugc.Query; + +namespace Facepunch.Steamworks.Ugc +{ + public struct Query + { + UgcType matchingType; + UGCQuery queryType; + AppId consumerApp; + AppId creatorApp; + string searchText; + + public Query( UgcType type ) : this() + { + matchingType = type; + } + + public static Query All => new Query( UgcType.All ); + public static Query Items => new Query( UgcType.Items ); + public static Query ItemsMtx => new Query( UgcType.Items_Mtx ); + public static Query ItemsReadyToUse => new Query( UgcType.Items_ReadyToUse ); + public static Query Collections => new Query( UgcType.Collections ); + public static Query Artwork => new Query( UgcType.Artwork ); + public static Query Videos => new Query( UgcType.Videos ); + public static Query Screenshots => new Query( UgcType.Screenshots ); + public static Query AllGuides => new Query( UgcType.AllGuides ); + public static Query WebGuides => new Query( UgcType.WebGuides ); + public static Query IntegratedGuides => new Query( UgcType.IntegratedGuides ); + public static Query UsableInGame => new Query( UgcType.UsableInGame ); + public static Query ControllerBindings => new Query( UgcType.ControllerBindings ); + public static Query GameManagedItems => new Query( UgcType.GameManagedItems ); + + + public Query RankedByVote() { queryType = UGCQuery.RankedByVote; return this; } + public Query RankedByPublicationDate() { queryType = UGCQuery.RankedByPublicationDate; return this; } + public Query RankedByAcceptanceDate() { queryType = UGCQuery.AcceptedForGameRankedByAcceptanceDate; return this; } + public Query RankedByTrend() { queryType = UGCQuery.RankedByTrend; return this; } + public Query FavoritedByFriends() { queryType = UGCQuery.FavoritedByFriendsRankedByPublicationDate; return this; } + public Query CreatedByFriends() { queryType = UGCQuery.CreatedByFriendsRankedByPublicationDate; return this; } + public Query RankedByNumTimesReported() { queryType = UGCQuery.RankedByNumTimesReported; return this; } + public Query CreatedByFollowedUsers() { queryType = UGCQuery.CreatedByFollowedUsersRankedByPublicationDate; return this; } + public Query NotYetRated() { queryType = UGCQuery.NotYetRated; return this; } + public Query RankedByTotalVotesAsc() { queryType = UGCQuery.RankedByTotalVotesAsc; return this; } + public Query RankedByVotesUp() { queryType = UGCQuery.RankedByVotesUp; return this; } + public Query RankedByTextSearch() { queryType = UGCQuery.RankedByTextSearch; return this; } + public Query RankedByTotalUniqueSubscriptions() { queryType = UGCQuery.RankedByTotalUniqueSubscriptions; return this; } + public Query RankedByPlaytimeTrend() { queryType = UGCQuery.RankedByPlaytimeTrend; return this; } + public Query RankedByTotalPlaytime() { queryType = UGCQuery.RankedByTotalPlaytime; return this; } + public Query RankedByAveragePlaytimeTrend() { queryType = UGCQuery.RankedByAveragePlaytimeTrend; return this; } + public Query RankedByLifetimeAveragePlaytime() { queryType = UGCQuery.RankedByLifetimeAveragePlaytime; return this; } + public Query RankedByPlaytimeSessionsTrend() { queryType = UGCQuery.RankedByPlaytimeSessionsTrend; return this; } + public Query RankedByLifetimePlaytimeSessions() { queryType = UGCQuery.RankedByLifetimePlaytimeSessions; return this; } + + #region UserQuery + + SteamId? steamid; + + UserUGCList userType; + UserUGCListSortOrder userSort; + + internal Query LimitUser( SteamId steamid ) + { + if ( steamid.Value == 0 ) + steamid = SteamClient.SteamId; + + this.steamid = steamid; + return this; + } + + public Query WhereUserPublished( SteamId user = default ) { userType = UserUGCList.Published; LimitUser( user ); return this; } + public Query WhereUserVotedOn( SteamId user = default ) { userType = UserUGCList.VotedOn; LimitUser( user ); return this; } + public Query WhereUserVotedUp( SteamId user = default ) { userType = UserUGCList.VotedUp; LimitUser( user ); return this; } + public Query WhereUserVotedDown( SteamId user = default ) { userType = UserUGCList.VotedDown; LimitUser( user ); return this; } + public Query WhereUserWillVoteLater( SteamId user = default ) { userType = UserUGCList.WillVoteLater; LimitUser( user ); return this; } + public Query WhereUserFavorited( SteamId user = default ) { userType = UserUGCList.Favorited; LimitUser( user ); return this; } + public Query WhereUserSubscribed( SteamId user = default ) { userType = UserUGCList.Subscribed; LimitUser( user ); return this; } + public Query WhereUserUsedOrPlayed( SteamId user = default ) { userType = UserUGCList.UsedOrPlayed; LimitUser( user ); return this; } + public Query WhereUserFollowed( SteamId user = default ) { userType = UserUGCList.Followed; LimitUser( user ); return this; } + + public Query SortByCreationDate() { userSort = UserUGCListSortOrder.CreationOrderDesc; return this; } + public Query SortByCreationDateAsc() { userSort = UserUGCListSortOrder.CreationOrderAsc; return this; } + public Query SortByTitleAsc() { userSort = UserUGCListSortOrder.TitleAsc; return this; } + public Query SortByUpdateDate() { userSort = UserUGCListSortOrder.LastUpdatedDesc; return this; } + public Query SortBySubscriptionDate() { userSort = UserUGCListSortOrder.SubscriptionDateDesc; return this; } + public Query SortByVoteScore() { userSort = UserUGCListSortOrder.VoteScoreDesc; return this; } + public Query SortByModeration() { userSort = UserUGCListSortOrder.ForModeration; return this; } + + public Query WhereSearchText(string searchText) { this.searchText = searchText; return this; } + + #endregion + + #region Files + PublishedFileId[] Files; + + public Query WithFileId( params PublishedFileId[] files ) + { + Files = files; + return this; + } + #endregion + + public async Task GetPageAsync( int page ) + { + if ( page <= 0 ) throw new System.Exception( "page should be > 0" ); + + if ( consumerApp == 0 ) consumerApp = SteamClient.AppId; + if ( creatorApp == 0 ) creatorApp = consumerApp; + + UGCQueryHandle_t handle; + + if ( Files != null ) + { + handle = SteamUGC.Internal.CreateQueryUGCDetailsRequest( Files, (uint)Files.Length ); + } + else if ( steamid.HasValue ) + { + handle = SteamUGC.Internal.CreateQueryUserUGCRequest( steamid.Value.AccountId, userType, matchingType, userSort, creatorApp.Value, consumerApp.Value, (uint)page ); + } + else + { + handle = SteamUGC.Internal.CreateQueryAllUGCRequest( queryType, matchingType, creatorApp.Value, consumerApp.Value, (uint)page ); + } + + ApplyReturns(handle); + + if (maxCacheAge.HasValue) + { + SteamUGC.Internal.SetAllowCachedResponse(handle, (uint)maxCacheAge.Value); + } + + ApplyConstraints( handle ); + + var result = await SteamUGC.Internal.SendQueryUGCRequest( handle ); + if ( !result.HasValue ) + return null; + + if ( result.Value.Result != Steamworks.Result.OK ) + return null; + + return new ResultPage + { + Handle = result.Value.Handle, + ResultCount = (int) result.Value.NumResultsReturned, + TotalCount = (int)result.Value.TotalMatchingResults, + CachedData = result.Value.CachedData + }; + } + + #region SharedConstraints + public QueryType WithType( UgcType type ) { matchingType = type; return this; } + int? maxCacheAge; + public QueryType AllowCachedResponse( int maxSecondsAge ) { maxCacheAge = maxSecondsAge; return this; } + string language; + public QueryType InLanguage( string lang ) { language = lang; return this; } + + int? trendDays; + public QueryType WithTrendDays( int days ) { trendDays = days; return this; } + + List requiredTags; + bool? matchAnyTag; + List excludedTags; + Dictionary requiredKv; + + /// + /// Found items must have at least one of the defined tags + /// + public QueryType MatchAnyTag() { matchAnyTag = true; return this; } + + /// + /// Found items must have all defined tags + /// + public QueryType MatchAllTags() { matchAnyTag = false; return this; } + + public QueryType WithTag( string tag ) + { + if ( requiredTags == null ) requiredTags = new List(); + requiredTags.Add( tag ); + return this; + } + + public QueryType AddRequiredKeyValueTag(string key, string value) + { + if (requiredKv == null) requiredKv = new Dictionary(); + requiredKv.Add(key, value); + return this; + } + + public QueryType WithoutTag( string tag ) + { + if ( excludedTags == null ) excludedTags = new List(); + excludedTags.Add( tag ); + return this; + } + + void ApplyConstraints( UGCQueryHandle_t handle ) + { + if ( requiredTags != null ) + { + foreach ( var tag in requiredTags ) + SteamUGC.Internal.AddRequiredTag( handle, tag ); + } + + if ( excludedTags != null ) + { + foreach ( var tag in excludedTags ) + SteamUGC.Internal.AddExcludedTag( handle, tag ); + } + + if ( requiredKv != null ) + { + foreach ( var tag in requiredKv ) + SteamUGC.Internal.AddRequiredKeyValueTag( handle, tag.Key, tag.Value ); + } + + if ( matchAnyTag.HasValue ) + { + SteamUGC.Internal.SetMatchAnyTag( handle, matchAnyTag.Value ); + } + + if ( trendDays.HasValue ) + { + SteamUGC.Internal.SetRankedByTrendDays( handle, (uint)trendDays.Value ); + } + + if ( !string.IsNullOrEmpty( searchText ) ) + { + SteamUGC.Internal.SetSearchText( handle, searchText ); + } + } + + #endregion + + #region ReturnValues + + bool? WantsReturnOnlyIDs; + public QueryType WithOnlyIDs(bool b) { WantsReturnOnlyIDs = b; return this; } + bool? WantsReturnKeyValueTags; + public QueryType WithKeyValueTag(bool b) { WantsReturnKeyValueTags = b; return this; } + bool? WantsReturnLongDescription; + public QueryType WithLongDescription(bool b) { WantsReturnLongDescription = b; return this; } + bool? WantsReturnMetadata; + public QueryType WithMetadata(bool b) { WantsReturnMetadata = b; return this; } + bool? WantsReturnChildren; + public QueryType WithChildren(bool b) { WantsReturnChildren = b; return this; } + bool? WantsReturnAdditionalPreviews; + public QueryType WithAdditionalPreviews(bool b) { WantsReturnAdditionalPreviews = b; return this; } + bool? WantsReturnTotalOnly; + public QueryType WithTotalOnly(bool b) { WantsReturnTotalOnly = b; return this; } + uint? WantsReturnPlaytimeStats; + public QueryType WithPlaytimeStats(uint unDays) { WantsReturnPlaytimeStats = unDays; return this; } + + private void ApplyReturns(UGCQueryHandle_t handle) + { + if (WantsReturnOnlyIDs.HasValue) + { + SteamUGC.Internal.SetReturnOnlyIDs(handle, WantsReturnOnlyIDs.Value); + } + + if (WantsReturnKeyValueTags.HasValue) + { + SteamUGC.Internal.SetReturnKeyValueTags(handle, WantsReturnKeyValueTags.Value); + } + + if (WantsReturnLongDescription.HasValue) + { + SteamUGC.Internal.SetReturnLongDescription(handle, WantsReturnLongDescription.Value); + } + + if (WantsReturnMetadata.HasValue) + { + SteamUGC.Internal.SetReturnMetadata(handle, WantsReturnMetadata.Value); + } + + if (WantsReturnChildren.HasValue) + { + SteamUGC.Internal.SetReturnChildren(handle, WantsReturnChildren.Value); + } + + if (WantsReturnAdditionalPreviews.HasValue) + { + SteamUGC.Internal.SetReturnAdditionalPreviews(handle, WantsReturnAdditionalPreviews.Value); + } + + if (WantsReturnTotalOnly.HasValue) + { + SteamUGC.Internal.SetReturnTotalOnly(handle, WantsReturnTotalOnly.Value); + } + + if (WantsReturnPlaytimeStats.HasValue) + { + SteamUGC.Internal.SetReturnPlaytimeStats(handle, WantsReturnPlaytimeStats.Value); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/UgcResultPage.cs b/BoneSync/Facepunch.Steamworks/Structs/UgcResultPage.cs new file mode 100644 index 0000000..6650da3 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/UgcResultPage.cs @@ -0,0 +1,77 @@ +using System.Collections.Generic; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks.Ugc +{ + public struct ResultPage : System.IDisposable + { + internal UGCQueryHandle_t Handle; + + public int ResultCount; + public int TotalCount; + + public bool CachedData; + + public IEnumerable Entries + { + get + { + + var details = default( SteamUGCDetails_t ); + for ( uint i=0; i< ResultCount; i++ ) + { + if ( SteamUGC.Internal.GetQueryUGCResult( Handle, i, ref details ) ) + { + var item = Item.From( details ); + + item.NumSubscriptions = GetStat( i, ItemStatistic.NumSubscriptions ); + item.NumFavorites = GetStat( i, ItemStatistic.NumFavorites ); + item.NumFollowers = GetStat( i, ItemStatistic.NumFollowers ); + item.NumUniqueSubscriptions = GetStat( i, ItemStatistic.NumUniqueSubscriptions ); + item.NumUniqueFavorites = GetStat( i, ItemStatistic.NumUniqueFavorites ); + item.NumUniqueFollowers = GetStat( i, ItemStatistic.NumUniqueFollowers ); + item.NumUniqueWebsiteViews = GetStat( i, ItemStatistic.NumUniqueWebsiteViews ); + item.ReportScore = GetStat( i, ItemStatistic.ReportScore ); + item.NumSecondsPlayed = GetStat( i, ItemStatistic.NumSecondsPlayed ); + item.NumPlaytimeSessions = GetStat( i, ItemStatistic.NumPlaytimeSessions ); + item.NumComments = GetStat( i, ItemStatistic.NumComments ); + item.NumSecondsPlayedDuringTimePeriod = GetStat( i, ItemStatistic.NumSecondsPlayedDuringTimePeriod ); + item.NumPlaytimeSessionsDuringTimePeriod = GetStat( i, ItemStatistic.NumPlaytimeSessionsDuringTimePeriod ); + + if ( SteamUGC.Internal.GetQueryUGCPreviewURL( Handle, i, out string preview ) ) + { + item.PreviewImageUrl = preview; + } + + // TODO GetQueryUGCAdditionalPreview + // TODO GetQueryUGCChildren + // TODO GetQueryUGCKeyValueTag + // TODO GetQueryUGCMetadata + + + yield return item; + } + } + } + } + + private ulong GetStat( uint index, ItemStatistic stat ) + { + ulong val = 0; + + if ( !SteamUGC.Internal.GetQueryUGCStatistic( Handle, index, stat, ref val ) ) + return 0; + + return val; + } + + public void Dispose() + { + if ( Handle > 0 ) + { + SteamUGC.Internal.ReleaseQueryUGCRequest( Handle ); + Handle = 0; + } + } + } +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Structs/UserItemVote.cs b/BoneSync/Facepunch.Steamworks/Structs/UserItemVote.cs new file mode 100644 index 0000000..3e2431d --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Structs/UserItemVote.cs @@ -0,0 +1,21 @@ +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks.Ugc +{ + public struct UserItemVote + { + public bool VotedUp; + public bool VotedDown; + public bool VoteSkipped; + + internal static UserItemVote? From(GetUserItemVoteResult_t result) + { + return new UserItemVote + { + VotedUp = result.VotedUp, + VotedDown = result.VotedDown, + VoteSkipped = result.VoteSkipped + }; + } + } +} diff --git a/BoneSync/Facepunch.Steamworks/Utility/Epoch.cs b/BoneSync/Facepunch.Steamworks/Utility/Epoch.cs new file mode 100644 index 0000000..7f578b0 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Utility/Epoch.cs @@ -0,0 +1,24 @@ +using System; + +namespace Facepunch.Steamworks +{ + static internal class Epoch + { + private static readonly DateTime epoch = new DateTime( 1970, 1, 1, 0, 0, 0, DateTimeKind.Utc ); + + /// + /// Returns the current Unix Epoch + /// + public static int Current => (int)(DateTime.UtcNow.Subtract( epoch ).TotalSeconds); + + /// + /// Convert an epoch to a datetime + /// + public static DateTime ToDateTime( decimal unixTime ) => epoch.AddSeconds( (long)unixTime ); + + /// + /// Convert a DateTime to a unix time + /// + public static uint FromDateTime( DateTime dt ) => (uint)(dt.Subtract( epoch ).TotalSeconds); + } +} diff --git a/BoneSync/Facepunch.Steamworks/Utility/Helpers.cs b/BoneSync/Facepunch.Steamworks/Utility/Helpers.cs new file mode 100644 index 0000000..066ab76 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Utility/Helpers.cs @@ -0,0 +1,100 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Collections.Generic; + +namespace Facepunch.Steamworks +{ + internal static class Helpers + { + public const int MemoryBufferSize = 1024 * 32; + + [ThreadStatic] private static IntPtr[] MemoryPool; + [ThreadStatic] private static int MemoryPoolIndex; + + public static unsafe IntPtr TakeMemory() + { + if ( MemoryPool == null ) + { + // + // The pool has 4 items. This should be safe because we shouldn't really + // ever be using more than 2 memory pools + // + MemoryPool = new IntPtr[4]; + + for ( int i = 0; i < MemoryPool.Length; i++ ) + MemoryPool[i] = Marshal.AllocHGlobal( MemoryBufferSize ); + } + + MemoryPoolIndex++; + if ( MemoryPoolIndex >= MemoryPool.Length ) + MemoryPoolIndex = 0; + + var take = MemoryPool[MemoryPoolIndex]; + + ((byte*)take)[0] = 0; + + return take; + } + + + [ThreadStatic] private static byte[][] BufferPool; + [ThreadStatic] private static int BufferPoolIndex; + + /// + /// Returns a buffer. This will get returned and reused later on. + /// We shouldn't really be using this anymore. + /// + public static byte[] TakeBuffer( int minSize ) + { + if ( BufferPool == null ) + { + // + // The pool has 4 items. + // + BufferPool = new byte[4][]; + + for ( int i = 0; i < BufferPool.Length; i++ ) + BufferPool[i] = new byte[ 1024 * 128 ]; + } + + BufferPoolIndex++; + if ( BufferPoolIndex >= BufferPool.Length ) + BufferPoolIndex = 0; + + if ( BufferPool[BufferPoolIndex].Length < minSize ) + { + BufferPool[BufferPoolIndex] = new byte[minSize + 1024]; + } + + return BufferPool[BufferPoolIndex]; + } + + internal unsafe static string MemoryToString( IntPtr ptr ) + { + var len = 0; + + for( len = 0; len < MemoryBufferSize; len++ ) + { + if ( ((byte*)ptr)[len] == 0 ) + break; + } + + if ( len == 0 ) + return string.Empty; + + return UTF8Encoding.UTF8.GetString( (byte*)ptr, len ); + } + } + + internal class MonoPInvokeCallbackAttribute : Attribute + { + public MonoPInvokeCallbackAttribute() { } + } + + /// + /// Prevent unity from stripping shit we depend on + /// https://docs.unity3d.com/Manual/ManagedCodeStripping.html + /// + internal class PreserveAttribute : System.Attribute { } +} diff --git a/BoneSync/Facepunch.Steamworks/Utility/Platform.cs b/BoneSync/Facepunch.Steamworks/Utility/Platform.cs new file mode 100644 index 0000000..b5d3582 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Utility/Platform.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Runtime.InteropServices; +using System.Text; + +namespace Facepunch.Steamworks +{ + internal static class Platform + { +/*#if PLATFORM_WIN32 + public const int StructPlatformPackSize = 8; + public const string LibraryName = "steam_api"; +#elif PLATFORM_POSIX + public const int StructPlatformPackSize = 4; + public const string LibraryName = "libsteam_api"; +#else*/ + public const int StructPlatformPackSize = 8; + public const string LibraryName = "steam_api64"; +//#endif + + public const CallingConvention CC = CallingConvention.Cdecl; + public const int StructPackSize = 4; + } +} diff --git a/BoneSync/Facepunch.Steamworks/Utility/SourceServerQuery.cs b/BoneSync/Facepunch.Steamworks/Utility/SourceServerQuery.cs new file mode 100644 index 0000000..a9c1c10 --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Utility/SourceServerQuery.cs @@ -0,0 +1,177 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Net.Sockets; +using System.Threading.Tasks; +using Facepunch.Steamworks.Data; + +namespace Facepunch.Steamworks +{ + internal static class SourceServerQuery + { + private static readonly byte[] A2S_SERVERQUERY_GETCHALLENGE = { 0x55, 0xFF, 0xFF, 0xFF, 0xFF }; + // private static readonly byte A2S_PLAYER = 0x55; + private const byte A2S_RULES = 0x56; + + private static readonly Dictionary>> PendingQueries = + new Dictionary>>(); + + internal static Task> GetRules( ServerInfo server ) + { + var endpoint = new IPEndPoint(server.Address, server.QueryPort); + + lock (PendingQueries) + { + if (PendingQueries.TryGetValue(endpoint, out var pending)) + return pending; + + var task = GetRulesImpl( endpoint ) + .ContinueWith(t => + { + lock (PendingQueries) + { + PendingQueries.Remove(endpoint); + } + + return t; + }) + .Unwrap(); + + PendingQueries.Add(endpoint, task); + return task; + } + } + + private static async Task> GetRulesImpl( IPEndPoint endpoint ) + { + try + { + using (var client = new UdpClient()) + { + client.Client.SendTimeout = 3000; + client.Client.ReceiveTimeout = 3000; + client.Connect(endpoint); + + return await GetRules(client); + } + } + catch (System.Exception) + { + //Console.Error.WriteLine( e.Message ); + return null; + } + } + + static async Task> GetRules( UdpClient client ) + { + var challengeBytes = await GetChallengeData( client ); + challengeBytes[0] = A2S_RULES; + await Send( client, challengeBytes ); + var ruleData = await Receive( client ); + + var rules = new Dictionary(); + + using ( var br = new BinaryReader( new MemoryStream( ruleData ) ) ) + { + if ( br.ReadByte() != 0x45 ) + throw new Exception( "Invalid data received in response to A2S_RULES request" ); + + var numRules = br.ReadUInt16(); + for ( int index = 0; index < numRules; index++ ) + { + rules.Add( br.ReadNullTerminatedUTF8String(), br.ReadNullTerminatedUTF8String() ); + } + } + + return rules; + } + + + + static async Task Receive( UdpClient client ) + { + byte[][] packets = null; + byte packetNumber = 0, packetCount = 1; + + do + { + var result = await client.ReceiveAsync(); + var buffer = result.Buffer; + + using ( var br = new BinaryReader( new MemoryStream( buffer ) ) ) + { + var header = br.ReadInt32(); + + if ( header == -1 ) + { + var unsplitdata = new byte[buffer.Length - br.BaseStream.Position]; + Buffer.BlockCopy( buffer, (int)br.BaseStream.Position, unsplitdata, 0, unsplitdata.Length ); + return unsplitdata; + } + else if ( header == -2 ) + { + int requestId = br.ReadInt32(); + packetNumber = br.ReadByte(); + packetCount = br.ReadByte(); + int splitSize = br.ReadInt32(); + } + else + { + throw new System.Exception( "Invalid Header" ); + } + + if ( packets == null ) packets = new byte[packetCount][]; + + var data = new byte[buffer.Length - br.BaseStream.Position]; + Buffer.BlockCopy( buffer, (int)br.BaseStream.Position, data, 0, data.Length ); + packets[packetNumber] = data; + } + } + while ( packets.Any( p => p == null ) ); + + var combinedData = Combine( packets ); + return combinedData; + } + + private static async Task GetChallengeData( UdpClient client ) + { + await Send( client, A2S_SERVERQUERY_GETCHALLENGE ); + + var challengeData = await Receive( client ); + + if ( challengeData[0] != 0x41 ) + throw new Exception( "Invalid Challenge" ); + + return challengeData; + } + + static async Task Send( UdpClient client, byte[] message ) + { + var sendBuffer = new byte[message.Length + 4]; + + sendBuffer[0] = 0xFF; + sendBuffer[1] = 0xFF; + sendBuffer[2] = 0xFF; + sendBuffer[3] = 0xFF; + + Buffer.BlockCopy( message, 0, sendBuffer, 4, message.Length ); + + await client.SendAsync( sendBuffer, message.Length + 4 ); + } + + static byte[] Combine( byte[][] arrays ) + { + var rv = new byte[arrays.Sum( a => a.Length )]; + int offset = 0; + foreach ( byte[] array in arrays ) + { + Buffer.BlockCopy( array, 0, rv, offset, array.Length ); + offset += array.Length; + } + return rv; + } + }; + +} diff --git a/BoneSync/Facepunch.Steamworks/Utility/SteamInterface.cs b/BoneSync/Facepunch.Steamworks/Utility/SteamInterface.cs new file mode 100644 index 0000000..5f6cb5e --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Utility/SteamInterface.cs @@ -0,0 +1,146 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Net.Sockets; +using System.Runtime.InteropServices; +using System.Text; + +namespace Facepunch.Steamworks +{ + internal abstract class SteamInterface + { + public virtual IntPtr GetUserInterfacePointer() => IntPtr.Zero; + public virtual IntPtr GetServerInterfacePointer() => IntPtr.Zero; + public virtual IntPtr GetGlobalInterfacePointer() => IntPtr.Zero; + + public IntPtr Self; + public IntPtr SelfGlobal; + public IntPtr SelfServer; + public IntPtr SelfClient; + + public bool IsValid => Self != IntPtr.Zero; + public bool IsServer { get; private set; } + + internal void SetupInterface( bool gameServer ) + { + if ( Self != IntPtr.Zero ) + return; + + IsServer = gameServer; + SelfGlobal = GetGlobalInterfacePointer(); + Self = SelfGlobal; + + if ( Self != IntPtr.Zero ) + return; + + if ( gameServer ) + { + SelfServer = GetServerInterfacePointer(); + Self = SelfServer; + } + else + { + SelfClient = GetUserInterfacePointer(); + Self = SelfClient; + } + } + + internal void ShutdownInterface() + { + Self = IntPtr.Zero; + } + } + + public abstract class SteamClass + { + internal abstract void InitializeInterface( bool server ); + internal abstract void DestroyInterface( bool server ); + } + + public class SteamSharedClass : SteamClass + { + internal static SteamInterface Interface => InterfaceClient ?? InterfaceServer; + internal static SteamInterface InterfaceClient; + internal static SteamInterface InterfaceServer; + + internal override void InitializeInterface( bool server ) + { + + } + + internal virtual void SetInterface( bool server, SteamInterface iface ) + { + if ( server ) + { + InterfaceServer = iface; + } + + if ( !server ) + { + InterfaceClient = iface; + } + } + + internal override void DestroyInterface( bool server ) + { + if ( !server ) + { + InterfaceClient = null; + } + + if ( server ) + { + InterfaceServer = null; + } + } + } + + public class SteamClientClass : SteamClass + { + internal static SteamInterface Interface; + + internal override void InitializeInterface( bool server ) + { + + } + + internal virtual void SetInterface( bool server, SteamInterface iface ) + { + if ( server ) + throw new System.NotSupportedException(); + + Interface = iface; + } + + internal override void DestroyInterface( bool server ) + { + Interface = null; + } + } + + public class SteamServerClass : SteamClass + { + internal static SteamInterface Interface; + + internal override void InitializeInterface( bool server ) + { + + } + + internal virtual void SetInterface( bool server, SteamInterface iface ) + { + if ( !server ) + throw new System.NotSupportedException(); + + Interface = iface; + } + + internal override void DestroyInterface( bool server ) + { + Interface = null; + } + } + +} \ No newline at end of file diff --git a/BoneSync/Facepunch.Steamworks/Utility/Utf8String.cs b/BoneSync/Facepunch.Steamworks/Utility/Utf8String.cs new file mode 100644 index 0000000..3a5d7bb --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Utility/Utf8String.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Runtime.InteropServices; +using System.Text; + +namespace Facepunch.Steamworks +{ + internal unsafe class Utf8StringToNative : ICustomMarshaler + { + public IntPtr MarshalManagedToNative(object managedObj) + { + if ( managedObj == null ) + return IntPtr.Zero; + + if ( managedObj is string str ) + { + fixed ( char* strPtr = str ) + { + int len = Encoding.UTF8.GetByteCount( str ); + var mem = Marshal.AllocHGlobal( len + 1 ); + + var wlen = System.Text.Encoding.UTF8.GetBytes( strPtr, str.Length, (byte*)mem, len + 1 ); + + ( (byte*)mem )[wlen] = 0; + + return mem; + } + } + + return IntPtr.Zero; + } + + public object MarshalNativeToManaged(IntPtr pNativeData) => throw new System.NotImplementedException(); + public void CleanUpNativeData(IntPtr pNativeData) => Marshal.FreeHGlobal( pNativeData ); + public void CleanUpManagedData(object managedObj) => throw new System.NotImplementedException(); + public int GetNativeDataSize() => -1; + + [Preserve] + public static ICustomMarshaler GetInstance(string cookie) => new Utf8StringToNative(); + } + + internal struct Utf8StringPointer + { +#pragma warning disable 649 + internal IntPtr ptr; +#pragma warning restore 649 + + public unsafe static implicit operator string( Utf8StringPointer p ) + { + if ( p.ptr == IntPtr.Zero ) + return null; + + var bytes = (byte*)p.ptr; + + var dataLen = 0; + while ( dataLen < 1024 * 1024 * 64 ) + { + if ( bytes[dataLen] == 0 ) + break; + + dataLen++; + } + + return Encoding.UTF8.GetString( bytes, dataLen ); + } + } +} diff --git a/BoneSync/Facepunch.Steamworks/Utility/Utility.cs b/BoneSync/Facepunch.Steamworks/Utility/Utility.cs new file mode 100644 index 0000000..27aed5a --- /dev/null +++ b/BoneSync/Facepunch.Steamworks/Utility/Utility.cs @@ -0,0 +1,118 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Runtime.InteropServices; +using System.Text; + +namespace Facepunch.Steamworks +{ + public static partial class Utility + { + static internal T ToType( this IntPtr ptr ) + { + if ( ptr == IntPtr.Zero ) + return default; + + return (T)Marshal.PtrToStructure( ptr, typeof( T ) ); + } + + static internal object ToType( this IntPtr ptr, System.Type t ) + { + if ( ptr == IntPtr.Zero ) + return default; + + return Marshal.PtrToStructure( ptr, t ); + } + + static internal uint Swap( uint x ) + { + return ((x & 0x000000ff) << 24) + + ((x & 0x0000ff00) << 8) + + ((x & 0x00ff0000) >> 8) + + ((x & 0xff000000) >> 24); + } + + static public uint IpToInt32( this IPAddress ipAddress ) + { + return Swap( (uint) ipAddress.Address ); + } + + static public IPAddress Int32ToIp( uint ipAddress ) + { + return new IPAddress( Swap( ipAddress ) ); + } + + public static string FormatPrice(string currency, double price) + { + var decimaled = price.ToString("0.00"); + + switch (currency) + { + case "AED": return $"{decimaled}د.إ"; + case "ARS": return $"${decimaled} ARS"; + case "AUD": return $"A${decimaled}"; + case "BRL": return $"R${decimaled}"; + case "CAD": return $"C${decimaled}"; + case "CHF": return $"Fr. {decimaled}"; + case "CLP": return $"${decimaled} CLP"; + case "CNY": return $"{decimaled}元"; + case "COP": return $"COL$ {decimaled}"; + case "CRC": return $"₡{decimaled}"; + case "EUR": return $"€{decimaled}"; + case "SEK": return $"{decimaled}kr"; + case "GBP": return $"£{decimaled}"; + case "HKD": return $"HK${decimaled}"; + case "ILS": return $"₪{decimaled}"; + case "IDR": return $"Rp{decimaled}"; + case "INR": return $"₹{decimaled}"; + case "JPY": return $"¥{decimaled}"; + case "KRW": return $"₩{decimaled}"; + case "KWD": return $"KD {decimaled}"; + case "KZT": return $"{decimaled}₸"; + case "MXN": return $"Mex${decimaled}"; + case "MYR": return $"RM {decimaled}"; + case "NOK": return $"{decimaled} kr"; + case "NZD": return $"${decimaled} NZD"; + case "PEN": return $"S/. {decimaled}"; + case "PHP": return $"₱{decimaled}"; + case "PLN": return $"{decimaled}zł"; + case "QAR": return $"QR {decimaled}"; + case "RUB": return $"{decimaled}₽"; + case "SAR": return $"SR {decimaled}"; + case "SGD": return $"S${decimaled}"; + case "THB": return $"฿{decimaled}"; + case "TRY": return $"₺{decimaled}"; + case "TWD": return $"NT$ {decimaled}"; + case "UAH": return $"₴{decimaled}"; + case "USD": return $"${decimaled}"; + case "UYU": return $"$U {decimaled}"; // yes the U goes after $ + case "VND": return $"₫{decimaled}"; + case "ZAR": return $"R {decimaled}"; + + // TODO - check all of them https://partner.steamgames.com/doc/store/pricing/currencies + + default: return $"{decimaled} {currency}"; + } + } + + static readonly byte[] readBuffer = new byte[1024 * 8]; + + public static string ReadNullTerminatedUTF8String( this BinaryReader br ) + { + lock ( readBuffer ) + { + byte chr; + int i = 0; + while ( (chr = br.ReadByte()) != 0 && i < readBuffer.Length ) + { + readBuffer[i] = chr; + i++; + } + + return Encoding.UTF8.GetString( readBuffer, 0, i ); + } + } + } +} diff --git a/BoneSync/Facepunch.Steamworks/steam_api.dll b/BoneSync/Facepunch.Steamworks/steam_api.dll new file mode 100644 index 0000000..6e0f440 Binary files /dev/null and b/BoneSync/Facepunch.Steamworks/steam_api.dll differ diff --git a/BoneSync/Facepunch.Steamworks/steam_api64.dll b/BoneSync/Facepunch.Steamworks/steam_api64.dll new file mode 100644 index 0000000..ad13f2b Binary files /dev/null and b/BoneSync/Facepunch.Steamworks/steam_api64.dll differ diff --git a/BoneSync/MelonLoaderMod.cs b/BoneSync/MelonLoaderMod.cs index ae34664..a9d6998 100644 --- a/BoneSync/MelonLoaderMod.cs +++ b/BoneSync/MelonLoaderMod.cs @@ -1,4 +1,5 @@ -using MelonLoader; +using BoneSync.Networking; +using MelonLoader; namespace BoneSync { @@ -16,6 +17,7 @@ namespace BoneSync public override void OnApplicationStart() { MelonLogger.Msg("OnApplicationStart"); + LobbyManager.Initialize(); // Initialize the LobbyManager } public override void OnSceneWasLoaded(int buildIndex, string sceneName) diff --git a/BoneSync/Networking/LobbyManager.cs b/BoneSync/Networking/LobbyManager.cs new file mode 100644 index 0000000..80674a9 --- /dev/null +++ b/BoneSync/Networking/LobbyManager.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Facepunch.Steamworks; +using Facepunch.Steamworks.ServerList; +using Facepunch.Steamworks.Data; + +namespace BoneSync.Networking +{ + internal static class LobbyManager + { + static Lobby lobby; + public static void CreateLobby() + { + _ = SteamMatchmaking.CreateLobbyAsync(10); + } + + private static void OnLobbyCreated(Result result, Lobby createdLobby) + { + if (result != Result.OK) + { + Console.WriteLine("Failed to create lobby: " + result); + return; + } + Console.WriteLine("Lobby created: " + createdLobby.Id); + lobby = createdLobby; + } + + + + public static void Initialize() + { + SteamMatchmaking.OnLobbyCreated += OnLobbyCreated; + } + } +}