mirror of
https://github.com/electronicarts/CnC_Remastered_Collection.git
synced 2026-07-03 00:33:15 -04:00
C&C Remastered Map Editor
Initial commit of C&C Remastered Map Editor code
This commit is contained in:
@@ -0,0 +1,420 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
#if UNITY_3_5 || UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6
|
||||
#error Unsupported Unity platform. Steamworks.NET requires Unity 4.7 or higher.
|
||||
#elif UNITY_4_7 || UNITY_5 || UNITY_2017 || UNITY_2017_1_OR_NEWER
|
||||
#if UNITY_EDITOR_WIN || (UNITY_STANDALONE_WIN && !UNITY_EDITOR)
|
||||
#define WINDOWS_BUILD
|
||||
#endif
|
||||
#elif STEAMWORKS_WIN
|
||||
#define WINDOWS_BUILD
|
||||
#elif STEAMWORKS_LIN_OSX
|
||||
// So that we don't enter the else block below.
|
||||
#else
|
||||
#error You need to define STEAMWORKS_WIN, or STEAMWORKS_LIN_OSX. Refer to the readme for more details.
|
||||
#endif
|
||||
|
||||
// Unity 32bit Mono on Windows crashes with ThisCall/Cdecl for some reason, StdCall without the 'this' ptr is the only thing that works..?
|
||||
#if (UNITY_EDITOR_WIN && !UNITY_EDITOR_64) || (!UNITY_EDITOR && UNITY_STANDALONE_WIN && !UNITY_64)
|
||||
#define STDCALL
|
||||
#elif STEAMWORKS_WIN
|
||||
#define THISCALL
|
||||
#endif
|
||||
|
||||
// Calling Conventions:
|
||||
// Unity x86 Windows - StdCall (No this pointer)
|
||||
// Unity x86 Linux - Cdecl
|
||||
// Unity x86 OSX - Cdecl
|
||||
// Unity x64 Windows - Cdecl
|
||||
// Unity x64 Linux - Cdecl
|
||||
// Unity x64 OSX - Cdecl
|
||||
// Microsoft x86 Windows - ThisCall
|
||||
// Microsoft x64 Windows - ThisCall
|
||||
// Mono x86 Linux - Cdecl
|
||||
// Mono x86 OSX - Cdecl
|
||||
// Mono x64 Linux - Cdecl
|
||||
// Mono x64 OSX - Cdecl
|
||||
// Mono on Windows is probably not supported.
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class CallbackDispatcher {
|
||||
// We catch exceptions inside callbacks and reroute them here.
|
||||
// For some reason throwing an exception causes RunCallbacks() to break otherwise.
|
||||
// If you have a custom ExceptionHandler in your engine you can register it here manually until we get something more elegant hooked up.
|
||||
public static void ExceptionHandler(Exception e) {
|
||||
#if UNITY_STANDALONE
|
||||
UnityEngine.Debug.LogException(e);
|
||||
#elif STEAMWORKS_WIN || STEAMWORKS_LIN_OSX
|
||||
Console.WriteLine(e.Message);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class Callback<T> : IDisposable {
|
||||
private CCallbackBaseVTable m_CallbackBaseVTable;
|
||||
private IntPtr m_pVTable = IntPtr.Zero;
|
||||
private CCallbackBase m_CCallbackBase;
|
||||
private GCHandle m_pCCallbackBase;
|
||||
|
||||
public delegate void DispatchDelegate(T param);
|
||||
private event DispatchDelegate m_Func;
|
||||
|
||||
private bool m_bGameServer;
|
||||
private readonly int m_size = Marshal.SizeOf(typeof(T));
|
||||
|
||||
private bool m_bDisposed = false;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new Callback. You must be calling SteamAPI.RunCallbacks() to retrieve the callbacks.
|
||||
/// <para>Returns a handle to the Callback.</para>
|
||||
/// <para>This MUST be assigned to a member variable to prevent the GC from cleaning it up.</para>
|
||||
/// </summary>
|
||||
public static Callback<T> Create(DispatchDelegate func) {
|
||||
return new Callback<T>(func, bGameServer: false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new GameServer Callback. You must be calling GameServer.RunCallbacks() to retrieve the callbacks.
|
||||
/// <para>Returns a handle to the Callback.</para>
|
||||
/// <para>This MUST be assigned to a member variable to prevent the GC from cleaning it up.</para>
|
||||
/// </summary>
|
||||
public static Callback<T> CreateGameServer(DispatchDelegate func) {
|
||||
return new Callback<T>(func, bGameServer: true);
|
||||
}
|
||||
|
||||
public Callback(DispatchDelegate func, bool bGameServer = false) {
|
||||
m_bGameServer = bGameServer;
|
||||
BuildCCallbackBase();
|
||||
Register(func);
|
||||
}
|
||||
|
||||
~Callback() {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public void Dispose() {
|
||||
if (m_bDisposed) {
|
||||
return;
|
||||
}
|
||||
|
||||
GC.SuppressFinalize(this);
|
||||
|
||||
Unregister();
|
||||
|
||||
if (m_pVTable != IntPtr.Zero) {
|
||||
Marshal.FreeHGlobal(m_pVTable);
|
||||
}
|
||||
|
||||
if (m_pCCallbackBase.IsAllocated) {
|
||||
m_pCCallbackBase.Free();
|
||||
}
|
||||
|
||||
m_bDisposed = true;
|
||||
}
|
||||
|
||||
// Manual registration of the callback
|
||||
public void Register(DispatchDelegate func) {
|
||||
if (func == null) {
|
||||
throw new Exception("Callback function must not be null.");
|
||||
}
|
||||
|
||||
if ((m_CCallbackBase.m_nCallbackFlags & CCallbackBase.k_ECallbackFlagsRegistered) == CCallbackBase.k_ECallbackFlagsRegistered) {
|
||||
Unregister();
|
||||
}
|
||||
|
||||
if (m_bGameServer) {
|
||||
SetGameserverFlag();
|
||||
}
|
||||
|
||||
m_Func = func;
|
||||
|
||||
// k_ECallbackFlagsRegistered is set by SteamAPI_RegisterCallback.
|
||||
NativeMethods.SteamAPI_RegisterCallback(m_pCCallbackBase.AddrOfPinnedObject(), CallbackIdentities.GetCallbackIdentity(typeof(T)));
|
||||
}
|
||||
|
||||
public void Unregister() {
|
||||
// k_ECallbackFlagsRegistered is removed by SteamAPI_UnregisterCallback.
|
||||
NativeMethods.SteamAPI_UnregisterCallback(m_pCCallbackBase.AddrOfPinnedObject());
|
||||
}
|
||||
|
||||
public void SetGameserverFlag() {
|
||||
m_CCallbackBase.m_nCallbackFlags |= CCallbackBase.k_ECallbackFlagsGameServer;
|
||||
}
|
||||
|
||||
private void OnRunCallback(
|
||||
#if !STDCALL
|
||||
IntPtr thisptr,
|
||||
#endif
|
||||
IntPtr pvParam) {
|
||||
try {
|
||||
m_Func((T)Marshal.PtrToStructure(pvParam, typeof(T)));
|
||||
}
|
||||
catch (Exception e) {
|
||||
CallbackDispatcher.ExceptionHandler(e);
|
||||
}
|
||||
}
|
||||
|
||||
// Shouldn't ever get called here, but this is what C++ Steamworks does!
|
||||
private void OnRunCallResult(
|
||||
#if !STDCALL
|
||||
IntPtr thisptr,
|
||||
#endif
|
||||
IntPtr pvParam, bool bFailed, ulong hSteamAPICall) {
|
||||
try {
|
||||
m_Func((T)Marshal.PtrToStructure(pvParam, typeof(T)));
|
||||
}
|
||||
catch (Exception e) {
|
||||
CallbackDispatcher.ExceptionHandler(e);
|
||||
}
|
||||
}
|
||||
|
||||
private int OnGetCallbackSizeBytes(
|
||||
#if !STDCALL
|
||||
IntPtr thisptr
|
||||
#endif
|
||||
) {
|
||||
return m_size;
|
||||
}
|
||||
|
||||
// Steamworks.NET Specific
|
||||
private void BuildCCallbackBase() {
|
||||
m_CallbackBaseVTable = new CCallbackBaseVTable() {
|
||||
m_RunCallResult = OnRunCallResult,
|
||||
m_RunCallback = OnRunCallback,
|
||||
m_GetCallbackSizeBytes = OnGetCallbackSizeBytes
|
||||
};
|
||||
m_pVTable = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(CCallbackBaseVTable)));
|
||||
Marshal.StructureToPtr(m_CallbackBaseVTable, m_pVTable, false);
|
||||
|
||||
m_CCallbackBase = new CCallbackBase() {
|
||||
m_vfptr = m_pVTable,
|
||||
m_nCallbackFlags = 0,
|
||||
m_iCallback = CallbackIdentities.GetCallbackIdentity(typeof(T))
|
||||
};
|
||||
m_pCCallbackBase = GCHandle.Alloc(m_CCallbackBase, GCHandleType.Pinned);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class CallResult<T> : IDisposable {
|
||||
private CCallbackBaseVTable m_CallbackBaseVTable;
|
||||
private IntPtr m_pVTable = IntPtr.Zero;
|
||||
private CCallbackBase m_CCallbackBase;
|
||||
private GCHandle m_pCCallbackBase;
|
||||
|
||||
public delegate void APIDispatchDelegate(T param, bool bIOFailure);
|
||||
private event APIDispatchDelegate m_Func;
|
||||
|
||||
private SteamAPICall_t m_hAPICall = SteamAPICall_t.Invalid;
|
||||
public SteamAPICall_t Handle { get { return m_hAPICall; } }
|
||||
|
||||
private readonly int m_size = Marshal.SizeOf(typeof(T));
|
||||
|
||||
private bool m_bDisposed = false;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new async CallResult. You must be calling SteamAPI.RunCallbacks() to retrieve the callback.
|
||||
/// <para>Returns a handle to the CallResult.</para>
|
||||
/// <para>This MUST be assigned to a member variable to prevent the GC from cleaning it up.</para>
|
||||
/// </summary>
|
||||
public static CallResult<T> Create(APIDispatchDelegate func = null) {
|
||||
return new CallResult<T>(func);
|
||||
}
|
||||
|
||||
public CallResult(APIDispatchDelegate func = null) {
|
||||
m_Func = func;
|
||||
BuildCCallbackBase();
|
||||
}
|
||||
|
||||
~CallResult() {
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public void Dispose() {
|
||||
if (m_bDisposed) {
|
||||
return;
|
||||
}
|
||||
|
||||
GC.SuppressFinalize(this);
|
||||
|
||||
Cancel();
|
||||
|
||||
if (m_pVTable != IntPtr.Zero) {
|
||||
Marshal.FreeHGlobal(m_pVTable);
|
||||
}
|
||||
|
||||
if (m_pCCallbackBase.IsAllocated) {
|
||||
m_pCCallbackBase.Free();
|
||||
}
|
||||
|
||||
m_bDisposed = true;
|
||||
}
|
||||
|
||||
public void Set(SteamAPICall_t hAPICall, APIDispatchDelegate func = null) {
|
||||
// Unlike the official SDK we let the user assign a single function during creation,
|
||||
// and allow them to skip having to do so every time that they call .Set()
|
||||
if (func != null) {
|
||||
m_Func = func;
|
||||
}
|
||||
|
||||
if (m_Func == null) {
|
||||
throw new Exception("CallResult function was null, you must either set it in the CallResult Constructor or via Set()");
|
||||
}
|
||||
|
||||
if (m_hAPICall != SteamAPICall_t.Invalid) {
|
||||
NativeMethods.SteamAPI_UnregisterCallResult(m_pCCallbackBase.AddrOfPinnedObject(), (ulong)m_hAPICall);
|
||||
}
|
||||
|
||||
m_hAPICall = hAPICall;
|
||||
|
||||
if (hAPICall != SteamAPICall_t.Invalid) {
|
||||
NativeMethods.SteamAPI_RegisterCallResult(m_pCCallbackBase.AddrOfPinnedObject(), (ulong)hAPICall);
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsActive() {
|
||||
return (m_hAPICall != SteamAPICall_t.Invalid);
|
||||
}
|
||||
|
||||
public void Cancel() {
|
||||
if (m_hAPICall != SteamAPICall_t.Invalid) {
|
||||
NativeMethods.SteamAPI_UnregisterCallResult(m_pCCallbackBase.AddrOfPinnedObject(), (ulong)m_hAPICall);
|
||||
m_hAPICall = SteamAPICall_t.Invalid;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetGameserverFlag() {
|
||||
m_CCallbackBase.m_nCallbackFlags |= CCallbackBase.k_ECallbackFlagsGameServer;
|
||||
}
|
||||
|
||||
// Shouldn't ever get called here, but this is what C++ Steamworks does!
|
||||
private void OnRunCallback(
|
||||
#if !STDCALL
|
||||
IntPtr thisptr,
|
||||
#endif
|
||||
IntPtr pvParam) {
|
||||
m_hAPICall = SteamAPICall_t.Invalid; // Caller unregisters for us
|
||||
|
||||
try {
|
||||
m_Func((T)Marshal.PtrToStructure(pvParam, typeof(T)), false);
|
||||
}
|
||||
catch (Exception e) {
|
||||
CallbackDispatcher.ExceptionHandler(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnRunCallResult(
|
||||
#if !STDCALL
|
||||
IntPtr thisptr,
|
||||
#endif
|
||||
IntPtr pvParam, bool bFailed, ulong hSteamAPICall_) {
|
||||
SteamAPICall_t hSteamAPICall = (SteamAPICall_t)hSteamAPICall_;
|
||||
if (hSteamAPICall == m_hAPICall) {
|
||||
m_hAPICall = SteamAPICall_t.Invalid; // Caller unregisters for us
|
||||
|
||||
try {
|
||||
m_Func((T)Marshal.PtrToStructure(pvParam, typeof(T)), bFailed);
|
||||
}
|
||||
catch (Exception e) {
|
||||
CallbackDispatcher.ExceptionHandler(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int OnGetCallbackSizeBytes(
|
||||
#if !STDCALL
|
||||
IntPtr thisptr
|
||||
#endif
|
||||
) {
|
||||
return m_size;
|
||||
}
|
||||
|
||||
// Steamworks.NET Specific
|
||||
private void BuildCCallbackBase() {
|
||||
m_CallbackBaseVTable = new CCallbackBaseVTable() {
|
||||
m_RunCallback = OnRunCallback,
|
||||
m_RunCallResult = OnRunCallResult,
|
||||
m_GetCallbackSizeBytes = OnGetCallbackSizeBytes
|
||||
};
|
||||
m_pVTable = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(CCallbackBaseVTable)));
|
||||
Marshal.StructureToPtr(m_CallbackBaseVTable, m_pVTable, false);
|
||||
|
||||
m_CCallbackBase = new CCallbackBase() {
|
||||
m_vfptr = m_pVTable,
|
||||
m_nCallbackFlags = 0,
|
||||
m_iCallback = CallbackIdentities.GetCallbackIdentity(typeof(T))
|
||||
};
|
||||
m_pCCallbackBase = GCHandle.Alloc(m_CCallbackBase, GCHandleType.Pinned);
|
||||
}
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal class CCallbackBase {
|
||||
public const byte k_ECallbackFlagsRegistered = 0x01;
|
||||
public const byte k_ECallbackFlagsGameServer = 0x02;
|
||||
|
||||
public IntPtr m_vfptr;
|
||||
public byte m_nCallbackFlags;
|
||||
public int m_iCallback;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal class CCallbackBaseVTable {
|
||||
#if STDCALL
|
||||
private const CallingConvention cc = CallingConvention.StdCall;
|
||||
|
||||
[UnmanagedFunctionPointer(cc)]
|
||||
public delegate void RunCBDel(IntPtr pvParam);
|
||||
[UnmanagedFunctionPointer(cc)]
|
||||
public delegate void RunCRDel(IntPtr pvParam, [MarshalAs(UnmanagedType.I1)] bool bIOFailure, ulong hSteamAPICall);
|
||||
[UnmanagedFunctionPointer(cc)]
|
||||
public delegate int GetCallbackSizeBytesDel();
|
||||
#else
|
||||
#if THISCALL
|
||||
private const CallingConvention cc = CallingConvention.ThisCall;
|
||||
#else
|
||||
private const CallingConvention cc = CallingConvention.Cdecl;
|
||||
#endif
|
||||
|
||||
[UnmanagedFunctionPointer(cc)]
|
||||
public delegate void RunCBDel(IntPtr thisptr, IntPtr pvParam);
|
||||
[UnmanagedFunctionPointer(cc)]
|
||||
public delegate void RunCRDel(IntPtr thisptr, IntPtr pvParam, [MarshalAs(UnmanagedType.I1)] bool bIOFailure, ulong hSteamAPICall);
|
||||
[UnmanagedFunctionPointer(cc)]
|
||||
public delegate int GetCallbackSizeBytesDel(IntPtr thisptr);
|
||||
#endif
|
||||
|
||||
// RunCallback and RunCallResult are swapped in MSVC ABI
|
||||
#if WINDOWS_BUILD
|
||||
[NonSerialized]
|
||||
[MarshalAs(UnmanagedType.FunctionPtr)]
|
||||
public RunCRDel m_RunCallResult;
|
||||
#endif
|
||||
[NonSerialized]
|
||||
[MarshalAs(UnmanagedType.FunctionPtr)]
|
||||
public RunCBDel m_RunCallback;
|
||||
#if !WINDOWS_BUILD
|
||||
[NonSerialized]
|
||||
[MarshalAs(UnmanagedType.FunctionPtr)]
|
||||
public RunCRDel m_RunCallResult;
|
||||
#endif
|
||||
[NonSerialized]
|
||||
[MarshalAs(UnmanagedType.FunctionPtr)]
|
||||
public GetCallbackSizeBytesDel m_GetCallbackSizeBytes;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,35 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
namespace Steamworks {
|
||||
class CallbackIdentities {
|
||||
public static int GetCallbackIdentity(System.Type callbackStruct) {
|
||||
#if UNITY_EDITOR || UNITY_STANDALONE || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX
|
||||
foreach (CallbackIdentityAttribute attribute in callbackStruct.GetCustomAttributes(typeof(CallbackIdentityAttribute), false)) {
|
||||
return attribute.Identity;
|
||||
}
|
||||
#endif
|
||||
throw new System.Exception("Callback number not found for struct " + callbackStruct);
|
||||
}
|
||||
}
|
||||
|
||||
[System.AttributeUsage(System.AttributeTargets.Struct, AllowMultiple = false)]
|
||||
internal class CallbackIdentityAttribute : System.Attribute {
|
||||
public int Identity { get; set; }
|
||||
public CallbackIdentityAttribute(int callbackNum) {
|
||||
Identity = callbackNum;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,448 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
// Unity 32bit Mono on Windows crashes with ThisCall for some reason, StdCall without the 'this' ptr is the only thing that works..?
|
||||
#if (UNITY_EDITOR_WIN && !UNITY_EDITOR_64) || (!UNITY_EDITOR && UNITY_STANDALONE_WIN && !UNITY_64)
|
||||
#define NOTHISPTR
|
||||
#endif
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Steamworks {
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after a server list refresh
|
||||
// or an individual server update.
|
||||
//
|
||||
// Since you get these callbacks after requesting full list refreshes you will
|
||||
// usually implement this interface inside an object like CServerBrowser. If that
|
||||
// object is getting destructed you should use ISteamMatchMakingServers()->CancelQuery()
|
||||
// to cancel any in-progress queries so you don't get a callback into the destructed
|
||||
// object and crash.
|
||||
//-----------------------------------------------------------------------------
|
||||
public class ISteamMatchmakingServerListResponse {
|
||||
// Server has responded ok with updated data
|
||||
public delegate void ServerResponded(HServerListRequest hRequest, int iServer);
|
||||
// Server has failed to respond
|
||||
public delegate void ServerFailedToRespond(HServerListRequest hRequest, int iServer);
|
||||
// A list refresh you had initiated is now 100% completed
|
||||
public delegate void RefreshComplete(HServerListRequest hRequest, EMatchMakingServerResponse response);
|
||||
|
||||
private VTable m_VTable;
|
||||
private IntPtr m_pVTable;
|
||||
private GCHandle m_pGCHandle;
|
||||
private ServerResponded m_ServerResponded;
|
||||
private ServerFailedToRespond m_ServerFailedToRespond;
|
||||
private RefreshComplete m_RefreshComplete;
|
||||
|
||||
public ISteamMatchmakingServerListResponse(ServerResponded onServerResponded, ServerFailedToRespond onServerFailedToRespond, RefreshComplete onRefreshComplete) {
|
||||
if (onServerResponded == null || onServerFailedToRespond == null || onRefreshComplete == null) {
|
||||
throw new ArgumentNullException();
|
||||
}
|
||||
m_ServerResponded = onServerResponded;
|
||||
m_ServerFailedToRespond = onServerFailedToRespond;
|
||||
m_RefreshComplete = onRefreshComplete;
|
||||
|
||||
m_VTable = new VTable() {
|
||||
m_VTServerResponded = InternalOnServerResponded,
|
||||
m_VTServerFailedToRespond = InternalOnServerFailedToRespond,
|
||||
m_VTRefreshComplete = InternalOnRefreshComplete
|
||||
};
|
||||
m_pVTable = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(VTable)));
|
||||
Marshal.StructureToPtr(m_VTable, m_pVTable, false);
|
||||
|
||||
m_pGCHandle = GCHandle.Alloc(m_pVTable, GCHandleType.Pinned);
|
||||
}
|
||||
|
||||
~ISteamMatchmakingServerListResponse() {
|
||||
if (m_pVTable != IntPtr.Zero) {
|
||||
Marshal.FreeHGlobal(m_pVTable);
|
||||
}
|
||||
|
||||
if (m_pGCHandle.IsAllocated) {
|
||||
m_pGCHandle.Free();
|
||||
}
|
||||
}
|
||||
|
||||
#if NOTHISPTR
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate void InternalServerResponded(HServerListRequest hRequest, int iServer);
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate void InternalServerFailedToRespond(HServerListRequest hRequest, int iServer);
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate void InternalRefreshComplete(HServerListRequest hRequest, EMatchMakingServerResponse response);
|
||||
private void InternalOnServerResponded(HServerListRequest hRequest, int iServer) {
|
||||
m_ServerResponded(hRequest, iServer);
|
||||
}
|
||||
private void InternalOnServerFailedToRespond(HServerListRequest hRequest, int iServer) {
|
||||
m_ServerFailedToRespond(hRequest, iServer);
|
||||
}
|
||||
private void InternalOnRefreshComplete(HServerListRequest hRequest, EMatchMakingServerResponse response) {
|
||||
m_RefreshComplete(hRequest, response);
|
||||
}
|
||||
#else
|
||||
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
|
||||
private delegate void InternalServerResponded(IntPtr thisptr, HServerListRequest hRequest, int iServer);
|
||||
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
|
||||
private delegate void InternalServerFailedToRespond(IntPtr thisptr, HServerListRequest hRequest, int iServer);
|
||||
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
|
||||
private delegate void InternalRefreshComplete(IntPtr thisptr, HServerListRequest hRequest, EMatchMakingServerResponse response);
|
||||
private void InternalOnServerResponded(IntPtr thisptr, HServerListRequest hRequest, int iServer) {
|
||||
m_ServerResponded(hRequest, iServer);
|
||||
}
|
||||
private void InternalOnServerFailedToRespond(IntPtr thisptr, HServerListRequest hRequest, int iServer) {
|
||||
m_ServerFailedToRespond(hRequest, iServer);
|
||||
}
|
||||
private void InternalOnRefreshComplete(IntPtr thisptr, HServerListRequest hRequest, EMatchMakingServerResponse response) {
|
||||
m_RefreshComplete(hRequest, response);
|
||||
}
|
||||
#endif
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
private class VTable {
|
||||
[NonSerialized]
|
||||
[MarshalAs(UnmanagedType.FunctionPtr)]
|
||||
public InternalServerResponded m_VTServerResponded;
|
||||
|
||||
[NonSerialized]
|
||||
[MarshalAs(UnmanagedType.FunctionPtr)]
|
||||
public InternalServerFailedToRespond m_VTServerFailedToRespond;
|
||||
|
||||
[NonSerialized]
|
||||
[MarshalAs(UnmanagedType.FunctionPtr)]
|
||||
public InternalRefreshComplete m_VTRefreshComplete;
|
||||
}
|
||||
|
||||
public static explicit operator System.IntPtr(ISteamMatchmakingServerListResponse that) {
|
||||
return that.m_pGCHandle.AddrOfPinnedObject();
|
||||
}
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after pinging an individual server
|
||||
//
|
||||
// These callbacks all occur in response to querying an individual server
|
||||
// via the ISteamMatchmakingServers()->PingServer() call below. If you are
|
||||
// destructing an object that implements this interface then you should call
|
||||
// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query
|
||||
// which is in progress. Failure to cancel in progress queries when destructing
|
||||
// a callback handler may result in a crash when a callback later occurs.
|
||||
//-----------------------------------------------------------------------------
|
||||
public class ISteamMatchmakingPingResponse {
|
||||
// Server has responded successfully and has updated data
|
||||
public delegate void ServerResponded(gameserveritem_t server);
|
||||
|
||||
// Server failed to respond to the ping request
|
||||
public delegate void ServerFailedToRespond();
|
||||
|
||||
private VTable m_VTable;
|
||||
private IntPtr m_pVTable;
|
||||
private GCHandle m_pGCHandle;
|
||||
private ServerResponded m_ServerResponded;
|
||||
private ServerFailedToRespond m_ServerFailedToRespond;
|
||||
|
||||
public ISteamMatchmakingPingResponse(ServerResponded onServerResponded, ServerFailedToRespond onServerFailedToRespond) {
|
||||
if (onServerResponded == null || onServerFailedToRespond == null) {
|
||||
throw new ArgumentNullException();
|
||||
}
|
||||
m_ServerResponded = onServerResponded;
|
||||
m_ServerFailedToRespond = onServerFailedToRespond;
|
||||
|
||||
m_VTable = new VTable() {
|
||||
m_VTServerResponded = InternalOnServerResponded,
|
||||
m_VTServerFailedToRespond = InternalOnServerFailedToRespond,
|
||||
};
|
||||
m_pVTable = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(VTable)));
|
||||
Marshal.StructureToPtr(m_VTable, m_pVTable, false);
|
||||
|
||||
m_pGCHandle = GCHandle.Alloc(m_pVTable, GCHandleType.Pinned);
|
||||
}
|
||||
|
||||
~ISteamMatchmakingPingResponse() {
|
||||
if (m_pVTable != IntPtr.Zero) {
|
||||
Marshal.FreeHGlobal(m_pVTable);
|
||||
}
|
||||
|
||||
if (m_pGCHandle.IsAllocated) {
|
||||
m_pGCHandle.Free();
|
||||
}
|
||||
}
|
||||
|
||||
#if NOTHISPTR
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate void InternalServerResponded(gameserveritem_t server);
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
private delegate void InternalServerFailedToRespond();
|
||||
private void InternalOnServerResponded(gameserveritem_t server) {
|
||||
m_ServerResponded(server);
|
||||
}
|
||||
private void InternalOnServerFailedToRespond() {
|
||||
m_ServerFailedToRespond();
|
||||
}
|
||||
#else
|
||||
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
|
||||
private delegate void InternalServerResponded(IntPtr thisptr, gameserveritem_t server);
|
||||
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
|
||||
private delegate void InternalServerFailedToRespond(IntPtr thisptr);
|
||||
private void InternalOnServerResponded(IntPtr thisptr, gameserveritem_t server) {
|
||||
m_ServerResponded(server);
|
||||
}
|
||||
private void InternalOnServerFailedToRespond(IntPtr thisptr) {
|
||||
m_ServerFailedToRespond();
|
||||
}
|
||||
#endif
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
private class VTable {
|
||||
[NonSerialized]
|
||||
[MarshalAs(UnmanagedType.FunctionPtr)]
|
||||
public InternalServerResponded m_VTServerResponded;
|
||||
|
||||
[NonSerialized]
|
||||
[MarshalAs(UnmanagedType.FunctionPtr)]
|
||||
public InternalServerFailedToRespond m_VTServerFailedToRespond;
|
||||
}
|
||||
|
||||
public static explicit operator System.IntPtr(ISteamMatchmakingPingResponse that) {
|
||||
return that.m_pGCHandle.AddrOfPinnedObject();
|
||||
}
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after requesting details on
|
||||
// who is playing on a particular server.
|
||||
//
|
||||
// These callbacks all occur in response to querying an individual server
|
||||
// via the ISteamMatchmakingServers()->PlayerDetails() call below. If you are
|
||||
// destructing an object that implements this interface then you should call
|
||||
// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query
|
||||
// which is in progress. Failure to cancel in progress queries when destructing
|
||||
// a callback handler may result in a crash when a callback later occurs.
|
||||
//-----------------------------------------------------------------------------
|
||||
public class ISteamMatchmakingPlayersResponse {
|
||||
// Got data on a new player on the server -- you'll get this callback once per player
|
||||
// on the server which you have requested player data on.
|
||||
public delegate void AddPlayerToList(string pchName, int nScore, float flTimePlayed);
|
||||
|
||||
// The server failed to respond to the request for player details
|
||||
public delegate void PlayersFailedToRespond();
|
||||
|
||||
// The server has finished responding to the player details request
|
||||
// (ie, you won't get anymore AddPlayerToList callbacks)
|
||||
public delegate void PlayersRefreshComplete();
|
||||
|
||||
private VTable m_VTable;
|
||||
private IntPtr m_pVTable;
|
||||
private GCHandle m_pGCHandle;
|
||||
private AddPlayerToList m_AddPlayerToList;
|
||||
private PlayersFailedToRespond m_PlayersFailedToRespond;
|
||||
private PlayersRefreshComplete m_PlayersRefreshComplete;
|
||||
|
||||
public ISteamMatchmakingPlayersResponse(AddPlayerToList onAddPlayerToList, PlayersFailedToRespond onPlayersFailedToRespond, PlayersRefreshComplete onPlayersRefreshComplete) {
|
||||
if (onAddPlayerToList == null || onPlayersFailedToRespond == null || onPlayersRefreshComplete == null) {
|
||||
throw new ArgumentNullException();
|
||||
}
|
||||
m_AddPlayerToList = onAddPlayerToList;
|
||||
m_PlayersFailedToRespond = onPlayersFailedToRespond;
|
||||
m_PlayersRefreshComplete = onPlayersRefreshComplete;
|
||||
|
||||
m_VTable = new VTable() {
|
||||
m_VTAddPlayerToList = InternalOnAddPlayerToList,
|
||||
m_VTPlayersFailedToRespond = InternalOnPlayersFailedToRespond,
|
||||
m_VTPlayersRefreshComplete = InternalOnPlayersRefreshComplete
|
||||
};
|
||||
m_pVTable = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(VTable)));
|
||||
Marshal.StructureToPtr(m_VTable, m_pVTable, false);
|
||||
|
||||
m_pGCHandle = GCHandle.Alloc(m_pVTable, GCHandleType.Pinned);
|
||||
}
|
||||
|
||||
~ISteamMatchmakingPlayersResponse() {
|
||||
if (m_pVTable != IntPtr.Zero) {
|
||||
Marshal.FreeHGlobal(m_pVTable);
|
||||
}
|
||||
|
||||
if (m_pGCHandle.IsAllocated) {
|
||||
m_pGCHandle.Free();
|
||||
}
|
||||
}
|
||||
|
||||
#if NOTHISPTR
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
public delegate void InternalAddPlayerToList(IntPtr pchName, int nScore, float flTimePlayed);
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
public delegate void InternalPlayersFailedToRespond();
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
public delegate void InternalPlayersRefreshComplete();
|
||||
private void InternalOnAddPlayerToList(IntPtr pchName, int nScore, float flTimePlayed) {
|
||||
m_AddPlayerToList(InteropHelp.PtrToStringUTF8(pchName), nScore, flTimePlayed);
|
||||
}
|
||||
private void InternalOnPlayersFailedToRespond() {
|
||||
m_PlayersFailedToRespond();
|
||||
}
|
||||
private void InternalOnPlayersRefreshComplete() {
|
||||
m_PlayersRefreshComplete();
|
||||
}
|
||||
#else
|
||||
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
|
||||
public delegate void InternalAddPlayerToList(IntPtr thisptr, IntPtr pchName, int nScore, float flTimePlayed);
|
||||
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
|
||||
public delegate void InternalPlayersFailedToRespond(IntPtr thisptr);
|
||||
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
|
||||
public delegate void InternalPlayersRefreshComplete(IntPtr thisptr);
|
||||
private void InternalOnAddPlayerToList(IntPtr thisptr, IntPtr pchName, int nScore, float flTimePlayed) {
|
||||
m_AddPlayerToList(InteropHelp.PtrToStringUTF8(pchName), nScore, flTimePlayed);
|
||||
}
|
||||
private void InternalOnPlayersFailedToRespond(IntPtr thisptr) {
|
||||
m_PlayersFailedToRespond();
|
||||
}
|
||||
private void InternalOnPlayersRefreshComplete(IntPtr thisptr) {
|
||||
m_PlayersRefreshComplete();
|
||||
}
|
||||
#endif
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
private class VTable {
|
||||
[NonSerialized]
|
||||
[MarshalAs(UnmanagedType.FunctionPtr)]
|
||||
public InternalAddPlayerToList m_VTAddPlayerToList;
|
||||
|
||||
[NonSerialized]
|
||||
[MarshalAs(UnmanagedType.FunctionPtr)]
|
||||
public InternalPlayersFailedToRespond m_VTPlayersFailedToRespond;
|
||||
|
||||
[NonSerialized]
|
||||
[MarshalAs(UnmanagedType.FunctionPtr)]
|
||||
public InternalPlayersRefreshComplete m_VTPlayersRefreshComplete;
|
||||
}
|
||||
|
||||
public static explicit operator System.IntPtr(ISteamMatchmakingPlayersResponse that) {
|
||||
return that.m_pGCHandle.AddrOfPinnedObject();
|
||||
}
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after requesting rules
|
||||
// details on a particular server.
|
||||
//
|
||||
// These callbacks all occur in response to querying an individual server
|
||||
// via the ISteamMatchmakingServers()->ServerRules() call below. If you are
|
||||
// destructing an object that implements this interface then you should call
|
||||
// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query
|
||||
// which is in progress. Failure to cancel in progress queries when destructing
|
||||
// a callback handler may result in a crash when a callback later occurs.
|
||||
//-----------------------------------------------------------------------------
|
||||
public class ISteamMatchmakingRulesResponse {
|
||||
// Got data on a rule on the server -- you'll get one of these per rule defined on
|
||||
// the server you are querying
|
||||
public delegate void RulesResponded(string pchRule, string pchValue);
|
||||
|
||||
// The server failed to respond to the request for rule details
|
||||
public delegate void RulesFailedToRespond();
|
||||
|
||||
// The server has finished responding to the rule details request
|
||||
// (ie, you won't get anymore RulesResponded callbacks)
|
||||
public delegate void RulesRefreshComplete();
|
||||
|
||||
private VTable m_VTable;
|
||||
private IntPtr m_pVTable;
|
||||
private GCHandle m_pGCHandle;
|
||||
private RulesResponded m_RulesResponded;
|
||||
private RulesFailedToRespond m_RulesFailedToRespond;
|
||||
private RulesRefreshComplete m_RulesRefreshComplete;
|
||||
|
||||
public ISteamMatchmakingRulesResponse(RulesResponded onRulesResponded, RulesFailedToRespond onRulesFailedToRespond, RulesRefreshComplete onRulesRefreshComplete) {
|
||||
if (onRulesResponded == null || onRulesFailedToRespond == null || onRulesRefreshComplete == null) {
|
||||
throw new ArgumentNullException();
|
||||
}
|
||||
m_RulesResponded = onRulesResponded;
|
||||
m_RulesFailedToRespond = onRulesFailedToRespond;
|
||||
m_RulesRefreshComplete = onRulesRefreshComplete;
|
||||
|
||||
m_VTable = new VTable() {
|
||||
m_VTRulesResponded = InternalOnRulesResponded,
|
||||
m_VTRulesFailedToRespond = InternalOnRulesFailedToRespond,
|
||||
m_VTRulesRefreshComplete = InternalOnRulesRefreshComplete
|
||||
};
|
||||
m_pVTable = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(VTable)));
|
||||
Marshal.StructureToPtr(m_VTable, m_pVTable, false);
|
||||
|
||||
m_pGCHandle = GCHandle.Alloc(m_pVTable, GCHandleType.Pinned);
|
||||
}
|
||||
|
||||
~ISteamMatchmakingRulesResponse() {
|
||||
if (m_pVTable != IntPtr.Zero) {
|
||||
Marshal.FreeHGlobal(m_pVTable);
|
||||
}
|
||||
|
||||
if (m_pGCHandle.IsAllocated) {
|
||||
m_pGCHandle.Free();
|
||||
}
|
||||
}
|
||||
|
||||
#if NOTHISPTR
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
public delegate void InternalRulesResponded(IntPtr pchRule, IntPtr pchValue);
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
public delegate void InternalRulesFailedToRespond();
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
public delegate void InternalRulesRefreshComplete();
|
||||
private void InternalOnRulesResponded(IntPtr pchRule, IntPtr pchValue) {
|
||||
m_RulesResponded(InteropHelp.PtrToStringUTF8(pchRule), InteropHelp.PtrToStringUTF8(pchValue));
|
||||
}
|
||||
private void InternalOnRulesFailedToRespond() {
|
||||
m_RulesFailedToRespond();
|
||||
}
|
||||
private void InternalOnRulesRefreshComplete() {
|
||||
m_RulesRefreshComplete();
|
||||
}
|
||||
#else
|
||||
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
|
||||
public delegate void InternalRulesResponded(IntPtr thisptr, IntPtr pchRule, IntPtr pchValue);
|
||||
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
|
||||
public delegate void InternalRulesFailedToRespond(IntPtr thisptr);
|
||||
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
|
||||
public delegate void InternalRulesRefreshComplete(IntPtr thisptr);
|
||||
private void InternalOnRulesResponded(IntPtr thisptr, IntPtr pchRule, IntPtr pchValue) {
|
||||
m_RulesResponded(InteropHelp.PtrToStringUTF8(pchRule), InteropHelp.PtrToStringUTF8(pchValue));
|
||||
}
|
||||
private void InternalOnRulesFailedToRespond(IntPtr thisptr) {
|
||||
m_RulesFailedToRespond();
|
||||
}
|
||||
private void InternalOnRulesRefreshComplete(IntPtr thisptr) {
|
||||
m_RulesRefreshComplete();
|
||||
}
|
||||
#endif
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
private class VTable {
|
||||
[NonSerialized]
|
||||
[MarshalAs(UnmanagedType.FunctionPtr)]
|
||||
public InternalRulesResponded m_VTRulesResponded;
|
||||
|
||||
[NonSerialized]
|
||||
[MarshalAs(UnmanagedType.FunctionPtr)]
|
||||
public InternalRulesFailedToRespond m_VTRulesFailedToRespond;
|
||||
|
||||
[NonSerialized]
|
||||
[MarshalAs(UnmanagedType.FunctionPtr)]
|
||||
public InternalRulesRefreshComplete m_VTRulesRefreshComplete;
|
||||
}
|
||||
|
||||
public static explicit operator System.IntPtr(ISteamMatchmakingRulesResponse that) {
|
||||
return that.m_pGCHandle.AddrOfPinnedObject();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,249 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
using System.Text;
|
||||
|
||||
namespace Steamworks {
|
||||
public class InteropHelp {
|
||||
public static void TestIfPlatformSupported() {
|
||||
#if !UNITY_EDITOR && !UNITY_STANDALONE && !STEAMWORKS_WIN && !STEAMWORKS_LIN_OSX
|
||||
throw new System.InvalidOperationException("Steamworks functions can only be called on platforms that Steam is available on.");
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void TestIfAvailableClient() {
|
||||
TestIfPlatformSupported();
|
||||
if (CSteamAPIContext.GetSteamClient() == System.IntPtr.Zero) {
|
||||
if (!CSteamAPIContext.Init()) {
|
||||
throw new System.InvalidOperationException("Steamworks is not initialized.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void TestIfAvailableGameServer() {
|
||||
TestIfPlatformSupported();
|
||||
if (CSteamGameServerAPIContext.GetSteamClient() == System.IntPtr.Zero) {
|
||||
if (!CSteamGameServerAPIContext.Init()) {
|
||||
throw new System.InvalidOperationException("Steamworks GameServer is not initialized.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This continues to exist for both 'out string' and strings returned by Steamworks functions.
|
||||
public static string PtrToStringUTF8(IntPtr nativeUtf8) {
|
||||
if (nativeUtf8 == IntPtr.Zero) {
|
||||
return null;
|
||||
}
|
||||
|
||||
int len = 0;
|
||||
|
||||
while (Marshal.ReadByte(nativeUtf8, len) != 0) {
|
||||
++len;
|
||||
}
|
||||
|
||||
if (len == 0) {
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
byte[] buffer = new byte[len];
|
||||
Marshal.Copy(nativeUtf8, buffer, 0, buffer.Length);
|
||||
return Encoding.UTF8.GetString(buffer);
|
||||
}
|
||||
|
||||
// This is for 'const char *' arguments which we need to ensure do not get GC'd while Steam is using them.
|
||||
// We can't use an ICustomMarshaler because Unity crashes when a string between 96 and 127 characters long is defined/initialized at the top of class scope...
|
||||
#if UNITY_EDITOR || UNITY_STANDALONE || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX
|
||||
public class UTF8StringHandle : Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid {
|
||||
public UTF8StringHandle(string str)
|
||||
: base(true) {
|
||||
if (str == null) {
|
||||
SetHandle(IntPtr.Zero);
|
||||
return;
|
||||
}
|
||||
|
||||
// +1 for '\0'
|
||||
byte[] strbuf = new byte[Encoding.UTF8.GetByteCount(str) + 1];
|
||||
Encoding.UTF8.GetBytes(str, 0, str.Length, strbuf, 0);
|
||||
IntPtr buffer = Marshal.AllocHGlobal(strbuf.Length);
|
||||
Marshal.Copy(strbuf, 0, buffer, strbuf.Length);
|
||||
|
||||
SetHandle(buffer);
|
||||
}
|
||||
|
||||
protected override bool ReleaseHandle() {
|
||||
if (!IsInvalid) {
|
||||
Marshal.FreeHGlobal(handle);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#else
|
||||
public class UTF8StringHandle : IDisposable {
|
||||
public UTF8StringHandle(string str) { }
|
||||
public void Dispose() {}
|
||||
}
|
||||
#endif
|
||||
|
||||
// TODO - Should be IDisposable
|
||||
// We can't use an ICustomMarshaler because Unity dies when MarshalManagedToNative() gets called with a generic type.
|
||||
public class SteamParamStringArray {
|
||||
// The pointer to each AllocHGlobal() string
|
||||
IntPtr[] m_Strings;
|
||||
// The pointer to the condensed version of m_Strings
|
||||
IntPtr m_ptrStrings;
|
||||
// The pointer to the StructureToPtr version of SteamParamStringArray_t that will get marshaled
|
||||
IntPtr m_pSteamParamStringArray;
|
||||
|
||||
public SteamParamStringArray(System.Collections.Generic.IList<string> strings) {
|
||||
if (strings == null) {
|
||||
m_pSteamParamStringArray = IntPtr.Zero;
|
||||
return;
|
||||
}
|
||||
|
||||
m_Strings = new IntPtr[strings.Count];
|
||||
for (int i = 0; i < strings.Count; ++i) {
|
||||
byte[] strbuf = new byte[Encoding.UTF8.GetByteCount(strings[i]) + 1];
|
||||
Encoding.UTF8.GetBytes(strings[i], 0, strings[i].Length, strbuf, 0);
|
||||
m_Strings[i] = Marshal.AllocHGlobal(strbuf.Length);
|
||||
Marshal.Copy(strbuf, 0, m_Strings[i], strbuf.Length);
|
||||
}
|
||||
|
||||
m_ptrStrings = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr)) * m_Strings.Length);
|
||||
SteamParamStringArray_t stringArray = new SteamParamStringArray_t() {
|
||||
m_ppStrings = m_ptrStrings,
|
||||
m_nNumStrings = m_Strings.Length
|
||||
};
|
||||
Marshal.Copy(m_Strings, 0, stringArray.m_ppStrings, m_Strings.Length);
|
||||
|
||||
m_pSteamParamStringArray = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(SteamParamStringArray_t)));
|
||||
Marshal.StructureToPtr(stringArray, m_pSteamParamStringArray, false);
|
||||
}
|
||||
|
||||
~SteamParamStringArray() {
|
||||
foreach (IntPtr ptr in m_Strings) {
|
||||
Marshal.FreeHGlobal(ptr);
|
||||
}
|
||||
|
||||
if (m_ptrStrings != IntPtr.Zero) {
|
||||
Marshal.FreeHGlobal(m_ptrStrings);
|
||||
}
|
||||
|
||||
if (m_pSteamParamStringArray != IntPtr.Zero) {
|
||||
Marshal.FreeHGlobal(m_pSteamParamStringArray);
|
||||
}
|
||||
}
|
||||
|
||||
public static implicit operator IntPtr(SteamParamStringArray that) {
|
||||
return that.m_pSteamParamStringArray;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO - Should be IDisposable
|
||||
// MatchMaking Key-Value Pair Marshaller
|
||||
public class MMKVPMarshaller {
|
||||
private IntPtr m_pNativeArray;
|
||||
private IntPtr m_pArrayEntries;
|
||||
|
||||
public MMKVPMarshaller(MatchMakingKeyValuePair_t[] filters) {
|
||||
if (filters == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
int sizeOfMMKVP = Marshal.SizeOf(typeof(MatchMakingKeyValuePair_t));
|
||||
|
||||
m_pNativeArray = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr)) * filters.Length);
|
||||
m_pArrayEntries = Marshal.AllocHGlobal(sizeOfMMKVP * filters.Length);
|
||||
for (int i = 0; i < filters.Length; ++i) {
|
||||
Marshal.StructureToPtr(filters[i], new IntPtr(m_pArrayEntries.ToInt64() + (i * sizeOfMMKVP)), false);
|
||||
}
|
||||
|
||||
Marshal.WriteIntPtr(m_pNativeArray, m_pArrayEntries);
|
||||
}
|
||||
|
||||
~MMKVPMarshaller() {
|
||||
if (m_pArrayEntries != IntPtr.Zero) {
|
||||
Marshal.FreeHGlobal(m_pArrayEntries);
|
||||
}
|
||||
if (m_pNativeArray != IntPtr.Zero) {
|
||||
Marshal.FreeHGlobal(m_pNativeArray);
|
||||
}
|
||||
}
|
||||
|
||||
public static implicit operator IntPtr(MMKVPMarshaller that) {
|
||||
return that.m_pNativeArray;
|
||||
}
|
||||
}
|
||||
|
||||
public class DllCheck {
|
||||
#if DISABLED
|
||||
[DllImport("kernel32.dll")]
|
||||
public static extern IntPtr GetModuleHandle(string lpModuleName);
|
||||
|
||||
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
|
||||
extern static int GetModuleFileName(IntPtr hModule, StringBuilder strFullPath, int nSize);
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// This is an optional runtime check to ensure that the dlls are the correct version. Returns false only if the steam_api.dll is found and it's the wrong size or version number.
|
||||
/// </summary>
|
||||
public static bool Test() {
|
||||
#if DISABLED
|
||||
bool ret = CheckSteamAPIDLL();
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
#if DISABLED
|
||||
private static bool CheckSteamAPIDLL() {
|
||||
string fileName;
|
||||
int fileBytes;
|
||||
if (IntPtr.Size == 4) {
|
||||
fileName = "steam_api.dll";
|
||||
fileBytes = Version.SteamAPIDLLSize;
|
||||
}
|
||||
else {
|
||||
fileName = "steam_api64.dll";
|
||||
fileBytes = Version.SteamAPI64DLLSize;
|
||||
}
|
||||
|
||||
IntPtr handle = GetModuleHandle(fileName);
|
||||
if (handle == IntPtr.Zero) {
|
||||
return true;
|
||||
}
|
||||
|
||||
StringBuilder filePath = new StringBuilder(256);
|
||||
GetModuleFileName(handle, filePath, filePath.Capacity);
|
||||
string file = filePath.ToString();
|
||||
|
||||
// If we can not find the file we'll just skip it and let the DllNotFoundException take care of it.
|
||||
if (System.IO.File.Exists(file)) {
|
||||
System.IO.FileInfo fInfo = new System.IO.FileInfo(file);
|
||||
if (fInfo.Length != fileBytes) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (System.Diagnostics.FileVersionInfo.GetVersionInfo(file).FileVersion != Version.SteamAPIDLLVersion) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,71 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
// If we're running in the Unity Editor we need the editors platform.
|
||||
#if UNITY_EDITOR_WIN
|
||||
#define VALVE_CALLBACK_PACK_LARGE
|
||||
#elif UNITY_EDITOR_OSX
|
||||
#define VALVE_CALLBACK_PACK_SMALL
|
||||
|
||||
// Otherwise we want the target platform.
|
||||
#elif UNITY_STANDALONE_WIN || STEAMWORKS_WIN
|
||||
#define VALVE_CALLBACK_PACK_LARGE
|
||||
#elif UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_LIN_OSX
|
||||
#define VALVE_CALLBACK_PACK_SMALL
|
||||
|
||||
// We do not want to throw a warning when we're building in Unity but for an unsupported platform. So we'll silently let this slip by.
|
||||
// It would be nice if Unity itself would define 'UNITY' or something like that...
|
||||
#elif UNITY_3_5 || UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7 || UNITY_5 || UNITY_2017_1_OR_NEWER
|
||||
#define VALVE_CALLBACK_PACK_SMALL
|
||||
|
||||
// But we do want to be explicit on the Standalone build for XNA/Monogame.
|
||||
#else
|
||||
#define VALVE_CALLBACK_PACK_LARGE
|
||||
#warning You need to define STEAMWORKS_WIN, or STEAMWORKS_LIN_OSX. Refer to the readme for more details.
|
||||
#endif
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class Packsize {
|
||||
#if VALVE_CALLBACK_PACK_LARGE
|
||||
public const int value = 8;
|
||||
#elif VALVE_CALLBACK_PACK_SMALL
|
||||
public const int value = 4;
|
||||
#endif
|
||||
|
||||
public static bool Test() {
|
||||
int sentinelSize = Marshal.SizeOf(typeof(ValvePackingSentinel_t));
|
||||
int subscribedFilesSize = Marshal.SizeOf(typeof(RemoteStorageEnumerateUserSubscribedFilesResult_t));
|
||||
#if VALVE_CALLBACK_PACK_LARGE
|
||||
if (sentinelSize != 32 || subscribedFilesSize != (1 + 1 + 1 + 50 + 100) * 4 + 4)
|
||||
return false;
|
||||
#elif VALVE_CALLBACK_PACK_SMALL
|
||||
if (sentinelSize != 24 || subscribedFilesSize != (1 + 1 + 1 + 50 + 100) * 4)
|
||||
return false;
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = Packsize.value)]
|
||||
struct ValvePackingSentinel_t {
|
||||
uint m_u32;
|
||||
ulong m_u64;
|
||||
ushort m_u16;
|
||||
double m_d;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,508 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class Version {
|
||||
public const string SteamworksNETVersion = "13.0.0";
|
||||
public const string SteamworksSDKVersion = "1.46";
|
||||
public const string SteamAPIDLLVersion = "05.25.65.21";
|
||||
public const int SteamAPIDLLSize = 259360;
|
||||
public const int SteamAPI64DLLSize = 289568;
|
||||
}
|
||||
|
||||
public static class SteamAPI {
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// Steam API setup & shutdown
|
||||
//
|
||||
// These functions manage loading, initializing and shutdown of the steamclient.dll
|
||||
//
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
// SteamAPI_Init must be called before using any other API functions. If it fails, an
|
||||
// error message will be output to the debugger (or stderr) with further information.
|
||||
public static bool Init() {
|
||||
InteropHelp.TestIfPlatformSupported();
|
||||
|
||||
bool ret = NativeMethods.SteamAPI_Init();
|
||||
|
||||
// Steamworks.NET specific: We initialize the SteamAPI Context like this for now, but we need to do it
|
||||
// every time that Unity reloads binaries, so we also check if the pointers are available and initialized
|
||||
// before each call to any interface functions. That is in InteropHelp.cs
|
||||
if (ret)
|
||||
{
|
||||
ret = CSteamAPIContext.Init();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static void Shutdown() {
|
||||
InteropHelp.TestIfPlatformSupported();
|
||||
NativeMethods.SteamAPI_Shutdown();
|
||||
}
|
||||
|
||||
// SteamAPI_RestartAppIfNecessary ensures that your executable was launched through Steam.
|
||||
//
|
||||
// Returns true if the current process should terminate. Steam is now re-launching your application.
|
||||
//
|
||||
// Returns false if no action needs to be taken. This means that your executable was started through
|
||||
// the Steam client, or a steam_appid.txt file is present in your game's directory (for development).
|
||||
// Your current process should continue if false is returned.
|
||||
//
|
||||
// NOTE: If you use the Steam DRM wrapper on your primary executable file, this check is unnecessary
|
||||
// since the DRM wrapper will ensure that your application was launched properly through Steam.
|
||||
public static bool RestartAppIfNecessary(AppId_t unOwnAppID) {
|
||||
InteropHelp.TestIfPlatformSupported();
|
||||
return NativeMethods.SteamAPI_RestartAppIfNecessary(unOwnAppID);
|
||||
}
|
||||
|
||||
// Many Steam API functions allocate a small amount of thread-local memory for parameter storage.
|
||||
// SteamAPI_ReleaseCurrentThreadMemory() will free API memory associated with the calling thread.
|
||||
// This function is also called automatically by SteamAPI_RunCallbacks(), so a single-threaded
|
||||
// program never needs to explicitly call this function.
|
||||
public static void ReleaseCurrentThreadMemory() {
|
||||
InteropHelp.TestIfPlatformSupported();
|
||||
NativeMethods.SteamAPI_ReleaseCurrentThreadMemory();
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// steam callback and call-result helpers
|
||||
//
|
||||
// The following macros and classes are used to register your application for
|
||||
// callbacks and call-results, which are delivered in a predictable manner.
|
||||
//
|
||||
// STEAM_CALLBACK macros are meant for use inside of a C++ class definition.
|
||||
// They map a Steam notification callback directly to a class member function
|
||||
// which is automatically prototyped as "void func( callback_type *pParam )".
|
||||
//
|
||||
// CCallResult is used with specific Steam APIs that return "result handles".
|
||||
// The handle can be passed to a CCallResult object's Set function, along with
|
||||
// an object pointer and member-function pointer. The member function will
|
||||
// be executed once the results of the Steam API call are available.
|
||||
//
|
||||
// CCallback and CCallbackManual classes can be used instead of STEAM_CALLBACK
|
||||
// macros if you require finer control over registration and unregistration.
|
||||
//
|
||||
// Callbacks and call-results are queued automatically and are only
|
||||
// delivered/executed when your application calls SteamAPI_RunCallbacks().
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
// SteamAPI_RunCallbacks is safe to call from multiple threads simultaneously,
|
||||
// but if you choose to do this, callback code could be executed on any thread.
|
||||
// One alternative is to call SteamAPI_RunCallbacks from the main thread only,
|
||||
// and call SteamAPI_ReleaseCurrentThreadMemory regularly on other threads.
|
||||
public static void RunCallbacks() {
|
||||
InteropHelp.TestIfPlatformSupported();
|
||||
NativeMethods.SteamAPI_RunCallbacks();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// steamclient.dll private wrapper functions
|
||||
//
|
||||
// The following functions are part of abstracting API access to the steamclient.dll, but should only be used in very specific cases
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
// SteamAPI_IsSteamRunning() returns true if Steam is currently running
|
||||
public static bool IsSteamRunning() {
|
||||
InteropHelp.TestIfPlatformSupported();
|
||||
return NativeMethods.SteamAPI_IsSteamRunning();
|
||||
}
|
||||
|
||||
// returns the HSteamUser of the last user to dispatch a callback
|
||||
public static HSteamUser GetHSteamUserCurrent() {
|
||||
InteropHelp.TestIfPlatformSupported();
|
||||
return (HSteamUser)NativeMethods.Steam_GetHSteamUserCurrent();
|
||||
}
|
||||
|
||||
// returns the pipe we are communicating to Steam with
|
||||
public static HSteamPipe GetHSteamPipe() {
|
||||
InteropHelp.TestIfPlatformSupported();
|
||||
return (HSteamPipe)NativeMethods.SteamAPI_GetHSteamPipe();
|
||||
}
|
||||
|
||||
public static HSteamUser GetHSteamUser() {
|
||||
InteropHelp.TestIfPlatformSupported();
|
||||
return (HSteamUser)NativeMethods.SteamAPI_GetHSteamUser();
|
||||
}
|
||||
}
|
||||
|
||||
public static class GameServer {
|
||||
// Initialize ISteamGameServer interface object, and set server properties which may not be changed.
|
||||
//
|
||||
// After calling this function, you should set any additional server parameters, and then
|
||||
// call ISteamGameServer::LogOnAnonymous() or ISteamGameServer::LogOn()
|
||||
//
|
||||
// - usSteamPort is the local port used to communicate with the steam servers.
|
||||
// - usGamePort is the port that clients will connect to for gameplay.
|
||||
// - usQueryPort is the port that will manage server browser related duties and info
|
||||
// pings from clients. If you pass MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE for usQueryPort, then it
|
||||
// will use "GameSocketShare" mode, which means that the game is responsible for sending and receiving
|
||||
// UDP packets for the master server updater. See references to GameSocketShare in isteamgameserver.h.
|
||||
// - 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. (Only servers with the latest version will be listed.)
|
||||
public static bool Init(uint unIP, ushort usSteamPort, ushort usGamePort, ushort usQueryPort, EServerMode eServerMode, string pchVersionString) {
|
||||
InteropHelp.TestIfPlatformSupported();
|
||||
|
||||
bool ret;
|
||||
using (var pchVersionString2 = new InteropHelp.UTF8StringHandle(pchVersionString)) {
|
||||
ret = NativeMethods.SteamGameServer_Init(unIP, usSteamPort, usGamePort, usQueryPort, eServerMode, pchVersionString2);
|
||||
}
|
||||
|
||||
// Steamworks.NET specific: We initialize the SteamAPI Context like this for now, but we need to do it
|
||||
// every time that Unity reloads binaries, so we also check if the pointers are available and initialized
|
||||
// before each call to any interface functions. That is in InteropHelp.cs
|
||||
if (ret) {
|
||||
ret = CSteamGameServerAPIContext.Init();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static void Shutdown() {
|
||||
InteropHelp.TestIfPlatformSupported();
|
||||
NativeMethods.SteamGameServer_Shutdown();
|
||||
CSteamGameServerAPIContext.Clear();
|
||||
}
|
||||
|
||||
public static void RunCallbacks() {
|
||||
InteropHelp.TestIfPlatformSupported();
|
||||
NativeMethods.SteamGameServer_RunCallbacks();
|
||||
}
|
||||
|
||||
// Most Steam API functions allocate some amount of thread-local memory for
|
||||
// parameter storage. Calling SteamGameServer_ReleaseCurrentThreadMemory()
|
||||
// will free all API-related memory associated with the calling thread.
|
||||
// This memory is released automatically by SteamGameServer_RunCallbacks(),
|
||||
// so single-threaded servers do not need to explicitly call this function.
|
||||
public static void ReleaseCurrentThreadMemory() {
|
||||
InteropHelp.TestIfPlatformSupported();
|
||||
NativeMethods.SteamGameServer_ReleaseCurrentThreadMemory();
|
||||
}
|
||||
|
||||
public static bool BSecure() {
|
||||
InteropHelp.TestIfPlatformSupported();
|
||||
return NativeMethods.SteamGameServer_BSecure();
|
||||
}
|
||||
|
||||
public static CSteamID GetSteamID() {
|
||||
InteropHelp.TestIfPlatformSupported();
|
||||
return (CSteamID)NativeMethods.SteamGameServer_GetSteamID();
|
||||
}
|
||||
|
||||
public static HSteamPipe GetHSteamPipe() {
|
||||
InteropHelp.TestIfPlatformSupported();
|
||||
return (HSteamPipe)NativeMethods.SteamGameServer_GetHSteamPipe();
|
||||
}
|
||||
|
||||
public static HSteamUser GetHSteamUser() {
|
||||
InteropHelp.TestIfPlatformSupported();
|
||||
return (HSteamUser)NativeMethods.SteamGameServer_GetHSteamUser();
|
||||
}
|
||||
}
|
||||
|
||||
public static class SteamEncryptedAppTicket {
|
||||
public static bool BDecryptTicket(byte[] rgubTicketEncrypted, uint cubTicketEncrypted, byte[] rgubTicketDecrypted, ref uint pcubTicketDecrypted, byte[] rgubKey, int cubKey) {
|
||||
InteropHelp.TestIfPlatformSupported();
|
||||
return NativeMethods.SteamEncryptedAppTicket_BDecryptTicket(rgubTicketEncrypted, cubTicketEncrypted, rgubTicketDecrypted, ref pcubTicketDecrypted, rgubKey, cubKey);
|
||||
}
|
||||
|
||||
public static bool BIsTicketForApp(byte[] rgubTicketDecrypted, uint cubTicketDecrypted, AppId_t nAppID) {
|
||||
InteropHelp.TestIfPlatformSupported();
|
||||
return NativeMethods.SteamEncryptedAppTicket_BIsTicketForApp(rgubTicketDecrypted, cubTicketDecrypted, nAppID);
|
||||
}
|
||||
|
||||
public static uint GetTicketIssueTime(byte[] rgubTicketDecrypted, uint cubTicketDecrypted) {
|
||||
InteropHelp.TestIfPlatformSupported();
|
||||
return NativeMethods.SteamEncryptedAppTicket_GetTicketIssueTime(rgubTicketDecrypted, cubTicketDecrypted);
|
||||
}
|
||||
|
||||
public static void GetTicketSteamID(byte[] rgubTicketDecrypted, uint cubTicketDecrypted, out CSteamID psteamID) {
|
||||
InteropHelp.TestIfPlatformSupported();
|
||||
NativeMethods.SteamEncryptedAppTicket_GetTicketSteamID(rgubTicketDecrypted, cubTicketDecrypted, out psteamID);
|
||||
}
|
||||
|
||||
public static uint GetTicketAppID(byte[] rgubTicketDecrypted, uint cubTicketDecrypted) {
|
||||
InteropHelp.TestIfPlatformSupported();
|
||||
return NativeMethods.SteamEncryptedAppTicket_GetTicketAppID(rgubTicketDecrypted, cubTicketDecrypted);
|
||||
}
|
||||
|
||||
public static bool BUserOwnsAppInTicket(byte[] rgubTicketDecrypted, uint cubTicketDecrypted, AppId_t nAppID) {
|
||||
InteropHelp.TestIfPlatformSupported();
|
||||
return NativeMethods.SteamEncryptedAppTicket_BUserOwnsAppInTicket(rgubTicketDecrypted, cubTicketDecrypted, nAppID);
|
||||
}
|
||||
|
||||
public static bool BUserIsVacBanned(byte[] rgubTicketDecrypted, uint cubTicketDecrypted) {
|
||||
InteropHelp.TestIfPlatformSupported();
|
||||
return NativeMethods.SteamEncryptedAppTicket_BUserIsVacBanned(rgubTicketDecrypted, cubTicketDecrypted);
|
||||
}
|
||||
|
||||
public static byte[] GetUserVariableData(byte[] rgubTicketDecrypted, uint cubTicketDecrypted, out uint pcubUserData) {
|
||||
InteropHelp.TestIfPlatformSupported();
|
||||
IntPtr punSecretData = NativeMethods.SteamEncryptedAppTicket_GetUserVariableData(rgubTicketDecrypted, cubTicketDecrypted, out pcubUserData);
|
||||
byte[] ret = new byte[pcubUserData];
|
||||
System.Runtime.InteropServices.Marshal.Copy(punSecretData, ret, 0, (int)pcubUserData);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static bool BIsTicketSigned(byte[] rgubTicketDecrypted, uint cubTicketDecrypted, byte[] pubRSAKey, uint cubRSAKey) {
|
||||
InteropHelp.TestIfPlatformSupported();
|
||||
return NativeMethods.SteamEncryptedAppTicket_BIsTicketSigned(rgubTicketDecrypted, cubTicketDecrypted, pubRSAKey, cubRSAKey);
|
||||
}
|
||||
}
|
||||
|
||||
internal static class CSteamAPIContext {
|
||||
internal static void Clear() {
|
||||
m_pSteamClient = IntPtr.Zero;
|
||||
m_pSteamUser = IntPtr.Zero;
|
||||
m_pSteamFriends = IntPtr.Zero;
|
||||
m_pSteamUtils = IntPtr.Zero;
|
||||
m_pSteamMatchmaking = IntPtr.Zero;
|
||||
m_pSteamUserStats = IntPtr.Zero;
|
||||
m_pSteamApps = IntPtr.Zero;
|
||||
m_pSteamMatchmakingServers = IntPtr.Zero;
|
||||
m_pSteamNetworking = IntPtr.Zero;
|
||||
m_pSteamRemoteStorage = IntPtr.Zero;
|
||||
m_pSteamHTTP = IntPtr.Zero;
|
||||
m_pSteamScreenshots = IntPtr.Zero;
|
||||
m_pSteamGameSearch = IntPtr.Zero;
|
||||
m_pSteamMusic = IntPtr.Zero;
|
||||
m_pController = IntPtr.Zero;
|
||||
m_pSteamUGC = IntPtr.Zero;
|
||||
m_pSteamAppList = IntPtr.Zero;
|
||||
m_pSteamMusic = IntPtr.Zero;
|
||||
m_pSteamMusicRemote = IntPtr.Zero;
|
||||
m_pSteamHTMLSurface = IntPtr.Zero;
|
||||
m_pSteamInventory = IntPtr.Zero;
|
||||
m_pSteamVideo = IntPtr.Zero;
|
||||
m_pSteamParentalSettings = IntPtr.Zero;
|
||||
m_pSteamInput = IntPtr.Zero;
|
||||
m_pSteamParties = IntPtr.Zero;
|
||||
m_pSteamRemotePlay = IntPtr.Zero;
|
||||
}
|
||||
|
||||
internal static bool Init() {
|
||||
HSteamUser hSteamUser = SteamAPI.GetHSteamUser();
|
||||
HSteamPipe hSteamPipe = SteamAPI.GetHSteamPipe();
|
||||
if (hSteamPipe == (HSteamPipe)0) { return false; }
|
||||
|
||||
using (var pchVersionString = new InteropHelp.UTF8StringHandle(Constants.STEAMCLIENT_INTERFACE_VERSION)) {
|
||||
m_pSteamClient = NativeMethods.SteamInternal_CreateInterface(pchVersionString);
|
||||
}
|
||||
|
||||
if (m_pSteamClient == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamUser = SteamClient.GetISteamUser(hSteamUser, hSteamPipe, Constants.STEAMUSER_INTERFACE_VERSION);
|
||||
if (m_pSteamUser == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamFriends = SteamClient.GetISteamFriends(hSteamUser, hSteamPipe, Constants.STEAMFRIENDS_INTERFACE_VERSION);
|
||||
if (m_pSteamFriends == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamUtils = SteamClient.GetISteamUtils(hSteamPipe, Constants.STEAMUTILS_INTERFACE_VERSION);
|
||||
if (m_pSteamUtils == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamMatchmaking = SteamClient.GetISteamMatchmaking(hSteamUser, hSteamPipe, Constants.STEAMMATCHMAKING_INTERFACE_VERSION);
|
||||
if (m_pSteamMatchmaking == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamMatchmakingServers = SteamClient.GetISteamMatchmakingServers(hSteamUser, hSteamPipe, Constants.STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION);
|
||||
if (m_pSteamMatchmakingServers == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamUserStats = SteamClient.GetISteamUserStats(hSteamUser, hSteamPipe, Constants.STEAMUSERSTATS_INTERFACE_VERSION);
|
||||
if (m_pSteamUserStats == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamApps = SteamClient.GetISteamApps(hSteamUser, hSteamPipe, Constants.STEAMAPPS_INTERFACE_VERSION);
|
||||
if (m_pSteamApps == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamNetworking = SteamClient.GetISteamNetworking(hSteamUser, hSteamPipe, Constants.STEAMNETWORKING_INTERFACE_VERSION);
|
||||
if (m_pSteamNetworking == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamRemoteStorage = SteamClient.GetISteamRemoteStorage(hSteamUser, hSteamPipe, Constants.STEAMREMOTESTORAGE_INTERFACE_VERSION);
|
||||
if (m_pSteamRemoteStorage == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamScreenshots = SteamClient.GetISteamScreenshots(hSteamUser, hSteamPipe, Constants.STEAMSCREENSHOTS_INTERFACE_VERSION);
|
||||
if (m_pSteamScreenshots == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamGameSearch = SteamClient.GetISteamGameSearch(hSteamUser, hSteamPipe, Constants.STEAMGAMESEARCH_INTERFACE_VERSION);
|
||||
if (m_pSteamGameSearch == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamHTTP = SteamClient.GetISteamHTTP(hSteamUser, hSteamPipe, Constants.STEAMHTTP_INTERFACE_VERSION);
|
||||
if (m_pSteamHTTP == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pController = SteamClient.GetISteamController(hSteamUser, hSteamPipe, Constants.STEAMCONTROLLER_INTERFACE_VERSION);
|
||||
if (m_pController == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamUGC = SteamClient.GetISteamUGC(hSteamUser, hSteamPipe, Constants.STEAMUGC_INTERFACE_VERSION);
|
||||
if (m_pSteamUGC == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamAppList = SteamClient.GetISteamAppList(hSteamUser, hSteamPipe, Constants.STEAMAPPLIST_INTERFACE_VERSION);
|
||||
if (m_pSteamAppList == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamMusic = SteamClient.GetISteamMusic(hSteamUser, hSteamPipe, Constants.STEAMMUSIC_INTERFACE_VERSION);
|
||||
if (m_pSteamMusic == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamMusicRemote = SteamClient.GetISteamMusicRemote(hSteamUser, hSteamPipe, Constants.STEAMMUSICREMOTE_INTERFACE_VERSION);
|
||||
if (m_pSteamMusicRemote == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamHTMLSurface = SteamClient.GetISteamHTMLSurface(hSteamUser, hSteamPipe, Constants.STEAMHTMLSURFACE_INTERFACE_VERSION);
|
||||
if (m_pSteamHTMLSurface == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamInventory = SteamClient.GetISteamInventory(hSteamUser, hSteamPipe, Constants.STEAMINVENTORY_INTERFACE_VERSION);
|
||||
if (m_pSteamInventory == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamVideo = SteamClient.GetISteamVideo(hSteamUser, hSteamPipe, Constants.STEAMVIDEO_INTERFACE_VERSION);
|
||||
if (m_pSteamVideo == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamParentalSettings = SteamClient.GetISteamParentalSettings(hSteamUser, hSteamPipe, Constants.STEAMPARENTALSETTINGS_INTERFACE_VERSION);
|
||||
if (m_pSteamParentalSettings == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamInput = SteamClient.GetISteamInput(hSteamUser, hSteamPipe, Constants.STEAMINPUT_INTERFACE_VERSION);
|
||||
if (m_pSteamInput == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamParties = SteamClient.GetISteamParties(hSteamUser, hSteamPipe, Constants.STEAMPARTIES_INTERFACE_VERSION);
|
||||
if (m_pSteamParties == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamRemotePlay = SteamClient.GetISteamRemotePlay(hSteamUser, hSteamPipe, Constants.STEAMREMOTEPLAY_INTERFACE_VERSION);
|
||||
if (m_pSteamRemotePlay == IntPtr.Zero) { return false; }
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
internal static IntPtr GetSteamClient() { return m_pSteamClient; }
|
||||
internal static IntPtr GetSteamUser() { return m_pSteamUser; }
|
||||
internal static IntPtr GetSteamFriends() { return m_pSteamFriends; }
|
||||
internal static IntPtr GetSteamUtils() { return m_pSteamUtils; }
|
||||
internal static IntPtr GetSteamMatchmaking() { return m_pSteamMatchmaking; }
|
||||
internal static IntPtr GetSteamUserStats() { return m_pSteamUserStats; }
|
||||
internal static IntPtr GetSteamApps() { return m_pSteamApps; }
|
||||
internal static IntPtr GetSteamMatchmakingServers() { return m_pSteamMatchmakingServers; }
|
||||
internal static IntPtr GetSteamNetworking() { return m_pSteamNetworking; }
|
||||
internal static IntPtr GetSteamRemoteStorage() { return m_pSteamRemoteStorage; }
|
||||
internal static IntPtr GetSteamScreenshots() { return m_pSteamScreenshots; }
|
||||
internal static IntPtr GetSteamGameSearch() { return m_pSteamGameSearch; }
|
||||
internal static IntPtr GetSteamHTTP() { return m_pSteamHTTP; }
|
||||
internal static IntPtr GetSteamController() { return m_pController; }
|
||||
internal static IntPtr GetSteamUGC() { return m_pSteamUGC; }
|
||||
internal static IntPtr GetSteamAppList() { return m_pSteamAppList; }
|
||||
internal static IntPtr GetSteamMusic() { return m_pSteamMusic; }
|
||||
internal static IntPtr GetSteamMusicRemote() { return m_pSteamMusicRemote; }
|
||||
internal static IntPtr GetSteamHTMLSurface() { return m_pSteamHTMLSurface; }
|
||||
internal static IntPtr GetSteamInventory() { return m_pSteamInventory; }
|
||||
internal static IntPtr GetSteamVideo() { return m_pSteamVideo; }
|
||||
internal static IntPtr GetSteamParentalSettings() { return m_pSteamParentalSettings; }
|
||||
internal static IntPtr GetSteamInput() { return m_pSteamInput; }
|
||||
internal static IntPtr GetSteamParties() { return m_pSteamParties; }
|
||||
internal static IntPtr GetSteamRemotePlay() { return m_pSteamRemotePlay; }
|
||||
|
||||
private static IntPtr m_pSteamClient;
|
||||
private static IntPtr m_pSteamUser;
|
||||
private static IntPtr m_pSteamFriends;
|
||||
private static IntPtr m_pSteamUtils;
|
||||
private static IntPtr m_pSteamMatchmaking;
|
||||
private static IntPtr m_pSteamUserStats;
|
||||
private static IntPtr m_pSteamApps;
|
||||
private static IntPtr m_pSteamMatchmakingServers;
|
||||
private static IntPtr m_pSteamNetworking;
|
||||
private static IntPtr m_pSteamRemoteStorage;
|
||||
private static IntPtr m_pSteamScreenshots;
|
||||
private static IntPtr m_pSteamGameSearch;
|
||||
private static IntPtr m_pSteamHTTP;
|
||||
private static IntPtr m_pController;
|
||||
private static IntPtr m_pSteamUGC;
|
||||
private static IntPtr m_pSteamAppList;
|
||||
private static IntPtr m_pSteamMusic;
|
||||
private static IntPtr m_pSteamMusicRemote;
|
||||
private static IntPtr m_pSteamHTMLSurface;
|
||||
private static IntPtr m_pSteamInventory;
|
||||
private static IntPtr m_pSteamVideo;
|
||||
private static IntPtr m_pSteamParentalSettings;
|
||||
private static IntPtr m_pSteamInput;
|
||||
private static IntPtr m_pSteamParties;
|
||||
private static IntPtr m_pSteamRemotePlay;
|
||||
}
|
||||
|
||||
internal static class CSteamGameServerAPIContext {
|
||||
internal static void Clear() {
|
||||
m_pSteamClient = IntPtr.Zero;
|
||||
m_pSteamGameServer = IntPtr.Zero;
|
||||
m_pSteamUtils = IntPtr.Zero;
|
||||
m_pSteamNetworking = IntPtr.Zero;
|
||||
m_pSteamGameServerStats = IntPtr.Zero;
|
||||
m_pSteamHTTP = IntPtr.Zero;
|
||||
m_pSteamInventory = IntPtr.Zero;
|
||||
m_pSteamUGC = IntPtr.Zero;
|
||||
m_pSteamApps = IntPtr.Zero;
|
||||
}
|
||||
|
||||
internal static bool Init() {
|
||||
HSteamUser hSteamUser = GameServer.GetHSteamUser();
|
||||
HSteamPipe hSteamPipe = GameServer.GetHSteamPipe();
|
||||
if (hSteamPipe == (HSteamPipe)0) { return false; }
|
||||
|
||||
using (var pchVersionString = new InteropHelp.UTF8StringHandle(Constants.STEAMCLIENT_INTERFACE_VERSION)) {
|
||||
m_pSteamClient = NativeMethods.SteamInternal_CreateInterface(pchVersionString);
|
||||
}
|
||||
if (m_pSteamClient == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamGameServer = SteamGameServerClient.GetISteamGameServer(hSteamUser, hSteamPipe, Constants.STEAMGAMESERVER_INTERFACE_VERSION);
|
||||
if (m_pSteamGameServer == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamUtils = SteamGameServerClient.GetISteamUtils(hSteamPipe, Constants.STEAMUTILS_INTERFACE_VERSION);
|
||||
if (m_pSteamUtils == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamNetworking = SteamGameServerClient.GetISteamNetworking(hSteamUser, hSteamPipe, Constants.STEAMNETWORKING_INTERFACE_VERSION);
|
||||
if (m_pSteamNetworking == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamGameServerStats = SteamGameServerClient.GetISteamGameServerStats(hSteamUser, hSteamPipe, Constants.STEAMGAMESERVERSTATS_INTERFACE_VERSION);
|
||||
if (m_pSteamGameServerStats == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamHTTP = SteamGameServerClient.GetISteamHTTP(hSteamUser, hSteamPipe, Constants.STEAMHTTP_INTERFACE_VERSION);
|
||||
if (m_pSteamHTTP == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamInventory = SteamGameServerClient.GetISteamInventory(hSteamUser, hSteamPipe, Constants.STEAMINVENTORY_INTERFACE_VERSION);
|
||||
if (m_pSteamInventory == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamUGC = SteamGameServerClient.GetISteamUGC(hSteamUser, hSteamPipe, Constants.STEAMUGC_INTERFACE_VERSION);
|
||||
if (m_pSteamUGC == IntPtr.Zero) { return false; }
|
||||
|
||||
m_pSteamApps = SteamGameServerClient.GetISteamApps(hSteamUser, hSteamPipe, Constants.STEAMAPPS_INTERFACE_VERSION);
|
||||
if (m_pSteamApps == IntPtr.Zero) { return false; }
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
internal static IntPtr GetSteamClient() { return m_pSteamClient; }
|
||||
internal static IntPtr GetSteamGameServer() { return m_pSteamGameServer; }
|
||||
internal static IntPtr GetSteamUtils() { return m_pSteamUtils; }
|
||||
internal static IntPtr GetSteamNetworking() { return m_pSteamNetworking; }
|
||||
internal static IntPtr GetSteamGameServerStats() { return m_pSteamGameServerStats; }
|
||||
internal static IntPtr GetSteamHTTP() { return m_pSteamHTTP; }
|
||||
internal static IntPtr GetSteamInventory() { return m_pSteamInventory; }
|
||||
internal static IntPtr GetSteamUGC() { return m_pSteamUGC; }
|
||||
internal static IntPtr GetSteamApps() { return m_pSteamApps; }
|
||||
|
||||
private static IntPtr m_pSteamClient;
|
||||
private static IntPtr m_pSteamGameServer;
|
||||
private static IntPtr m_pSteamUtils;
|
||||
private static IntPtr m_pSteamNetworking;
|
||||
private static IntPtr m_pSteamGameServerStats;
|
||||
private static IntPtr m_pSteamHTTP;
|
||||
private static IntPtr m_pSteamInventory;
|
||||
private static IntPtr m_pSteamUGC;
|
||||
private static IntPtr m_pSteamApps;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,228 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class Constants {
|
||||
public const string STEAMAPPLIST_INTERFACE_VERSION = "STEAMAPPLIST_INTERFACE_VERSION001";
|
||||
public const string STEAMAPPS_INTERFACE_VERSION = "STEAMAPPS_INTERFACE_VERSION008";
|
||||
public const string STEAMAPPTICKET_INTERFACE_VERSION = "STEAMAPPTICKET_INTERFACE_VERSION001";
|
||||
public const string STEAMCLIENT_INTERFACE_VERSION = "SteamClient019";
|
||||
public const string STEAMCONTROLLER_INTERFACE_VERSION = "SteamController007";
|
||||
public const string STEAMFRIENDS_INTERFACE_VERSION = "SteamFriends017";
|
||||
public const string STEAMGAMECOORDINATOR_INTERFACE_VERSION = "SteamGameCoordinator001";
|
||||
public const string STEAMGAMESERVER_INTERFACE_VERSION = "SteamGameServer012";
|
||||
public const string STEAMGAMESERVERSTATS_INTERFACE_VERSION = "SteamGameServerStats001";
|
||||
public const string STEAMHTMLSURFACE_INTERFACE_VERSION = "STEAMHTMLSURFACE_INTERFACE_VERSION_005";
|
||||
public const string STEAMHTTP_INTERFACE_VERSION = "STEAMHTTP_INTERFACE_VERSION003";
|
||||
public const string STEAMINPUT_INTERFACE_VERSION = "SteamInput001";
|
||||
public const string STEAMINVENTORY_INTERFACE_VERSION = "STEAMINVENTORY_INTERFACE_V003";
|
||||
public const string STEAMMATCHMAKING_INTERFACE_VERSION = "SteamMatchMaking009";
|
||||
public const string STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION = "SteamMatchMakingServers002";
|
||||
public const string STEAMGAMESEARCH_INTERFACE_VERSION = "SteamMatchGameSearch001";
|
||||
public const string STEAMPARTIES_INTERFACE_VERSION = "SteamParties002";
|
||||
public const string STEAMMUSIC_INTERFACE_VERSION = "STEAMMUSIC_INTERFACE_VERSION001";
|
||||
public const string STEAMMUSICREMOTE_INTERFACE_VERSION = "STEAMMUSICREMOTE_INTERFACE_VERSION001";
|
||||
public const string STEAMNETWORKING_INTERFACE_VERSION = "SteamNetworking005";
|
||||
public const string STEAMPARENTALSETTINGS_INTERFACE_VERSION = "STEAMPARENTALSETTINGS_INTERFACE_VERSION001";
|
||||
public const string STEAMREMOTEPLAY_INTERFACE_VERSION = "STEAMREMOTEPLAY_INTERFACE_VERSION001";
|
||||
public const string STEAMREMOTESTORAGE_INTERFACE_VERSION = "STEAMREMOTESTORAGE_INTERFACE_VERSION014";
|
||||
public const string STEAMSCREENSHOTS_INTERFACE_VERSION = "STEAMSCREENSHOTS_INTERFACE_VERSION003";
|
||||
public const string STEAMUGC_INTERFACE_VERSION = "STEAMUGC_INTERFACE_VERSION013";
|
||||
public const string STEAMUSER_INTERFACE_VERSION = "SteamUser020";
|
||||
public const string STEAMUSERSTATS_INTERFACE_VERSION = "STEAMUSERSTATS_INTERFACE_VERSION011";
|
||||
public const string STEAMUTILS_INTERFACE_VERSION = "SteamUtils009";
|
||||
public const string STEAMVIDEO_INTERFACE_VERSION = "STEAMVIDEO_INTERFACE_V002";
|
||||
public const int k_cubAppProofOfPurchaseKeyMax = 240; // max supported length of a legacy cd key
|
||||
// maximum length of friend group name (not including terminating nul!)
|
||||
public const int k_cchMaxFriendsGroupName = 64;
|
||||
// maximum number of groups a single user is allowed
|
||||
public const int k_cFriendsGroupLimit = 100;
|
||||
public const int k_cEnumerateFollowersMax = 50;
|
||||
// maximum number of characters in a user's name. Two flavors; one for UTF-8 and one for UTF-16.
|
||||
// The UTF-8 version has to be very generous to accomodate characters that get large when encoded
|
||||
// in UTF-8.
|
||||
public const int k_cchPersonaNameMax = 128;
|
||||
public const int k_cwchPersonaNameMax = 32;
|
||||
// size limit on chat room or member metadata
|
||||
public const int k_cubChatMetadataMax = 8192;
|
||||
// size limits on Rich Presence data
|
||||
public const int k_cchMaxRichPresenceKeys = 30;
|
||||
public const int k_cchMaxRichPresenceKeyLength = 64;
|
||||
public const int k_cchMaxRichPresenceValueLength = 256;
|
||||
// game server flags
|
||||
public const int k_unServerFlagNone = 0x00;
|
||||
public const int k_unServerFlagActive = 0x01; // server has users playing
|
||||
public const int k_unServerFlagSecure = 0x02; // server wants to be secure
|
||||
public const int k_unServerFlagDedicated = 0x04; // server is dedicated
|
||||
public const int k_unServerFlagLinux = 0x08; // linux build
|
||||
public const int k_unServerFlagPassworded = 0x10; // password protected
|
||||
public const int k_unServerFlagPrivate = 0x20; // server shouldn't list on master server and
|
||||
// game server flags
|
||||
public const int k_unFavoriteFlagNone = 0x00;
|
||||
public const int k_unFavoriteFlagFavorite = 0x01; // this game favorite entry is for the favorites list
|
||||
public const int k_unFavoriteFlagHistory = 0x02; // this game favorite entry is for the history list
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Defines the largest allowed file size. Cloud files cannot be written
|
||||
// in a single chunk over 100MB (and cannot be over 200MB total.)
|
||||
//-----------------------------------------------------------------------------
|
||||
public const int k_unMaxCloudFileChunkSize = 100 * 1024 * 1024;
|
||||
public const int k_cchPublishedDocumentTitleMax = 128 + 1;
|
||||
public const int k_cchPublishedDocumentDescriptionMax = 8000;
|
||||
public const int k_cchPublishedDocumentChangeDescriptionMax = 8000;
|
||||
public const int k_unEnumeratePublishedFilesMaxResults = 50;
|
||||
public const int k_cchTagListMax = 1024 + 1;
|
||||
public const int k_cchFilenameMax = 260;
|
||||
public const int k_cchPublishedFileURLMax = 256;
|
||||
public const int k_nScreenshotMaxTaggedUsers = 32;
|
||||
public const int k_nScreenshotMaxTaggedPublishedFiles = 32;
|
||||
public const int k_cubUFSTagTypeMax = 255;
|
||||
public const int k_cubUFSTagValueMax = 255;
|
||||
// Required with of a thumbnail provided to AddScreenshotToLibrary. If you do not provide a thumbnail
|
||||
// one will be generated.
|
||||
public const int k_ScreenshotThumbWidth = 200;
|
||||
public const int kNumUGCResultsPerPage = 50;
|
||||
public const int k_cchDeveloperMetadataMax = 5000;
|
||||
// size limit on stat or achievement name (UTF-8 encoded)
|
||||
public const int k_cchStatNameMax = 128;
|
||||
// maximum number of bytes for a leaderboard name (UTF-8 encoded)
|
||||
public const int k_cchLeaderboardNameMax = 128;
|
||||
// maximum number of details int32's storable for a single leaderboard entry
|
||||
public const int k_cLeaderboardDetailsMax = 64;
|
||||
//
|
||||
// Max size (in bytes of UTF-8 data, not in characters) of server fields, including null terminator.
|
||||
// WARNING: These cannot be changed easily, without breaking clients using old interfaces.
|
||||
//
|
||||
public const int k_cbMaxGameServerGameDir = 32;
|
||||
public const int k_cbMaxGameServerMapName = 32;
|
||||
public const int k_cbMaxGameServerGameDescription = 64;
|
||||
public const int k_cbMaxGameServerName = 64;
|
||||
public const int k_cbMaxGameServerTags = 128;
|
||||
public const int k_cbMaxGameServerGameData = 2048;
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Base values for callback identifiers, each callback must
|
||||
// have a unique ID.
|
||||
//-----------------------------------------------------------------------------
|
||||
public const int k_iSteamUserCallbacks = 100;
|
||||
public const int k_iSteamGameServerCallbacks = 200;
|
||||
public const int k_iSteamFriendsCallbacks = 300;
|
||||
public const int k_iSteamBillingCallbacks = 400;
|
||||
public const int k_iSteamMatchmakingCallbacks = 500;
|
||||
public const int k_iSteamContentServerCallbacks = 600;
|
||||
public const int k_iSteamUtilsCallbacks = 700;
|
||||
public const int k_iClientFriendsCallbacks = 800;
|
||||
public const int k_iClientUserCallbacks = 900;
|
||||
public const int k_iSteamAppsCallbacks = 1000;
|
||||
public const int k_iSteamUserStatsCallbacks = 1100;
|
||||
public const int k_iSteamNetworkingCallbacks = 1200;
|
||||
public const int k_iSteamNetworkingSocketsCallbacks = 1220;
|
||||
public const int k_iSteamNetworkingMessagesCallbacks = 1250;
|
||||
public const int k_iSteamNetworkingUtilsCallbacks = 1280;
|
||||
public const int k_iClientRemoteStorageCallbacks = 1300;
|
||||
public const int k_iClientDepotBuilderCallbacks = 1400;
|
||||
public const int k_iSteamGameServerItemsCallbacks = 1500;
|
||||
public const int k_iClientUtilsCallbacks = 1600;
|
||||
public const int k_iSteamGameCoordinatorCallbacks = 1700;
|
||||
public const int k_iSteamGameServerStatsCallbacks = 1800;
|
||||
public const int k_iSteam2AsyncCallbacks = 1900;
|
||||
public const int k_iSteamGameStatsCallbacks = 2000;
|
||||
public const int k_iClientHTTPCallbacks = 2100;
|
||||
public const int k_iClientScreenshotsCallbacks = 2200;
|
||||
public const int k_iSteamScreenshotsCallbacks = 2300;
|
||||
public const int k_iClientAudioCallbacks = 2400;
|
||||
public const int k_iClientUnifiedMessagesCallbacks = 2500;
|
||||
public const int k_iSteamStreamLauncherCallbacks = 2600;
|
||||
public const int k_iClientControllerCallbacks = 2700;
|
||||
public const int k_iSteamControllerCallbacks = 2800;
|
||||
public const int k_iClientParentalSettingsCallbacks = 2900;
|
||||
public const int k_iClientDeviceAuthCallbacks = 3000;
|
||||
public const int k_iClientNetworkDeviceManagerCallbacks = 3100;
|
||||
public const int k_iClientMusicCallbacks = 3200;
|
||||
public const int k_iClientRemoteClientManagerCallbacks = 3300;
|
||||
public const int k_iClientUGCCallbacks = 3400;
|
||||
public const int k_iSteamStreamClientCallbacks = 3500;
|
||||
public const int k_IClientProductBuilderCallbacks = 3600;
|
||||
public const int k_iClientShortcutsCallbacks = 3700;
|
||||
public const int k_iClientRemoteControlManagerCallbacks = 3800;
|
||||
public const int k_iSteamAppListCallbacks = 3900;
|
||||
public const int k_iSteamMusicCallbacks = 4000;
|
||||
public const int k_iSteamMusicRemoteCallbacks = 4100;
|
||||
public const int k_iClientVRCallbacks = 4200;
|
||||
public const int k_iClientGameNotificationCallbacks = 4300;
|
||||
public const int k_iSteamGameNotificationCallbacks = 4400;
|
||||
public const int k_iSteamHTMLSurfaceCallbacks = 4500;
|
||||
public const int k_iClientVideoCallbacks = 4600;
|
||||
public const int k_iClientInventoryCallbacks = 4700;
|
||||
public const int k_iClientBluetoothManagerCallbacks = 4800;
|
||||
public const int k_iClientSharedConnectionCallbacks = 4900;
|
||||
public const int k_ISteamParentalSettingsCallbacks = 5000;
|
||||
public const int k_iClientShaderCallbacks = 5100;
|
||||
public const int k_iSteamGameSearchCallbacks = 5200;
|
||||
public const int k_iSteamPartiesCallbacks = 5300;
|
||||
public const int k_iClientPartiesCallbacks = 5400;
|
||||
public const int k_iSteamSTARCallbacks = 5500;
|
||||
public const int k_iClientSTARCallbacks = 5600;
|
||||
public const int k_iSteamRemotePlayCallbacks = 5700;
|
||||
public const int k_unSteamAccountIDMask = -1;
|
||||
public const int k_unSteamAccountInstanceMask = 0x000FFFFF;
|
||||
// we allow 3 simultaneous user account instances right now, 1= desktop, 2 = console, 4 = web, 0 = all
|
||||
public const int k_unSteamUserDesktopInstance = 1;
|
||||
public const int k_unSteamUserConsoleInstance = 2;
|
||||
public const int k_unSteamUserWebInstance = 4;
|
||||
public const int k_cchGameExtraInfoMax = 64;
|
||||
public const int k_nSteamEncryptedAppTicketSymmetricKeyLen = 32;
|
||||
public const int k_cubSaltSize = 8;
|
||||
public const ulong k_GIDNil = 0xffffffffffffffff;
|
||||
public const ulong k_TxnIDNil = k_GIDNil;
|
||||
public const ulong k_TxnIDUnknown = 0;
|
||||
public const int k_uPackageIdInvalid = -1;
|
||||
public const ulong k_ulAssetClassIdInvalid = 0x0;
|
||||
public const int k_uPhysicalItemIdInvalid = 0x0;
|
||||
public const int k_uCellIDInvalid = -1;
|
||||
public const int k_uPartnerIdInvalid = 0;
|
||||
public const ulong k_ulPartyBeaconIdInvalid = 0;
|
||||
public const int STEAM_CONTROLLER_MAX_COUNT = 16;
|
||||
public const int STEAM_CONTROLLER_MAX_ANALOG_ACTIONS = 16;
|
||||
public const int STEAM_CONTROLLER_MAX_DIGITAL_ACTIONS = 128;
|
||||
public const int STEAM_CONTROLLER_MAX_ORIGINS = 8;
|
||||
public const int STEAM_CONTROLLER_MAX_ACTIVE_LAYERS = 16;
|
||||
// When sending an option to a specific controller handle, you can send to all controllers via this command
|
||||
public const ulong STEAM_CONTROLLER_HANDLE_ALL_CONTROLLERS = 0xFFFFFFFFFFFFFFFF;
|
||||
public const float STEAM_CONTROLLER_MIN_ANALOG_ACTION_DATA = -1.0f;
|
||||
public const float STEAM_CONTROLLER_MAX_ANALOG_ACTION_DATA = 1.0f;
|
||||
public const ushort MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE = 0xFFFF;
|
||||
public const int INVALID_HTTPREQUEST_HANDLE = 0;
|
||||
public const int STEAM_INPUT_MAX_COUNT = 16;
|
||||
public const int STEAM_INPUT_MAX_ANALOG_ACTIONS = 16;
|
||||
public const int STEAM_INPUT_MAX_DIGITAL_ACTIONS = 128;
|
||||
public const int STEAM_INPUT_MAX_ORIGINS = 8;
|
||||
public const int STEAM_INPUT_MAX_ACTIVE_LAYERS = 16;
|
||||
// When sending an option to a specific controller handle, you can send to all devices via this command
|
||||
public const ulong STEAM_INPUT_HANDLE_ALL_CONTROLLERS = 0xFFFFFFFFFFFFFFFF;
|
||||
public const float STEAM_INPUT_MIN_ANALOG_ACTION_DATA = -1.0f;
|
||||
public const float STEAM_INPUT_MAX_ANALOG_ACTION_DATA = 1.0f;
|
||||
// maximum number of characters a lobby metadata key can be
|
||||
public const byte k_nMaxLobbyKeyLength = 255;
|
||||
public const int k_SteamMusicNameMaxLength = 255;
|
||||
public const int k_SteamMusicPNGMaxLength = 65535;
|
||||
//-----------------------------------------------------------------------------
|
||||
// Constants used for query ports.
|
||||
//-----------------------------------------------------------------------------
|
||||
public const int QUERY_PORT_NOT_INITIALIZED = 0xFFFF; // We haven't asked the GS for this query port's actual value yet.
|
||||
public const int QUERY_PORT_ERROR = 0xFFFE; // We were unable to get the query port for this server.
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,234 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct ControllerAnalogActionData_t {
|
||||
// Type of data coming from this action, this will match what got specified in the action set
|
||||
public EControllerSourceMode eMode;
|
||||
|
||||
// The current state of this action; will be delta updates for mouse actions
|
||||
public float x, y;
|
||||
|
||||
// Whether or not this action is currently available to be bound in the active action set
|
||||
public byte bActive;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct ControllerDigitalActionData_t {
|
||||
// The current state of this action; will be true if currently pressed
|
||||
public byte bState;
|
||||
|
||||
// Whether or not this action is currently available to be bound in the active action set
|
||||
public byte bActive;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = Packsize.value)]
|
||||
public struct ControllerMotionData_t {
|
||||
// Sensor-fused absolute rotation; will drift in heading
|
||||
public float rotQuatX;
|
||||
public float rotQuatY;
|
||||
public float rotQuatZ;
|
||||
public float rotQuatW;
|
||||
|
||||
// Positional acceleration
|
||||
public float posAccelX;
|
||||
public float posAccelY;
|
||||
public float posAccelZ;
|
||||
|
||||
// Angular velocity
|
||||
public float rotVelX;
|
||||
public float rotVelY;
|
||||
public float rotVelZ;
|
||||
}
|
||||
|
||||
// friend game played information
|
||||
[StructLayout(LayoutKind.Sequential, Pack = Packsize.value)]
|
||||
public struct FriendGameInfo_t {
|
||||
public CGameID m_gameID;
|
||||
public uint m_unGameIP;
|
||||
public ushort m_usGamePort;
|
||||
public ushort m_usQueryPort;
|
||||
public CSteamID m_steamIDLobby;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: information about user sessions
|
||||
//-----------------------------------------------------------------------------
|
||||
public struct FriendSessionStateInfo_t {
|
||||
public uint m_uiOnlineSessionInstances;
|
||||
public byte m_uiPublishedToFriendsSessionInstance;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct InputAnalogActionData_t {
|
||||
// Type of data coming from this action, this will match what got specified in the action set
|
||||
public EInputSourceMode eMode;
|
||||
|
||||
// The current state of this action; will be delta updates for mouse actions
|
||||
public float x, y;
|
||||
|
||||
// Whether or not this action is currently available to be bound in the active action set
|
||||
public byte bActive;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct InputDigitalActionData_t {
|
||||
// The current state of this action; will be true if currently pressed
|
||||
public byte bState;
|
||||
|
||||
// Whether or not this action is currently available to be bound in the active action set
|
||||
public byte bActive;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = Packsize.value)]
|
||||
public struct InputMotionData_t {
|
||||
// Sensor-fused absolute rotation; will drift in heading
|
||||
public float rotQuatX;
|
||||
public float rotQuatY;
|
||||
public float rotQuatZ;
|
||||
public float rotQuatW;
|
||||
|
||||
// Positional acceleration
|
||||
public float posAccelX;
|
||||
public float posAccelY;
|
||||
public float posAccelZ;
|
||||
|
||||
// Angular velocity
|
||||
public float rotVelX;
|
||||
public float rotVelY;
|
||||
public float rotVelZ;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = Packsize.value)]
|
||||
public struct SteamItemDetails_t {
|
||||
public SteamItemInstanceID_t m_itemId;
|
||||
public SteamItemDef_t m_iDefinition;
|
||||
public ushort m_unQuantity;
|
||||
public ushort m_unFlags; // see ESteamItemFlags
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = Packsize.value)]
|
||||
public struct SteamPartyBeaconLocation_t {
|
||||
public ESteamPartyBeaconLocationType m_eType;
|
||||
public ulong m_ulLocationID;
|
||||
}
|
||||
|
||||
// connection state to a specified user, returned by GetP2PSessionState()
|
||||
// this is under-the-hood info about what's going on with a SendP2PPacket(), shouldn't be needed except for debuggin
|
||||
[StructLayout(LayoutKind.Sequential, Pack = Packsize.value)]
|
||||
public struct P2PSessionState_t {
|
||||
public byte m_bConnectionActive; // true if we've got an active open connection
|
||||
public byte m_bConnecting; // true if we're currently trying to establish a connection
|
||||
public byte m_eP2PSessionError; // last error recorded (see enum above)
|
||||
public byte m_bUsingRelay; // true if it's going through a relay server (TURN)
|
||||
public int m_nBytesQueuedForSend;
|
||||
public int m_nPacketsQueuedForSend;
|
||||
public uint m_nRemoteIP; // potential IP:Port of remote host. Could be TURN server.
|
||||
public ushort m_nRemotePort; // Only exists for compatibility with older authentication api's
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Structure that contains an array of const char * strings and the number of those strings
|
||||
//-----------------------------------------------------------------------------
|
||||
[StructLayout(LayoutKind.Sequential, Pack = Packsize.value)]
|
||||
public struct SteamParamStringArray_t {
|
||||
public IntPtr m_ppStrings;
|
||||
public int m_nNumStrings;
|
||||
}
|
||||
|
||||
// Details for a single published file/UGC
|
||||
[StructLayout(LayoutKind.Sequential, Pack = Packsize.value)]
|
||||
public struct SteamUGCDetails_t {
|
||||
public PublishedFileId_t m_nPublishedFileId;
|
||||
public EResult m_eResult; // The result of the operation.
|
||||
public EWorkshopFileType m_eFileType; // Type of the file
|
||||
public AppId_t m_nCreatorAppID; // ID of the app that created this file.
|
||||
public AppId_t m_nConsumerAppID; // ID of the app that will consume this file.
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = Constants.k_cchPublishedDocumentTitleMax)]
|
||||
public string m_rgchTitle; // title of document
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = Constants.k_cchPublishedDocumentDescriptionMax)]
|
||||
public string m_rgchDescription; // description of document
|
||||
public ulong m_ulSteamIDOwner; // Steam ID of the user who created this content.
|
||||
public uint m_rtimeCreated; // time when the published file was created
|
||||
public uint m_rtimeUpdated; // time when the published file was last updated
|
||||
public uint m_rtimeAddedToUserList; // time when the user added the published file to their list (not always applicable)
|
||||
public ERemoteStoragePublishedFileVisibility m_eVisibility; // visibility
|
||||
[MarshalAs(UnmanagedType.I1)]
|
||||
public bool m_bBanned; // whether the file was banned
|
||||
[MarshalAs(UnmanagedType.I1)]
|
||||
public bool m_bAcceptedForUse; // developer has specifically flagged this item as accepted in the Workshop
|
||||
[MarshalAs(UnmanagedType.I1)]
|
||||
public bool m_bTagsTruncated; // whether the list of tags was too long to be returned in the provided buffer
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = Constants.k_cchTagListMax)]
|
||||
public string m_rgchTags; // comma separated list of all tags associated with this file
|
||||
// file/url information
|
||||
public UGCHandle_t m_hFile; // The handle of the primary file
|
||||
public UGCHandle_t m_hPreviewFile; // The handle of the preview file
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = Constants.k_cchFilenameMax)]
|
||||
public string m_pchFileName; // The cloud filename of the primary file
|
||||
public int m_nFileSize; // Size of the primary file
|
||||
public int m_nPreviewFileSize; // Size of the preview file
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = Constants.k_cchPublishedFileURLMax)]
|
||||
public string m_rgchURL; // URL (for a video or a website)
|
||||
// voting information
|
||||
public uint m_unVotesUp; // number of votes up
|
||||
public uint m_unVotesDown; // number of votes down
|
||||
public float m_flScore; // calculated score
|
||||
// collection details
|
||||
public uint m_unNumChildren;
|
||||
}
|
||||
|
||||
// structure that contains client callback data
|
||||
// see callbacks documentation for more details
|
||||
[StructLayout(LayoutKind.Sequential, Pack = Packsize.value)]
|
||||
public struct CallbackMsg_t {
|
||||
public int m_hSteamUser;
|
||||
public int m_iCallback;
|
||||
public IntPtr m_pubParam;
|
||||
public int m_cubParam;
|
||||
}
|
||||
|
||||
// a single entry in a leaderboard, as returned by GetDownloadedLeaderboardEntry()
|
||||
[StructLayout(LayoutKind.Sequential, Pack = Packsize.value)]
|
||||
public struct LeaderboardEntry_t {
|
||||
public CSteamID m_steamIDUser; // user with the entry - use SteamFriends()->GetFriendPersonaName() & SteamFriends()->GetFriendAvatar() to get more info
|
||||
public int m_nGlobalRank; // [1..N], where N is the number of users with an entry in the leaderboard
|
||||
public int m_nScore; // score as set in the leaderboard
|
||||
public int m_cDetails; // number of int32 details available for this entry
|
||||
public UGCHandle_t m_hUGC; // handle for UGC attached to the entry
|
||||
}
|
||||
|
||||
/// Store key/value pair used in matchmaking queries.
|
||||
///
|
||||
/// Actually, the name Key/Value is a bit misleading. The "key" is better
|
||||
/// understood as "filter operation code" and the "value" is the operand to this
|
||||
/// filter operation. The meaning of the operand depends upon the filter.
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct MatchMakingKeyValuePair_t {
|
||||
MatchMakingKeyValuePair_t(string strKey, string strValue) {
|
||||
m_szKey = strKey;
|
||||
m_szValue = strValue;
|
||||
}
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
|
||||
public string m_szKey;
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
|
||||
public string m_szValue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,63 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamAppList {
|
||||
public static uint GetNumInstalledApps() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamAppList_GetNumInstalledApps(CSteamAPIContext.GetSteamAppList());
|
||||
}
|
||||
|
||||
public static uint GetInstalledApps(AppId_t[] pvecAppID, uint unMaxAppIDs) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamAppList_GetInstalledApps(CSteamAPIContext.GetSteamAppList(), pvecAppID, unMaxAppIDs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns -1 if no name was found</para>
|
||||
/// </summary>
|
||||
public static int GetAppName(AppId_t nAppID, out string pchName, int cchNameMax) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
IntPtr pchName2 = Marshal.AllocHGlobal(cchNameMax);
|
||||
int ret = NativeMethods.ISteamAppList_GetAppName(CSteamAPIContext.GetSteamAppList(), nAppID, pchName2, cchNameMax);
|
||||
pchName = ret != -1 ? InteropHelp.PtrToStringUTF8(pchName2) : null;
|
||||
Marshal.FreeHGlobal(pchName2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns -1 if no dir was found</para>
|
||||
/// </summary>
|
||||
public static int GetAppInstallDir(AppId_t nAppID, out string pchDirectory, int cchNameMax) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
IntPtr pchDirectory2 = Marshal.AllocHGlobal(cchNameMax);
|
||||
int ret = NativeMethods.ISteamAppList_GetAppInstallDir(CSteamAPIContext.GetSteamAppList(), nAppID, pchDirectory2, cchNameMax);
|
||||
pchDirectory = ret != -1 ? InteropHelp.PtrToStringUTF8(pchDirectory2) : null;
|
||||
Marshal.FreeHGlobal(pchDirectory2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> return the buildid of this app, may change at any time based on backend updates to the game</para>
|
||||
/// </summary>
|
||||
public static int GetAppBuildId(AppId_t nAppID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamAppList_GetAppBuildId(CSteamAPIContext.GetSteamAppList(), nAppID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,261 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamApps {
|
||||
public static bool BIsSubscribed() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamApps_BIsSubscribed(CSteamAPIContext.GetSteamApps());
|
||||
}
|
||||
|
||||
public static bool BIsLowViolence() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamApps_BIsLowViolence(CSteamAPIContext.GetSteamApps());
|
||||
}
|
||||
|
||||
public static bool BIsCybercafe() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamApps_BIsCybercafe(CSteamAPIContext.GetSteamApps());
|
||||
}
|
||||
|
||||
public static bool BIsVACBanned() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamApps_BIsVACBanned(CSteamAPIContext.GetSteamApps());
|
||||
}
|
||||
|
||||
public static string GetCurrentGameLanguage() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamApps_GetCurrentGameLanguage(CSteamAPIContext.GetSteamApps()));
|
||||
}
|
||||
|
||||
public static string GetAvailableGameLanguages() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamApps_GetAvailableGameLanguages(CSteamAPIContext.GetSteamApps()));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> only use this member if you need to check ownership of another game related to yours, a demo for example</para>
|
||||
/// </summary>
|
||||
public static bool BIsSubscribedApp(AppId_t appID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamApps_BIsSubscribedApp(CSteamAPIContext.GetSteamApps(), appID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Takes AppID of DLC and checks if the user owns the DLC & if the DLC is installed</para>
|
||||
/// </summary>
|
||||
public static bool BIsDlcInstalled(AppId_t appID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamApps_BIsDlcInstalled(CSteamAPIContext.GetSteamApps(), appID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the Unix time of the purchase of the app</para>
|
||||
/// </summary>
|
||||
public static uint GetEarliestPurchaseUnixTime(AppId_t nAppID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamApps_GetEarliestPurchaseUnixTime(CSteamAPIContext.GetSteamApps(), nAppID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Checks if the user is subscribed to the current app through a free weekend</para>
|
||||
/// <para> This function will return false for users who have a retail or other type of license</para>
|
||||
/// <para> Before using, please ask your Valve technical contact how to package and secure your free weekened</para>
|
||||
/// </summary>
|
||||
public static bool BIsSubscribedFromFreeWeekend() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamApps_BIsSubscribedFromFreeWeekend(CSteamAPIContext.GetSteamApps());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns the number of DLC pieces for the running app</para>
|
||||
/// </summary>
|
||||
public static int GetDLCCount() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamApps_GetDLCCount(CSteamAPIContext.GetSteamApps());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns metadata for DLC by index, of range [0, GetDLCCount()]</para>
|
||||
/// </summary>
|
||||
public static bool BGetDLCDataByIndex(int iDLC, out AppId_t pAppID, out bool pbAvailable, out string pchName, int cchNameBufferSize) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
IntPtr pchName2 = Marshal.AllocHGlobal(cchNameBufferSize);
|
||||
bool ret = NativeMethods.ISteamApps_BGetDLCDataByIndex(CSteamAPIContext.GetSteamApps(), iDLC, out pAppID, out pbAvailable, pchName2, cchNameBufferSize);
|
||||
pchName = ret ? InteropHelp.PtrToStringUTF8(pchName2) : null;
|
||||
Marshal.FreeHGlobal(pchName2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Install/Uninstall control for optional DLC</para>
|
||||
/// </summary>
|
||||
public static void InstallDLC(AppId_t nAppID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamApps_InstallDLC(CSteamAPIContext.GetSteamApps(), nAppID);
|
||||
}
|
||||
|
||||
public static void UninstallDLC(AppId_t nAppID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamApps_UninstallDLC(CSteamAPIContext.GetSteamApps(), nAppID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Request legacy cd-key for yourself or owned DLC. If you are interested in this</para>
|
||||
/// <para> data then make sure you provide us with a list of valid keys to be distributed</para>
|
||||
/// <para> to users when they purchase the game, before the game ships.</para>
|
||||
/// <para> You'll receive an AppProofOfPurchaseKeyResponse_t callback when</para>
|
||||
/// <para> the key is available (which may be immediately).</para>
|
||||
/// </summary>
|
||||
public static void RequestAppProofOfPurchaseKey(AppId_t nAppID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamApps_RequestAppProofOfPurchaseKey(CSteamAPIContext.GetSteamApps(), nAppID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns current beta branch name, 'public' is the default branch</para>
|
||||
/// </summary>
|
||||
public static bool GetCurrentBetaName(out string pchName, int cchNameBufferSize) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
IntPtr pchName2 = Marshal.AllocHGlobal(cchNameBufferSize);
|
||||
bool ret = NativeMethods.ISteamApps_GetCurrentBetaName(CSteamAPIContext.GetSteamApps(), pchName2, cchNameBufferSize);
|
||||
pchName = ret ? InteropHelp.PtrToStringUTF8(pchName2) : null;
|
||||
Marshal.FreeHGlobal(pchName2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> signal Steam that game files seems corrupt or missing</para>
|
||||
/// </summary>
|
||||
public static bool MarkContentCorrupt(bool bMissingFilesOnly) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamApps_MarkContentCorrupt(CSteamAPIContext.GetSteamApps(), bMissingFilesOnly);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> return installed depots in mount order</para>
|
||||
/// </summary>
|
||||
public static uint GetInstalledDepots(AppId_t appID, DepotId_t[] pvecDepots, uint cMaxDepots) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamApps_GetInstalledDepots(CSteamAPIContext.GetSteamApps(), appID, pvecDepots, cMaxDepots);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns current app install folder for AppID, returns folder name length</para>
|
||||
/// </summary>
|
||||
public static uint GetAppInstallDir(AppId_t appID, out string pchFolder, uint cchFolderBufferSize) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
IntPtr pchFolder2 = Marshal.AllocHGlobal((int)cchFolderBufferSize);
|
||||
uint ret = NativeMethods.ISteamApps_GetAppInstallDir(CSteamAPIContext.GetSteamApps(), appID, pchFolder2, cchFolderBufferSize);
|
||||
pchFolder = ret != 0 ? InteropHelp.PtrToStringUTF8(pchFolder2) : null;
|
||||
Marshal.FreeHGlobal(pchFolder2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns true if that app is installed (not necessarily owned)</para>
|
||||
/// </summary>
|
||||
public static bool BIsAppInstalled(AppId_t appID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamApps_BIsAppInstalled(CSteamAPIContext.GetSteamApps(), appID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the SteamID of the original owner. If this CSteamID is different from ISteamUser::GetSteamID(),</para>
|
||||
/// <para> the user has a temporary license borrowed via Family Sharing</para>
|
||||
/// </summary>
|
||||
public static CSteamID GetAppOwner() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (CSteamID)NativeMethods.ISteamApps_GetAppOwner(CSteamAPIContext.GetSteamApps());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns the associated launch param if the game is run via steam://run/<appid>//?param1=value1&param2=value2&param3=value3 etc.</para>
|
||||
/// <para> Parameter names starting with the character '@' are reserved for internal use and will always return and empty string.</para>
|
||||
/// <para> Parameter names starting with an underscore '_' are reserved for steam features -- they can be queried by the game,</para>
|
||||
/// <para> but it is advised that you not param names beginning with an underscore for your own features.</para>
|
||||
/// <para> Check for new launch parameters on callback NewUrlLaunchParameters_t</para>
|
||||
/// </summary>
|
||||
public static string GetLaunchQueryParam(string pchKey) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchKey2 = new InteropHelp.UTF8StringHandle(pchKey)) {
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamApps_GetLaunchQueryParam(CSteamAPIContext.GetSteamApps(), pchKey2));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> get download progress for optional DLC</para>
|
||||
/// </summary>
|
||||
public static bool GetDlcDownloadProgress(AppId_t nAppID, out ulong punBytesDownloaded, out ulong punBytesTotal) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamApps_GetDlcDownloadProgress(CSteamAPIContext.GetSteamApps(), nAppID, out punBytesDownloaded, out punBytesTotal);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> return the buildid of this app, may change at any time based on backend updates to the game</para>
|
||||
/// </summary>
|
||||
public static int GetAppBuildId() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamApps_GetAppBuildId(CSteamAPIContext.GetSteamApps());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Request all proof of purchase keys for the calling appid and asociated DLC.</para>
|
||||
/// <para> A series of AppProofOfPurchaseKeyResponse_t callbacks will be sent with</para>
|
||||
/// <para> appropriate appid values, ending with a final callback where the m_nAppId</para>
|
||||
/// <para> member is k_uAppIdInvalid (zero).</para>
|
||||
/// </summary>
|
||||
public static void RequestAllProofOfPurchaseKeys() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamApps_RequestAllProofOfPurchaseKeys(CSteamAPIContext.GetSteamApps());
|
||||
}
|
||||
|
||||
public static SteamAPICall_t GetFileDetails(string pszFileName) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pszFileName2 = new InteropHelp.UTF8StringHandle(pszFileName)) {
|
||||
return (SteamAPICall_t)NativeMethods.ISteamApps_GetFileDetails(CSteamAPIContext.GetSteamApps(), pszFileName2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Get command line if game was launched via Steam URL, e.g. steam://run/<appid>//<command line>/.</para>
|
||||
/// <para> This method of passing a connect string (used when joining via rich presence, accepting an</para>
|
||||
/// <para> invite, etc) is preferable to passing the connect string on the operating system command</para>
|
||||
/// <para> line, which is a security risk. In order for rich presence joins to go through this</para>
|
||||
/// <para> path and not be placed on the OS command line, you must set a value in your app's</para>
|
||||
/// <para> configuration on Steam. Ask Valve for help with this.</para>
|
||||
/// <para> If game was already running and launched again, the NewUrlLaunchParameters_t will be fired.</para>
|
||||
/// </summary>
|
||||
public static int GetLaunchCommandLine(out string pszCommandLine, int cubCommandLine) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
IntPtr pszCommandLine2 = Marshal.AllocHGlobal(cubCommandLine);
|
||||
int ret = NativeMethods.ISteamApps_GetLaunchCommandLine(CSteamAPIContext.GetSteamApps(), pszCommandLine2, cubCommandLine);
|
||||
pszCommandLine = ret != -1 ? InteropHelp.PtrToStringUTF8(pszCommandLine2) : null;
|
||||
Marshal.FreeHGlobal(pszCommandLine2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Check if user borrowed this game via Family Sharing, If true, call GetAppOwner() to get the lender SteamID</para>
|
||||
/// </summary>
|
||||
public static bool BIsSubscribedFromFamilySharing() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamApps_BIsSubscribedFromFamilySharing(CSteamAPIContext.GetSteamApps());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,376 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamClient {
|
||||
/// <summary>
|
||||
/// <para> Creates a communication pipe to the Steam client.</para>
|
||||
/// <para> NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling</para>
|
||||
/// </summary>
|
||||
public static HSteamPipe CreateSteamPipe() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (HSteamPipe)NativeMethods.ISteamClient_CreateSteamPipe(CSteamAPIContext.GetSteamClient());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Releases a previously created communications pipe</para>
|
||||
/// <para> NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling</para>
|
||||
/// </summary>
|
||||
public static bool BReleaseSteamPipe(HSteamPipe hSteamPipe) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamClient_BReleaseSteamPipe(CSteamAPIContext.GetSteamClient(), hSteamPipe);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> connects to an existing global user, failing if none exists</para>
|
||||
/// <para> used by the game to coordinate with the steamUI</para>
|
||||
/// <para> NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling</para>
|
||||
/// </summary>
|
||||
public static HSteamUser ConnectToGlobalUser(HSteamPipe hSteamPipe) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (HSteamUser)NativeMethods.ISteamClient_ConnectToGlobalUser(CSteamAPIContext.GetSteamClient(), hSteamPipe);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> used by game servers, create a steam user that won't be shared with anyone else</para>
|
||||
/// <para> NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling</para>
|
||||
/// </summary>
|
||||
public static HSteamUser CreateLocalUser(out HSteamPipe phSteamPipe, EAccountType eAccountType) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (HSteamUser)NativeMethods.ISteamClient_CreateLocalUser(CSteamAPIContext.GetSteamClient(), out phSteamPipe, eAccountType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> removes an allocated user</para>
|
||||
/// <para> NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling</para>
|
||||
/// </summary>
|
||||
public static void ReleaseUser(HSteamPipe hSteamPipe, HSteamUser hUser) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamClient_ReleaseUser(CSteamAPIContext.GetSteamClient(), hSteamPipe, hUser);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> retrieves the ISteamUser interface associated with the handle</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamUser(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamUser(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> retrieves the ISteamGameServer interface associated with the handle</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamGameServer(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamGameServer(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> set the local IP and Port to bind to</para>
|
||||
/// <para> this must be set before CreateLocalUser()</para>
|
||||
/// </summary>
|
||||
public static void SetLocalIPBinding(uint unIP, ushort usPort) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamClient_SetLocalIPBinding(CSteamAPIContext.GetSteamClient(), unIP, usPort);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the ISteamFriends interface</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamFriends(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamFriends(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the ISteamUtils interface</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamUtils(HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamUtils(CSteamAPIContext.GetSteamClient(), hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the ISteamMatchmaking interface</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamMatchmaking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamMatchmaking(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the ISteamMatchmakingServers interface</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamMatchmakingServers(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamMatchmakingServers(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the a generic interface</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamGenericInterface(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamGenericInterface(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the ISteamUserStats interface</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamUserStats(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamUserStats(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the ISteamGameServerStats interface</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamGameServerStats(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamGameServerStats(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns apps interface</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamApps(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamApps(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> networking</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamNetworking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamNetworking(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> remote storage</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamRemoteStorage(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamRemoteStorage(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> user screenshots</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamScreenshots(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamScreenshots(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> game search</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamGameSearch(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamGameSearch(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the number of IPC calls made since the last time this function was called</para>
|
||||
/// <para> Used for perf debugging so you can understand how many IPC calls your game makes per frame</para>
|
||||
/// <para> Every IPC call is at minimum a thread context switch if not a process one so you want to rate</para>
|
||||
/// <para> control how often you do them.</para>
|
||||
/// </summary>
|
||||
public static uint GetIPCCallCount() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamClient_GetIPCCallCount(CSteamAPIContext.GetSteamClient());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> API warning handling</para>
|
||||
/// <para> 'int' is the severity; 0 for msg, 1 for warning</para>
|
||||
/// <para> 'const char *' is the text of the message</para>
|
||||
/// <para> callbacks will occur directly after the API function is called that generated the warning or message.</para>
|
||||
/// </summary>
|
||||
public static void SetWarningMessageHook(SteamAPIWarningMessageHook_t pFunction) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamClient_SetWarningMessageHook(CSteamAPIContext.GetSteamClient(), pFunction);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Trigger global shutdown for the DLL</para>
|
||||
/// </summary>
|
||||
public static bool BShutdownIfAllPipesClosed() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamClient_BShutdownIfAllPipesClosed(CSteamAPIContext.GetSteamClient());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Expose HTTP interface</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamHTTP(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamHTTP(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Exposes the ISteamController interface - deprecated in favor of Steam Input</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamController(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamController(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Exposes the ISteamUGC interface</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamUGC(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamUGC(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns app list interface, only available on specially registered apps</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamAppList(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamAppList(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Music Player</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamMusic(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamMusic(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Music Player Remote</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamMusicRemote(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamMusicRemote(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> html page display</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamHTMLSurface(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamHTMLSurface(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> inventory</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamInventory(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamInventory(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Video</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamVideo(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamVideo(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Parental controls</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamParentalSettings(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamParentalSettings(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Exposes the Steam Input interface for controller support</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamInput(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamInput(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Steam Parties interface</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamParties(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamParties(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Steam Remote Play interface</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamRemotePlay(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamRemotePlay(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,325 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamController {
|
||||
/// <summary>
|
||||
/// <para> Init and Shutdown must be called when starting/ending use of this interface</para>
|
||||
/// </summary>
|
||||
public static bool Init() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamController_Init(CSteamAPIContext.GetSteamController());
|
||||
}
|
||||
|
||||
public static bool Shutdown() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamController_Shutdown(CSteamAPIContext.GetSteamController());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Synchronize API state with the latest Steam Controller inputs available. This</para>
|
||||
/// <para> is performed automatically by SteamAPI_RunCallbacks, but for the absolute lowest</para>
|
||||
/// <para> possible latency, you call this directly before reading controller state. This must</para>
|
||||
/// <para> be called from somewhere before GetConnectedControllers will return any handles</para>
|
||||
/// </summary>
|
||||
public static void RunFrame() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamController_RunFrame(CSteamAPIContext.GetSteamController());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Enumerate currently connected controllers</para>
|
||||
/// <para> handlesOut should point to a STEAM_CONTROLLER_MAX_COUNT sized array of ControllerHandle_t handles</para>
|
||||
/// <para> Returns the number of handles written to handlesOut</para>
|
||||
/// </summary>
|
||||
public static int GetConnectedControllers(ControllerHandle_t[] handlesOut) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
if (handlesOut != null && handlesOut.Length != Constants.STEAM_CONTROLLER_MAX_COUNT) {
|
||||
throw new System.ArgumentException("handlesOut must be the same size as Constants.STEAM_CONTROLLER_MAX_COUNT!");
|
||||
}
|
||||
return NativeMethods.ISteamController_GetConnectedControllers(CSteamAPIContext.GetSteamController(), handlesOut);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>-----------------------------------------------------------------------------</para>
|
||||
/// <para> ACTION SETS</para>
|
||||
/// <para>-----------------------------------------------------------------------------</para>
|
||||
/// <para> Lookup the handle for an Action Set. Best to do this once on startup, and store the handles for all future API calls.</para>
|
||||
/// </summary>
|
||||
public static ControllerActionSetHandle_t GetActionSetHandle(string pszActionSetName) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pszActionSetName2 = new InteropHelp.UTF8StringHandle(pszActionSetName)) {
|
||||
return (ControllerActionSetHandle_t)NativeMethods.ISteamController_GetActionSetHandle(CSteamAPIContext.GetSteamController(), pszActionSetName2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Reconfigure the controller to use the specified action set (ie 'Menu', 'Walk' or 'Drive')</para>
|
||||
/// <para> This is cheap, and can be safely called repeatedly. It's often easier to repeatedly call it in</para>
|
||||
/// <para> your state loops, instead of trying to place it in all of your state transitions.</para>
|
||||
/// </summary>
|
||||
public static void ActivateActionSet(ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamController_ActivateActionSet(CSteamAPIContext.GetSteamController(), controllerHandle, actionSetHandle);
|
||||
}
|
||||
|
||||
public static ControllerActionSetHandle_t GetCurrentActionSet(ControllerHandle_t controllerHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (ControllerActionSetHandle_t)NativeMethods.ISteamController_GetCurrentActionSet(CSteamAPIContext.GetSteamController(), controllerHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> ACTION SET LAYERS</para>
|
||||
/// </summary>
|
||||
public static void ActivateActionSetLayer(ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetLayerHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamController_ActivateActionSetLayer(CSteamAPIContext.GetSteamController(), controllerHandle, actionSetLayerHandle);
|
||||
}
|
||||
|
||||
public static void DeactivateActionSetLayer(ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetLayerHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamController_DeactivateActionSetLayer(CSteamAPIContext.GetSteamController(), controllerHandle, actionSetLayerHandle);
|
||||
}
|
||||
|
||||
public static void DeactivateAllActionSetLayers(ControllerHandle_t controllerHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamController_DeactivateAllActionSetLayers(CSteamAPIContext.GetSteamController(), controllerHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Enumerate currently active layers</para>
|
||||
/// <para> handlesOut should point to a STEAM_CONTROLLER_MAX_ACTIVE_LAYERS sized array of ControllerActionSetHandle_t handles.</para>
|
||||
/// <para> Returns the number of handles written to handlesOut</para>
|
||||
/// </summary>
|
||||
public static int GetActiveActionSetLayers(ControllerHandle_t controllerHandle, ControllerActionSetHandle_t[] handlesOut) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
if (handlesOut != null && handlesOut.Length != Constants.STEAM_CONTROLLER_MAX_ACTIVE_LAYERS) {
|
||||
throw new System.ArgumentException("handlesOut must be the same size as Constants.STEAM_CONTROLLER_MAX_ACTIVE_LAYERS!");
|
||||
}
|
||||
return NativeMethods.ISteamController_GetActiveActionSetLayers(CSteamAPIContext.GetSteamController(), controllerHandle, handlesOut);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>-----------------------------------------------------------------------------</para>
|
||||
/// <para> ACTIONS</para>
|
||||
/// <para>-----------------------------------------------------------------------------</para>
|
||||
/// <para> Lookup the handle for a digital action. Best to do this once on startup, and store the handles for all future API calls.</para>
|
||||
/// </summary>
|
||||
public static ControllerDigitalActionHandle_t GetDigitalActionHandle(string pszActionName) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pszActionName2 = new InteropHelp.UTF8StringHandle(pszActionName)) {
|
||||
return (ControllerDigitalActionHandle_t)NativeMethods.ISteamController_GetDigitalActionHandle(CSteamAPIContext.GetSteamController(), pszActionName2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns the current state of the supplied digital game action</para>
|
||||
/// </summary>
|
||||
public static ControllerDigitalActionData_t GetDigitalActionData(ControllerHandle_t controllerHandle, ControllerDigitalActionHandle_t digitalActionHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamController_GetDigitalActionData(CSteamAPIContext.GetSteamController(), controllerHandle, digitalActionHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Get the origin(s) for a digital action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action.</para>
|
||||
/// <para> originsOut should point to a STEAM_CONTROLLER_MAX_ORIGINS sized array of EControllerActionOrigin handles. The EControllerActionOrigin enum will get extended as support for new controller controllers gets added to</para>
|
||||
/// <para> the Steam client and will exceed the values from this header, please check bounds if you are using a look up table.</para>
|
||||
/// </summary>
|
||||
public static int GetDigitalActionOrigins(ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerDigitalActionHandle_t digitalActionHandle, EControllerActionOrigin[] originsOut) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
if (originsOut != null && originsOut.Length != Constants.STEAM_CONTROLLER_MAX_ORIGINS) {
|
||||
throw new System.ArgumentException("originsOut must be the same size as Constants.STEAM_CONTROLLER_MAX_ORIGINS!");
|
||||
}
|
||||
return NativeMethods.ISteamController_GetDigitalActionOrigins(CSteamAPIContext.GetSteamController(), controllerHandle, actionSetHandle, digitalActionHandle, originsOut);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Lookup the handle for an analog action. Best to do this once on startup, and store the handles for all future API calls.</para>
|
||||
/// </summary>
|
||||
public static ControllerAnalogActionHandle_t GetAnalogActionHandle(string pszActionName) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pszActionName2 = new InteropHelp.UTF8StringHandle(pszActionName)) {
|
||||
return (ControllerAnalogActionHandle_t)NativeMethods.ISteamController_GetAnalogActionHandle(CSteamAPIContext.GetSteamController(), pszActionName2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns the current state of these supplied analog game action</para>
|
||||
/// </summary>
|
||||
public static ControllerAnalogActionData_t GetAnalogActionData(ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamController_GetAnalogActionData(CSteamAPIContext.GetSteamController(), controllerHandle, analogActionHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Get the origin(s) for an analog action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action.</para>
|
||||
/// <para> originsOut should point to a STEAM_CONTROLLER_MAX_ORIGINS sized array of EControllerActionOrigin handles. The EControllerActionOrigin enum will get extended as support for new controller controllers gets added to</para>
|
||||
/// <para> the Steam client and will exceed the values from this header, please check bounds if you are using a look up table.</para>
|
||||
/// </summary>
|
||||
public static int GetAnalogActionOrigins(ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerAnalogActionHandle_t analogActionHandle, EControllerActionOrigin[] originsOut) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
if (originsOut != null && originsOut.Length != Constants.STEAM_CONTROLLER_MAX_ORIGINS) {
|
||||
throw new System.ArgumentException("originsOut must be the same size as Constants.STEAM_CONTROLLER_MAX_ORIGINS!");
|
||||
}
|
||||
return NativeMethods.ISteamController_GetAnalogActionOrigins(CSteamAPIContext.GetSteamController(), controllerHandle, actionSetHandle, analogActionHandle, originsOut);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Get a local path to art for on-screen glyph for a particular origin - this call is cheap</para>
|
||||
/// </summary>
|
||||
public static string GetGlyphForActionOrigin(EControllerActionOrigin eOrigin) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamController_GetGlyphForActionOrigin(CSteamAPIContext.GetSteamController(), eOrigin));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns a localized string (from Steam's language setting) for the specified origin - this call is serialized</para>
|
||||
/// </summary>
|
||||
public static string GetStringForActionOrigin(EControllerActionOrigin eOrigin) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamController_GetStringForActionOrigin(CSteamAPIContext.GetSteamController(), eOrigin));
|
||||
}
|
||||
|
||||
public static void StopAnalogActionMomentum(ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t eAction) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamController_StopAnalogActionMomentum(CSteamAPIContext.GetSteamController(), controllerHandle, eAction);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns raw motion data from the specified controller</para>
|
||||
/// </summary>
|
||||
public static ControllerMotionData_t GetMotionData(ControllerHandle_t controllerHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamController_GetMotionData(CSteamAPIContext.GetSteamController(), controllerHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>-----------------------------------------------------------------------------</para>
|
||||
/// <para> OUTPUTS</para>
|
||||
/// <para>-----------------------------------------------------------------------------</para>
|
||||
/// <para> Trigger a haptic pulse on a controller</para>
|
||||
/// </summary>
|
||||
public static void TriggerHapticPulse(ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, ushort usDurationMicroSec) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamController_TriggerHapticPulse(CSteamAPIContext.GetSteamController(), controllerHandle, eTargetPad, usDurationMicroSec);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Trigger a pulse with a duty cycle of usDurationMicroSec / usOffMicroSec, unRepeat times.</para>
|
||||
/// <para> nFlags is currently unused and reserved for future use.</para>
|
||||
/// </summary>
|
||||
public static void TriggerRepeatedHapticPulse(ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, ushort usDurationMicroSec, ushort usOffMicroSec, ushort unRepeat, uint nFlags) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamController_TriggerRepeatedHapticPulse(CSteamAPIContext.GetSteamController(), controllerHandle, eTargetPad, usDurationMicroSec, usOffMicroSec, unRepeat, nFlags);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Trigger a vibration event on supported controllers.</para>
|
||||
/// </summary>
|
||||
public static void TriggerVibration(ControllerHandle_t controllerHandle, ushort usLeftSpeed, ushort usRightSpeed) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamController_TriggerVibration(CSteamAPIContext.GetSteamController(), controllerHandle, usLeftSpeed, usRightSpeed);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Set the controller LED color on supported controllers.</para>
|
||||
/// </summary>
|
||||
public static void SetLEDColor(ControllerHandle_t controllerHandle, byte nColorR, byte nColorG, byte nColorB, uint nFlags) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamController_SetLEDColor(CSteamAPIContext.GetSteamController(), controllerHandle, nColorR, nColorG, nColorB, nFlags);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>-----------------------------------------------------------------------------</para>
|
||||
/// <para> Utility functions availible without using the rest of Steam Input API</para>
|
||||
/// <para>-----------------------------------------------------------------------------</para>
|
||||
/// <para> Invokes the Steam overlay and brings up the binding screen if the user is using Big Picture Mode</para>
|
||||
/// <para> If the user is not in Big Picture Mode it will open up the binding in a new window</para>
|
||||
/// </summary>
|
||||
public static bool ShowBindingPanel(ControllerHandle_t controllerHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamController_ShowBindingPanel(CSteamAPIContext.GetSteamController(), controllerHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns the input type for a particular handle</para>
|
||||
/// </summary>
|
||||
public static ESteamInputType GetInputTypeForHandle(ControllerHandle_t controllerHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamController_GetInputTypeForHandle(CSteamAPIContext.GetSteamController(), controllerHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns the associated controller handle for the specified emulated gamepad - can be used with the above 2 functions</para>
|
||||
/// <para> to identify controllers presented to your game over Xinput. Returns 0 if the Xinput index isn't associated with Steam Input</para>
|
||||
/// </summary>
|
||||
public static ControllerHandle_t GetControllerForGamepadIndex(int nIndex) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (ControllerHandle_t)NativeMethods.ISteamController_GetControllerForGamepadIndex(CSteamAPIContext.GetSteamController(), nIndex);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns the associated gamepad index for the specified controller, if emulating a gamepad or -1 if not associated with an Xinput index</para>
|
||||
/// </summary>
|
||||
public static int GetGamepadIndexForController(ControllerHandle_t ulControllerHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamController_GetGamepadIndexForController(CSteamAPIContext.GetSteamController(), ulControllerHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns a localized string (from Steam's language setting) for the specified Xbox controller origin.</para>
|
||||
/// </summary>
|
||||
public static string GetStringForXboxOrigin(EXboxOrigin eOrigin) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamController_GetStringForXboxOrigin(CSteamAPIContext.GetSteamController(), eOrigin));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Get a local path to art for on-screen glyph for a particular Xbox controller origin.</para>
|
||||
/// </summary>
|
||||
public static string GetGlyphForXboxOrigin(EXboxOrigin eOrigin) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamController_GetGlyphForXboxOrigin(CSteamAPIContext.GetSteamController(), eOrigin));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Get the equivalent ActionOrigin for a given Xbox controller origin this can be chained with GetGlyphForActionOrigin to provide future proof glyphs for</para>
|
||||
/// <para> non-Steam Input API action games. Note - this only translates the buttons directly and doesn't take into account any remapping a user has made in their configuration</para>
|
||||
/// </summary>
|
||||
public static EControllerActionOrigin GetActionOriginFromXboxOrigin(ControllerHandle_t controllerHandle, EXboxOrigin eOrigin) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamController_GetActionOriginFromXboxOrigin(CSteamAPIContext.GetSteamController(), controllerHandle, eOrigin);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Convert an origin to another controller type - for inputs not present on the other controller type this will return k_EControllerActionOrigin_None</para>
|
||||
/// </summary>
|
||||
public static EControllerActionOrigin TranslateActionOrigin(ESteamInputType eDestinationInputType, EControllerActionOrigin eSourceOrigin) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamController_TranslateActionOrigin(CSteamAPIContext.GetSteamController(), eDestinationInputType, eSourceOrigin);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Get the binding revision for a given device. Returns false if the handle was not valid or if a mapping is not yet loaded for the device</para>
|
||||
/// </summary>
|
||||
public static bool GetControllerBindingRevision(ControllerHandle_t controllerHandle, out int pMajor, out int pMinor) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamController_GetControllerBindingRevision(CSteamAPIContext.GetSteamController(), controllerHandle, out pMajor, out pMinor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,629 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamFriends {
|
||||
/// <summary>
|
||||
/// <para> returns the local players name - guaranteed to not be NULL.</para>
|
||||
/// <para> this is the same name as on the users community profile page</para>
|
||||
/// <para> this is stored in UTF-8 format</para>
|
||||
/// <para> like all the other interface functions that return a char *, it's important that this pointer is not saved</para>
|
||||
/// <para> off; it will eventually be free'd or re-allocated</para>
|
||||
/// </summary>
|
||||
public static string GetPersonaName() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamFriends_GetPersonaName(CSteamAPIContext.GetSteamFriends()));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Sets the player name, stores it on the server and publishes the changes to all friends who are online.</para>
|
||||
/// <para> Changes take place locally immediately, and a PersonaStateChange_t is posted, presuming success.</para>
|
||||
/// <para> The final results are available through the return value SteamAPICall_t, using SetPersonaNameResponse_t.</para>
|
||||
/// <para> If the name change fails to happen on the server, then an additional global PersonaStateChange_t will be posted</para>
|
||||
/// <para> to change the name back, in addition to the SetPersonaNameResponse_t callback.</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t SetPersonaName(string pchPersonaName) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchPersonaName2 = new InteropHelp.UTF8StringHandle(pchPersonaName)) {
|
||||
return (SteamAPICall_t)NativeMethods.ISteamFriends_SetPersonaName(CSteamAPIContext.GetSteamFriends(), pchPersonaName2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> gets the status of the current user</para>
|
||||
/// </summary>
|
||||
public static EPersonaState GetPersonaState() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_GetPersonaState(CSteamAPIContext.GetSteamFriends());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> friend iteration</para>
|
||||
/// <para> takes a set of k_EFriendFlags, and returns the number of users the client knows about who meet that criteria</para>
|
||||
/// <para> then GetFriendByIndex() can then be used to return the id's of each of those users</para>
|
||||
/// </summary>
|
||||
public static int GetFriendCount(EFriendFlags iFriendFlags) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_GetFriendCount(CSteamAPIContext.GetSteamFriends(), iFriendFlags);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the steamID of a user</para>
|
||||
/// <para> iFriend is a index of range [0, GetFriendCount())</para>
|
||||
/// <para> iFriendsFlags must be the same value as used in GetFriendCount()</para>
|
||||
/// <para> the returned CSteamID can then be used by all the functions below to access details about the user</para>
|
||||
/// </summary>
|
||||
public static CSteamID GetFriendByIndex(int iFriend, EFriendFlags iFriendFlags) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (CSteamID)NativeMethods.ISteamFriends_GetFriendByIndex(CSteamAPIContext.GetSteamFriends(), iFriend, iFriendFlags);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns a relationship to a user</para>
|
||||
/// </summary>
|
||||
public static EFriendRelationship GetFriendRelationship(CSteamID steamIDFriend) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_GetFriendRelationship(CSteamAPIContext.GetSteamFriends(), steamIDFriend);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the current status of the specified user</para>
|
||||
/// <para> this will only be known by the local user if steamIDFriend is in their friends list; on the same game server; in a chat room or lobby; or in a small group with the local user</para>
|
||||
/// </summary>
|
||||
public static EPersonaState GetFriendPersonaState(CSteamID steamIDFriend) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_GetFriendPersonaState(CSteamAPIContext.GetSteamFriends(), steamIDFriend);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the name another user - guaranteed to not be NULL.</para>
|
||||
/// <para> same rules as GetFriendPersonaState() apply as to whether or not the user knowns the name of the other user</para>
|
||||
/// <para> note that on first joining a lobby, chat room or game server the local user will not known the name of the other users automatically; that information will arrive asyncronously</para>
|
||||
/// </summary>
|
||||
public static string GetFriendPersonaName(CSteamID steamIDFriend) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamFriends_GetFriendPersonaName(CSteamAPIContext.GetSteamFriends(), steamIDFriend));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns true if the friend is actually in a game, and fills in pFriendGameInfo with an extra details</para>
|
||||
/// </summary>
|
||||
public static bool GetFriendGamePlayed(CSteamID steamIDFriend, out FriendGameInfo_t pFriendGameInfo) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_GetFriendGamePlayed(CSteamAPIContext.GetSteamFriends(), steamIDFriend, out pFriendGameInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> accesses old friends names - returns an empty string when their are no more items in the history</para>
|
||||
/// </summary>
|
||||
public static string GetFriendPersonaNameHistory(CSteamID steamIDFriend, int iPersonaName) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamFriends_GetFriendPersonaNameHistory(CSteamAPIContext.GetSteamFriends(), steamIDFriend, iPersonaName));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> friends steam level</para>
|
||||
/// </summary>
|
||||
public static int GetFriendSteamLevel(CSteamID steamIDFriend) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_GetFriendSteamLevel(CSteamAPIContext.GetSteamFriends(), steamIDFriend);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns nickname the current user has set for the specified player. Returns NULL if the no nickname has been set for that player.</para>
|
||||
/// <para> DEPRECATED: GetPersonaName follows the Steam nickname preferences, so apps shouldn't need to care about nicknames explicitly.</para>
|
||||
/// </summary>
|
||||
public static string GetPlayerNickname(CSteamID steamIDPlayer) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamFriends_GetPlayerNickname(CSteamAPIContext.GetSteamFriends(), steamIDPlayer));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> friend grouping (tag) apis</para>
|
||||
/// <para> returns the number of friends groups</para>
|
||||
/// </summary>
|
||||
public static int GetFriendsGroupCount() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_GetFriendsGroupCount(CSteamAPIContext.GetSteamFriends());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the friends group ID for the given index (invalid indices return k_FriendsGroupID_Invalid)</para>
|
||||
/// </summary>
|
||||
public static FriendsGroupID_t GetFriendsGroupIDByIndex(int iFG) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (FriendsGroupID_t)NativeMethods.ISteamFriends_GetFriendsGroupIDByIndex(CSteamAPIContext.GetSteamFriends(), iFG);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the name for the given friends group (NULL in the case of invalid friends group IDs)</para>
|
||||
/// </summary>
|
||||
public static string GetFriendsGroupName(FriendsGroupID_t friendsGroupID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamFriends_GetFriendsGroupName(CSteamAPIContext.GetSteamFriends(), friendsGroupID));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the number of members in a given friends group</para>
|
||||
/// </summary>
|
||||
public static int GetFriendsGroupMembersCount(FriendsGroupID_t friendsGroupID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_GetFriendsGroupMembersCount(CSteamAPIContext.GetSteamFriends(), friendsGroupID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> gets up to nMembersCount members of the given friends group, if fewer exist than requested those positions' SteamIDs will be invalid</para>
|
||||
/// </summary>
|
||||
public static void GetFriendsGroupMembersList(FriendsGroupID_t friendsGroupID, CSteamID[] pOutSteamIDMembers, int nMembersCount) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamFriends_GetFriendsGroupMembersList(CSteamAPIContext.GetSteamFriends(), friendsGroupID, pOutSteamIDMembers, nMembersCount);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns true if the specified user meets any of the criteria specified in iFriendFlags</para>
|
||||
/// <para> iFriendFlags can be the union (binary or, |) of one or more k_EFriendFlags values</para>
|
||||
/// </summary>
|
||||
public static bool HasFriend(CSteamID steamIDFriend, EFriendFlags iFriendFlags) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_HasFriend(CSteamAPIContext.GetSteamFriends(), steamIDFriend, iFriendFlags);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> clan (group) iteration and access functions</para>
|
||||
/// </summary>
|
||||
public static int GetClanCount() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_GetClanCount(CSteamAPIContext.GetSteamFriends());
|
||||
}
|
||||
|
||||
public static CSteamID GetClanByIndex(int iClan) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (CSteamID)NativeMethods.ISteamFriends_GetClanByIndex(CSteamAPIContext.GetSteamFriends(), iClan);
|
||||
}
|
||||
|
||||
public static string GetClanName(CSteamID steamIDClan) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamFriends_GetClanName(CSteamAPIContext.GetSteamFriends(), steamIDClan));
|
||||
}
|
||||
|
||||
public static string GetClanTag(CSteamID steamIDClan) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamFriends_GetClanTag(CSteamAPIContext.GetSteamFriends(), steamIDClan));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the most recent information we have about what's happening in a clan</para>
|
||||
/// </summary>
|
||||
public static bool GetClanActivityCounts(CSteamID steamIDClan, out int pnOnline, out int pnInGame, out int pnChatting) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_GetClanActivityCounts(CSteamAPIContext.GetSteamFriends(), steamIDClan, out pnOnline, out pnInGame, out pnChatting);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> for clans a user is a member of, they will have reasonably up-to-date information, but for others you'll have to download the info to have the latest</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t DownloadClanActivityCounts(CSteamID[] psteamIDClans, int cClansToRequest) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamFriends_DownloadClanActivityCounts(CSteamAPIContext.GetSteamFriends(), psteamIDClans, cClansToRequest);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> iterators for getting users in a chat room, lobby, game server or clan</para>
|
||||
/// <para> note that large clans that cannot be iterated by the local user</para>
|
||||
/// <para> note that the current user must be in a lobby to retrieve CSteamIDs of other users in that lobby</para>
|
||||
/// <para> steamIDSource can be the steamID of a group, game server, lobby or chat room</para>
|
||||
/// </summary>
|
||||
public static int GetFriendCountFromSource(CSteamID steamIDSource) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_GetFriendCountFromSource(CSteamAPIContext.GetSteamFriends(), steamIDSource);
|
||||
}
|
||||
|
||||
public static CSteamID GetFriendFromSourceByIndex(CSteamID steamIDSource, int iFriend) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (CSteamID)NativeMethods.ISteamFriends_GetFriendFromSourceByIndex(CSteamAPIContext.GetSteamFriends(), steamIDSource, iFriend);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns true if the local user can see that steamIDUser is a member or in steamIDSource</para>
|
||||
/// </summary>
|
||||
public static bool IsUserInSource(CSteamID steamIDUser, CSteamID steamIDSource) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_IsUserInSource(CSteamAPIContext.GetSteamFriends(), steamIDUser, steamIDSource);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> User is in a game pressing the talk button (will suppress the microphone for all voice comms from the Steam friends UI)</para>
|
||||
/// </summary>
|
||||
public static void SetInGameVoiceSpeaking(CSteamID steamIDUser, bool bSpeaking) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamFriends_SetInGameVoiceSpeaking(CSteamAPIContext.GetSteamFriends(), steamIDUser, bSpeaking);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> activates the game overlay, with an optional dialog to open</para>
|
||||
/// <para> valid options include "Friends", "Community", "Players", "Settings", "OfficialGameGroup", "Stats", "Achievements",</para>
|
||||
/// <para> "chatroomgroup/nnnn"</para>
|
||||
/// </summary>
|
||||
public static void ActivateGameOverlay(string pchDialog) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchDialog2 = new InteropHelp.UTF8StringHandle(pchDialog)) {
|
||||
NativeMethods.ISteamFriends_ActivateGameOverlay(CSteamAPIContext.GetSteamFriends(), pchDialog2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> activates game overlay to a specific place</para>
|
||||
/// <para> valid options are</para>
|
||||
/// <para> "steamid" - opens the overlay web browser to the specified user or groups profile</para>
|
||||
/// <para> "chat" - opens a chat window to the specified user, or joins the group chat</para>
|
||||
/// <para> "jointrade" - opens a window to a Steam Trading session that was started with the ISteamEconomy/StartTrade Web API</para>
|
||||
/// <para> "stats" - opens the overlay web browser to the specified user's stats</para>
|
||||
/// <para> "achievements" - opens the overlay web browser to the specified user's achievements</para>
|
||||
/// <para> "friendadd" - opens the overlay in minimal mode prompting the user to add the target user as a friend</para>
|
||||
/// <para> "friendremove" - opens the overlay in minimal mode prompting the user to remove the target friend</para>
|
||||
/// <para> "friendrequestaccept" - opens the overlay in minimal mode prompting the user to accept an incoming friend invite</para>
|
||||
/// <para> "friendrequestignore" - opens the overlay in minimal mode prompting the user to ignore an incoming friend invite</para>
|
||||
/// </summary>
|
||||
public static void ActivateGameOverlayToUser(string pchDialog, CSteamID steamID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchDialog2 = new InteropHelp.UTF8StringHandle(pchDialog)) {
|
||||
NativeMethods.ISteamFriends_ActivateGameOverlayToUser(CSteamAPIContext.GetSteamFriends(), pchDialog2, steamID);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> activates game overlay web browser directly to the specified URL</para>
|
||||
/// <para> full address with protocol type is required, e.g. http://www.steamgames.com/</para>
|
||||
/// </summary>
|
||||
public static void ActivateGameOverlayToWebPage(string pchURL, EActivateGameOverlayToWebPageMode eMode = EActivateGameOverlayToWebPageMode.k_EActivateGameOverlayToWebPageMode_Default) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchURL2 = new InteropHelp.UTF8StringHandle(pchURL)) {
|
||||
NativeMethods.ISteamFriends_ActivateGameOverlayToWebPage(CSteamAPIContext.GetSteamFriends(), pchURL2, eMode);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> activates game overlay to store page for app</para>
|
||||
/// </summary>
|
||||
public static void ActivateGameOverlayToStore(AppId_t nAppID, EOverlayToStoreFlag eFlag) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamFriends_ActivateGameOverlayToStore(CSteamAPIContext.GetSteamFriends(), nAppID, eFlag);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Mark a target user as 'played with'. This is a client-side only feature that requires that the calling user is</para>
|
||||
/// <para> in game</para>
|
||||
/// </summary>
|
||||
public static void SetPlayedWith(CSteamID steamIDUserPlayedWith) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamFriends_SetPlayedWith(CSteamAPIContext.GetSteamFriends(), steamIDUserPlayedWith);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> activates game overlay to open the invite dialog. Invitations will be sent for the provided lobby.</para>
|
||||
/// </summary>
|
||||
public static void ActivateGameOverlayInviteDialog(CSteamID steamIDLobby) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamFriends_ActivateGameOverlayInviteDialog(CSteamAPIContext.GetSteamFriends(), steamIDLobby);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> gets the small (32x32) avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set</para>
|
||||
/// </summary>
|
||||
public static int GetSmallFriendAvatar(CSteamID steamIDFriend) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_GetSmallFriendAvatar(CSteamAPIContext.GetSteamFriends(), steamIDFriend);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> gets the medium (64x64) avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set</para>
|
||||
/// </summary>
|
||||
public static int GetMediumFriendAvatar(CSteamID steamIDFriend) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_GetMediumFriendAvatar(CSteamAPIContext.GetSteamFriends(), steamIDFriend);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> gets the large (184x184) avatar of the current user, which is a handle to be used in IClientUtils::GetImageRGBA(), or 0 if none set</para>
|
||||
/// <para> returns -1 if this image has yet to be loaded, in this case wait for a AvatarImageLoaded_t callback and then call this again</para>
|
||||
/// </summary>
|
||||
public static int GetLargeFriendAvatar(CSteamID steamIDFriend) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_GetLargeFriendAvatar(CSteamAPIContext.GetSteamFriends(), steamIDFriend);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> requests information about a user - persona name & avatar</para>
|
||||
/// <para> if bRequireNameOnly is set, then the avatar of a user isn't downloaded</para>
|
||||
/// <para> - it's a lot slower to download avatars and churns the local cache, so if you don't need avatars, don't request them</para>
|
||||
/// <para> if returns true, it means that data is being requested, and a PersonaStateChanged_t callback will be posted when it's retrieved</para>
|
||||
/// <para> if returns false, it means that we already have all the details about that user, and functions can be called immediately</para>
|
||||
/// </summary>
|
||||
public static bool RequestUserInformation(CSteamID steamIDUser, bool bRequireNameOnly) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_RequestUserInformation(CSteamAPIContext.GetSteamFriends(), steamIDUser, bRequireNameOnly);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> requests information about a clan officer list</para>
|
||||
/// <para> when complete, data is returned in ClanOfficerListResponse_t call result</para>
|
||||
/// <para> this makes available the calls below</para>
|
||||
/// <para> you can only ask about clans that a user is a member of</para>
|
||||
/// <para> note that this won't download avatars automatically; if you get an officer,</para>
|
||||
/// <para> and no avatar image is available, call RequestUserInformation( steamID, false ) to download the avatar</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t RequestClanOfficerList(CSteamID steamIDClan) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamFriends_RequestClanOfficerList(CSteamAPIContext.GetSteamFriends(), steamIDClan);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> iteration of clan officers - can only be done when a RequestClanOfficerList() call has completed</para>
|
||||
/// <para> returns the steamID of the clan owner</para>
|
||||
/// </summary>
|
||||
public static CSteamID GetClanOwner(CSteamID steamIDClan) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (CSteamID)NativeMethods.ISteamFriends_GetClanOwner(CSteamAPIContext.GetSteamFriends(), steamIDClan);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the number of officers in a clan (including the owner)</para>
|
||||
/// </summary>
|
||||
public static int GetClanOfficerCount(CSteamID steamIDClan) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_GetClanOfficerCount(CSteamAPIContext.GetSteamFriends(), steamIDClan);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the steamID of a clan officer, by index, of range [0,GetClanOfficerCount)</para>
|
||||
/// </summary>
|
||||
public static CSteamID GetClanOfficerByIndex(CSteamID steamIDClan, int iOfficer) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (CSteamID)NativeMethods.ISteamFriends_GetClanOfficerByIndex(CSteamAPIContext.GetSteamFriends(), steamIDClan, iOfficer);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> if current user is chat restricted, he can't send or receive any text/voice chat messages.</para>
|
||||
/// <para> the user can't see custom avatars. But the user can be online and send/recv game invites.</para>
|
||||
/// <para> a chat restricted user can't add friends or join any groups.</para>
|
||||
/// </summary>
|
||||
public static uint GetUserRestrictions() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_GetUserRestrictions(CSteamAPIContext.GetSteamFriends());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Rich Presence data is automatically shared between friends who are in the same game</para>
|
||||
/// <para> Each user has a set of Key/Value pairs</para>
|
||||
/// <para> Note the following limits: k_cchMaxRichPresenceKeys, k_cchMaxRichPresenceKeyLength, k_cchMaxRichPresenceValueLength</para>
|
||||
/// <para> There are two magic keys:</para>
|
||||
/// <para> "status" - a UTF-8 string that will show up in the 'view game info' dialog in the Steam friends list</para>
|
||||
/// <para> "connect" - a UTF-8 string that contains the command-line for how a friend can connect to a game</para>
|
||||
/// <para> GetFriendRichPresence() returns an empty string "" if no value is set</para>
|
||||
/// <para> SetRichPresence() to a NULL or an empty string deletes the key</para>
|
||||
/// <para> You can iterate the current set of keys for a friend with GetFriendRichPresenceKeyCount()</para>
|
||||
/// <para> and GetFriendRichPresenceKeyByIndex() (typically only used for debugging)</para>
|
||||
/// </summary>
|
||||
public static bool SetRichPresence(string pchKey, string pchValue) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchKey2 = new InteropHelp.UTF8StringHandle(pchKey))
|
||||
using (var pchValue2 = new InteropHelp.UTF8StringHandle(pchValue)) {
|
||||
return NativeMethods.ISteamFriends_SetRichPresence(CSteamAPIContext.GetSteamFriends(), pchKey2, pchValue2);
|
||||
}
|
||||
}
|
||||
|
||||
public static void ClearRichPresence() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamFriends_ClearRichPresence(CSteamAPIContext.GetSteamFriends());
|
||||
}
|
||||
|
||||
public static string GetFriendRichPresence(CSteamID steamIDFriend, string pchKey) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchKey2 = new InteropHelp.UTF8StringHandle(pchKey)) {
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamFriends_GetFriendRichPresence(CSteamAPIContext.GetSteamFriends(), steamIDFriend, pchKey2));
|
||||
}
|
||||
}
|
||||
|
||||
public static int GetFriendRichPresenceKeyCount(CSteamID steamIDFriend) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_GetFriendRichPresenceKeyCount(CSteamAPIContext.GetSteamFriends(), steamIDFriend);
|
||||
}
|
||||
|
||||
public static string GetFriendRichPresenceKeyByIndex(CSteamID steamIDFriend, int iKey) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamFriends_GetFriendRichPresenceKeyByIndex(CSteamAPIContext.GetSteamFriends(), steamIDFriend, iKey));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Requests rich presence for a specific user.</para>
|
||||
/// </summary>
|
||||
public static void RequestFriendRichPresence(CSteamID steamIDFriend) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamFriends_RequestFriendRichPresence(CSteamAPIContext.GetSteamFriends(), steamIDFriend);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Rich invite support.</para>
|
||||
/// <para> If the target accepts the invite, a GameRichPresenceJoinRequested_t callback is posted containing the connect string.</para>
|
||||
/// <para> (Or you can configure yout game so that it is passed on the command line instead. This is a deprecated path; ask us if you really need this.)</para>
|
||||
/// <para> Invites can only be sent to friends.</para>
|
||||
/// </summary>
|
||||
public static bool InviteUserToGame(CSteamID steamIDFriend, string pchConnectString) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchConnectString2 = new InteropHelp.UTF8StringHandle(pchConnectString)) {
|
||||
return NativeMethods.ISteamFriends_InviteUserToGame(CSteamAPIContext.GetSteamFriends(), steamIDFriend, pchConnectString2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> recently-played-with friends iteration</para>
|
||||
/// <para> this iterates the entire list of users recently played with, across games</para>
|
||||
/// <para> GetFriendCoplayTime() returns as a unix time</para>
|
||||
/// </summary>
|
||||
public static int GetCoplayFriendCount() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_GetCoplayFriendCount(CSteamAPIContext.GetSteamFriends());
|
||||
}
|
||||
|
||||
public static CSteamID GetCoplayFriend(int iCoplayFriend) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (CSteamID)NativeMethods.ISteamFriends_GetCoplayFriend(CSteamAPIContext.GetSteamFriends(), iCoplayFriend);
|
||||
}
|
||||
|
||||
public static int GetFriendCoplayTime(CSteamID steamIDFriend) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_GetFriendCoplayTime(CSteamAPIContext.GetSteamFriends(), steamIDFriend);
|
||||
}
|
||||
|
||||
public static AppId_t GetFriendCoplayGame(CSteamID steamIDFriend) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (AppId_t)NativeMethods.ISteamFriends_GetFriendCoplayGame(CSteamAPIContext.GetSteamFriends(), steamIDFriend);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> chat interface for games</para>
|
||||
/// <para> this allows in-game access to group (clan) chats from in the game</para>
|
||||
/// <para> the behavior is somewhat sophisticated, because the user may or may not be already in the group chat from outside the game or in the overlay</para>
|
||||
/// <para> use ActivateGameOverlayToUser( "chat", steamIDClan ) to open the in-game overlay version of the chat</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t JoinClanChatRoom(CSteamID steamIDClan) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamFriends_JoinClanChatRoom(CSteamAPIContext.GetSteamFriends(), steamIDClan);
|
||||
}
|
||||
|
||||
public static bool LeaveClanChatRoom(CSteamID steamIDClan) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_LeaveClanChatRoom(CSteamAPIContext.GetSteamFriends(), steamIDClan);
|
||||
}
|
||||
|
||||
public static int GetClanChatMemberCount(CSteamID steamIDClan) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_GetClanChatMemberCount(CSteamAPIContext.GetSteamFriends(), steamIDClan);
|
||||
}
|
||||
|
||||
public static CSteamID GetChatMemberByIndex(CSteamID steamIDClan, int iUser) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (CSteamID)NativeMethods.ISteamFriends_GetChatMemberByIndex(CSteamAPIContext.GetSteamFriends(), steamIDClan, iUser);
|
||||
}
|
||||
|
||||
public static bool SendClanChatMessage(CSteamID steamIDClanChat, string pchText) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchText2 = new InteropHelp.UTF8StringHandle(pchText)) {
|
||||
return NativeMethods.ISteamFriends_SendClanChatMessage(CSteamAPIContext.GetSteamFriends(), steamIDClanChat, pchText2);
|
||||
}
|
||||
}
|
||||
|
||||
public static int GetClanChatMessage(CSteamID steamIDClanChat, int iMessage, out string prgchText, int cchTextMax, out EChatEntryType peChatEntryType, out CSteamID psteamidChatter) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
IntPtr prgchText2 = Marshal.AllocHGlobal(cchTextMax);
|
||||
int ret = NativeMethods.ISteamFriends_GetClanChatMessage(CSteamAPIContext.GetSteamFriends(), steamIDClanChat, iMessage, prgchText2, cchTextMax, out peChatEntryType, out psteamidChatter);
|
||||
prgchText = ret != 0 ? InteropHelp.PtrToStringUTF8(prgchText2) : null;
|
||||
Marshal.FreeHGlobal(prgchText2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static bool IsClanChatAdmin(CSteamID steamIDClanChat, CSteamID steamIDUser) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_IsClanChatAdmin(CSteamAPIContext.GetSteamFriends(), steamIDClanChat, steamIDUser);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> interact with the Steam (game overlay / desktop)</para>
|
||||
/// </summary>
|
||||
public static bool IsClanChatWindowOpenInSteam(CSteamID steamIDClanChat) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_IsClanChatWindowOpenInSteam(CSteamAPIContext.GetSteamFriends(), steamIDClanChat);
|
||||
}
|
||||
|
||||
public static bool OpenClanChatWindowInSteam(CSteamID steamIDClanChat) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_OpenClanChatWindowInSteam(CSteamAPIContext.GetSteamFriends(), steamIDClanChat);
|
||||
}
|
||||
|
||||
public static bool CloseClanChatWindowInSteam(CSteamID steamIDClanChat) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_CloseClanChatWindowInSteam(CSteamAPIContext.GetSteamFriends(), steamIDClanChat);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> peer-to-peer chat interception</para>
|
||||
/// <para> this is so you can show P2P chats inline in the game</para>
|
||||
/// </summary>
|
||||
public static bool SetListenForFriendsMessages(bool bInterceptEnabled) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_SetListenForFriendsMessages(CSteamAPIContext.GetSteamFriends(), bInterceptEnabled);
|
||||
}
|
||||
|
||||
public static bool ReplyToFriendMessage(CSteamID steamIDFriend, string pchMsgToSend) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchMsgToSend2 = new InteropHelp.UTF8StringHandle(pchMsgToSend)) {
|
||||
return NativeMethods.ISteamFriends_ReplyToFriendMessage(CSteamAPIContext.GetSteamFriends(), steamIDFriend, pchMsgToSend2);
|
||||
}
|
||||
}
|
||||
|
||||
public static int GetFriendMessage(CSteamID steamIDFriend, int iMessageID, out string pvData, int cubData, out EChatEntryType peChatEntryType) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
IntPtr pvData2 = Marshal.AllocHGlobal(cubData);
|
||||
int ret = NativeMethods.ISteamFriends_GetFriendMessage(CSteamAPIContext.GetSteamFriends(), steamIDFriend, iMessageID, pvData2, cubData, out peChatEntryType);
|
||||
pvData = ret != 0 ? InteropHelp.PtrToStringUTF8(pvData2) : null;
|
||||
Marshal.FreeHGlobal(pvData2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> following apis</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t GetFollowerCount(CSteamID steamID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamFriends_GetFollowerCount(CSteamAPIContext.GetSteamFriends(), steamID);
|
||||
}
|
||||
|
||||
public static SteamAPICall_t IsFollowing(CSteamID steamID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamFriends_IsFollowing(CSteamAPIContext.GetSteamFriends(), steamID);
|
||||
}
|
||||
|
||||
public static SteamAPICall_t EnumerateFollowingList(uint unStartIndex) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamFriends_EnumerateFollowingList(CSteamAPIContext.GetSteamFriends(), unStartIndex);
|
||||
}
|
||||
|
||||
public static bool IsClanPublic(CSteamID steamIDClan) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_IsClanPublic(CSteamAPIContext.GetSteamFriends(), steamIDClan);
|
||||
}
|
||||
|
||||
public static bool IsClanOfficialGameGroup(CSteamID steamIDClan) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_IsClanOfficialGameGroup(CSteamAPIContext.GetSteamFriends(), steamIDClan);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>/ Return the number of chats (friends or chat rooms) with unread messages.</para>
|
||||
/// <para>/ A "priority" message is one that would generate some sort of toast or</para>
|
||||
/// <para>/ notification, and depends on user settings.</para>
|
||||
/// <para>/</para>
|
||||
/// <para>/ You can register for UnreadChatMessagesChanged_t callbacks to know when this</para>
|
||||
/// <para>/ has potentially changed.</para>
|
||||
/// </summary>
|
||||
public static int GetNumChatsWithUnreadPriorityMessages() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamFriends_GetNumChatsWithUnreadPriorityMessages(CSteamAPIContext.GetSteamFriends());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,465 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamGameServer {
|
||||
/// <summary>
|
||||
/// <para> Basic server data. These properties, if set, must be set before before calling LogOn. They</para>
|
||||
/// <para> may not be changed after logged in.</para>
|
||||
/// <para>/ This is called by SteamGameServer_Init, and you will usually not need to call it directly</para>
|
||||
/// </summary>
|
||||
public static bool InitGameServer(uint unIP, ushort usGamePort, ushort usQueryPort, uint unFlags, AppId_t nGameAppId, string pchVersionString) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchVersionString2 = new InteropHelp.UTF8StringHandle(pchVersionString)) {
|
||||
return NativeMethods.ISteamGameServer_InitGameServer(CSteamGameServerAPIContext.GetSteamGameServer(), unIP, usGamePort, usQueryPort, unFlags, nGameAppId, pchVersionString2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>/ Game product identifier. This is currently used by the master server for version checking purposes.</para>
|
||||
/// <para>/ It's a required field, but will eventually will go away, and the AppID will be used for this purpose.</para>
|
||||
/// </summary>
|
||||
public static void SetProduct(string pszProduct) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pszProduct2 = new InteropHelp.UTF8StringHandle(pszProduct)) {
|
||||
NativeMethods.ISteamGameServer_SetProduct(CSteamGameServerAPIContext.GetSteamGameServer(), pszProduct2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>/ Description of the game. This is a required field and is displayed in the steam server browser....for now.</para>
|
||||
/// <para>/ This is a required field, but it will go away eventually, as the data should be determined from the AppID.</para>
|
||||
/// </summary>
|
||||
public static void SetGameDescription(string pszGameDescription) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pszGameDescription2 = new InteropHelp.UTF8StringHandle(pszGameDescription)) {
|
||||
NativeMethods.ISteamGameServer_SetGameDescription(CSteamGameServerAPIContext.GetSteamGameServer(), pszGameDescription2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>/ If your game is a "mod," pass the string that identifies it. The default is an empty string, meaning</para>
|
||||
/// <para>/ this application is the original game, not a mod.</para>
|
||||
/// <para>/</para>
|
||||
/// <para>/ @see k_cbMaxGameServerGameDir</para>
|
||||
/// </summary>
|
||||
public static void SetModDir(string pszModDir) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pszModDir2 = new InteropHelp.UTF8StringHandle(pszModDir)) {
|
||||
NativeMethods.ISteamGameServer_SetModDir(CSteamGameServerAPIContext.GetSteamGameServer(), pszModDir2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>/ Is this is a dedicated server? The default value is false.</para>
|
||||
/// </summary>
|
||||
public static void SetDedicatedServer(bool bDedicated) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamGameServer_SetDedicatedServer(CSteamGameServerAPIContext.GetSteamGameServer(), bDedicated);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Login</para>
|
||||
/// <para>/ Begin process to login to a persistent game server account</para>
|
||||
/// <para>/</para>
|
||||
/// <para>/ You need to register for callbacks to determine the result of this operation.</para>
|
||||
/// <para>/ @see SteamServersConnected_t</para>
|
||||
/// <para>/ @see SteamServerConnectFailure_t</para>
|
||||
/// <para>/ @see SteamServersDisconnected_t</para>
|
||||
/// </summary>
|
||||
public static void LogOn(string pszToken) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pszToken2 = new InteropHelp.UTF8StringHandle(pszToken)) {
|
||||
NativeMethods.ISteamGameServer_LogOn(CSteamGameServerAPIContext.GetSteamGameServer(), pszToken2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>/ Login to a generic, anonymous account.</para>
|
||||
/// <para>/</para>
|
||||
/// <para>/ Note: in previous versions of the SDK, this was automatically called within SteamGameServer_Init,</para>
|
||||
/// <para>/ but this is no longer the case.</para>
|
||||
/// </summary>
|
||||
public static void LogOnAnonymous() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamGameServer_LogOnAnonymous(CSteamGameServerAPIContext.GetSteamGameServer());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>/ Begin process of logging game server out of steam</para>
|
||||
/// </summary>
|
||||
public static void LogOff() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamGameServer_LogOff(CSteamGameServerAPIContext.GetSteamGameServer());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> status functions</para>
|
||||
/// </summary>
|
||||
public static bool BLoggedOn() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamGameServer_BLoggedOn(CSteamGameServerAPIContext.GetSteamGameServer());
|
||||
}
|
||||
|
||||
public static bool BSecure() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamGameServer_BSecure(CSteamGameServerAPIContext.GetSteamGameServer());
|
||||
}
|
||||
|
||||
public static CSteamID GetSteamID() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (CSteamID)NativeMethods.ISteamGameServer_GetSteamID(CSteamGameServerAPIContext.GetSteamGameServer());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>/ Returns true if the master server has requested a restart.</para>
|
||||
/// <para>/ Only returns true once per request.</para>
|
||||
/// </summary>
|
||||
public static bool WasRestartRequested() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamGameServer_WasRestartRequested(CSteamGameServerAPIContext.GetSteamGameServer());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Server state. These properties may be changed at any time.</para>
|
||||
/// <para>/ Max player count that will be reported to server browser and client queries</para>
|
||||
/// </summary>
|
||||
public static void SetMaxPlayerCount(int cPlayersMax) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamGameServer_SetMaxPlayerCount(CSteamGameServerAPIContext.GetSteamGameServer(), cPlayersMax);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>/ Number of bots. Default value is zero</para>
|
||||
/// </summary>
|
||||
public static void SetBotPlayerCount(int cBotplayers) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamGameServer_SetBotPlayerCount(CSteamGameServerAPIContext.GetSteamGameServer(), cBotplayers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>/ Set the name of server as it will appear in the server browser</para>
|
||||
/// <para>/</para>
|
||||
/// <para>/ @see k_cbMaxGameServerName</para>
|
||||
/// </summary>
|
||||
public static void SetServerName(string pszServerName) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pszServerName2 = new InteropHelp.UTF8StringHandle(pszServerName)) {
|
||||
NativeMethods.ISteamGameServer_SetServerName(CSteamGameServerAPIContext.GetSteamGameServer(), pszServerName2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>/ Set name of map to report in the server browser</para>
|
||||
/// <para>/</para>
|
||||
/// <para>/ @see k_cbMaxGameServerName</para>
|
||||
/// </summary>
|
||||
public static void SetMapName(string pszMapName) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pszMapName2 = new InteropHelp.UTF8StringHandle(pszMapName)) {
|
||||
NativeMethods.ISteamGameServer_SetMapName(CSteamGameServerAPIContext.GetSteamGameServer(), pszMapName2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>/ Let people know if your server will require a password</para>
|
||||
/// </summary>
|
||||
public static void SetPasswordProtected(bool bPasswordProtected) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamGameServer_SetPasswordProtected(CSteamGameServerAPIContext.GetSteamGameServer(), bPasswordProtected);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>/ Spectator server. The default value is zero, meaning the service</para>
|
||||
/// <para>/ is not used.</para>
|
||||
/// </summary>
|
||||
public static void SetSpectatorPort(ushort unSpectatorPort) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamGameServer_SetSpectatorPort(CSteamGameServerAPIContext.GetSteamGameServer(), unSpectatorPort);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>/ Name of the spectator server. (Only used if spectator port is nonzero.)</para>
|
||||
/// <para>/</para>
|
||||
/// <para>/ @see k_cbMaxGameServerMapName</para>
|
||||
/// </summary>
|
||||
public static void SetSpectatorServerName(string pszSpectatorServerName) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pszSpectatorServerName2 = new InteropHelp.UTF8StringHandle(pszSpectatorServerName)) {
|
||||
NativeMethods.ISteamGameServer_SetSpectatorServerName(CSteamGameServerAPIContext.GetSteamGameServer(), pszSpectatorServerName2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>/ Call this to clear the whole list of key/values that are sent in rules queries.</para>
|
||||
/// </summary>
|
||||
public static void ClearAllKeyValues() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamGameServer_ClearAllKeyValues(CSteamGameServerAPIContext.GetSteamGameServer());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>/ Call this to add/update a key/value pair.</para>
|
||||
/// </summary>
|
||||
public static void SetKeyValue(string pKey, string pValue) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pKey2 = new InteropHelp.UTF8StringHandle(pKey))
|
||||
using (var pValue2 = new InteropHelp.UTF8StringHandle(pValue)) {
|
||||
NativeMethods.ISteamGameServer_SetKeyValue(CSteamGameServerAPIContext.GetSteamGameServer(), pKey2, pValue2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>/ Sets a string defining the "gametags" for this server, this is optional, but if it is set</para>
|
||||
/// <para>/ it allows users to filter in the matchmaking/server-browser interfaces based on the value</para>
|
||||
/// <para>/</para>
|
||||
/// <para>/ @see k_cbMaxGameServerTags</para>
|
||||
/// </summary>
|
||||
public static void SetGameTags(string pchGameTags) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchGameTags2 = new InteropHelp.UTF8StringHandle(pchGameTags)) {
|
||||
NativeMethods.ISteamGameServer_SetGameTags(CSteamGameServerAPIContext.GetSteamGameServer(), pchGameTags2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>/ Sets a string defining the "gamedata" for this server, this is optional, but if it is set</para>
|
||||
/// <para>/ it allows users to filter in the matchmaking/server-browser interfaces based on the value</para>
|
||||
/// <para>/ don't set this unless it actually changes, its only uploaded to the master once (when</para>
|
||||
/// <para>/ acknowledged)</para>
|
||||
/// <para>/</para>
|
||||
/// <para>/ @see k_cbMaxGameServerGameData</para>
|
||||
/// </summary>
|
||||
public static void SetGameData(string pchGameData) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchGameData2 = new InteropHelp.UTF8StringHandle(pchGameData)) {
|
||||
NativeMethods.ISteamGameServer_SetGameData(CSteamGameServerAPIContext.GetSteamGameServer(), pchGameData2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>/ Region identifier. This is an optional field, the default value is empty, meaning the "world" region</para>
|
||||
/// </summary>
|
||||
public static void SetRegion(string pszRegion) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pszRegion2 = new InteropHelp.UTF8StringHandle(pszRegion)) {
|
||||
NativeMethods.ISteamGameServer_SetRegion(CSteamGameServerAPIContext.GetSteamGameServer(), pszRegion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Player list management / authentication</para>
|
||||
/// <para> Handles receiving a new connection from a Steam user. This call will ask the Steam</para>
|
||||
/// <para> servers to validate the users identity, app ownership, and VAC status. If the Steam servers</para>
|
||||
/// <para> are off-line, then it will validate the cached ticket itself which will validate app ownership</para>
|
||||
/// <para> and identity. The AuthBlob here should be acquired on the game client using SteamUser()->InitiateGameConnection()</para>
|
||||
/// <para> and must then be sent up to the game server for authentication.</para>
|
||||
/// <para> Return Value: returns true if the users ticket passes basic checks. pSteamIDUser will contain the Steam ID of this user. pSteamIDUser must NOT be NULL</para>
|
||||
/// <para> If the call succeeds then you should expect a GSClientApprove_t or GSClientDeny_t callback which will tell you whether authentication</para>
|
||||
/// <para> for the user has succeeded or failed (the steamid in the callback will match the one returned by this call)</para>
|
||||
/// </summary>
|
||||
public static bool SendUserConnectAndAuthenticate(uint unIPClient, byte[] pvAuthBlob, uint cubAuthBlobSize, out CSteamID pSteamIDUser) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamGameServer_SendUserConnectAndAuthenticate(CSteamGameServerAPIContext.GetSteamGameServer(), unIPClient, pvAuthBlob, cubAuthBlobSize, out pSteamIDUser);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Creates a fake user (ie, a bot) which will be listed as playing on the server, but skips validation.</para>
|
||||
/// <para> Return Value: Returns a SteamID for the user to be tracked with, you should call HandleUserDisconnect()</para>
|
||||
/// <para> when this user leaves the server just like you would for a real user.</para>
|
||||
/// </summary>
|
||||
public static CSteamID CreateUnauthenticatedUserConnection() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (CSteamID)NativeMethods.ISteamGameServer_CreateUnauthenticatedUserConnection(CSteamGameServerAPIContext.GetSteamGameServer());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Should be called whenever a user leaves our game server, this lets Steam internally</para>
|
||||
/// <para> track which users are currently on which servers for the purposes of preventing a single</para>
|
||||
/// <para> account being logged into multiple servers, showing who is currently on a server, etc.</para>
|
||||
/// </summary>
|
||||
public static void SendUserDisconnect(CSteamID steamIDUser) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamGameServer_SendUserDisconnect(CSteamGameServerAPIContext.GetSteamGameServer(), steamIDUser);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Update the data to be displayed in the server browser and matchmaking interfaces for a user</para>
|
||||
/// <para> currently connected to the server. For regular users you must call this after you receive a</para>
|
||||
/// <para> GSUserValidationSuccess callback.</para>
|
||||
/// <para> Return Value: true if successful, false if failure (ie, steamIDUser wasn't for an active player)</para>
|
||||
/// </summary>
|
||||
public static bool BUpdateUserData(CSteamID steamIDUser, string pchPlayerName, uint uScore) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchPlayerName2 = new InteropHelp.UTF8StringHandle(pchPlayerName)) {
|
||||
return NativeMethods.ISteamGameServer_BUpdateUserData(CSteamGameServerAPIContext.GetSteamGameServer(), steamIDUser, pchPlayerName2, uScore);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> New auth system APIs - do not mix with the old auth system APIs.</para>
|
||||
/// <para> ----------------------------------------------------------------</para>
|
||||
/// <para> Retrieve ticket to be sent to the entity who wishes to authenticate you ( using BeginAuthSession API ).</para>
|
||||
/// <para> pcbTicket retrieves the length of the actual ticket.</para>
|
||||
/// </summary>
|
||||
public static HAuthTicket GetAuthSessionTicket(byte[] pTicket, int cbMaxTicket, out uint pcbTicket) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (HAuthTicket)NativeMethods.ISteamGameServer_GetAuthSessionTicket(CSteamGameServerAPIContext.GetSteamGameServer(), pTicket, cbMaxTicket, out pcbTicket);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Authenticate ticket ( from GetAuthSessionTicket ) from entity steamID to be sure it is valid and isnt reused</para>
|
||||
/// <para> Registers for callbacks if the entity goes offline or cancels the ticket ( see ValidateAuthTicketResponse_t callback and EAuthSessionResponse )</para>
|
||||
/// </summary>
|
||||
public static EBeginAuthSessionResult BeginAuthSession(byte[] pAuthTicket, int cbAuthTicket, CSteamID steamID) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamGameServer_BeginAuthSession(CSteamGameServerAPIContext.GetSteamGameServer(), pAuthTicket, cbAuthTicket, steamID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Stop tracking started by BeginAuthSession - called when no longer playing game with this entity</para>
|
||||
/// </summary>
|
||||
public static void EndAuthSession(CSteamID steamID) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamGameServer_EndAuthSession(CSteamGameServerAPIContext.GetSteamGameServer(), steamID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Cancel auth ticket from GetAuthSessionTicket, called when no longer playing game with the entity you gave the ticket to</para>
|
||||
/// </summary>
|
||||
public static void CancelAuthTicket(HAuthTicket hAuthTicket) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamGameServer_CancelAuthTicket(CSteamGameServerAPIContext.GetSteamGameServer(), hAuthTicket);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> After receiving a user's authentication data, and passing it to SendUserConnectAndAuthenticate, use this function</para>
|
||||
/// <para> to determine if the user owns downloadable content specified by the provided AppID.</para>
|
||||
/// </summary>
|
||||
public static EUserHasLicenseForAppResult UserHasLicenseForApp(CSteamID steamID, AppId_t appID) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamGameServer_UserHasLicenseForApp(CSteamGameServerAPIContext.GetSteamGameServer(), steamID, appID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Ask if a user in in the specified group, results returns async by GSUserGroupStatus_t</para>
|
||||
/// <para> returns false if we're not connected to the steam servers and thus cannot ask</para>
|
||||
/// </summary>
|
||||
public static bool RequestUserGroupStatus(CSteamID steamIDUser, CSteamID steamIDGroup) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamGameServer_RequestUserGroupStatus(CSteamGameServerAPIContext.GetSteamGameServer(), steamIDUser, steamIDGroup);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> these two functions s are deprecated, and will not return results</para>
|
||||
/// <para> they will be removed in a future version of the SDK</para>
|
||||
/// </summary>
|
||||
public static void GetGameplayStats() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamGameServer_GetGameplayStats(CSteamGameServerAPIContext.GetSteamGameServer());
|
||||
}
|
||||
|
||||
public static SteamAPICall_t GetServerReputation() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamGameServer_GetServerReputation(CSteamGameServerAPIContext.GetSteamGameServer());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns the public IP of the server according to Steam, useful when the server is</para>
|
||||
/// <para> behind NAT and you want to advertise its IP in a lobby for other clients to directly</para>
|
||||
/// <para> connect to</para>
|
||||
/// </summary>
|
||||
public static uint GetPublicIP() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamGameServer_GetPublicIP(CSteamGameServerAPIContext.GetSteamGameServer());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> These are in GameSocketShare mode, where instead of ISteamGameServer creating its own</para>
|
||||
/// <para> socket to talk to the master server on, it lets the game use its socket to forward messages</para>
|
||||
/// <para> back and forth. This prevents us from requiring server ops to open up yet another port</para>
|
||||
/// <para> in their firewalls.</para>
|
||||
/// <para> the IP address and port should be in host order, i.e 127.0.0.1 == 0x7f000001</para>
|
||||
/// <para> These are used when you've elected to multiplex the game server's UDP socket</para>
|
||||
/// <para> rather than having the master server updater use its own sockets.</para>
|
||||
/// <para> Source games use this to simplify the job of the server admins, so they</para>
|
||||
/// <para> don't have to open up more ports on their firewalls.</para>
|
||||
/// <para> Call this when a packet that starts with 0xFFFFFFFF comes in. That means</para>
|
||||
/// <para> it's for us.</para>
|
||||
/// </summary>
|
||||
public static bool HandleIncomingPacket(byte[] pData, int cbData, uint srcIP, ushort srcPort) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamGameServer_HandleIncomingPacket(CSteamGameServerAPIContext.GetSteamGameServer(), pData, cbData, srcIP, srcPort);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> AFTER calling HandleIncomingPacket for any packets that came in that frame, call this.</para>
|
||||
/// <para> This gets a packet that the master server updater needs to send out on UDP.</para>
|
||||
/// <para> It returns the length of the packet it wants to send, or 0 if there are no more packets to send.</para>
|
||||
/// <para> Call this each frame until it returns 0.</para>
|
||||
/// </summary>
|
||||
public static int GetNextOutgoingPacket(byte[] pOut, int cbMaxOut, out uint pNetAdr, out ushort pPort) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamGameServer_GetNextOutgoingPacket(CSteamGameServerAPIContext.GetSteamGameServer(), pOut, cbMaxOut, out pNetAdr, out pPort);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Control heartbeats / advertisement with master server</para>
|
||||
/// <para> Call this as often as you like to tell the master server updater whether or not</para>
|
||||
/// <para> you want it to be active (default: off).</para>
|
||||
/// </summary>
|
||||
public static void EnableHeartbeats(bool bActive) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamGameServer_EnableHeartbeats(CSteamGameServerAPIContext.GetSteamGameServer(), bActive);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> You usually don't need to modify this.</para>
|
||||
/// <para> Pass -1 to use the default value for iHeartbeatInterval.</para>
|
||||
/// <para> Some mods change this.</para>
|
||||
/// </summary>
|
||||
public static void SetHeartbeatInterval(int iHeartbeatInterval) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamGameServer_SetHeartbeatInterval(CSteamGameServerAPIContext.GetSteamGameServer(), iHeartbeatInterval);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Force a heartbeat to steam at the next opportunity</para>
|
||||
/// </summary>
|
||||
public static void ForceHeartbeat() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamGameServer_ForceHeartbeat(CSteamGameServerAPIContext.GetSteamGameServer());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> associate this game server with this clan for the purposes of computing player compat</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t AssociateWithClan(CSteamID steamIDClan) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamGameServer_AssociateWithClan(CSteamGameServerAPIContext.GetSteamGameServer(), steamIDClan);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> ask if any of the current players dont want to play with this new player - or vice versa</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t ComputeNewPlayerCompatibility(CSteamID steamIDNewPlayer) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamGameServer_ComputeNewPlayerCompatibility(CSteamGameServerAPIContext.GetSteamGameServer(), steamIDNewPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,261 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamGameServerApps {
|
||||
public static bool BIsSubscribed() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamApps_BIsSubscribed(CSteamGameServerAPIContext.GetSteamApps());
|
||||
}
|
||||
|
||||
public static bool BIsLowViolence() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamApps_BIsLowViolence(CSteamGameServerAPIContext.GetSteamApps());
|
||||
}
|
||||
|
||||
public static bool BIsCybercafe() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamApps_BIsCybercafe(CSteamGameServerAPIContext.GetSteamApps());
|
||||
}
|
||||
|
||||
public static bool BIsVACBanned() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamApps_BIsVACBanned(CSteamGameServerAPIContext.GetSteamApps());
|
||||
}
|
||||
|
||||
public static string GetCurrentGameLanguage() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamApps_GetCurrentGameLanguage(CSteamGameServerAPIContext.GetSteamApps()));
|
||||
}
|
||||
|
||||
public static string GetAvailableGameLanguages() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamApps_GetAvailableGameLanguages(CSteamGameServerAPIContext.GetSteamApps()));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> only use this member if you need to check ownership of another game related to yours, a demo for example</para>
|
||||
/// </summary>
|
||||
public static bool BIsSubscribedApp(AppId_t appID) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamApps_BIsSubscribedApp(CSteamGameServerAPIContext.GetSteamApps(), appID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Takes AppID of DLC and checks if the user owns the DLC & if the DLC is installed</para>
|
||||
/// </summary>
|
||||
public static bool BIsDlcInstalled(AppId_t appID) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamApps_BIsDlcInstalled(CSteamGameServerAPIContext.GetSteamApps(), appID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the Unix time of the purchase of the app</para>
|
||||
/// </summary>
|
||||
public static uint GetEarliestPurchaseUnixTime(AppId_t nAppID) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamApps_GetEarliestPurchaseUnixTime(CSteamGameServerAPIContext.GetSteamApps(), nAppID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Checks if the user is subscribed to the current app through a free weekend</para>
|
||||
/// <para> This function will return false for users who have a retail or other type of license</para>
|
||||
/// <para> Before using, please ask your Valve technical contact how to package and secure your free weekened</para>
|
||||
/// </summary>
|
||||
public static bool BIsSubscribedFromFreeWeekend() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamApps_BIsSubscribedFromFreeWeekend(CSteamGameServerAPIContext.GetSteamApps());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns the number of DLC pieces for the running app</para>
|
||||
/// </summary>
|
||||
public static int GetDLCCount() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamApps_GetDLCCount(CSteamGameServerAPIContext.GetSteamApps());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns metadata for DLC by index, of range [0, GetDLCCount()]</para>
|
||||
/// </summary>
|
||||
public static bool BGetDLCDataByIndex(int iDLC, out AppId_t pAppID, out bool pbAvailable, out string pchName, int cchNameBufferSize) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
IntPtr pchName2 = Marshal.AllocHGlobal(cchNameBufferSize);
|
||||
bool ret = NativeMethods.ISteamApps_BGetDLCDataByIndex(CSteamGameServerAPIContext.GetSteamApps(), iDLC, out pAppID, out pbAvailable, pchName2, cchNameBufferSize);
|
||||
pchName = ret ? InteropHelp.PtrToStringUTF8(pchName2) : null;
|
||||
Marshal.FreeHGlobal(pchName2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Install/Uninstall control for optional DLC</para>
|
||||
/// </summary>
|
||||
public static void InstallDLC(AppId_t nAppID) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamApps_InstallDLC(CSteamGameServerAPIContext.GetSteamApps(), nAppID);
|
||||
}
|
||||
|
||||
public static void UninstallDLC(AppId_t nAppID) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamApps_UninstallDLC(CSteamGameServerAPIContext.GetSteamApps(), nAppID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Request legacy cd-key for yourself or owned DLC. If you are interested in this</para>
|
||||
/// <para> data then make sure you provide us with a list of valid keys to be distributed</para>
|
||||
/// <para> to users when they purchase the game, before the game ships.</para>
|
||||
/// <para> You'll receive an AppProofOfPurchaseKeyResponse_t callback when</para>
|
||||
/// <para> the key is available (which may be immediately).</para>
|
||||
/// </summary>
|
||||
public static void RequestAppProofOfPurchaseKey(AppId_t nAppID) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamApps_RequestAppProofOfPurchaseKey(CSteamGameServerAPIContext.GetSteamApps(), nAppID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns current beta branch name, 'public' is the default branch</para>
|
||||
/// </summary>
|
||||
public static bool GetCurrentBetaName(out string pchName, int cchNameBufferSize) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
IntPtr pchName2 = Marshal.AllocHGlobal(cchNameBufferSize);
|
||||
bool ret = NativeMethods.ISteamApps_GetCurrentBetaName(CSteamGameServerAPIContext.GetSteamApps(), pchName2, cchNameBufferSize);
|
||||
pchName = ret ? InteropHelp.PtrToStringUTF8(pchName2) : null;
|
||||
Marshal.FreeHGlobal(pchName2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> signal Steam that game files seems corrupt or missing</para>
|
||||
/// </summary>
|
||||
public static bool MarkContentCorrupt(bool bMissingFilesOnly) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamApps_MarkContentCorrupt(CSteamGameServerAPIContext.GetSteamApps(), bMissingFilesOnly);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> return installed depots in mount order</para>
|
||||
/// </summary>
|
||||
public static uint GetInstalledDepots(AppId_t appID, DepotId_t[] pvecDepots, uint cMaxDepots) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamApps_GetInstalledDepots(CSteamGameServerAPIContext.GetSteamApps(), appID, pvecDepots, cMaxDepots);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns current app install folder for AppID, returns folder name length</para>
|
||||
/// </summary>
|
||||
public static uint GetAppInstallDir(AppId_t appID, out string pchFolder, uint cchFolderBufferSize) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
IntPtr pchFolder2 = Marshal.AllocHGlobal((int)cchFolderBufferSize);
|
||||
uint ret = NativeMethods.ISteamApps_GetAppInstallDir(CSteamGameServerAPIContext.GetSteamApps(), appID, pchFolder2, cchFolderBufferSize);
|
||||
pchFolder = ret != 0 ? InteropHelp.PtrToStringUTF8(pchFolder2) : null;
|
||||
Marshal.FreeHGlobal(pchFolder2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns true if that app is installed (not necessarily owned)</para>
|
||||
/// </summary>
|
||||
public static bool BIsAppInstalled(AppId_t appID) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamApps_BIsAppInstalled(CSteamGameServerAPIContext.GetSteamApps(), appID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the SteamID of the original owner. If this CSteamID is different from ISteamUser::GetSteamID(),</para>
|
||||
/// <para> the user has a temporary license borrowed via Family Sharing</para>
|
||||
/// </summary>
|
||||
public static CSteamID GetAppOwner() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (CSteamID)NativeMethods.ISteamApps_GetAppOwner(CSteamGameServerAPIContext.GetSteamApps());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns the associated launch param if the game is run via steam://run/<appid>//?param1=value1&param2=value2&param3=value3 etc.</para>
|
||||
/// <para> Parameter names starting with the character '@' are reserved for internal use and will always return and empty string.</para>
|
||||
/// <para> Parameter names starting with an underscore '_' are reserved for steam features -- they can be queried by the game,</para>
|
||||
/// <para> but it is advised that you not param names beginning with an underscore for your own features.</para>
|
||||
/// <para> Check for new launch parameters on callback NewUrlLaunchParameters_t</para>
|
||||
/// </summary>
|
||||
public static string GetLaunchQueryParam(string pchKey) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchKey2 = new InteropHelp.UTF8StringHandle(pchKey)) {
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamApps_GetLaunchQueryParam(CSteamGameServerAPIContext.GetSteamApps(), pchKey2));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> get download progress for optional DLC</para>
|
||||
/// </summary>
|
||||
public static bool GetDlcDownloadProgress(AppId_t nAppID, out ulong punBytesDownloaded, out ulong punBytesTotal) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamApps_GetDlcDownloadProgress(CSteamGameServerAPIContext.GetSteamApps(), nAppID, out punBytesDownloaded, out punBytesTotal);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> return the buildid of this app, may change at any time based on backend updates to the game</para>
|
||||
/// </summary>
|
||||
public static int GetAppBuildId() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamApps_GetAppBuildId(CSteamGameServerAPIContext.GetSteamApps());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Request all proof of purchase keys for the calling appid and asociated DLC.</para>
|
||||
/// <para> A series of AppProofOfPurchaseKeyResponse_t callbacks will be sent with</para>
|
||||
/// <para> appropriate appid values, ending with a final callback where the m_nAppId</para>
|
||||
/// <para> member is k_uAppIdInvalid (zero).</para>
|
||||
/// </summary>
|
||||
public static void RequestAllProofOfPurchaseKeys() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamApps_RequestAllProofOfPurchaseKeys(CSteamGameServerAPIContext.GetSteamApps());
|
||||
}
|
||||
|
||||
public static SteamAPICall_t GetFileDetails(string pszFileName) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pszFileName2 = new InteropHelp.UTF8StringHandle(pszFileName)) {
|
||||
return (SteamAPICall_t)NativeMethods.ISteamApps_GetFileDetails(CSteamGameServerAPIContext.GetSteamApps(), pszFileName2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Get command line if game was launched via Steam URL, e.g. steam://run/<appid>//<command line>/.</para>
|
||||
/// <para> This method of passing a connect string (used when joining via rich presence, accepting an</para>
|
||||
/// <para> invite, etc) is preferable to passing the connect string on the operating system command</para>
|
||||
/// <para> line, which is a security risk. In order for rich presence joins to go through this</para>
|
||||
/// <para> path and not be placed on the OS command line, you must set a value in your app's</para>
|
||||
/// <para> configuration on Steam. Ask Valve for help with this.</para>
|
||||
/// <para> If game was already running and launched again, the NewUrlLaunchParameters_t will be fired.</para>
|
||||
/// </summary>
|
||||
public static int GetLaunchCommandLine(out string pszCommandLine, int cubCommandLine) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
IntPtr pszCommandLine2 = Marshal.AllocHGlobal(cubCommandLine);
|
||||
int ret = NativeMethods.ISteamApps_GetLaunchCommandLine(CSteamGameServerAPIContext.GetSteamApps(), pszCommandLine2, cubCommandLine);
|
||||
pszCommandLine = ret != -1 ? InteropHelp.PtrToStringUTF8(pszCommandLine2) : null;
|
||||
Marshal.FreeHGlobal(pszCommandLine2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Check if user borrowed this game via Family Sharing, If true, call GetAppOwner() to get the lender SteamID</para>
|
||||
/// </summary>
|
||||
public static bool BIsSubscribedFromFamilySharing() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamApps_BIsSubscribedFromFamilySharing(CSteamGameServerAPIContext.GetSteamApps());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,376 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamGameServerClient {
|
||||
/// <summary>
|
||||
/// <para> Creates a communication pipe to the Steam client.</para>
|
||||
/// <para> NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling</para>
|
||||
/// </summary>
|
||||
public static HSteamPipe CreateSteamPipe() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (HSteamPipe)NativeMethods.ISteamClient_CreateSteamPipe(CSteamGameServerAPIContext.GetSteamClient());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Releases a previously created communications pipe</para>
|
||||
/// <para> NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling</para>
|
||||
/// </summary>
|
||||
public static bool BReleaseSteamPipe(HSteamPipe hSteamPipe) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamClient_BReleaseSteamPipe(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> connects to an existing global user, failing if none exists</para>
|
||||
/// <para> used by the game to coordinate with the steamUI</para>
|
||||
/// <para> NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling</para>
|
||||
/// </summary>
|
||||
public static HSteamUser ConnectToGlobalUser(HSteamPipe hSteamPipe) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (HSteamUser)NativeMethods.ISteamClient_ConnectToGlobalUser(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> used by game servers, create a steam user that won't be shared with anyone else</para>
|
||||
/// <para> NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling</para>
|
||||
/// </summary>
|
||||
public static HSteamUser CreateLocalUser(out HSteamPipe phSteamPipe, EAccountType eAccountType) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (HSteamUser)NativeMethods.ISteamClient_CreateLocalUser(CSteamGameServerAPIContext.GetSteamClient(), out phSteamPipe, eAccountType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> removes an allocated user</para>
|
||||
/// <para> NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling</para>
|
||||
/// </summary>
|
||||
public static void ReleaseUser(HSteamPipe hSteamPipe, HSteamUser hUser) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamClient_ReleaseUser(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe, hUser);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> retrieves the ISteamUser interface associated with the handle</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamUser(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamUser(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> retrieves the ISteamGameServer interface associated with the handle</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamGameServer(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamGameServer(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> set the local IP and Port to bind to</para>
|
||||
/// <para> this must be set before CreateLocalUser()</para>
|
||||
/// </summary>
|
||||
public static void SetLocalIPBinding(uint unIP, ushort usPort) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamClient_SetLocalIPBinding(CSteamGameServerAPIContext.GetSteamClient(), unIP, usPort);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the ISteamFriends interface</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamFriends(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamFriends(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the ISteamUtils interface</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamUtils(HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamUtils(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the ISteamMatchmaking interface</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamMatchmaking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamMatchmaking(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the ISteamMatchmakingServers interface</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamMatchmakingServers(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamMatchmakingServers(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the a generic interface</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamGenericInterface(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamGenericInterface(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the ISteamUserStats interface</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamUserStats(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamUserStats(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the ISteamGameServerStats interface</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamGameServerStats(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamGameServerStats(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns apps interface</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamApps(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamApps(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> networking</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamNetworking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamNetworking(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> remote storage</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamRemoteStorage(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamRemoteStorage(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> user screenshots</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamScreenshots(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamScreenshots(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> game search</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamGameSearch(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamGameSearch(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the number of IPC calls made since the last time this function was called</para>
|
||||
/// <para> Used for perf debugging so you can understand how many IPC calls your game makes per frame</para>
|
||||
/// <para> Every IPC call is at minimum a thread context switch if not a process one so you want to rate</para>
|
||||
/// <para> control how often you do them.</para>
|
||||
/// </summary>
|
||||
public static uint GetIPCCallCount() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamClient_GetIPCCallCount(CSteamGameServerAPIContext.GetSteamClient());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> API warning handling</para>
|
||||
/// <para> 'int' is the severity; 0 for msg, 1 for warning</para>
|
||||
/// <para> 'const char *' is the text of the message</para>
|
||||
/// <para> callbacks will occur directly after the API function is called that generated the warning or message.</para>
|
||||
/// </summary>
|
||||
public static void SetWarningMessageHook(SteamAPIWarningMessageHook_t pFunction) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamClient_SetWarningMessageHook(CSteamGameServerAPIContext.GetSteamClient(), pFunction);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Trigger global shutdown for the DLL</para>
|
||||
/// </summary>
|
||||
public static bool BShutdownIfAllPipesClosed() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamClient_BShutdownIfAllPipesClosed(CSteamGameServerAPIContext.GetSteamClient());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Expose HTTP interface</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamHTTP(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamHTTP(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Exposes the ISteamController interface - deprecated in favor of Steam Input</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamController(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamController(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Exposes the ISteamUGC interface</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamUGC(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamUGC(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns app list interface, only available on specially registered apps</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamAppList(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamAppList(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Music Player</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamMusic(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamMusic(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Music Player Remote</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamMusicRemote(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamMusicRemote(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> html page display</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamHTMLSurface(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamHTMLSurface(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> inventory</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamInventory(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamInventory(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Video</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamVideo(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamVideo(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Parental controls</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamParentalSettings(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamParentalSettings(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Exposes the Steam Input interface for controller support</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamInput(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamInput(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Steam Parties interface</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamParties(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamParties(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Steam Remote Play interface</para>
|
||||
/// </summary>
|
||||
public static IntPtr GetISteamRemotePlay(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) {
|
||||
return NativeMethods.ISteamClient_GetISteamRemotePlay(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,277 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamGameServerHTTP {
|
||||
/// <summary>
|
||||
/// <para> Initializes a new HTTP request, returning a handle to use in further operations on it. Requires</para>
|
||||
/// <para> the method (GET or POST) and the absolute URL for the request. Both http and https are supported,</para>
|
||||
/// <para> so this string must start with http:// or https:// and should look like http://store.steampowered.com/app/250/</para>
|
||||
/// <para> or such.</para>
|
||||
/// </summary>
|
||||
public static HTTPRequestHandle CreateHTTPRequest(EHTTPMethod eHTTPRequestMethod, string pchAbsoluteURL) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchAbsoluteURL2 = new InteropHelp.UTF8StringHandle(pchAbsoluteURL)) {
|
||||
return (HTTPRequestHandle)NativeMethods.ISteamHTTP_CreateHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), eHTTPRequestMethod, pchAbsoluteURL2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Set a context value for the request, which will be returned in the HTTPRequestCompleted_t callback after</para>
|
||||
/// <para> sending the request. This is just so the caller can easily keep track of which callbacks go with which request data.</para>
|
||||
/// </summary>
|
||||
public static bool SetHTTPRequestContextValue(HTTPRequestHandle hRequest, ulong ulContextValue) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamHTTP_SetHTTPRequestContextValue(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, ulContextValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Set a timeout in seconds for the HTTP request, must be called prior to sending the request. Default</para>
|
||||
/// <para> timeout is 60 seconds if you don't call this. Returns false if the handle is invalid, or the request</para>
|
||||
/// <para> has already been sent.</para>
|
||||
/// </summary>
|
||||
public static bool SetHTTPRequestNetworkActivityTimeout(HTTPRequestHandle hRequest, uint unTimeoutSeconds) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamHTTP_SetHTTPRequestNetworkActivityTimeout(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, unTimeoutSeconds);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Set a request header value for the request, must be called prior to sending the request. Will</para>
|
||||
/// <para> return false if the handle is invalid or the request is already sent.</para>
|
||||
/// </summary>
|
||||
public static bool SetHTTPRequestHeaderValue(HTTPRequestHandle hRequest, string pchHeaderName, string pchHeaderValue) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchHeaderName2 = new InteropHelp.UTF8StringHandle(pchHeaderName))
|
||||
using (var pchHeaderValue2 = new InteropHelp.UTF8StringHandle(pchHeaderValue)) {
|
||||
return NativeMethods.ISteamHTTP_SetHTTPRequestHeaderValue(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchHeaderName2, pchHeaderValue2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Set a GET or POST parameter value on the request, which is set will depend on the EHTTPMethod specified</para>
|
||||
/// <para> when creating the request. Must be called prior to sending the request. Will return false if the</para>
|
||||
/// <para> handle is invalid or the request is already sent.</para>
|
||||
/// </summary>
|
||||
public static bool SetHTTPRequestGetOrPostParameter(HTTPRequestHandle hRequest, string pchParamName, string pchParamValue) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchParamName2 = new InteropHelp.UTF8StringHandle(pchParamName))
|
||||
using (var pchParamValue2 = new InteropHelp.UTF8StringHandle(pchParamValue)) {
|
||||
return NativeMethods.ISteamHTTP_SetHTTPRequestGetOrPostParameter(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchParamName2, pchParamValue2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Sends the HTTP request, will return false on a bad handle, otherwise use SteamCallHandle to wait on</para>
|
||||
/// <para> asynchronous response via callback.</para>
|
||||
/// <para> Note: If the user is in offline mode in Steam, then this will add a only-if-cached cache-control</para>
|
||||
/// <para> header and only do a local cache lookup rather than sending any actual remote request.</para>
|
||||
/// </summary>
|
||||
public static bool SendHTTPRequest(HTTPRequestHandle hRequest, out SteamAPICall_t pCallHandle) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamHTTP_SendHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out pCallHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Sends the HTTP request, will return false on a bad handle, otherwise use SteamCallHandle to wait on</para>
|
||||
/// <para> asynchronous response via callback for completion, and listen for HTTPRequestHeadersReceived_t and</para>
|
||||
/// <para> HTTPRequestDataReceived_t callbacks while streaming.</para>
|
||||
/// </summary>
|
||||
public static bool SendHTTPRequestAndStreamResponse(HTTPRequestHandle hRequest, out SteamAPICall_t pCallHandle) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamHTTP_SendHTTPRequestAndStreamResponse(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out pCallHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Defers a request you have sent, the actual HTTP client code may have many requests queued, and this will move</para>
|
||||
/// <para> the specified request to the tail of the queue. Returns false on invalid handle, or if the request is not yet sent.</para>
|
||||
/// </summary>
|
||||
public static bool DeferHTTPRequest(HTTPRequestHandle hRequest) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamHTTP_DeferHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Prioritizes a request you have sent, the actual HTTP client code may have many requests queued, and this will move</para>
|
||||
/// <para> the specified request to the head of the queue. Returns false on invalid handle, or if the request is not yet sent.</para>
|
||||
/// </summary>
|
||||
public static bool PrioritizeHTTPRequest(HTTPRequestHandle hRequest) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamHTTP_PrioritizeHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Checks if a response header is present in a HTTP response given a handle from HTTPRequestCompleted_t, also</para>
|
||||
/// <para> returns the size of the header value if present so the caller and allocate a correctly sized buffer for</para>
|
||||
/// <para> GetHTTPResponseHeaderValue.</para>
|
||||
/// </summary>
|
||||
public static bool GetHTTPResponseHeaderSize(HTTPRequestHandle hRequest, string pchHeaderName, out uint unResponseHeaderSize) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchHeaderName2 = new InteropHelp.UTF8StringHandle(pchHeaderName)) {
|
||||
return NativeMethods.ISteamHTTP_GetHTTPResponseHeaderSize(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchHeaderName2, out unResponseHeaderSize);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Gets header values from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the</para>
|
||||
/// <para> header is not present or if your buffer is too small to contain it's value. You should first call</para>
|
||||
/// <para> BGetHTTPResponseHeaderSize to check for the presence of the header and to find out the size buffer needed.</para>
|
||||
/// </summary>
|
||||
public static bool GetHTTPResponseHeaderValue(HTTPRequestHandle hRequest, string pchHeaderName, byte[] pHeaderValueBuffer, uint unBufferSize) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchHeaderName2 = new InteropHelp.UTF8StringHandle(pchHeaderName)) {
|
||||
return NativeMethods.ISteamHTTP_GetHTTPResponseHeaderValue(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchHeaderName2, pHeaderValueBuffer, unBufferSize);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Gets the size of the body data from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the</para>
|
||||
/// <para> handle is invalid.</para>
|
||||
/// </summary>
|
||||
public static bool GetHTTPResponseBodySize(HTTPRequestHandle hRequest, out uint unBodySize) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamHTTP_GetHTTPResponseBodySize(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out unBodySize);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Gets the body data from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the</para>
|
||||
/// <para> handle is invalid or is to a streaming response, or if the provided buffer is not the correct size. Use BGetHTTPResponseBodySize first to find out</para>
|
||||
/// <para> the correct buffer size to use.</para>
|
||||
/// </summary>
|
||||
public static bool GetHTTPResponseBodyData(HTTPRequestHandle hRequest, byte[] pBodyDataBuffer, uint unBufferSize) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamHTTP_GetHTTPResponseBodyData(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pBodyDataBuffer, unBufferSize);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Gets the body data from a streaming HTTP response given a handle from HTTPRequestDataReceived_t. Will return false if the</para>
|
||||
/// <para> handle is invalid or is to a non-streaming response (meaning it wasn't sent with SendHTTPRequestAndStreamResponse), or if the buffer size and offset</para>
|
||||
/// <para> do not match the size and offset sent in HTTPRequestDataReceived_t.</para>
|
||||
/// </summary>
|
||||
public static bool GetHTTPStreamingResponseBodyData(HTTPRequestHandle hRequest, uint cOffset, byte[] pBodyDataBuffer, uint unBufferSize) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamHTTP_GetHTTPStreamingResponseBodyData(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, cOffset, pBodyDataBuffer, unBufferSize);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Releases an HTTP response handle, should always be called to free resources after receiving a HTTPRequestCompleted_t</para>
|
||||
/// <para> callback and finishing using the response.</para>
|
||||
/// </summary>
|
||||
public static bool ReleaseHTTPRequest(HTTPRequestHandle hRequest) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamHTTP_ReleaseHTTPRequest(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Gets progress on downloading the body for the request. This will be zero unless a response header has already been</para>
|
||||
/// <para> received which included a content-length field. For responses that contain no content-length it will report</para>
|
||||
/// <para> zero for the duration of the request as the size is unknown until the connection closes.</para>
|
||||
/// </summary>
|
||||
public static bool GetHTTPDownloadProgressPct(HTTPRequestHandle hRequest, out float pflPercentOut) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamHTTP_GetHTTPDownloadProgressPct(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out pflPercentOut);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Sets the body for an HTTP Post request. Will fail and return false on a GET request, and will fail if POST params</para>
|
||||
/// <para> have already been set for the request. Setting this raw body makes it the only contents for the post, the pchContentType</para>
|
||||
/// <para> parameter will set the content-type header for the request so the server may know how to interpret the body.</para>
|
||||
/// </summary>
|
||||
public static bool SetHTTPRequestRawPostBody(HTTPRequestHandle hRequest, string pchContentType, byte[] pubBody, uint unBodyLen) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchContentType2 = new InteropHelp.UTF8StringHandle(pchContentType)) {
|
||||
return NativeMethods.ISteamHTTP_SetHTTPRequestRawPostBody(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchContentType2, pubBody, unBodyLen);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Creates a cookie container handle which you must later free with ReleaseCookieContainer(). If bAllowResponsesToModify=true</para>
|
||||
/// <para> than any response to your requests using this cookie container may add new cookies which may be transmitted with</para>
|
||||
/// <para> future requests. If bAllowResponsesToModify=false than only cookies you explicitly set will be sent. This API is just for</para>
|
||||
/// <para> during process lifetime, after steam restarts no cookies are persisted and you have no way to access the cookie container across</para>
|
||||
/// <para> repeat executions of your process.</para>
|
||||
/// </summary>
|
||||
public static HTTPCookieContainerHandle CreateCookieContainer(bool bAllowResponsesToModify) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (HTTPCookieContainerHandle)NativeMethods.ISteamHTTP_CreateCookieContainer(CSteamGameServerAPIContext.GetSteamHTTP(), bAllowResponsesToModify);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Release a cookie container you are finished using, freeing it's memory</para>
|
||||
/// </summary>
|
||||
public static bool ReleaseCookieContainer(HTTPCookieContainerHandle hCookieContainer) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamHTTP_ReleaseCookieContainer(CSteamGameServerAPIContext.GetSteamHTTP(), hCookieContainer);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Adds a cookie to the specified cookie container that will be used with future requests.</para>
|
||||
/// </summary>
|
||||
public static bool SetCookie(HTTPCookieContainerHandle hCookieContainer, string pchHost, string pchUrl, string pchCookie) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchHost2 = new InteropHelp.UTF8StringHandle(pchHost))
|
||||
using (var pchUrl2 = new InteropHelp.UTF8StringHandle(pchUrl))
|
||||
using (var pchCookie2 = new InteropHelp.UTF8StringHandle(pchCookie)) {
|
||||
return NativeMethods.ISteamHTTP_SetCookie(CSteamGameServerAPIContext.GetSteamHTTP(), hCookieContainer, pchHost2, pchUrl2, pchCookie2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Set the cookie container to use for a HTTP request</para>
|
||||
/// </summary>
|
||||
public static bool SetHTTPRequestCookieContainer(HTTPRequestHandle hRequest, HTTPCookieContainerHandle hCookieContainer) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamHTTP_SetHTTPRequestCookieContainer(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, hCookieContainer);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Set the extra user agent info for a request, this doesn't clobber the normal user agent, it just adds the extra info on the end</para>
|
||||
/// </summary>
|
||||
public static bool SetHTTPRequestUserAgentInfo(HTTPRequestHandle hRequest, string pchUserAgentInfo) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchUserAgentInfo2 = new InteropHelp.UTF8StringHandle(pchUserAgentInfo)) {
|
||||
return NativeMethods.ISteamHTTP_SetHTTPRequestUserAgentInfo(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, pchUserAgentInfo2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Disable or re-enable verification of SSL/TLS certificates.</para>
|
||||
/// <para> By default, certificates are checked for all HTTPS requests.</para>
|
||||
/// </summary>
|
||||
public static bool SetHTTPRequestRequiresVerifiedCertificate(HTTPRequestHandle hRequest, bool bRequireVerifiedCertificate) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, bRequireVerifiedCertificate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Set an absolute timeout on the HTTP request, this is just a total time timeout different than the network activity timeout</para>
|
||||
/// <para> which can bump everytime we get more data</para>
|
||||
/// </summary>
|
||||
public static bool SetHTTPRequestAbsoluteTimeoutMS(HTTPRequestHandle hRequest, uint unMilliseconds) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, unMilliseconds);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Check if the reason the request failed was because we timed it out (rather than some harder failure)</para>
|
||||
/// </summary>
|
||||
public static bool GetHTTPRequestWasTimedOut(HTTPRequestHandle hRequest, out bool pbWasTimedOut) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamHTTP_GetHTTPRequestWasTimedOut(CSteamGameServerAPIContext.GetSteamHTTP(), hRequest, out pbWasTimedOut);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,471 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamGameServerInventory {
|
||||
/// <summary>
|
||||
/// <para> INVENTORY ASYNC RESULT MANAGEMENT</para>
|
||||
/// <para> Asynchronous inventory queries always output a result handle which can be used with</para>
|
||||
/// <para> GetResultStatus, GetResultItems, etc. A SteamInventoryResultReady_t callback will</para>
|
||||
/// <para> be triggered when the asynchronous result becomes ready (or fails).</para>
|
||||
/// <para> Find out the status of an asynchronous inventory result handle. Possible values:</para>
|
||||
/// <para> k_EResultPending - still in progress</para>
|
||||
/// <para> k_EResultOK - done, result ready</para>
|
||||
/// <para> k_EResultExpired - done, result ready, maybe out of date (see DeserializeResult)</para>
|
||||
/// <para> k_EResultInvalidParam - ERROR: invalid API call parameters</para>
|
||||
/// <para> k_EResultServiceUnavailable - ERROR: service temporarily down, you may retry later</para>
|
||||
/// <para> k_EResultLimitExceeded - ERROR: operation would exceed per-user inventory limits</para>
|
||||
/// <para> k_EResultFail - ERROR: unknown / generic error</para>
|
||||
/// </summary>
|
||||
public static EResult GetResultStatus(SteamInventoryResult_t resultHandle) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamInventory_GetResultStatus(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Copies the contents of a result set into a flat array. The specific</para>
|
||||
/// <para> contents of the result set depend on which query which was used.</para>
|
||||
/// </summary>
|
||||
public static bool GetResultItems(SteamInventoryResult_t resultHandle, SteamItemDetails_t[] pOutItemsArray, ref uint punOutItemsArraySize) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
if (pOutItemsArray != null && pOutItemsArray.Length != punOutItemsArraySize) {
|
||||
throw new System.ArgumentException("pOutItemsArray must be the same size as punOutItemsArraySize!");
|
||||
}
|
||||
return NativeMethods.ISteamInventory_GetResultItems(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, pOutItemsArray, ref punOutItemsArraySize);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> In combination with GetResultItems, you can use GetResultItemProperty to retrieve</para>
|
||||
/// <para> dynamic string properties for a given item returned in the result set.</para>
|
||||
/// <para> Property names are always composed of ASCII letters, numbers, and/or underscores.</para>
|
||||
/// <para> Pass a NULL pointer for pchPropertyName to get a comma - separated list of available</para>
|
||||
/// <para> property names.</para>
|
||||
/// <para> If pchValueBuffer is NULL, *punValueBufferSize will contain the</para>
|
||||
/// <para> suggested buffer size. Otherwise it will be the number of bytes actually copied</para>
|
||||
/// <para> to pchValueBuffer. If the results do not fit in the given buffer, partial</para>
|
||||
/// <para> results may be copied.</para>
|
||||
/// </summary>
|
||||
public static bool GetResultItemProperty(SteamInventoryResult_t resultHandle, uint unItemIndex, string pchPropertyName, out string pchValueBuffer, ref uint punValueBufferSizeOut) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
IntPtr pchValueBuffer2 = Marshal.AllocHGlobal((int)punValueBufferSizeOut);
|
||||
using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName)) {
|
||||
bool ret = NativeMethods.ISteamInventory_GetResultItemProperty(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, unItemIndex, pchPropertyName2, pchValueBuffer2, ref punValueBufferSizeOut);
|
||||
pchValueBuffer = ret ? InteropHelp.PtrToStringUTF8(pchValueBuffer2) : null;
|
||||
Marshal.FreeHGlobal(pchValueBuffer2);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns the server time at which the result was generated. Compare against</para>
|
||||
/// <para> the value of IClientUtils::GetServerRealTime() to determine age.</para>
|
||||
/// </summary>
|
||||
public static uint GetResultTimestamp(SteamInventoryResult_t resultHandle) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamInventory_GetResultTimestamp(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns true if the result belongs to the target steam ID, false if the</para>
|
||||
/// <para> result does not. This is important when using DeserializeResult, to verify</para>
|
||||
/// <para> that a remote player is not pretending to have a different user's inventory.</para>
|
||||
/// </summary>
|
||||
public static bool CheckResultSteamID(SteamInventoryResult_t resultHandle, CSteamID steamIDExpected) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamInventory_CheckResultSteamID(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, steamIDExpected);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Destroys a result handle and frees all associated memory.</para>
|
||||
/// </summary>
|
||||
public static void DestroyResult(SteamInventoryResult_t resultHandle) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamInventory_DestroyResult(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> INVENTORY ASYNC QUERY</para>
|
||||
/// <para> Captures the entire state of the current user's Steam inventory.</para>
|
||||
/// <para> You must call DestroyResult on this handle when you are done with it.</para>
|
||||
/// <para> Returns false and sets *pResultHandle to zero if inventory is unavailable.</para>
|
||||
/// <para> Note: calls to this function are subject to rate limits and may return</para>
|
||||
/// <para> cached results if called too frequently. It is suggested that you call</para>
|
||||
/// <para> this function only when you are about to display the user's full inventory,</para>
|
||||
/// <para> or if you expect that the inventory may have changed.</para>
|
||||
/// </summary>
|
||||
public static bool GetAllItems(out SteamInventoryResult_t pResultHandle) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamInventory_GetAllItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Captures the state of a subset of the current user's Steam inventory,</para>
|
||||
/// <para> identified by an array of item instance IDs. The results from this call</para>
|
||||
/// <para> can be serialized and passed to other players to "prove" that the current</para>
|
||||
/// <para> user owns specific items, without exposing the user's entire inventory.</para>
|
||||
/// <para> For example, you could call GetItemsByID with the IDs of the user's</para>
|
||||
/// <para> currently equipped cosmetic items and serialize this to a buffer, and</para>
|
||||
/// <para> then transmit this buffer to other players upon joining a game.</para>
|
||||
/// </summary>
|
||||
public static bool GetItemsByID(out SteamInventoryResult_t pResultHandle, SteamItemInstanceID_t[] pInstanceIDs, uint unCountInstanceIDs) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamInventory_GetItemsByID(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pInstanceIDs, unCountInstanceIDs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> RESULT SERIALIZATION AND AUTHENTICATION</para>
|
||||
/// <para> Serialized result sets contain a short signature which can't be forged</para>
|
||||
/// <para> or replayed across different game sessions. A result set can be serialized</para>
|
||||
/// <para> on the local client, transmitted to other players via your game networking,</para>
|
||||
/// <para> and deserialized by the remote players. This is a secure way of preventing</para>
|
||||
/// <para> hackers from lying about posessing rare/high-value items.</para>
|
||||
/// <para> Serializes a result set with signature bytes to an output buffer. Pass</para>
|
||||
/// <para> NULL as an output buffer to get the required size via punOutBufferSize.</para>
|
||||
/// <para> The size of a serialized result depends on the number items which are being</para>
|
||||
/// <para> serialized. When securely transmitting items to other players, it is</para>
|
||||
/// <para> recommended to use "GetItemsByID" first to create a minimal result set.</para>
|
||||
/// <para> Results have a built-in timestamp which will be considered "expired" after</para>
|
||||
/// <para> an hour has elapsed. See DeserializeResult for expiration handling.</para>
|
||||
/// </summary>
|
||||
public static bool SerializeResult(SteamInventoryResult_t resultHandle, byte[] pOutBuffer, out uint punOutBufferSize) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamInventory_SerializeResult(CSteamGameServerAPIContext.GetSteamInventory(), resultHandle, pOutBuffer, out punOutBufferSize);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Deserializes a result set and verifies the signature bytes. Returns false</para>
|
||||
/// <para> if bRequireFullOnlineVerify is set but Steam is running in Offline mode.</para>
|
||||
/// <para> Otherwise returns true and then delivers error codes via GetResultStatus.</para>
|
||||
/// <para> The bRESERVED_MUST_BE_FALSE flag is reserved for future use and should not</para>
|
||||
/// <para> be set to true by your game at this time.</para>
|
||||
/// <para> DeserializeResult has a potential soft-failure mode where the handle status</para>
|
||||
/// <para> is set to k_EResultExpired. GetResultItems() still succeeds in this mode.</para>
|
||||
/// <para> The "expired" result could indicate that the data may be out of date - not</para>
|
||||
/// <para> just due to timed expiration (one hour), but also because one of the items</para>
|
||||
/// <para> in the result set may have been traded or consumed since the result set was</para>
|
||||
/// <para> generated. You could compare the timestamp from GetResultTimestamp() to</para>
|
||||
/// <para> ISteamUtils::GetServerRealTime() to determine how old the data is. You could</para>
|
||||
/// <para> simply ignore the "expired" result code and continue as normal, or you</para>
|
||||
/// <para> could challenge the player with expired data to send an updated result set.</para>
|
||||
/// </summary>
|
||||
public static bool DeserializeResult(out SteamInventoryResult_t pOutResultHandle, byte[] pBuffer, uint unBufferSize, bool bRESERVED_MUST_BE_FALSE = false) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamInventory_DeserializeResult(CSteamGameServerAPIContext.GetSteamInventory(), out pOutResultHandle, pBuffer, unBufferSize, bRESERVED_MUST_BE_FALSE);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> INVENTORY ASYNC MODIFICATION</para>
|
||||
/// <para> GenerateItems() creates one or more items and then generates a SteamInventoryCallback_t</para>
|
||||
/// <para> notification with a matching nCallbackContext parameter. This API is only intended</para>
|
||||
/// <para> for prototyping - it is only usable by Steam accounts that belong to the publisher group</para>
|
||||
/// <para> for your game.</para>
|
||||
/// <para> If punArrayQuantity is not NULL, it should be the same length as pArrayItems and should</para>
|
||||
/// <para> describe the quantity of each item to generate.</para>
|
||||
/// </summary>
|
||||
public static bool GenerateItems(out SteamInventoryResult_t pResultHandle, SteamItemDef_t[] pArrayItemDefs, uint[] punArrayQuantity, uint unArrayLength) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamInventory_GenerateItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pArrayItemDefs, punArrayQuantity, unArrayLength);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> GrantPromoItems() checks the list of promotional items for which the user may be eligible</para>
|
||||
/// <para> and grants the items (one time only). On success, the result set will include items which</para>
|
||||
/// <para> were granted, if any. If no items were granted because the user isn't eligible for any</para>
|
||||
/// <para> promotions, this is still considered a success.</para>
|
||||
/// </summary>
|
||||
public static bool GrantPromoItems(out SteamInventoryResult_t pResultHandle) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamInventory_GrantPromoItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> AddPromoItem() / AddPromoItems() are restricted versions of GrantPromoItems(). Instead of</para>
|
||||
/// <para> scanning for all eligible promotional items, the check is restricted to a single item</para>
|
||||
/// <para> definition or set of item definitions. This can be useful if your game has custom UI for</para>
|
||||
/// <para> showing a specific promo item to the user.</para>
|
||||
/// </summary>
|
||||
public static bool AddPromoItem(out SteamInventoryResult_t pResultHandle, SteamItemDef_t itemDef) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamInventory_AddPromoItem(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, itemDef);
|
||||
}
|
||||
|
||||
public static bool AddPromoItems(out SteamInventoryResult_t pResultHandle, SteamItemDef_t[] pArrayItemDefs, uint unArrayLength) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamInventory_AddPromoItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pArrayItemDefs, unArrayLength);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> ConsumeItem() removes items from the inventory, permanently. They cannot be recovered.</para>
|
||||
/// <para> Not for the faint of heart - if your game implements item removal at all, a high-friction</para>
|
||||
/// <para> UI confirmation process is highly recommended.</para>
|
||||
/// </summary>
|
||||
public static bool ConsumeItem(out SteamInventoryResult_t pResultHandle, SteamItemInstanceID_t itemConsume, uint unQuantity) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamInventory_ConsumeItem(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, itemConsume, unQuantity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> ExchangeItems() is an atomic combination of item generation and consumption.</para>
|
||||
/// <para> It can be used to implement crafting recipes or transmutations, or items which unpack</para>
|
||||
/// <para> themselves into other items (e.g., a chest).</para>
|
||||
/// <para> Exchange recipes are defined in the ItemDef, and explicitly list the required item</para>
|
||||
/// <para> types and resulting generated type.</para>
|
||||
/// <para> Exchange recipes are evaluated atomically by the Inventory Service; if the supplied</para>
|
||||
/// <para> components do not match the recipe, or do not contain sufficient quantity, the</para>
|
||||
/// <para> exchange will fail.</para>
|
||||
/// </summary>
|
||||
public static bool ExchangeItems(out SteamInventoryResult_t pResultHandle, SteamItemDef_t[] pArrayGenerate, uint[] punArrayGenerateQuantity, uint unArrayGenerateLength, SteamItemInstanceID_t[] pArrayDestroy, uint[] punArrayDestroyQuantity, uint unArrayDestroyLength) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamInventory_ExchangeItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, pArrayGenerate, punArrayGenerateQuantity, unArrayGenerateLength, pArrayDestroy, punArrayDestroyQuantity, unArrayDestroyLength);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> TransferItemQuantity() is intended for use with items which are "stackable" (can have</para>
|
||||
/// <para> quantity greater than one). It can be used to split a stack into two, or to transfer</para>
|
||||
/// <para> quantity from one stack into another stack of identical items. To split one stack into</para>
|
||||
/// <para> two, pass k_SteamItemInstanceIDInvalid for itemIdDest and a new item will be generated.</para>
|
||||
/// </summary>
|
||||
public static bool TransferItemQuantity(out SteamInventoryResult_t pResultHandle, SteamItemInstanceID_t itemIdSource, uint unQuantity, SteamItemInstanceID_t itemIdDest) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamInventory_TransferItemQuantity(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, itemIdSource, unQuantity, itemIdDest);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> TIMED DROPS AND PLAYTIME CREDIT</para>
|
||||
/// <para> Deprecated. Calling this method is not required for proper playtime accounting.</para>
|
||||
/// </summary>
|
||||
public static void SendItemDropHeartbeat() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamInventory_SendItemDropHeartbeat(CSteamGameServerAPIContext.GetSteamInventory());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Playtime credit must be consumed and turned into item drops by your game. Only item</para>
|
||||
/// <para> definitions which are marked as "playtime item generators" can be spawned. The call</para>
|
||||
/// <para> will return an empty result set if there is not enough playtime credit for a drop.</para>
|
||||
/// <para> Your game should call TriggerItemDrop at an appropriate time for the user to receive</para>
|
||||
/// <para> new items, such as between rounds or while the player is dead. Note that players who</para>
|
||||
/// <para> hack their clients could modify the value of "dropListDefinition", so do not use it</para>
|
||||
/// <para> to directly control rarity.</para>
|
||||
/// <para> See your Steamworks configuration to set playtime drop rates for individual itemdefs.</para>
|
||||
/// <para> The client library will suppress too-frequent calls to this method.</para>
|
||||
/// </summary>
|
||||
public static bool TriggerItemDrop(out SteamInventoryResult_t pResultHandle, SteamItemDef_t dropListDefinition) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamInventory_TriggerItemDrop(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, dropListDefinition);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Deprecated. This method is not supported.</para>
|
||||
/// </summary>
|
||||
public static bool TradeItems(out SteamInventoryResult_t pResultHandle, CSteamID steamIDTradePartner, SteamItemInstanceID_t[] pArrayGive, uint[] pArrayGiveQuantity, uint nArrayGiveLength, SteamItemInstanceID_t[] pArrayGet, uint[] pArrayGetQuantity, uint nArrayGetLength) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamInventory_TradeItems(CSteamGameServerAPIContext.GetSteamInventory(), out pResultHandle, steamIDTradePartner, pArrayGive, pArrayGiveQuantity, nArrayGiveLength, pArrayGet, pArrayGetQuantity, nArrayGetLength);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> ITEM DEFINITIONS</para>
|
||||
/// <para> Item definitions are a mapping of "definition IDs" (integers between 1 and 1000000)</para>
|
||||
/// <para> to a set of string properties. Some of these properties are required to display items</para>
|
||||
/// <para> on the Steam community web site. Other properties can be defined by applications.</para>
|
||||
/// <para> Use of these functions is optional; there is no reason to call LoadItemDefinitions</para>
|
||||
/// <para> if your game hardcodes the numeric definition IDs (eg, purple face mask = 20, blue</para>
|
||||
/// <para> weapon mod = 55) and does not allow for adding new item types without a client patch.</para>
|
||||
/// <para> LoadItemDefinitions triggers the automatic load and refresh of item definitions.</para>
|
||||
/// <para> Every time new item definitions are available (eg, from the dynamic addition of new</para>
|
||||
/// <para> item types while players are still in-game), a SteamInventoryDefinitionUpdate_t</para>
|
||||
/// <para> callback will be fired.</para>
|
||||
/// </summary>
|
||||
public static bool LoadItemDefinitions() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamInventory_LoadItemDefinitions(CSteamGameServerAPIContext.GetSteamInventory());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> GetItemDefinitionIDs returns the set of all defined item definition IDs (which are</para>
|
||||
/// <para> defined via Steamworks configuration, and not necessarily contiguous integers).</para>
|
||||
/// <para> If pItemDefIDs is null, the call will return true and *punItemDefIDsArraySize will</para>
|
||||
/// <para> contain the total size necessary for a subsequent call. Otherwise, the call will</para>
|
||||
/// <para> return false if and only if there is not enough space in the output array.</para>
|
||||
/// </summary>
|
||||
public static bool GetItemDefinitionIDs(SteamItemDef_t[] pItemDefIDs, ref uint punItemDefIDsArraySize) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
if (pItemDefIDs != null && pItemDefIDs.Length != punItemDefIDsArraySize) {
|
||||
throw new System.ArgumentException("pItemDefIDs must be the same size as punItemDefIDsArraySize!");
|
||||
}
|
||||
return NativeMethods.ISteamInventory_GetItemDefinitionIDs(CSteamGameServerAPIContext.GetSteamInventory(), pItemDefIDs, ref punItemDefIDsArraySize);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> GetItemDefinitionProperty returns a string property from a given item definition.</para>
|
||||
/// <para> Note that some properties (for example, "name") may be localized and will depend</para>
|
||||
/// <para> on the current Steam language settings (see ISteamApps::GetCurrentGameLanguage).</para>
|
||||
/// <para> Property names are always composed of ASCII letters, numbers, and/or underscores.</para>
|
||||
/// <para> Pass a NULL pointer for pchPropertyName to get a comma - separated list of available</para>
|
||||
/// <para> property names. If pchValueBuffer is NULL, *punValueBufferSize will contain the</para>
|
||||
/// <para> suggested buffer size. Otherwise it will be the number of bytes actually copied</para>
|
||||
/// <para> to pchValueBuffer. If the results do not fit in the given buffer, partial</para>
|
||||
/// <para> results may be copied.</para>
|
||||
/// </summary>
|
||||
public static bool GetItemDefinitionProperty(SteamItemDef_t iDefinition, string pchPropertyName, out string pchValueBuffer, ref uint punValueBufferSizeOut) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
IntPtr pchValueBuffer2 = Marshal.AllocHGlobal((int)punValueBufferSizeOut);
|
||||
using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName)) {
|
||||
bool ret = NativeMethods.ISteamInventory_GetItemDefinitionProperty(CSteamGameServerAPIContext.GetSteamInventory(), iDefinition, pchPropertyName2, pchValueBuffer2, ref punValueBufferSizeOut);
|
||||
pchValueBuffer = ret ? InteropHelp.PtrToStringUTF8(pchValueBuffer2) : null;
|
||||
Marshal.FreeHGlobal(pchValueBuffer2);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Request the list of "eligible" promo items that can be manually granted to the given</para>
|
||||
/// <para> user. These are promo items of type "manual" that won't be granted automatically.</para>
|
||||
/// <para> An example usage of this is an item that becomes available every week.</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t RequestEligiblePromoItemDefinitionsIDs(CSteamID steamID) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamInventory_RequestEligiblePromoItemDefinitionsIDs(CSteamGameServerAPIContext.GetSteamInventory(), steamID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> After handling a SteamInventoryEligiblePromoItemDefIDs_t call result, use this</para>
|
||||
/// <para> function to pull out the list of item definition ids that the user can be</para>
|
||||
/// <para> manually granted via the AddPromoItems() call.</para>
|
||||
/// </summary>
|
||||
public static bool GetEligiblePromoItemDefinitionIDs(CSteamID steamID, SteamItemDef_t[] pItemDefIDs, ref uint punItemDefIDsArraySize) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
if (pItemDefIDs != null && pItemDefIDs.Length != punItemDefIDsArraySize) {
|
||||
throw new System.ArgumentException("pItemDefIDs must be the same size as punItemDefIDsArraySize!");
|
||||
}
|
||||
return NativeMethods.ISteamInventory_GetEligiblePromoItemDefinitionIDs(CSteamGameServerAPIContext.GetSteamInventory(), steamID, pItemDefIDs, ref punItemDefIDsArraySize);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Starts the purchase process for the given item definitions. The callback SteamInventoryStartPurchaseResult_t</para>
|
||||
/// <para> will be posted if Steam was able to initialize the transaction.</para>
|
||||
/// <para> Once the purchase has been authorized and completed by the user, the callback SteamInventoryResultReady_t</para>
|
||||
/// <para> will be posted.</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t StartPurchase(SteamItemDef_t[] pArrayItemDefs, uint[] punArrayQuantity, uint unArrayLength) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamInventory_StartPurchase(CSteamGameServerAPIContext.GetSteamInventory(), pArrayItemDefs, punArrayQuantity, unArrayLength);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Request current prices for all applicable item definitions</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t RequestPrices() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamInventory_RequestPrices(CSteamGameServerAPIContext.GetSteamInventory());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns the number of items with prices. Need to call RequestPrices() first.</para>
|
||||
/// </summary>
|
||||
public static uint GetNumItemsWithPrices() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamInventory_GetNumItemsWithPrices(CSteamGameServerAPIContext.GetSteamInventory());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns item definition ids and their prices in the user's local currency.</para>
|
||||
/// <para> Need to call RequestPrices() first.</para>
|
||||
/// </summary>
|
||||
public static bool GetItemsWithPrices(SteamItemDef_t[] pArrayItemDefs, ulong[] pCurrentPrices, ulong[] pBasePrices, uint unArrayLength) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
if (pArrayItemDefs != null && pArrayItemDefs.Length != unArrayLength) {
|
||||
throw new System.ArgumentException("pArrayItemDefs must be the same size as unArrayLength!");
|
||||
}
|
||||
if (pCurrentPrices != null && pCurrentPrices.Length != unArrayLength) {
|
||||
throw new System.ArgumentException("pCurrentPrices must be the same size as unArrayLength!");
|
||||
}
|
||||
if (pBasePrices != null && pBasePrices.Length != unArrayLength) {
|
||||
throw new System.ArgumentException("pBasePrices must be the same size as unArrayLength!");
|
||||
}
|
||||
return NativeMethods.ISteamInventory_GetItemsWithPrices(CSteamGameServerAPIContext.GetSteamInventory(), pArrayItemDefs, pCurrentPrices, pBasePrices, unArrayLength);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Retrieves the price for the item definition id</para>
|
||||
/// <para> Returns false if there is no price stored for the item definition.</para>
|
||||
/// </summary>
|
||||
public static bool GetItemPrice(SteamItemDef_t iDefinition, out ulong pCurrentPrice, out ulong pBasePrice) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamInventory_GetItemPrice(CSteamGameServerAPIContext.GetSteamInventory(), iDefinition, out pCurrentPrice, out pBasePrice);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Create a request to update properties on items</para>
|
||||
/// </summary>
|
||||
public static SteamInventoryUpdateHandle_t StartUpdateProperties() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SteamInventoryUpdateHandle_t)NativeMethods.ISteamInventory_StartUpdateProperties(CSteamGameServerAPIContext.GetSteamInventory());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Remove the property on the item</para>
|
||||
/// </summary>
|
||||
public static bool RemoveProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName)) {
|
||||
return NativeMethods.ISteamInventory_RemoveProperty(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Accessor methods to set properties on items</para>
|
||||
/// </summary>
|
||||
public static bool SetProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName, string pchPropertyValue) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName))
|
||||
using (var pchPropertyValue2 = new InteropHelp.UTF8StringHandle(pchPropertyValue)) {
|
||||
return NativeMethods.ISteamInventory_SetProperty(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, pchPropertyValue2);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool SetProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName, bool bValue) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName)) {
|
||||
return NativeMethods.ISteamInventory_SetProperty0(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, bValue);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool SetProperty1(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName, long nValue) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName)) {
|
||||
return NativeMethods.ISteamInventory_SetProperty1(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, nValue);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool SetProperty2(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName, float flValue) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName)) {
|
||||
return NativeMethods.ISteamInventory_SetProperty2(CSteamGameServerAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, flValue);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Submit the update request by handle</para>
|
||||
/// </summary>
|
||||
public static bool SubmitUpdateProperties(SteamInventoryUpdateHandle_t handle, out SteamInventoryResult_t pResultHandle) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamInventory_SubmitUpdateProperties(CSteamGameServerAPIContext.GetSteamInventory(), handle, out pResultHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,263 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamGameServerNetworking {
|
||||
/// <summary>
|
||||
/// <para>//////////////////////////////////////////////////////////////////////////////////////////</para>
|
||||
/// <para> UDP-style (connectionless) networking interface. These functions send messages using</para>
|
||||
/// <para> an API organized around the destination. Reliable and unreliable messages are supported.</para>
|
||||
/// <para> For a more TCP-style interface (meaning you have a connection handle), see the functions below.</para>
|
||||
/// <para> Both interface styles can send both reliable and unreliable messages.</para>
|
||||
/// <para> Automatically establishes NAT-traversing or Relay server connections</para>
|
||||
/// <para> Sends a P2P packet to the specified user</para>
|
||||
/// <para> UDP-like, unreliable and a max packet size of 1200 bytes</para>
|
||||
/// <para> the first packet send may be delayed as the NAT-traversal code runs</para>
|
||||
/// <para> if we can't get through to the user, an error will be posted via the callback P2PSessionConnectFail_t</para>
|
||||
/// <para> see EP2PSend enum above for the descriptions of the different ways of sending packets</para>
|
||||
/// <para> nChannel is a routing number you can use to help route message to different systems - you'll have to call ReadP2PPacket()</para>
|
||||
/// <para> with the same channel number in order to retrieve the data on the other end</para>
|
||||
/// <para> using different channels to talk to the same user will still use the same underlying p2p connection, saving on resources</para>
|
||||
/// </summary>
|
||||
public static bool SendP2PPacket(CSteamID steamIDRemote, byte[] pubData, uint cubData, EP2PSend eP2PSendType, int nChannel = 0) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamNetworking_SendP2PPacket(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote, pubData, cubData, eP2PSendType, nChannel);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns true if any data is available for read, and the amount of data that will need to be read</para>
|
||||
/// </summary>
|
||||
public static bool IsP2PPacketAvailable(out uint pcubMsgSize, int nChannel = 0) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamNetworking_IsP2PPacketAvailable(CSteamGameServerAPIContext.GetSteamNetworking(), out pcubMsgSize, nChannel);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> reads in a packet that has been sent from another user via SendP2PPacket()</para>
|
||||
/// <para> returns the size of the message and the steamID of the user who sent it in the last two parameters</para>
|
||||
/// <para> if the buffer passed in is too small, the message will be truncated</para>
|
||||
/// <para> this call is not blocking, and will return false if no data is available</para>
|
||||
/// </summary>
|
||||
public static bool ReadP2PPacket(byte[] pubDest, uint cubDest, out uint pcubMsgSize, out CSteamID psteamIDRemote, int nChannel = 0) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamNetworking_ReadP2PPacket(CSteamGameServerAPIContext.GetSteamNetworking(), pubDest, cubDest, out pcubMsgSize, out psteamIDRemote, nChannel);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> AcceptP2PSessionWithUser() should only be called in response to a P2PSessionRequest_t callback</para>
|
||||
/// <para> P2PSessionRequest_t will be posted if another user tries to send you a packet that you haven't talked to yet</para>
|
||||
/// <para> if you don't want to talk to the user, just ignore the request</para>
|
||||
/// <para> if the user continues to send you packets, another P2PSessionRequest_t will be posted periodically</para>
|
||||
/// <para> this may be called multiple times for a single user</para>
|
||||
/// <para> (if you've called SendP2PPacket() on the other user, this implicitly accepts the session request)</para>
|
||||
/// </summary>
|
||||
public static bool AcceptP2PSessionWithUser(CSteamID steamIDRemote) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamNetworking_AcceptP2PSessionWithUser(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> call CloseP2PSessionWithUser() when you're done talking to a user, will free up resources under-the-hood</para>
|
||||
/// <para> if the remote user tries to send data to you again, another P2PSessionRequest_t callback will be posted</para>
|
||||
/// </summary>
|
||||
public static bool CloseP2PSessionWithUser(CSteamID steamIDRemote) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamNetworking_CloseP2PSessionWithUser(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> call CloseP2PChannelWithUser() when you're done talking to a user on a specific channel. Once all channels</para>
|
||||
/// <para> open channels to a user have been closed, the open session to the user will be closed and new data from this</para>
|
||||
/// <para> user will trigger a P2PSessionRequest_t callback</para>
|
||||
/// </summary>
|
||||
public static bool CloseP2PChannelWithUser(CSteamID steamIDRemote, int nChannel) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamNetworking_CloseP2PChannelWithUser(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote, nChannel);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> fills out P2PSessionState_t structure with details about the underlying connection to the user</para>
|
||||
/// <para> should only needed for debugging purposes</para>
|
||||
/// <para> returns false if no connection exists to the specified user</para>
|
||||
/// </summary>
|
||||
public static bool GetP2PSessionState(CSteamID steamIDRemote, out P2PSessionState_t pConnectionState) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamNetworking_GetP2PSessionState(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDRemote, out pConnectionState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Allow P2P connections to fall back to being relayed through the Steam servers if a direct connection</para>
|
||||
/// <para> or NAT-traversal cannot be established. Only applies to connections created after setting this value,</para>
|
||||
/// <para> or to existing connections that need to automatically reconnect after this value is set.</para>
|
||||
/// <para> P2P packet relay is allowed by default</para>
|
||||
/// </summary>
|
||||
public static bool AllowP2PPacketRelay(bool bAllow) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamNetworking_AllowP2PPacketRelay(CSteamGameServerAPIContext.GetSteamNetworking(), bAllow);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>//////////////////////////////////////////////////////////////////////////////////////////</para>
|
||||
/// <para> LISTEN / CONNECT connection-oriented interface functions</para>
|
||||
/// <para> These functions are more like a client-server TCP API. One side is the "server"</para>
|
||||
/// <para> and "listens" for incoming connections, which then must be "accepted." The "client"</para>
|
||||
/// <para> initiates a connection by "connecting." Sending and receiving is done through a</para>
|
||||
/// <para> connection handle.</para>
|
||||
/// <para> For a more UDP-style interface, where you do not track connection handles but</para>
|
||||
/// <para> simply send messages to a SteamID, use the UDP-style functions above.</para>
|
||||
/// <para> Both methods can send both reliable and unreliable methods.</para>
|
||||
/// <para>//////////////////////////////////////////////////////////////////////////////////////////</para>
|
||||
/// <para> creates a socket and listens others to connect</para>
|
||||
/// <para> will trigger a SocketStatusCallback_t callback on another client connecting</para>
|
||||
/// <para> nVirtualP2PPort is the unique ID that the client will connect to, in case you have multiple ports</para>
|
||||
/// <para> this can usually just be 0 unless you want multiple sets of connections</para>
|
||||
/// <para> unIP is the local IP address to bind to</para>
|
||||
/// <para> pass in 0 if you just want the default local IP</para>
|
||||
/// <para> unPort is the port to use</para>
|
||||
/// <para> pass in 0 if you don't want users to be able to connect via IP/Port, but expect to be always peer-to-peer connections only</para>
|
||||
/// </summary>
|
||||
public static SNetListenSocket_t CreateListenSocket(int nVirtualP2PPort, uint nIP, ushort nPort, bool bAllowUseOfPacketRelay) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SNetListenSocket_t)NativeMethods.ISteamNetworking_CreateListenSocket(CSteamGameServerAPIContext.GetSteamNetworking(), nVirtualP2PPort, nIP, nPort, bAllowUseOfPacketRelay);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> creates a socket and begin connection to a remote destination</para>
|
||||
/// <para> can connect via a known steamID (client or game server), or directly to an IP</para>
|
||||
/// <para> on success will trigger a SocketStatusCallback_t callback</para>
|
||||
/// <para> on failure or timeout will trigger a SocketStatusCallback_t callback with a failure code in m_eSNetSocketState</para>
|
||||
/// </summary>
|
||||
public static SNetSocket_t CreateP2PConnectionSocket(CSteamID steamIDTarget, int nVirtualPort, int nTimeoutSec, bool bAllowUseOfPacketRelay) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SNetSocket_t)NativeMethods.ISteamNetworking_CreateP2PConnectionSocket(CSteamGameServerAPIContext.GetSteamNetworking(), steamIDTarget, nVirtualPort, nTimeoutSec, bAllowUseOfPacketRelay);
|
||||
}
|
||||
|
||||
public static SNetSocket_t CreateConnectionSocket(uint nIP, ushort nPort, int nTimeoutSec) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SNetSocket_t)NativeMethods.ISteamNetworking_CreateConnectionSocket(CSteamGameServerAPIContext.GetSteamNetworking(), nIP, nPort, nTimeoutSec);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> disconnects the connection to the socket, if any, and invalidates the handle</para>
|
||||
/// <para> any unread data on the socket will be thrown away</para>
|
||||
/// <para> if bNotifyRemoteEnd is set, socket will not be completely destroyed until the remote end acknowledges the disconnect</para>
|
||||
/// </summary>
|
||||
public static bool DestroySocket(SNetSocket_t hSocket, bool bNotifyRemoteEnd) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamNetworking_DestroySocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, bNotifyRemoteEnd);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> destroying a listen socket will automatically kill all the regular sockets generated from it</para>
|
||||
/// </summary>
|
||||
public static bool DestroyListenSocket(SNetListenSocket_t hSocket, bool bNotifyRemoteEnd) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamNetworking_DestroyListenSocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, bNotifyRemoteEnd);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> sending data</para>
|
||||
/// <para> must be a handle to a connected socket</para>
|
||||
/// <para> data is all sent via UDP, and thus send sizes are limited to 1200 bytes; after this, many routers will start dropping packets</para>
|
||||
/// <para> use the reliable flag with caution; although the resend rate is pretty aggressive,</para>
|
||||
/// <para> it can still cause stalls in receiving data (like TCP)</para>
|
||||
/// </summary>
|
||||
public static bool SendDataOnSocket(SNetSocket_t hSocket, byte[] pubData, uint cubData, bool bReliable) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamNetworking_SendDataOnSocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, pubData, cubData, bReliable);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> receiving data</para>
|
||||
/// <para> returns false if there is no data remaining</para>
|
||||
/// <para> fills out *pcubMsgSize with the size of the next message, in bytes</para>
|
||||
/// </summary>
|
||||
public static bool IsDataAvailableOnSocket(SNetSocket_t hSocket, out uint pcubMsgSize) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamNetworking_IsDataAvailableOnSocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, out pcubMsgSize);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> fills in pubDest with the contents of the message</para>
|
||||
/// <para> messages are always complete, of the same size as was sent (i.e. packetized, not streaming)</para>
|
||||
/// <para> if *pcubMsgSize < cubDest, only partial data is written</para>
|
||||
/// <para> returns false if no data is available</para>
|
||||
/// </summary>
|
||||
public static bool RetrieveDataFromSocket(SNetSocket_t hSocket, byte[] pubDest, uint cubDest, out uint pcubMsgSize) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamNetworking_RetrieveDataFromSocket(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, pubDest, cubDest, out pcubMsgSize);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> checks for data from any socket that has been connected off this listen socket</para>
|
||||
/// <para> returns false if there is no data remaining</para>
|
||||
/// <para> fills out *pcubMsgSize with the size of the next message, in bytes</para>
|
||||
/// <para> fills out *phSocket with the socket that data is available on</para>
|
||||
/// </summary>
|
||||
public static bool IsDataAvailable(SNetListenSocket_t hListenSocket, out uint pcubMsgSize, out SNetSocket_t phSocket) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamNetworking_IsDataAvailable(CSteamGameServerAPIContext.GetSteamNetworking(), hListenSocket, out pcubMsgSize, out phSocket);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> retrieves data from any socket that has been connected off this listen socket</para>
|
||||
/// <para> fills in pubDest with the contents of the message</para>
|
||||
/// <para> messages are always complete, of the same size as was sent (i.e. packetized, not streaming)</para>
|
||||
/// <para> if *pcubMsgSize < cubDest, only partial data is written</para>
|
||||
/// <para> returns false if no data is available</para>
|
||||
/// <para> fills out *phSocket with the socket that data is available on</para>
|
||||
/// </summary>
|
||||
public static bool RetrieveData(SNetListenSocket_t hListenSocket, byte[] pubDest, uint cubDest, out uint pcubMsgSize, out SNetSocket_t phSocket) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamNetworking_RetrieveData(CSteamGameServerAPIContext.GetSteamNetworking(), hListenSocket, pubDest, cubDest, out pcubMsgSize, out phSocket);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns information about the specified socket, filling out the contents of the pointers</para>
|
||||
/// </summary>
|
||||
public static bool GetSocketInfo(SNetSocket_t hSocket, out CSteamID pSteamIDRemote, out int peSocketStatus, out uint punIPRemote, out ushort punPortRemote) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamNetworking_GetSocketInfo(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket, out pSteamIDRemote, out peSocketStatus, out punIPRemote, out punPortRemote);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns which local port the listen socket is bound to</para>
|
||||
/// <para> *pnIP and *pnPort will be 0 if the socket is set to listen for P2P connections only</para>
|
||||
/// </summary>
|
||||
public static bool GetListenSocketInfo(SNetListenSocket_t hListenSocket, out uint pnIP, out ushort pnPort) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamNetworking_GetListenSocketInfo(CSteamGameServerAPIContext.GetSteamNetworking(), hListenSocket, out pnIP, out pnPort);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns true to describe how the socket ended up connecting</para>
|
||||
/// </summary>
|
||||
public static ESNetSocketConnectionType GetSocketConnectionType(SNetSocket_t hSocket) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamNetworking_GetSocketConnectionType(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> max packet size, in bytes</para>
|
||||
/// </summary>
|
||||
public static int GetMaxPacketSize(SNetSocket_t hSocket) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamNetworking_GetMaxPacketSize(CSteamGameServerAPIContext.GetSteamNetworking(), hSocket);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,110 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamGameServerStats {
|
||||
/// <summary>
|
||||
/// <para> downloads stats for the user</para>
|
||||
/// <para> returns a GSStatsReceived_t callback when completed</para>
|
||||
/// <para> if the user has no stats, GSStatsReceived_t.m_eResult will be set to k_EResultFail</para>
|
||||
/// <para> these stats will only be auto-updated for clients playing on the server. For other</para>
|
||||
/// <para> users you'll need to call RequestUserStats() again to refresh any data</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t RequestUserStats(CSteamID steamIDUser) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamGameServerStats_RequestUserStats(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> requests stat information for a user, usable after a successful call to RequestUserStats()</para>
|
||||
/// </summary>
|
||||
public static bool GetUserStat(CSteamID steamIDUser, string pchName, out int pData) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) {
|
||||
return NativeMethods.ISteamGameServerStats_GetUserStat(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser, pchName2, out pData);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool GetUserStat(CSteamID steamIDUser, string pchName, out float pData) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) {
|
||||
return NativeMethods.ISteamGameServerStats_GetUserStat0(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser, pchName2, out pData);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool GetUserAchievement(CSteamID steamIDUser, string pchName, out bool pbAchieved) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) {
|
||||
return NativeMethods.ISteamGameServerStats_GetUserAchievement(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser, pchName2, out pbAchieved);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Set / update stats and achievements.</para>
|
||||
/// <para> Note: These updates will work only on stats game servers are allowed to edit and only for</para>
|
||||
/// <para> game servers that have been declared as officially controlled by the game creators.</para>
|
||||
/// <para> Set the IP range of your official servers on the Steamworks page</para>
|
||||
/// </summary>
|
||||
public static bool SetUserStat(CSteamID steamIDUser, string pchName, int nData) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) {
|
||||
return NativeMethods.ISteamGameServerStats_SetUserStat(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser, pchName2, nData);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool SetUserStat(CSteamID steamIDUser, string pchName, float fData) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) {
|
||||
return NativeMethods.ISteamGameServerStats_SetUserStat0(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser, pchName2, fData);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool UpdateUserAvgRateStat(CSteamID steamIDUser, string pchName, float flCountThisSession, double dSessionLength) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) {
|
||||
return NativeMethods.ISteamGameServerStats_UpdateUserAvgRateStat(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser, pchName2, flCountThisSession, dSessionLength);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool SetUserAchievement(CSteamID steamIDUser, string pchName) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) {
|
||||
return NativeMethods.ISteamGameServerStats_SetUserAchievement(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser, pchName2);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool ClearUserAchievement(CSteamID steamIDUser, string pchName) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) {
|
||||
return NativeMethods.ISteamGameServerStats_ClearUserAchievement(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser, pchName2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Store the current data on the server, will get a GSStatsStored_t callback when set.</para>
|
||||
/// <para> If the callback has a result of k_EResultInvalidParam, one or more stats</para>
|
||||
/// <para> uploaded has been rejected, either because they broke constraints</para>
|
||||
/// <para> or were out of date. In this case the server sends back updated values.</para>
|
||||
/// <para> The stats should be re-iterated to keep in sync.</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t StoreUserStats(CSteamID steamIDUser) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamGameServerStats_StoreUserStats(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,637 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamGameServerUGC {
|
||||
/// <summary>
|
||||
/// <para> Query UGC associated with a user. Creator app id or consumer app id must be valid and be set to the current running app. unPage should start at 1.</para>
|
||||
/// </summary>
|
||||
public static UGCQueryHandle_t CreateQueryUserUGCRequest(AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint unPage) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (UGCQueryHandle_t)NativeMethods.ISteamUGC_CreateQueryUserUGCRequest(CSteamGameServerAPIContext.GetSteamUGC(), unAccountID, eListType, eMatchingUGCType, eSortOrder, nCreatorAppID, nConsumerAppID, unPage);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Query for all matching UGC. Creator app id or consumer app id must be valid and be set to the current running app. unPage should start at 1.</para>
|
||||
/// </summary>
|
||||
public static UGCQueryHandle_t CreateQueryAllUGCRequest(EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint unPage) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (UGCQueryHandle_t)NativeMethods.ISteamUGC_CreateQueryAllUGCRequest(CSteamGameServerAPIContext.GetSteamUGC(), eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, unPage);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Query for all matching UGC using the new deep paging interface. Creator app id or consumer app id must be valid and be set to the current running app. pchCursor should be set to NULL or "*" to get the first result set.</para>
|
||||
/// </summary>
|
||||
public static UGCQueryHandle_t CreateQueryAllUGCRequest(EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, string pchCursor = null) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchCursor2 = new InteropHelp.UTF8StringHandle(pchCursor)) {
|
||||
return (UGCQueryHandle_t)NativeMethods.ISteamUGC_CreateQueryAllUGCRequest0(CSteamGameServerAPIContext.GetSteamUGC(), eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, pchCursor2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Query for the details of the given published file ids (the RequestUGCDetails call is deprecated and replaced with this)</para>
|
||||
/// </summary>
|
||||
public static UGCQueryHandle_t CreateQueryUGCDetailsRequest(PublishedFileId_t[] pvecPublishedFileID, uint unNumPublishedFileIDs) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (UGCQueryHandle_t)NativeMethods.ISteamUGC_CreateQueryUGCDetailsRequest(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileID, unNumPublishedFileIDs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Send the query to Steam</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t SendQueryUGCRequest(UGCQueryHandle_t handle) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_SendQueryUGCRequest(CSteamGameServerAPIContext.GetSteamUGC(), handle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Retrieve an individual result after receiving the callback for querying UGC</para>
|
||||
/// </summary>
|
||||
public static bool GetQueryUGCResult(UGCQueryHandle_t handle, uint index, out SteamUGCDetails_t pDetails) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUGC_GetQueryUGCResult(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, out pDetails);
|
||||
}
|
||||
|
||||
public static bool GetQueryUGCPreviewURL(UGCQueryHandle_t handle, uint index, out string pchURL, uint cchURLSize) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
IntPtr pchURL2 = Marshal.AllocHGlobal((int)cchURLSize);
|
||||
bool ret = NativeMethods.ISteamUGC_GetQueryUGCPreviewURL(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pchURL2, cchURLSize);
|
||||
pchURL = ret ? InteropHelp.PtrToStringUTF8(pchURL2) : null;
|
||||
Marshal.FreeHGlobal(pchURL2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static bool GetQueryUGCMetadata(UGCQueryHandle_t handle, uint index, out string pchMetadata, uint cchMetadatasize) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
IntPtr pchMetadata2 = Marshal.AllocHGlobal((int)cchMetadatasize);
|
||||
bool ret = NativeMethods.ISteamUGC_GetQueryUGCMetadata(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pchMetadata2, cchMetadatasize);
|
||||
pchMetadata = ret ? InteropHelp.PtrToStringUTF8(pchMetadata2) : null;
|
||||
Marshal.FreeHGlobal(pchMetadata2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static bool GetQueryUGCChildren(UGCQueryHandle_t handle, uint index, PublishedFileId_t[] pvecPublishedFileID, uint cMaxEntries) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUGC_GetQueryUGCChildren(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pvecPublishedFileID, cMaxEntries);
|
||||
}
|
||||
|
||||
public static bool GetQueryUGCStatistic(UGCQueryHandle_t handle, uint index, EItemStatistic eStatType, out ulong pStatValue) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUGC_GetQueryUGCStatistic(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, eStatType, out pStatValue);
|
||||
}
|
||||
|
||||
public static uint GetQueryUGCNumAdditionalPreviews(UGCQueryHandle_t handle, uint index) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUGC_GetQueryUGCNumAdditionalPreviews(CSteamGameServerAPIContext.GetSteamUGC(), handle, index);
|
||||
}
|
||||
|
||||
public static bool GetQueryUGCAdditionalPreview(UGCQueryHandle_t handle, uint index, uint previewIndex, out string pchURLOrVideoID, uint cchURLSize, out string pchOriginalFileName, uint cchOriginalFileNameSize, out EItemPreviewType pPreviewType) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
IntPtr pchURLOrVideoID2 = Marshal.AllocHGlobal((int)cchURLSize);
|
||||
IntPtr pchOriginalFileName2 = Marshal.AllocHGlobal((int)cchOriginalFileNameSize);
|
||||
bool ret = NativeMethods.ISteamUGC_GetQueryUGCAdditionalPreview(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, previewIndex, pchURLOrVideoID2, cchURLSize, pchOriginalFileName2, cchOriginalFileNameSize, out pPreviewType);
|
||||
pchURLOrVideoID = ret ? InteropHelp.PtrToStringUTF8(pchURLOrVideoID2) : null;
|
||||
Marshal.FreeHGlobal(pchURLOrVideoID2);
|
||||
pchOriginalFileName = ret ? InteropHelp.PtrToStringUTF8(pchOriginalFileName2) : null;
|
||||
Marshal.FreeHGlobal(pchOriginalFileName2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static uint GetQueryUGCNumKeyValueTags(UGCQueryHandle_t handle, uint index) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUGC_GetQueryUGCNumKeyValueTags(CSteamGameServerAPIContext.GetSteamUGC(), handle, index);
|
||||
}
|
||||
|
||||
public static bool GetQueryUGCKeyValueTag(UGCQueryHandle_t handle, uint index, uint keyValueTagIndex, out string pchKey, uint cchKeySize, out string pchValue, uint cchValueSize) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
IntPtr pchKey2 = Marshal.AllocHGlobal((int)cchKeySize);
|
||||
IntPtr pchValue2 = Marshal.AllocHGlobal((int)cchValueSize);
|
||||
bool ret = NativeMethods.ISteamUGC_GetQueryUGCKeyValueTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, keyValueTagIndex, pchKey2, cchKeySize, pchValue2, cchValueSize);
|
||||
pchKey = ret ? InteropHelp.PtrToStringUTF8(pchKey2) : null;
|
||||
Marshal.FreeHGlobal(pchKey2);
|
||||
pchValue = ret ? InteropHelp.PtrToStringUTF8(pchValue2) : null;
|
||||
Marshal.FreeHGlobal(pchValue2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Return the first value matching the pchKey. Note that a key may map to multiple values. Returns false if there was an error or no matching value was found.</para>
|
||||
/// </summary>
|
||||
public static bool GetQueryUGCKeyValueTag(UGCQueryHandle_t handle, uint index, string pchKey, out string pchValue, uint cchValueSize) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
IntPtr pchValue2 = Marshal.AllocHGlobal((int)cchValueSize);
|
||||
using (var pchKey2 = new InteropHelp.UTF8StringHandle(pchKey)) {
|
||||
bool ret = NativeMethods.ISteamUGC_GetQueryUGCKeyValueTag0(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pchKey2, pchValue2, cchValueSize);
|
||||
pchValue = ret ? InteropHelp.PtrToStringUTF8(pchValue2) : null;
|
||||
Marshal.FreeHGlobal(pchValue2);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Release the request to free up memory, after retrieving results</para>
|
||||
/// </summary>
|
||||
public static bool ReleaseQueryUGCRequest(UGCQueryHandle_t handle) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUGC_ReleaseQueryUGCRequest(CSteamGameServerAPIContext.GetSteamUGC(), handle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Options to set for querying UGC</para>
|
||||
/// </summary>
|
||||
public static bool AddRequiredTag(UGCQueryHandle_t handle, string pTagName) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pTagName2 = new InteropHelp.UTF8StringHandle(pTagName)) {
|
||||
return NativeMethods.ISteamUGC_AddRequiredTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, pTagName2);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool AddExcludedTag(UGCQueryHandle_t handle, string pTagName) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pTagName2 = new InteropHelp.UTF8StringHandle(pTagName)) {
|
||||
return NativeMethods.ISteamUGC_AddExcludedTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, pTagName2);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool SetReturnOnlyIDs(UGCQueryHandle_t handle, bool bReturnOnlyIDs) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUGC_SetReturnOnlyIDs(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnOnlyIDs);
|
||||
}
|
||||
|
||||
public static bool SetReturnKeyValueTags(UGCQueryHandle_t handle, bool bReturnKeyValueTags) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUGC_SetReturnKeyValueTags(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnKeyValueTags);
|
||||
}
|
||||
|
||||
public static bool SetReturnLongDescription(UGCQueryHandle_t handle, bool bReturnLongDescription) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUGC_SetReturnLongDescription(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnLongDescription);
|
||||
}
|
||||
|
||||
public static bool SetReturnMetadata(UGCQueryHandle_t handle, bool bReturnMetadata) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUGC_SetReturnMetadata(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnMetadata);
|
||||
}
|
||||
|
||||
public static bool SetReturnChildren(UGCQueryHandle_t handle, bool bReturnChildren) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUGC_SetReturnChildren(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnChildren);
|
||||
}
|
||||
|
||||
public static bool SetReturnAdditionalPreviews(UGCQueryHandle_t handle, bool bReturnAdditionalPreviews) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUGC_SetReturnAdditionalPreviews(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnAdditionalPreviews);
|
||||
}
|
||||
|
||||
public static bool SetReturnTotalOnly(UGCQueryHandle_t handle, bool bReturnTotalOnly) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUGC_SetReturnTotalOnly(CSteamGameServerAPIContext.GetSteamUGC(), handle, bReturnTotalOnly);
|
||||
}
|
||||
|
||||
public static bool SetReturnPlaytimeStats(UGCQueryHandle_t handle, uint unDays) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUGC_SetReturnPlaytimeStats(CSteamGameServerAPIContext.GetSteamUGC(), handle, unDays);
|
||||
}
|
||||
|
||||
public static bool SetLanguage(UGCQueryHandle_t handle, string pchLanguage) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchLanguage2 = new InteropHelp.UTF8StringHandle(pchLanguage)) {
|
||||
return NativeMethods.ISteamUGC_SetLanguage(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchLanguage2);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool SetAllowCachedResponse(UGCQueryHandle_t handle, uint unMaxAgeSeconds) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUGC_SetAllowCachedResponse(CSteamGameServerAPIContext.GetSteamUGC(), handle, unMaxAgeSeconds);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Options only for querying user UGC</para>
|
||||
/// </summary>
|
||||
public static bool SetCloudFileNameFilter(UGCQueryHandle_t handle, string pMatchCloudFileName) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pMatchCloudFileName2 = new InteropHelp.UTF8StringHandle(pMatchCloudFileName)) {
|
||||
return NativeMethods.ISteamUGC_SetCloudFileNameFilter(CSteamGameServerAPIContext.GetSteamUGC(), handle, pMatchCloudFileName2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Options only for querying all UGC</para>
|
||||
/// </summary>
|
||||
public static bool SetMatchAnyTag(UGCQueryHandle_t handle, bool bMatchAnyTag) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUGC_SetMatchAnyTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, bMatchAnyTag);
|
||||
}
|
||||
|
||||
public static bool SetSearchText(UGCQueryHandle_t handle, string pSearchText) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pSearchText2 = new InteropHelp.UTF8StringHandle(pSearchText)) {
|
||||
return NativeMethods.ISteamUGC_SetSearchText(CSteamGameServerAPIContext.GetSteamUGC(), handle, pSearchText2);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool SetRankedByTrendDays(UGCQueryHandle_t handle, uint unDays) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUGC_SetRankedByTrendDays(CSteamGameServerAPIContext.GetSteamUGC(), handle, unDays);
|
||||
}
|
||||
|
||||
public static bool AddRequiredKeyValueTag(UGCQueryHandle_t handle, string pKey, string pValue) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pKey2 = new InteropHelp.UTF8StringHandle(pKey))
|
||||
using (var pValue2 = new InteropHelp.UTF8StringHandle(pValue)) {
|
||||
return NativeMethods.ISteamUGC_AddRequiredKeyValueTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, pKey2, pValue2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> DEPRECATED - Use CreateQueryUGCDetailsRequest call above instead!</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t RequestUGCDetails(PublishedFileId_t nPublishedFileID, uint unMaxAgeSeconds) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_RequestUGCDetails(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, unMaxAgeSeconds);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Steam Workshop Creator API</para>
|
||||
/// <para> create new item for this app with no content attached yet</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t CreateItem(AppId_t nConsumerAppId, EWorkshopFileType eFileType) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_CreateItem(CSteamGameServerAPIContext.GetSteamUGC(), nConsumerAppId, eFileType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> start an UGC item update. Set changed properties before commiting update with CommitItemUpdate()</para>
|
||||
/// </summary>
|
||||
public static UGCUpdateHandle_t StartItemUpdate(AppId_t nConsumerAppId, PublishedFileId_t nPublishedFileID) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (UGCUpdateHandle_t)NativeMethods.ISteamUGC_StartItemUpdate(CSteamGameServerAPIContext.GetSteamUGC(), nConsumerAppId, nPublishedFileID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> change the title of an UGC item</para>
|
||||
/// </summary>
|
||||
public static bool SetItemTitle(UGCUpdateHandle_t handle, string pchTitle) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchTitle2 = new InteropHelp.UTF8StringHandle(pchTitle)) {
|
||||
return NativeMethods.ISteamUGC_SetItemTitle(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchTitle2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> change the description of an UGC item</para>
|
||||
/// </summary>
|
||||
public static bool SetItemDescription(UGCUpdateHandle_t handle, string pchDescription) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchDescription2 = new InteropHelp.UTF8StringHandle(pchDescription)) {
|
||||
return NativeMethods.ISteamUGC_SetItemDescription(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchDescription2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> specify the language of the title or description that will be set</para>
|
||||
/// </summary>
|
||||
public static bool SetItemUpdateLanguage(UGCUpdateHandle_t handle, string pchLanguage) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchLanguage2 = new InteropHelp.UTF8StringHandle(pchLanguage)) {
|
||||
return NativeMethods.ISteamUGC_SetItemUpdateLanguage(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchLanguage2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> change the metadata of an UGC item (max = k_cchDeveloperMetadataMax)</para>
|
||||
/// </summary>
|
||||
public static bool SetItemMetadata(UGCUpdateHandle_t handle, string pchMetaData) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchMetaData2 = new InteropHelp.UTF8StringHandle(pchMetaData)) {
|
||||
return NativeMethods.ISteamUGC_SetItemMetadata(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchMetaData2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> change the visibility of an UGC item</para>
|
||||
/// </summary>
|
||||
public static bool SetItemVisibility(UGCUpdateHandle_t handle, ERemoteStoragePublishedFileVisibility eVisibility) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUGC_SetItemVisibility(CSteamGameServerAPIContext.GetSteamUGC(), handle, eVisibility);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> change the tags of an UGC item</para>
|
||||
/// </summary>
|
||||
public static bool SetItemTags(UGCUpdateHandle_t updateHandle, System.Collections.Generic.IList<string> pTags) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUGC_SetItemTags(CSteamGameServerAPIContext.GetSteamUGC(), updateHandle, new InteropHelp.SteamParamStringArray(pTags));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> update item content from this local folder</para>
|
||||
/// </summary>
|
||||
public static bool SetItemContent(UGCUpdateHandle_t handle, string pszContentFolder) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pszContentFolder2 = new InteropHelp.UTF8StringHandle(pszContentFolder)) {
|
||||
return NativeMethods.ISteamUGC_SetItemContent(CSteamGameServerAPIContext.GetSteamUGC(), handle, pszContentFolder2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> change preview image file for this item. pszPreviewFile points to local image file, which must be under 1MB in size</para>
|
||||
/// </summary>
|
||||
public static bool SetItemPreview(UGCUpdateHandle_t handle, string pszPreviewFile) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pszPreviewFile2 = new InteropHelp.UTF8StringHandle(pszPreviewFile)) {
|
||||
return NativeMethods.ISteamUGC_SetItemPreview(CSteamGameServerAPIContext.GetSteamUGC(), handle, pszPreviewFile2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> use legacy upload for a single small file. The parameter to SetItemContent() should either be a directory with one file or the full path to the file. The file must also be less than 10MB in size.</para>
|
||||
/// </summary>
|
||||
public static bool SetAllowLegacyUpload(UGCUpdateHandle_t handle, bool bAllowLegacyUpload) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUGC_SetAllowLegacyUpload(CSteamGameServerAPIContext.GetSteamUGC(), handle, bAllowLegacyUpload);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> remove all existing key-value tags (you can add new ones via the AddItemKeyValueTag function)</para>
|
||||
/// </summary>
|
||||
public static bool RemoveAllItemKeyValueTags(UGCUpdateHandle_t handle) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUGC_RemoveAllItemKeyValueTags(CSteamGameServerAPIContext.GetSteamUGC(), handle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> remove any existing key-value tags with the specified key</para>
|
||||
/// </summary>
|
||||
public static bool RemoveItemKeyValueTags(UGCUpdateHandle_t handle, string pchKey) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchKey2 = new InteropHelp.UTF8StringHandle(pchKey)) {
|
||||
return NativeMethods.ISteamUGC_RemoveItemKeyValueTags(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchKey2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> add new key-value tags for the item. Note that there can be multiple values for a tag.</para>
|
||||
/// </summary>
|
||||
public static bool AddItemKeyValueTag(UGCUpdateHandle_t handle, string pchKey, string pchValue) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchKey2 = new InteropHelp.UTF8StringHandle(pchKey))
|
||||
using (var pchValue2 = new InteropHelp.UTF8StringHandle(pchValue)) {
|
||||
return NativeMethods.ISteamUGC_AddItemKeyValueTag(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchKey2, pchValue2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> add preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size</para>
|
||||
/// </summary>
|
||||
public static bool AddItemPreviewFile(UGCUpdateHandle_t handle, string pszPreviewFile, EItemPreviewType type) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pszPreviewFile2 = new InteropHelp.UTF8StringHandle(pszPreviewFile)) {
|
||||
return NativeMethods.ISteamUGC_AddItemPreviewFile(CSteamGameServerAPIContext.GetSteamUGC(), handle, pszPreviewFile2, type);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> add preview video for this item</para>
|
||||
/// </summary>
|
||||
public static bool AddItemPreviewVideo(UGCUpdateHandle_t handle, string pszVideoID) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pszVideoID2 = new InteropHelp.UTF8StringHandle(pszVideoID)) {
|
||||
return NativeMethods.ISteamUGC_AddItemPreviewVideo(CSteamGameServerAPIContext.GetSteamUGC(), handle, pszVideoID2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> updates an existing preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size</para>
|
||||
/// </summary>
|
||||
public static bool UpdateItemPreviewFile(UGCUpdateHandle_t handle, uint index, string pszPreviewFile) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pszPreviewFile2 = new InteropHelp.UTF8StringHandle(pszPreviewFile)) {
|
||||
return NativeMethods.ISteamUGC_UpdateItemPreviewFile(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pszPreviewFile2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> updates an existing preview video for this item</para>
|
||||
/// </summary>
|
||||
public static bool UpdateItemPreviewVideo(UGCUpdateHandle_t handle, uint index, string pszVideoID) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pszVideoID2 = new InteropHelp.UTF8StringHandle(pszVideoID)) {
|
||||
return NativeMethods.ISteamUGC_UpdateItemPreviewVideo(CSteamGameServerAPIContext.GetSteamUGC(), handle, index, pszVideoID2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> remove a preview by index starting at 0 (previews are sorted)</para>
|
||||
/// </summary>
|
||||
public static bool RemoveItemPreview(UGCUpdateHandle_t handle, uint index) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUGC_RemoveItemPreview(CSteamGameServerAPIContext.GetSteamUGC(), handle, index);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> commit update process started with StartItemUpdate()</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t SubmitItemUpdate(UGCUpdateHandle_t handle, string pchChangeNote) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchChangeNote2 = new InteropHelp.UTF8StringHandle(pchChangeNote)) {
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_SubmitItemUpdate(CSteamGameServerAPIContext.GetSteamUGC(), handle, pchChangeNote2);
|
||||
}
|
||||
}
|
||||
|
||||
public static EItemUpdateStatus GetItemUpdateProgress(UGCUpdateHandle_t handle, out ulong punBytesProcessed, out ulong punBytesTotal) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUGC_GetItemUpdateProgress(CSteamGameServerAPIContext.GetSteamUGC(), handle, out punBytesProcessed, out punBytesTotal);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Steam Workshop Consumer API</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t SetUserItemVote(PublishedFileId_t nPublishedFileID, bool bVoteUp) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_SetUserItemVote(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, bVoteUp);
|
||||
}
|
||||
|
||||
public static SteamAPICall_t GetUserItemVote(PublishedFileId_t nPublishedFileID) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_GetUserItemVote(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID);
|
||||
}
|
||||
|
||||
public static SteamAPICall_t AddItemToFavorites(AppId_t nAppId, PublishedFileId_t nPublishedFileID) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_AddItemToFavorites(CSteamGameServerAPIContext.GetSteamUGC(), nAppId, nPublishedFileID);
|
||||
}
|
||||
|
||||
public static SteamAPICall_t RemoveItemFromFavorites(AppId_t nAppId, PublishedFileId_t nPublishedFileID) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_RemoveItemFromFavorites(CSteamGameServerAPIContext.GetSteamUGC(), nAppId, nPublishedFileID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> subscribe to this item, will be installed ASAP</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t SubscribeItem(PublishedFileId_t nPublishedFileID) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_SubscribeItem(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> unsubscribe from this item, will be uninstalled after game quits</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t UnsubscribeItem(PublishedFileId_t nPublishedFileID) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_UnsubscribeItem(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> number of subscribed items</para>
|
||||
/// </summary>
|
||||
public static uint GetNumSubscribedItems() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUGC_GetNumSubscribedItems(CSteamGameServerAPIContext.GetSteamUGC());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> all subscribed item PublishFileIDs</para>
|
||||
/// </summary>
|
||||
public static uint GetSubscribedItems(PublishedFileId_t[] pvecPublishedFileID, uint cMaxEntries) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUGC_GetSubscribedItems(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileID, cMaxEntries);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> get EItemState flags about item on this client</para>
|
||||
/// </summary>
|
||||
public static uint GetItemState(PublishedFileId_t nPublishedFileID) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUGC_GetItemState(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> get info about currently installed content on disc for items that have k_EItemStateInstalled set</para>
|
||||
/// <para> if k_EItemStateLegacyItem is set, pchFolder contains the path to the legacy file itself (not a folder)</para>
|
||||
/// </summary>
|
||||
public static bool GetItemInstallInfo(PublishedFileId_t nPublishedFileID, out ulong punSizeOnDisk, out string pchFolder, uint cchFolderSize, out uint punTimeStamp) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
IntPtr pchFolder2 = Marshal.AllocHGlobal((int)cchFolderSize);
|
||||
bool ret = NativeMethods.ISteamUGC_GetItemInstallInfo(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, out punSizeOnDisk, pchFolder2, cchFolderSize, out punTimeStamp);
|
||||
pchFolder = ret ? InteropHelp.PtrToStringUTF8(pchFolder2) : null;
|
||||
Marshal.FreeHGlobal(pchFolder2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> get info about pending update for items that have k_EItemStateNeedsUpdate set. punBytesTotal will be valid after download started once</para>
|
||||
/// </summary>
|
||||
public static bool GetItemDownloadInfo(PublishedFileId_t nPublishedFileID, out ulong punBytesDownloaded, out ulong punBytesTotal) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUGC_GetItemDownloadInfo(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, out punBytesDownloaded, out punBytesTotal);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> download new or update already installed item. If function returns true, wait for DownloadItemResult_t. If the item is already installed,</para>
|
||||
/// <para> then files on disk should not be used until callback received. If item is not subscribed to, it will be cached for some time.</para>
|
||||
/// <para> If bHighPriority is set, any other item download will be suspended and this item downloaded ASAP.</para>
|
||||
/// </summary>
|
||||
public static bool DownloadItem(PublishedFileId_t nPublishedFileID, bool bHighPriority) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUGC_DownloadItem(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, bHighPriority);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> game servers can set a specific workshop folder before issuing any UGC commands.</para>
|
||||
/// <para> This is helpful if you want to support multiple game servers running out of the same install folder</para>
|
||||
/// </summary>
|
||||
public static bool BInitWorkshopForGameServer(DepotId_t unWorkshopDepotID, string pszFolder) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pszFolder2 = new InteropHelp.UTF8StringHandle(pszFolder)) {
|
||||
return NativeMethods.ISteamUGC_BInitWorkshopForGameServer(CSteamGameServerAPIContext.GetSteamUGC(), unWorkshopDepotID, pszFolder2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> SuspendDownloads( true ) will suspend all workshop downloads until SuspendDownloads( false ) is called or the game ends</para>
|
||||
/// </summary>
|
||||
public static void SuspendDownloads(bool bSuspend) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamUGC_SuspendDownloads(CSteamGameServerAPIContext.GetSteamUGC(), bSuspend);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> usage tracking</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t StartPlaytimeTracking(PublishedFileId_t[] pvecPublishedFileID, uint unNumPublishedFileIDs) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_StartPlaytimeTracking(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileID, unNumPublishedFileIDs);
|
||||
}
|
||||
|
||||
public static SteamAPICall_t StopPlaytimeTracking(PublishedFileId_t[] pvecPublishedFileID, uint unNumPublishedFileIDs) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_StopPlaytimeTracking(CSteamGameServerAPIContext.GetSteamUGC(), pvecPublishedFileID, unNumPublishedFileIDs);
|
||||
}
|
||||
|
||||
public static SteamAPICall_t StopPlaytimeTrackingForAllItems() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_StopPlaytimeTrackingForAllItems(CSteamGameServerAPIContext.GetSteamUGC());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> parent-child relationship or dependency management</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t AddDependency(PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_AddDependency(CSteamGameServerAPIContext.GetSteamUGC(), nParentPublishedFileID, nChildPublishedFileID);
|
||||
}
|
||||
|
||||
public static SteamAPICall_t RemoveDependency(PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_RemoveDependency(CSteamGameServerAPIContext.GetSteamUGC(), nParentPublishedFileID, nChildPublishedFileID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> add/remove app dependence/requirements (usually DLC)</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t AddAppDependency(PublishedFileId_t nPublishedFileID, AppId_t nAppID) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_AddAppDependency(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, nAppID);
|
||||
}
|
||||
|
||||
public static SteamAPICall_t RemoveAppDependency(PublishedFileId_t nPublishedFileID, AppId_t nAppID) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_RemoveAppDependency(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID, nAppID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> request app dependencies. note that whatever callback you register for GetAppDependenciesResult_t may be called multiple times</para>
|
||||
/// <para> until all app dependencies have been returned</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t GetAppDependencies(PublishedFileId_t nPublishedFileID) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_GetAppDependencies(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> delete the item without prompting the user</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t DeleteItem(PublishedFileId_t nPublishedFileID) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_DeleteItem(CSteamGameServerAPIContext.GetSteamUGC(), nPublishedFileID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,318 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamGameServerUtils {
|
||||
/// <summary>
|
||||
/// <para> return the number of seconds since the user</para>
|
||||
/// </summary>
|
||||
public static uint GetSecondsSinceAppActive() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUtils_GetSecondsSinceAppActive(CSteamGameServerAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
public static uint GetSecondsSinceComputerActive() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUtils_GetSecondsSinceComputerActive(CSteamGameServerAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> the universe this client is connecting to</para>
|
||||
/// </summary>
|
||||
public static EUniverse GetConnectedUniverse() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUtils_GetConnectedUniverse(CSteamGameServerAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Steam server time. Number of seconds since January 1, 1970, GMT (i.e unix time)</para>
|
||||
/// </summary>
|
||||
public static uint GetServerRealTime() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUtils_GetServerRealTime(CSteamGameServerAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> 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)</para>
|
||||
/// <para> e.g "US" or "UK".</para>
|
||||
/// </summary>
|
||||
public static string GetIPCountry() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamUtils_GetIPCountry(CSteamGameServerAPIContext.GetSteamUtils()));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns true if the image exists, and valid sizes were filled out</para>
|
||||
/// </summary>
|
||||
public static bool GetImageSize(int iImage, out uint pnWidth, out uint pnHeight) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUtils_GetImageSize(CSteamGameServerAPIContext.GetSteamUtils(), iImage, out pnWidth, out pnHeight);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns true if the image exists, and the buffer was successfully filled out</para>
|
||||
/// <para> results are returned in RGBA format</para>
|
||||
/// <para> the destination buffer size should be 4 * height * width * sizeof(char)</para>
|
||||
/// </summary>
|
||||
public static bool GetImageRGBA(int iImage, byte[] pubDest, int nDestBufferSize) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUtils_GetImageRGBA(CSteamGameServerAPIContext.GetSteamUtils(), iImage, pubDest, nDestBufferSize);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the IP of the reporting server for valve - currently only used in Source engine games</para>
|
||||
/// </summary>
|
||||
public static bool GetCSERIPPort(out uint unIP, out ushort usPort) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUtils_GetCSERIPPort(CSteamGameServerAPIContext.GetSteamUtils(), out unIP, out usPort);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> return the amount of battery power left in the current system in % [0..100], 255 for being on AC power</para>
|
||||
/// </summary>
|
||||
public static byte GetCurrentBatteryPower() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUtils_GetCurrentBatteryPower(CSteamGameServerAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the appID of the current process</para>
|
||||
/// </summary>
|
||||
public static AppId_t GetAppID() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return (AppId_t)NativeMethods.ISteamUtils_GetAppID(CSteamGameServerAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Sets the position where the overlay instance for the currently calling game should show notifications.</para>
|
||||
/// <para> This position is per-game and if this function is called from outside of a game context it will do nothing.</para>
|
||||
/// </summary>
|
||||
public static void SetOverlayNotificationPosition(ENotificationPosition eNotificationPosition) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamUtils_SetOverlayNotificationPosition(CSteamGameServerAPIContext.GetSteamUtils(), eNotificationPosition);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> API asynchronous call results</para>
|
||||
/// <para> can be used directly, but more commonly used via the callback dispatch API (see steam_api.h)</para>
|
||||
/// </summary>
|
||||
public static bool IsAPICallCompleted(SteamAPICall_t hSteamAPICall, out bool pbFailed) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUtils_IsAPICallCompleted(CSteamGameServerAPIContext.GetSteamUtils(), hSteamAPICall, out pbFailed);
|
||||
}
|
||||
|
||||
public static ESteamAPICallFailure GetAPICallFailureReason(SteamAPICall_t hSteamAPICall) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUtils_GetAPICallFailureReason(CSteamGameServerAPIContext.GetSteamUtils(), hSteamAPICall);
|
||||
}
|
||||
|
||||
public static bool GetAPICallResult(SteamAPICall_t hSteamAPICall, IntPtr pCallback, int cubCallback, int iCallbackExpected, out bool pbFailed) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUtils_GetAPICallResult(CSteamGameServerAPIContext.GetSteamUtils(), hSteamAPICall, pCallback, cubCallback, iCallbackExpected, out pbFailed);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the number of IPC calls made since the last time this function was called</para>
|
||||
/// <para> Used for perf debugging so you can understand how many IPC calls your game makes per frame</para>
|
||||
/// <para> Every IPC call is at minimum a thread context switch if not a process one so you want to rate</para>
|
||||
/// <para> control how often you do them.</para>
|
||||
/// </summary>
|
||||
public static uint GetIPCCallCount() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUtils_GetIPCCallCount(CSteamGameServerAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> API warning handling</para>
|
||||
/// <para> 'int' is the severity; 0 for msg, 1 for warning</para>
|
||||
/// <para> 'const char *' is the text of the message</para>
|
||||
/// <para> callbacks will occur directly after the API function is called that generated the warning or message</para>
|
||||
/// </summary>
|
||||
public static void SetWarningMessageHook(SteamAPIWarningMessageHook_t pFunction) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamUtils_SetWarningMessageHook(CSteamGameServerAPIContext.GetSteamUtils(), pFunction);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns true if the overlay is running & the user can access it. The overlay process could take a few seconds to</para>
|
||||
/// <para> start & hook the game process, so this function will initially return false while the overlay is loading.</para>
|
||||
/// </summary>
|
||||
public static bool IsOverlayEnabled() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUtils_IsOverlayEnabled(CSteamGameServerAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Normally this call is unneeded if your game has a constantly running frame loop that calls the</para>
|
||||
/// <para> D3D Present API, or OGL SwapBuffers API every frame.</para>
|
||||
/// <para> However, if you have a game that only refreshes the screen on an event driven basis then that can break</para>
|
||||
/// <para> the overlay, as it uses your Present/SwapBuffers calls to drive it's internal frame loop and it may also</para>
|
||||
/// <para> need to Present() to the screen any time an even needing a notification happens or when the overlay is</para>
|
||||
/// <para> brought up over the game by a user. You can use this API to ask the overlay if it currently need a present</para>
|
||||
/// <para> in that case, and then you can check for this periodically (roughly 33hz is desirable) and make sure you</para>
|
||||
/// <para> refresh the screen with Present or SwapBuffers to allow the overlay to do it's work.</para>
|
||||
/// </summary>
|
||||
public static bool BOverlayNeedsPresent() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUtils_BOverlayNeedsPresent(CSteamGameServerAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Asynchronous call to check if an executable file has been signed using the public key set on the signing tab</para>
|
||||
/// <para> of the partner site, for example to refuse to load modified executable files.</para>
|
||||
/// <para> The result is returned in CheckFileSignature_t.</para>
|
||||
/// <para> k_ECheckFileSignatureNoSignaturesFoundForThisApp - This app has not been configured on the signing tab of the partner site to enable this function.</para>
|
||||
/// <para> k_ECheckFileSignatureNoSignaturesFoundForThisFile - This file is not listed on the signing tab for the partner site.</para>
|
||||
/// <para> k_ECheckFileSignatureFileNotFound - The file does not exist on disk.</para>
|
||||
/// <para> k_ECheckFileSignatureInvalidSignature - The file exists, and the signing tab has been set for this file, but the file is either not signed or the signature does not match.</para>
|
||||
/// <para> k_ECheckFileSignatureValidSignature - The file is signed and the signature is valid.</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t CheckFileSignature(string szFileName) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var szFileName2 = new InteropHelp.UTF8StringHandle(szFileName)) {
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUtils_CheckFileSignature(CSteamGameServerAPIContext.GetSteamUtils(), szFileName2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Activates the Big Picture text input dialog which only supports gamepad input</para>
|
||||
/// </summary>
|
||||
public static bool ShowGamepadTextInput(EGamepadTextInputMode eInputMode, EGamepadTextInputLineMode eLineInputMode, string pchDescription, uint unCharMax, string pchExistingText) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
using (var pchDescription2 = new InteropHelp.UTF8StringHandle(pchDescription))
|
||||
using (var pchExistingText2 = new InteropHelp.UTF8StringHandle(pchExistingText)) {
|
||||
return NativeMethods.ISteamUtils_ShowGamepadTextInput(CSteamGameServerAPIContext.GetSteamUtils(), eInputMode, eLineInputMode, pchDescription2, unCharMax, pchExistingText2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns previously entered text & length</para>
|
||||
/// </summary>
|
||||
public static uint GetEnteredGamepadTextLength() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUtils_GetEnteredGamepadTextLength(CSteamGameServerAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
public static bool GetEnteredGamepadTextInput(out string pchText, uint cchText) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
IntPtr pchText2 = Marshal.AllocHGlobal((int)cchText);
|
||||
bool ret = NativeMethods.ISteamUtils_GetEnteredGamepadTextInput(CSteamGameServerAPIContext.GetSteamUtils(), pchText2, cchText);
|
||||
pchText = ret ? InteropHelp.PtrToStringUTF8(pchText2) : null;
|
||||
Marshal.FreeHGlobal(pchText2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the language the steam client is running in, you probably want ISteamApps::GetCurrentGameLanguage instead, this is for very special usage cases</para>
|
||||
/// </summary>
|
||||
public static string GetSteamUILanguage() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamUtils_GetSteamUILanguage(CSteamGameServerAPIContext.GetSteamUtils()));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns true if Steam itself is running in VR mode</para>
|
||||
/// </summary>
|
||||
public static bool IsSteamRunningInVR() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUtils_IsSteamRunningInVR(CSteamGameServerAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Sets the inset of the overlay notification from the corner specified by SetOverlayNotificationPosition.</para>
|
||||
/// </summary>
|
||||
public static void SetOverlayNotificationInset(int nHorizontalInset, int nVerticalInset) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamUtils_SetOverlayNotificationInset(CSteamGameServerAPIContext.GetSteamUtils(), nHorizontalInset, nVerticalInset);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns true if Steam & the Steam Overlay are running in Big Picture mode</para>
|
||||
/// <para> Games much be launched through the Steam client to enable the Big Picture overlay. During development,</para>
|
||||
/// <para> a game can be added as a non-steam game to the developers library to test this feature</para>
|
||||
/// </summary>
|
||||
public static bool IsSteamInBigPictureMode() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUtils_IsSteamInBigPictureMode(CSteamGameServerAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> ask SteamUI to create and render its OpenVR dashboard</para>
|
||||
/// </summary>
|
||||
public static void StartVRDashboard() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamUtils_StartVRDashboard(CSteamGameServerAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns true if the HMD content will be streamed via Steam In-Home Streaming</para>
|
||||
/// </summary>
|
||||
public static bool IsVRHeadsetStreamingEnabled() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUtils_IsVRHeadsetStreamingEnabled(CSteamGameServerAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Set whether the HMD content will be streamed via Steam In-Home Streaming</para>
|
||||
/// <para> If this is set to true, then the scene in the HMD headset will be streamed, and remote input will not be allowed.</para>
|
||||
/// <para> If this is set to false, then the application window will be streamed instead, and remote input will be allowed.</para>
|
||||
/// <para> The default is true unless "VRHeadsetStreaming" "0" is in the extended appinfo for a game.</para>
|
||||
/// <para> (this is useful for games that have asymmetric multiplayer gameplay)</para>
|
||||
/// </summary>
|
||||
public static void SetVRHeadsetStreamingEnabled(bool bEnabled) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
NativeMethods.ISteamUtils_SetVRHeadsetStreamingEnabled(CSteamGameServerAPIContext.GetSteamUtils(), bEnabled);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns whether this steam client is a Steam China specific client, vs the global client.</para>
|
||||
/// </summary>
|
||||
public static bool IsSteamChinaLauncher() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUtils_IsSteamChinaLauncher(CSteamGameServerAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Initializes text filtering.</para>
|
||||
/// <para> Returns false if filtering is unavailable for the language the user is currently running in.</para>
|
||||
/// </summary>
|
||||
public static bool InitFilterText() {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
return NativeMethods.ISteamUtils_InitFilterText(CSteamGameServerAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Filters the provided input message and places the filtered result into pchOutFilteredText.</para>
|
||||
/// <para> pchOutFilteredText is where the output will be placed, even if no filtering or censoring is performed</para>
|
||||
/// <para> nByteSizeOutFilteredText is the size (in bytes) of pchOutFilteredText</para>
|
||||
/// <para> pchInputText is the input string that should be filtered, which can be ASCII or UTF-8</para>
|
||||
/// <para> bLegalOnly should be false if you want profanity and legally required filtering (where required) and true if you want legally required filtering only</para>
|
||||
/// <para> Returns the number of characters (not bytes) filtered.</para>
|
||||
/// </summary>
|
||||
public static int FilterText(out string pchOutFilteredText, uint nByteSizeOutFilteredText, string pchInputMessage, bool bLegalOnly) {
|
||||
InteropHelp.TestIfAvailableGameServer();
|
||||
IntPtr pchOutFilteredText2 = Marshal.AllocHGlobal((int)nByteSizeOutFilteredText);
|
||||
using (var pchInputMessage2 = new InteropHelp.UTF8StringHandle(pchInputMessage)) {
|
||||
int ret = NativeMethods.ISteamUtils_FilterText(CSteamGameServerAPIContext.GetSteamUtils(), pchOutFilteredText2, nByteSizeOutFilteredText, pchInputMessage2, bLegalOnly);
|
||||
pchOutFilteredText = ret != -1 ? InteropHelp.PtrToStringUTF8(pchOutFilteredText2) : null;
|
||||
Marshal.FreeHGlobal(pchOutFilteredText2);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,341 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamHTMLSurface {
|
||||
/// <summary>
|
||||
/// <para> Must call init and shutdown when starting/ending use of the interface</para>
|
||||
/// </summary>
|
||||
public static bool Init() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamHTMLSurface_Init(CSteamAPIContext.GetSteamHTMLSurface());
|
||||
}
|
||||
|
||||
public static bool Shutdown() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamHTMLSurface_Shutdown(CSteamAPIContext.GetSteamHTMLSurface());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Create a browser object for display of a html page, when creation is complete the call handle</para>
|
||||
/// <para> will return a HTML_BrowserReady_t callback for the HHTMLBrowser of your new browser.</para>
|
||||
/// <para> The user agent string is a substring to be added to the general user agent string so you can</para>
|
||||
/// <para> identify your client on web servers.</para>
|
||||
/// <para> The userCSS string lets you apply a CSS style sheet to every displayed page, leave null if</para>
|
||||
/// <para> you do not require this functionality.</para>
|
||||
/// <para> YOU MUST HAVE IMPLEMENTED HANDLERS FOR HTML_BrowserReady_t, HTML_StartRequest_t,</para>
|
||||
/// <para> HTML_JSAlert_t, HTML_JSConfirm_t, and HTML_FileOpenDialog_t! See the CALLBACKS</para>
|
||||
/// <para> section of this interface (AllowStartRequest, etc) for more details. If you do</para>
|
||||
/// <para> not implement these callback handlers, the browser may appear to hang instead of</para>
|
||||
/// <para> navigating to new pages or triggering javascript popups.</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t CreateBrowser(string pchUserAgent, string pchUserCSS) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchUserAgent2 = new InteropHelp.UTF8StringHandle(pchUserAgent))
|
||||
using (var pchUserCSS2 = new InteropHelp.UTF8StringHandle(pchUserCSS)) {
|
||||
return (SteamAPICall_t)NativeMethods.ISteamHTMLSurface_CreateBrowser(CSteamAPIContext.GetSteamHTMLSurface(), pchUserAgent2, pchUserCSS2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Call this when you are done with a html surface, this lets us free the resources being used by it</para>
|
||||
/// </summary>
|
||||
public static void RemoveBrowser(HHTMLBrowser unBrowserHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_RemoveBrowser(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Navigate to this URL, results in a HTML_StartRequest_t as the request commences</para>
|
||||
/// </summary>
|
||||
public static void LoadURL(HHTMLBrowser unBrowserHandle, string pchURL, string pchPostData) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchURL2 = new InteropHelp.UTF8StringHandle(pchURL))
|
||||
using (var pchPostData2 = new InteropHelp.UTF8StringHandle(pchPostData)) {
|
||||
NativeMethods.ISteamHTMLSurface_LoadURL(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, pchURL2, pchPostData2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Tells the surface the size in pixels to display the surface</para>
|
||||
/// </summary>
|
||||
public static void SetSize(HHTMLBrowser unBrowserHandle, uint unWidth, uint unHeight) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_SetSize(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, unWidth, unHeight);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Stop the load of the current html page</para>
|
||||
/// </summary>
|
||||
public static void StopLoad(HHTMLBrowser unBrowserHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_StopLoad(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Reload (most likely from local cache) the current page</para>
|
||||
/// </summary>
|
||||
public static void Reload(HHTMLBrowser unBrowserHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_Reload(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> navigate back in the page history</para>
|
||||
/// </summary>
|
||||
public static void GoBack(HHTMLBrowser unBrowserHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_GoBack(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> navigate forward in the page history</para>
|
||||
/// </summary>
|
||||
public static void GoForward(HHTMLBrowser unBrowserHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_GoForward(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> add this header to any url requests from this browser</para>
|
||||
/// </summary>
|
||||
public static void AddHeader(HHTMLBrowser unBrowserHandle, string pchKey, string pchValue) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchKey2 = new InteropHelp.UTF8StringHandle(pchKey))
|
||||
using (var pchValue2 = new InteropHelp.UTF8StringHandle(pchValue)) {
|
||||
NativeMethods.ISteamHTMLSurface_AddHeader(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, pchKey2, pchValue2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> run this javascript script in the currently loaded page</para>
|
||||
/// </summary>
|
||||
public static void ExecuteJavascript(HHTMLBrowser unBrowserHandle, string pchScript) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchScript2 = new InteropHelp.UTF8StringHandle(pchScript)) {
|
||||
NativeMethods.ISteamHTMLSurface_ExecuteJavascript(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, pchScript2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Mouse click and mouse movement commands</para>
|
||||
/// </summary>
|
||||
public static void MouseUp(HHTMLBrowser unBrowserHandle, EHTMLMouseButton eMouseButton) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_MouseUp(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, eMouseButton);
|
||||
}
|
||||
|
||||
public static void MouseDown(HHTMLBrowser unBrowserHandle, EHTMLMouseButton eMouseButton) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_MouseDown(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, eMouseButton);
|
||||
}
|
||||
|
||||
public static void MouseDoubleClick(HHTMLBrowser unBrowserHandle, EHTMLMouseButton eMouseButton) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_MouseDoubleClick(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, eMouseButton);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> x and y are relative to the HTML bounds</para>
|
||||
/// </summary>
|
||||
public static void MouseMove(HHTMLBrowser unBrowserHandle, int x, int y) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_MouseMove(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, x, y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> nDelta is pixels of scroll</para>
|
||||
/// </summary>
|
||||
public static void MouseWheel(HHTMLBrowser unBrowserHandle, int nDelta) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_MouseWheel(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, nDelta);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> keyboard interactions, native keycode is the virtual key code value from your OS, system key flags the key to not</para>
|
||||
/// <para> be sent as a typed character as well as a key down</para>
|
||||
/// </summary>
|
||||
public static void KeyDown(HHTMLBrowser unBrowserHandle, uint nNativeKeyCode, EHTMLKeyModifiers eHTMLKeyModifiers, bool bIsSystemKey = false) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_KeyDown(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, nNativeKeyCode, eHTMLKeyModifiers, bIsSystemKey);
|
||||
}
|
||||
|
||||
public static void KeyUp(HHTMLBrowser unBrowserHandle, uint nNativeKeyCode, EHTMLKeyModifiers eHTMLKeyModifiers) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_KeyUp(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, nNativeKeyCode, eHTMLKeyModifiers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> cUnicodeChar is the unicode character point for this keypress (and potentially multiple chars per press)</para>
|
||||
/// </summary>
|
||||
public static void KeyChar(HHTMLBrowser unBrowserHandle, uint cUnicodeChar, EHTMLKeyModifiers eHTMLKeyModifiers) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_KeyChar(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, cUnicodeChar, eHTMLKeyModifiers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> programmatically scroll this many pixels on the page</para>
|
||||
/// </summary>
|
||||
public static void SetHorizontalScroll(HHTMLBrowser unBrowserHandle, uint nAbsolutePixelScroll) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_SetHorizontalScroll(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, nAbsolutePixelScroll);
|
||||
}
|
||||
|
||||
public static void SetVerticalScroll(HHTMLBrowser unBrowserHandle, uint nAbsolutePixelScroll) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_SetVerticalScroll(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, nAbsolutePixelScroll);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> tell the html control if it has key focus currently, controls showing the I-beam cursor in text controls amongst other things</para>
|
||||
/// </summary>
|
||||
public static void SetKeyFocus(HHTMLBrowser unBrowserHandle, bool bHasKeyFocus) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_SetKeyFocus(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, bHasKeyFocus);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> open the current pages html code in the local editor of choice, used for debugging</para>
|
||||
/// </summary>
|
||||
public static void ViewSource(HHTMLBrowser unBrowserHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_ViewSource(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> copy the currently selected text on the html page to the local clipboard</para>
|
||||
/// </summary>
|
||||
public static void CopyToClipboard(HHTMLBrowser unBrowserHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_CopyToClipboard(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> paste from the local clipboard to the current html page</para>
|
||||
/// </summary>
|
||||
public static void PasteFromClipboard(HHTMLBrowser unBrowserHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_PasteFromClipboard(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> find this string in the browser, if bCurrentlyInFind is true then instead cycle to the next matching element</para>
|
||||
/// </summary>
|
||||
public static void Find(HHTMLBrowser unBrowserHandle, string pchSearchStr, bool bCurrentlyInFind, bool bReverse) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchSearchStr2 = new InteropHelp.UTF8StringHandle(pchSearchStr)) {
|
||||
NativeMethods.ISteamHTMLSurface_Find(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, pchSearchStr2, bCurrentlyInFind, bReverse);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> cancel a currently running find</para>
|
||||
/// </summary>
|
||||
public static void StopFind(HHTMLBrowser unBrowserHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_StopFind(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> return details about the link at position x,y on the current page</para>
|
||||
/// </summary>
|
||||
public static void GetLinkAtPosition(HHTMLBrowser unBrowserHandle, int x, int y) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_GetLinkAtPosition(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, x, y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> set a webcookie for the hostname in question</para>
|
||||
/// </summary>
|
||||
public static void SetCookie(string pchHostname, string pchKey, string pchValue, string pchPath = "/", uint nExpires = 0, bool bSecure = false, bool bHTTPOnly = false) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchHostname2 = new InteropHelp.UTF8StringHandle(pchHostname))
|
||||
using (var pchKey2 = new InteropHelp.UTF8StringHandle(pchKey))
|
||||
using (var pchValue2 = new InteropHelp.UTF8StringHandle(pchValue))
|
||||
using (var pchPath2 = new InteropHelp.UTF8StringHandle(pchPath)) {
|
||||
NativeMethods.ISteamHTMLSurface_SetCookie(CSteamAPIContext.GetSteamHTMLSurface(), pchHostname2, pchKey2, pchValue2, pchPath2, nExpires, bSecure, bHTTPOnly);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Zoom the current page by flZoom ( from 0.0 to 2.0, so to zoom to 120% use 1.2 ), zooming around point X,Y in the page (use 0,0 if you don't care)</para>
|
||||
/// </summary>
|
||||
public static void SetPageScaleFactor(HHTMLBrowser unBrowserHandle, float flZoom, int nPointX, int nPointY) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_SetPageScaleFactor(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, flZoom, nPointX, nPointY);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Enable/disable low-resource background mode, where javascript and repaint timers are throttled, resources are</para>
|
||||
/// <para> more aggressively purged from memory, and audio/video elements are paused. When background mode is enabled,</para>
|
||||
/// <para> all HTML5 video and audio objects will execute ".pause()" and gain the property "._steam_background_paused = 1".</para>
|
||||
/// <para> When background mode is disabled, any video or audio objects with that property will resume with ".play()".</para>
|
||||
/// </summary>
|
||||
public static void SetBackgroundMode(HHTMLBrowser unBrowserHandle, bool bBackgroundMode) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_SetBackgroundMode(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, bBackgroundMode);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Scale the output display space by this factor, this is useful when displaying content on high dpi devices.</para>
|
||||
/// <para> Specifies the ratio between physical and logical pixels.</para>
|
||||
/// </summary>
|
||||
public static void SetDPIScalingFactor(HHTMLBrowser unBrowserHandle, float flDPIScaling) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_SetDPIScalingFactor(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, flDPIScaling);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Open HTML/JS developer tools</para>
|
||||
/// </summary>
|
||||
public static void OpenDeveloperTools(HHTMLBrowser unBrowserHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_OpenDeveloperTools(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> CALLBACKS</para>
|
||||
/// <para> These set of functions are used as responses to callback requests</para>
|
||||
/// <para> You MUST call this in response to a HTML_StartRequest_t callback</para>
|
||||
/// <para> Set bAllowed to true to allow this navigation, false to cancel it and stay</para>
|
||||
/// <para> on the current page. You can use this feature to limit the valid pages</para>
|
||||
/// <para> allowed in your HTML surface.</para>
|
||||
/// </summary>
|
||||
public static void AllowStartRequest(HHTMLBrowser unBrowserHandle, bool bAllowed) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_AllowStartRequest(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, bAllowed);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> You MUST call this in response to a HTML_JSAlert_t or HTML_JSConfirm_t callback</para>
|
||||
/// <para> Set bResult to true for the OK option of a confirm, use false otherwise</para>
|
||||
/// </summary>
|
||||
public static void JSDialogResponse(HHTMLBrowser unBrowserHandle, bool bResult) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_JSDialogResponse(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, bResult);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> You MUST call this in response to a HTML_FileOpenDialog_t callback</para>
|
||||
/// </summary>
|
||||
public static void FileLoadDialogResponse(HHTMLBrowser unBrowserHandle, IntPtr pchSelectedFiles) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamHTMLSurface_FileLoadDialogResponse(CSteamAPIContext.GetSteamHTMLSurface(), unBrowserHandle, pchSelectedFiles);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,277 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamHTTP {
|
||||
/// <summary>
|
||||
/// <para> Initializes a new HTTP request, returning a handle to use in further operations on it. Requires</para>
|
||||
/// <para> the method (GET or POST) and the absolute URL for the request. Both http and https are supported,</para>
|
||||
/// <para> so this string must start with http:// or https:// and should look like http://store.steampowered.com/app/250/</para>
|
||||
/// <para> or such.</para>
|
||||
/// </summary>
|
||||
public static HTTPRequestHandle CreateHTTPRequest(EHTTPMethod eHTTPRequestMethod, string pchAbsoluteURL) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchAbsoluteURL2 = new InteropHelp.UTF8StringHandle(pchAbsoluteURL)) {
|
||||
return (HTTPRequestHandle)NativeMethods.ISteamHTTP_CreateHTTPRequest(CSteamAPIContext.GetSteamHTTP(), eHTTPRequestMethod, pchAbsoluteURL2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Set a context value for the request, which will be returned in the HTTPRequestCompleted_t callback after</para>
|
||||
/// <para> sending the request. This is just so the caller can easily keep track of which callbacks go with which request data.</para>
|
||||
/// </summary>
|
||||
public static bool SetHTTPRequestContextValue(HTTPRequestHandle hRequest, ulong ulContextValue) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamHTTP_SetHTTPRequestContextValue(CSteamAPIContext.GetSteamHTTP(), hRequest, ulContextValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Set a timeout in seconds for the HTTP request, must be called prior to sending the request. Default</para>
|
||||
/// <para> timeout is 60 seconds if you don't call this. Returns false if the handle is invalid, or the request</para>
|
||||
/// <para> has already been sent.</para>
|
||||
/// </summary>
|
||||
public static bool SetHTTPRequestNetworkActivityTimeout(HTTPRequestHandle hRequest, uint unTimeoutSeconds) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamHTTP_SetHTTPRequestNetworkActivityTimeout(CSteamAPIContext.GetSteamHTTP(), hRequest, unTimeoutSeconds);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Set a request header value for the request, must be called prior to sending the request. Will</para>
|
||||
/// <para> return false if the handle is invalid or the request is already sent.</para>
|
||||
/// </summary>
|
||||
public static bool SetHTTPRequestHeaderValue(HTTPRequestHandle hRequest, string pchHeaderName, string pchHeaderValue) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchHeaderName2 = new InteropHelp.UTF8StringHandle(pchHeaderName))
|
||||
using (var pchHeaderValue2 = new InteropHelp.UTF8StringHandle(pchHeaderValue)) {
|
||||
return NativeMethods.ISteamHTTP_SetHTTPRequestHeaderValue(CSteamAPIContext.GetSteamHTTP(), hRequest, pchHeaderName2, pchHeaderValue2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Set a GET or POST parameter value on the request, which is set will depend on the EHTTPMethod specified</para>
|
||||
/// <para> when creating the request. Must be called prior to sending the request. Will return false if the</para>
|
||||
/// <para> handle is invalid or the request is already sent.</para>
|
||||
/// </summary>
|
||||
public static bool SetHTTPRequestGetOrPostParameter(HTTPRequestHandle hRequest, string pchParamName, string pchParamValue) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchParamName2 = new InteropHelp.UTF8StringHandle(pchParamName))
|
||||
using (var pchParamValue2 = new InteropHelp.UTF8StringHandle(pchParamValue)) {
|
||||
return NativeMethods.ISteamHTTP_SetHTTPRequestGetOrPostParameter(CSteamAPIContext.GetSteamHTTP(), hRequest, pchParamName2, pchParamValue2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Sends the HTTP request, will return false on a bad handle, otherwise use SteamCallHandle to wait on</para>
|
||||
/// <para> asynchronous response via callback.</para>
|
||||
/// <para> Note: If the user is in offline mode in Steam, then this will add a only-if-cached cache-control</para>
|
||||
/// <para> header and only do a local cache lookup rather than sending any actual remote request.</para>
|
||||
/// </summary>
|
||||
public static bool SendHTTPRequest(HTTPRequestHandle hRequest, out SteamAPICall_t pCallHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamHTTP_SendHTTPRequest(CSteamAPIContext.GetSteamHTTP(), hRequest, out pCallHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Sends the HTTP request, will return false on a bad handle, otherwise use SteamCallHandle to wait on</para>
|
||||
/// <para> asynchronous response via callback for completion, and listen for HTTPRequestHeadersReceived_t and</para>
|
||||
/// <para> HTTPRequestDataReceived_t callbacks while streaming.</para>
|
||||
/// </summary>
|
||||
public static bool SendHTTPRequestAndStreamResponse(HTTPRequestHandle hRequest, out SteamAPICall_t pCallHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamHTTP_SendHTTPRequestAndStreamResponse(CSteamAPIContext.GetSteamHTTP(), hRequest, out pCallHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Defers a request you have sent, the actual HTTP client code may have many requests queued, and this will move</para>
|
||||
/// <para> the specified request to the tail of the queue. Returns false on invalid handle, or if the request is not yet sent.</para>
|
||||
/// </summary>
|
||||
public static bool DeferHTTPRequest(HTTPRequestHandle hRequest) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamHTTP_DeferHTTPRequest(CSteamAPIContext.GetSteamHTTP(), hRequest);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Prioritizes a request you have sent, the actual HTTP client code may have many requests queued, and this will move</para>
|
||||
/// <para> the specified request to the head of the queue. Returns false on invalid handle, or if the request is not yet sent.</para>
|
||||
/// </summary>
|
||||
public static bool PrioritizeHTTPRequest(HTTPRequestHandle hRequest) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamHTTP_PrioritizeHTTPRequest(CSteamAPIContext.GetSteamHTTP(), hRequest);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Checks if a response header is present in a HTTP response given a handle from HTTPRequestCompleted_t, also</para>
|
||||
/// <para> returns the size of the header value if present so the caller and allocate a correctly sized buffer for</para>
|
||||
/// <para> GetHTTPResponseHeaderValue.</para>
|
||||
/// </summary>
|
||||
public static bool GetHTTPResponseHeaderSize(HTTPRequestHandle hRequest, string pchHeaderName, out uint unResponseHeaderSize) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchHeaderName2 = new InteropHelp.UTF8StringHandle(pchHeaderName)) {
|
||||
return NativeMethods.ISteamHTTP_GetHTTPResponseHeaderSize(CSteamAPIContext.GetSteamHTTP(), hRequest, pchHeaderName2, out unResponseHeaderSize);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Gets header values from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the</para>
|
||||
/// <para> header is not present or if your buffer is too small to contain it's value. You should first call</para>
|
||||
/// <para> BGetHTTPResponseHeaderSize to check for the presence of the header and to find out the size buffer needed.</para>
|
||||
/// </summary>
|
||||
public static bool GetHTTPResponseHeaderValue(HTTPRequestHandle hRequest, string pchHeaderName, byte[] pHeaderValueBuffer, uint unBufferSize) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchHeaderName2 = new InteropHelp.UTF8StringHandle(pchHeaderName)) {
|
||||
return NativeMethods.ISteamHTTP_GetHTTPResponseHeaderValue(CSteamAPIContext.GetSteamHTTP(), hRequest, pchHeaderName2, pHeaderValueBuffer, unBufferSize);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Gets the size of the body data from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the</para>
|
||||
/// <para> handle is invalid.</para>
|
||||
/// </summary>
|
||||
public static bool GetHTTPResponseBodySize(HTTPRequestHandle hRequest, out uint unBodySize) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamHTTP_GetHTTPResponseBodySize(CSteamAPIContext.GetSteamHTTP(), hRequest, out unBodySize);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Gets the body data from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the</para>
|
||||
/// <para> handle is invalid or is to a streaming response, or if the provided buffer is not the correct size. Use BGetHTTPResponseBodySize first to find out</para>
|
||||
/// <para> the correct buffer size to use.</para>
|
||||
/// </summary>
|
||||
public static bool GetHTTPResponseBodyData(HTTPRequestHandle hRequest, byte[] pBodyDataBuffer, uint unBufferSize) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamHTTP_GetHTTPResponseBodyData(CSteamAPIContext.GetSteamHTTP(), hRequest, pBodyDataBuffer, unBufferSize);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Gets the body data from a streaming HTTP response given a handle from HTTPRequestDataReceived_t. Will return false if the</para>
|
||||
/// <para> handle is invalid or is to a non-streaming response (meaning it wasn't sent with SendHTTPRequestAndStreamResponse), or if the buffer size and offset</para>
|
||||
/// <para> do not match the size and offset sent in HTTPRequestDataReceived_t.</para>
|
||||
/// </summary>
|
||||
public static bool GetHTTPStreamingResponseBodyData(HTTPRequestHandle hRequest, uint cOffset, byte[] pBodyDataBuffer, uint unBufferSize) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamHTTP_GetHTTPStreamingResponseBodyData(CSteamAPIContext.GetSteamHTTP(), hRequest, cOffset, pBodyDataBuffer, unBufferSize);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Releases an HTTP response handle, should always be called to free resources after receiving a HTTPRequestCompleted_t</para>
|
||||
/// <para> callback and finishing using the response.</para>
|
||||
/// </summary>
|
||||
public static bool ReleaseHTTPRequest(HTTPRequestHandle hRequest) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamHTTP_ReleaseHTTPRequest(CSteamAPIContext.GetSteamHTTP(), hRequest);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Gets progress on downloading the body for the request. This will be zero unless a response header has already been</para>
|
||||
/// <para> received which included a content-length field. For responses that contain no content-length it will report</para>
|
||||
/// <para> zero for the duration of the request as the size is unknown until the connection closes.</para>
|
||||
/// </summary>
|
||||
public static bool GetHTTPDownloadProgressPct(HTTPRequestHandle hRequest, out float pflPercentOut) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamHTTP_GetHTTPDownloadProgressPct(CSteamAPIContext.GetSteamHTTP(), hRequest, out pflPercentOut);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Sets the body for an HTTP Post request. Will fail and return false on a GET request, and will fail if POST params</para>
|
||||
/// <para> have already been set for the request. Setting this raw body makes it the only contents for the post, the pchContentType</para>
|
||||
/// <para> parameter will set the content-type header for the request so the server may know how to interpret the body.</para>
|
||||
/// </summary>
|
||||
public static bool SetHTTPRequestRawPostBody(HTTPRequestHandle hRequest, string pchContentType, byte[] pubBody, uint unBodyLen) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchContentType2 = new InteropHelp.UTF8StringHandle(pchContentType)) {
|
||||
return NativeMethods.ISteamHTTP_SetHTTPRequestRawPostBody(CSteamAPIContext.GetSteamHTTP(), hRequest, pchContentType2, pubBody, unBodyLen);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Creates a cookie container handle which you must later free with ReleaseCookieContainer(). If bAllowResponsesToModify=true</para>
|
||||
/// <para> than any response to your requests using this cookie container may add new cookies which may be transmitted with</para>
|
||||
/// <para> future requests. If bAllowResponsesToModify=false than only cookies you explicitly set will be sent. This API is just for</para>
|
||||
/// <para> during process lifetime, after steam restarts no cookies are persisted and you have no way to access the cookie container across</para>
|
||||
/// <para> repeat executions of your process.</para>
|
||||
/// </summary>
|
||||
public static HTTPCookieContainerHandle CreateCookieContainer(bool bAllowResponsesToModify) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (HTTPCookieContainerHandle)NativeMethods.ISteamHTTP_CreateCookieContainer(CSteamAPIContext.GetSteamHTTP(), bAllowResponsesToModify);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Release a cookie container you are finished using, freeing it's memory</para>
|
||||
/// </summary>
|
||||
public static bool ReleaseCookieContainer(HTTPCookieContainerHandle hCookieContainer) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamHTTP_ReleaseCookieContainer(CSteamAPIContext.GetSteamHTTP(), hCookieContainer);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Adds a cookie to the specified cookie container that will be used with future requests.</para>
|
||||
/// </summary>
|
||||
public static bool SetCookie(HTTPCookieContainerHandle hCookieContainer, string pchHost, string pchUrl, string pchCookie) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchHost2 = new InteropHelp.UTF8StringHandle(pchHost))
|
||||
using (var pchUrl2 = new InteropHelp.UTF8StringHandle(pchUrl))
|
||||
using (var pchCookie2 = new InteropHelp.UTF8StringHandle(pchCookie)) {
|
||||
return NativeMethods.ISteamHTTP_SetCookie(CSteamAPIContext.GetSteamHTTP(), hCookieContainer, pchHost2, pchUrl2, pchCookie2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Set the cookie container to use for a HTTP request</para>
|
||||
/// </summary>
|
||||
public static bool SetHTTPRequestCookieContainer(HTTPRequestHandle hRequest, HTTPCookieContainerHandle hCookieContainer) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamHTTP_SetHTTPRequestCookieContainer(CSteamAPIContext.GetSteamHTTP(), hRequest, hCookieContainer);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Set the extra user agent info for a request, this doesn't clobber the normal user agent, it just adds the extra info on the end</para>
|
||||
/// </summary>
|
||||
public static bool SetHTTPRequestUserAgentInfo(HTTPRequestHandle hRequest, string pchUserAgentInfo) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchUserAgentInfo2 = new InteropHelp.UTF8StringHandle(pchUserAgentInfo)) {
|
||||
return NativeMethods.ISteamHTTP_SetHTTPRequestUserAgentInfo(CSteamAPIContext.GetSteamHTTP(), hRequest, pchUserAgentInfo2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Disable or re-enable verification of SSL/TLS certificates.</para>
|
||||
/// <para> By default, certificates are checked for all HTTPS requests.</para>
|
||||
/// </summary>
|
||||
public static bool SetHTTPRequestRequiresVerifiedCertificate(HTTPRequestHandle hRequest, bool bRequireVerifiedCertificate) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate(CSteamAPIContext.GetSteamHTTP(), hRequest, bRequireVerifiedCertificate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Set an absolute timeout on the HTTP request, this is just a total time timeout different than the network activity timeout</para>
|
||||
/// <para> which can bump everytime we get more data</para>
|
||||
/// </summary>
|
||||
public static bool SetHTTPRequestAbsoluteTimeoutMS(HTTPRequestHandle hRequest, uint unMilliseconds) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS(CSteamAPIContext.GetSteamHTTP(), hRequest, unMilliseconds);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Check if the reason the request failed was because we timed it out (rather than some harder failure)</para>
|
||||
/// </summary>
|
||||
public static bool GetHTTPRequestWasTimedOut(HTTPRequestHandle hRequest, out bool pbWasTimedOut) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamHTTP_GetHTTPRequestWasTimedOut(CSteamAPIContext.GetSteamHTTP(), hRequest, out pbWasTimedOut);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,342 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamInput {
|
||||
/// <summary>
|
||||
/// <para> Init and Shutdown must be called when starting/ending use of this interface</para>
|
||||
/// </summary>
|
||||
public static bool Init() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInput_Init(CSteamAPIContext.GetSteamInput());
|
||||
}
|
||||
|
||||
public static bool Shutdown() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInput_Shutdown(CSteamAPIContext.GetSteamInput());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Synchronize API state with the latest Steam Controller inputs available. This</para>
|
||||
/// <para> is performed automatically by SteamAPI_RunCallbacks, but for the absolute lowest</para>
|
||||
/// <para> possible latency, you call this directly before reading controller state. This must</para>
|
||||
/// <para> be called from somewhere before GetConnectedControllers will return any handles</para>
|
||||
/// </summary>
|
||||
public static void RunFrame() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamInput_RunFrame(CSteamAPIContext.GetSteamInput());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Enumerate currently connected Steam Input enabled devices - developers can opt in controller by type (ex: Xbox/Playstation/etc) via</para>
|
||||
/// <para> the Steam Input settings in the Steamworks site or users can opt-in in their controller settings in Steam.</para>
|
||||
/// <para> handlesOut should point to a STEAM_INPUT_MAX_COUNT sized array of InputHandle_t handles</para>
|
||||
/// <para> Returns the number of handles written to handlesOut</para>
|
||||
/// </summary>
|
||||
public static int GetConnectedControllers(InputHandle_t[] handlesOut) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
if (handlesOut != null && handlesOut.Length != Constants.STEAM_INPUT_MAX_COUNT) {
|
||||
throw new System.ArgumentException("handlesOut must be the same size as Constants.STEAM_INPUT_MAX_COUNT!");
|
||||
}
|
||||
return NativeMethods.ISteamInput_GetConnectedControllers(CSteamAPIContext.GetSteamInput(), handlesOut);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>-----------------------------------------------------------------------------</para>
|
||||
/// <para> ACTION SETS</para>
|
||||
/// <para>-----------------------------------------------------------------------------</para>
|
||||
/// <para> Lookup the handle for an Action Set. Best to do this once on startup, and store the handles for all future API calls.</para>
|
||||
/// </summary>
|
||||
public static InputActionSetHandle_t GetActionSetHandle(string pszActionSetName) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pszActionSetName2 = new InteropHelp.UTF8StringHandle(pszActionSetName)) {
|
||||
return (InputActionSetHandle_t)NativeMethods.ISteamInput_GetActionSetHandle(CSteamAPIContext.GetSteamInput(), pszActionSetName2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Reconfigure the controller to use the specified action set (ie 'Menu', 'Walk' or 'Drive')</para>
|
||||
/// <para> This is cheap, and can be safely called repeatedly. It's often easier to repeatedly call it in</para>
|
||||
/// <para> your state loops, instead of trying to place it in all of your state transitions.</para>
|
||||
/// </summary>
|
||||
public static void ActivateActionSet(InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamInput_ActivateActionSet(CSteamAPIContext.GetSteamInput(), inputHandle, actionSetHandle);
|
||||
}
|
||||
|
||||
public static InputActionSetHandle_t GetCurrentActionSet(InputHandle_t inputHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (InputActionSetHandle_t)NativeMethods.ISteamInput_GetCurrentActionSet(CSteamAPIContext.GetSteamInput(), inputHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> ACTION SET LAYERS</para>
|
||||
/// </summary>
|
||||
public static void ActivateActionSetLayer(InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamInput_ActivateActionSetLayer(CSteamAPIContext.GetSteamInput(), inputHandle, actionSetLayerHandle);
|
||||
}
|
||||
|
||||
public static void DeactivateActionSetLayer(InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamInput_DeactivateActionSetLayer(CSteamAPIContext.GetSteamInput(), inputHandle, actionSetLayerHandle);
|
||||
}
|
||||
|
||||
public static void DeactivateAllActionSetLayers(InputHandle_t inputHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamInput_DeactivateAllActionSetLayers(CSteamAPIContext.GetSteamInput(), inputHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Enumerate currently active layers.</para>
|
||||
/// <para> handlesOut should point to a STEAM_INPUT_MAX_ACTIVE_LAYERS sized array of ControllerActionSetHandle_t handles</para>
|
||||
/// <para> Returns the number of handles written to handlesOut</para>
|
||||
/// </summary>
|
||||
public static int GetActiveActionSetLayers(InputHandle_t inputHandle, InputActionSetHandle_t[] handlesOut) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
if (handlesOut != null && handlesOut.Length != Constants.STEAM_INPUT_MAX_ACTIVE_LAYERS) {
|
||||
throw new System.ArgumentException("handlesOut must be the same size as Constants.STEAM_INPUT_MAX_ACTIVE_LAYERS!");
|
||||
}
|
||||
return NativeMethods.ISteamInput_GetActiveActionSetLayers(CSteamAPIContext.GetSteamInput(), inputHandle, handlesOut);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>-----------------------------------------------------------------------------</para>
|
||||
/// <para> ACTIONS</para>
|
||||
/// <para>-----------------------------------------------------------------------------</para>
|
||||
/// <para> Lookup the handle for a digital action. Best to do this once on startup, and store the handles for all future API calls.</para>
|
||||
/// </summary>
|
||||
public static InputDigitalActionHandle_t GetDigitalActionHandle(string pszActionName) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pszActionName2 = new InteropHelp.UTF8StringHandle(pszActionName)) {
|
||||
return (InputDigitalActionHandle_t)NativeMethods.ISteamInput_GetDigitalActionHandle(CSteamAPIContext.GetSteamInput(), pszActionName2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns the current state of the supplied digital game action</para>
|
||||
/// </summary>
|
||||
public static InputDigitalActionData_t GetDigitalActionData(InputHandle_t inputHandle, InputDigitalActionHandle_t digitalActionHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInput_GetDigitalActionData(CSteamAPIContext.GetSteamInput(), inputHandle, digitalActionHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Get the origin(s) for a digital action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action.</para>
|
||||
/// <para> originsOut should point to a STEAM_INPUT_MAX_ORIGINS sized array of EInputActionOrigin handles. The EInputActionOrigin enum will get extended as support for new controller controllers gets added to</para>
|
||||
/// <para> the Steam client and will exceed the values from this header, please check bounds if you are using a look up table.</para>
|
||||
/// </summary>
|
||||
public static int GetDigitalActionOrigins(InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputDigitalActionHandle_t digitalActionHandle, EInputActionOrigin[] originsOut) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
if (originsOut != null && originsOut.Length != Constants.STEAM_INPUT_MAX_ORIGINS) {
|
||||
throw new System.ArgumentException("originsOut must be the same size as Constants.STEAM_INPUT_MAX_ORIGINS!");
|
||||
}
|
||||
return NativeMethods.ISteamInput_GetDigitalActionOrigins(CSteamAPIContext.GetSteamInput(), inputHandle, actionSetHandle, digitalActionHandle, originsOut);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Lookup the handle for an analog action. Best to do this once on startup, and store the handles for all future API calls.</para>
|
||||
/// </summary>
|
||||
public static InputAnalogActionHandle_t GetAnalogActionHandle(string pszActionName) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pszActionName2 = new InteropHelp.UTF8StringHandle(pszActionName)) {
|
||||
return (InputAnalogActionHandle_t)NativeMethods.ISteamInput_GetAnalogActionHandle(CSteamAPIContext.GetSteamInput(), pszActionName2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns the current state of these supplied analog game action</para>
|
||||
/// </summary>
|
||||
public static InputAnalogActionData_t GetAnalogActionData(InputHandle_t inputHandle, InputAnalogActionHandle_t analogActionHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInput_GetAnalogActionData(CSteamAPIContext.GetSteamInput(), inputHandle, analogActionHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Get the origin(s) for an analog action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action.</para>
|
||||
/// <para> originsOut should point to a STEAM_INPUT_MAX_ORIGINS sized array of EInputActionOrigin handles. The EInputActionOrigin enum will get extended as support for new controller controllers gets added to</para>
|
||||
/// <para> the Steam client and will exceed the values from this header, please check bounds if you are using a look up table.</para>
|
||||
/// </summary>
|
||||
public static int GetAnalogActionOrigins(InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputAnalogActionHandle_t analogActionHandle, EInputActionOrigin[] originsOut) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
if (originsOut != null && originsOut.Length != Constants.STEAM_INPUT_MAX_ORIGINS) {
|
||||
throw new System.ArgumentException("originsOut must be the same size as Constants.STEAM_INPUT_MAX_ORIGINS!");
|
||||
}
|
||||
return NativeMethods.ISteamInput_GetAnalogActionOrigins(CSteamAPIContext.GetSteamInput(), inputHandle, actionSetHandle, analogActionHandle, originsOut);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Get a local path to art for on-screen glyph for a particular origin</para>
|
||||
/// </summary>
|
||||
public static string GetGlyphForActionOrigin(EInputActionOrigin eOrigin) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamInput_GetGlyphForActionOrigin(CSteamAPIContext.GetSteamInput(), eOrigin));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns a localized string (from Steam's language setting) for the specified origin.</para>
|
||||
/// </summary>
|
||||
public static string GetStringForActionOrigin(EInputActionOrigin eOrigin) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamInput_GetStringForActionOrigin(CSteamAPIContext.GetSteamInput(), eOrigin));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Stop analog momentum for the action if it is a mouse action in trackball mode</para>
|
||||
/// </summary>
|
||||
public static void StopAnalogActionMomentum(InputHandle_t inputHandle, InputAnalogActionHandle_t eAction) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamInput_StopAnalogActionMomentum(CSteamAPIContext.GetSteamInput(), inputHandle, eAction);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns raw motion data from the specified device</para>
|
||||
/// </summary>
|
||||
public static InputMotionData_t GetMotionData(InputHandle_t inputHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInput_GetMotionData(CSteamAPIContext.GetSteamInput(), inputHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>-----------------------------------------------------------------------------</para>
|
||||
/// <para> OUTPUTS</para>
|
||||
/// <para>-----------------------------------------------------------------------------</para>
|
||||
/// <para> Trigger a vibration event on supported controllers - Steam will translate these commands into haptic pulses for Steam Controllers</para>
|
||||
/// </summary>
|
||||
public static void TriggerVibration(InputHandle_t inputHandle, ushort usLeftSpeed, ushort usRightSpeed) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamInput_TriggerVibration(CSteamAPIContext.GetSteamInput(), inputHandle, usLeftSpeed, usRightSpeed);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Set the controller LED color on supported controllers. nFlags is a bitmask of values from ESteamInputLEDFlag - 0 will default to setting a color. Steam will handle</para>
|
||||
/// <para> the behavior on exit of your program so you don't need to try restore the default as you are shutting down</para>
|
||||
/// </summary>
|
||||
public static void SetLEDColor(InputHandle_t inputHandle, byte nColorR, byte nColorG, byte nColorB, uint nFlags) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamInput_SetLEDColor(CSteamAPIContext.GetSteamInput(), inputHandle, nColorR, nColorG, nColorB, nFlags);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Trigger a haptic pulse on a Steam Controller - if you are approximating rumble you may want to use TriggerVibration instead.</para>
|
||||
/// <para> Good uses for Haptic pulses include chimes, noises, or directional gameplay feedback (taking damage, footstep locations, etc).</para>
|
||||
/// </summary>
|
||||
public static void TriggerHapticPulse(InputHandle_t inputHandle, ESteamControllerPad eTargetPad, ushort usDurationMicroSec) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamInput_TriggerHapticPulse(CSteamAPIContext.GetSteamInput(), inputHandle, eTargetPad, usDurationMicroSec);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Trigger a haptic pulse with a duty cycle of usDurationMicroSec / usOffMicroSec, unRepeat times. If you are approximating rumble you may want to use TriggerVibration instead.</para>
|
||||
/// <para> nFlags is currently unused and reserved for future use.</para>
|
||||
/// </summary>
|
||||
public static void TriggerRepeatedHapticPulse(InputHandle_t inputHandle, ESteamControllerPad eTargetPad, ushort usDurationMicroSec, ushort usOffMicroSec, ushort unRepeat, uint nFlags) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamInput_TriggerRepeatedHapticPulse(CSteamAPIContext.GetSteamInput(), inputHandle, eTargetPad, usDurationMicroSec, usOffMicroSec, unRepeat, nFlags);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>-----------------------------------------------------------------------------</para>
|
||||
/// <para> Utility functions availible without using the rest of Steam Input API</para>
|
||||
/// <para>-----------------------------------------------------------------------------</para>
|
||||
/// <para> Invokes the Steam overlay and brings up the binding screen if the user is using Big Picture Mode</para>
|
||||
/// <para> If the user is not in Big Picture Mode it will open up the binding in a new window</para>
|
||||
/// </summary>
|
||||
public static bool ShowBindingPanel(InputHandle_t inputHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInput_ShowBindingPanel(CSteamAPIContext.GetSteamInput(), inputHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns the input type for a particular handle</para>
|
||||
/// </summary>
|
||||
public static ESteamInputType GetInputTypeForHandle(InputHandle_t inputHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInput_GetInputTypeForHandle(CSteamAPIContext.GetSteamInput(), inputHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns the associated controller handle for the specified emulated gamepad - can be used with the above 2 functions</para>
|
||||
/// <para> to identify controllers presented to your game over Xinput. Returns 0 if the Xinput index isn't associated with Steam Input</para>
|
||||
/// </summary>
|
||||
public static InputHandle_t GetControllerForGamepadIndex(int nIndex) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (InputHandle_t)NativeMethods.ISteamInput_GetControllerForGamepadIndex(CSteamAPIContext.GetSteamInput(), nIndex);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns the associated gamepad index for the specified controller, if emulating a gamepad or -1 if not associated with an Xinput index</para>
|
||||
/// </summary>
|
||||
public static int GetGamepadIndexForController(InputHandle_t ulinputHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInput_GetGamepadIndexForController(CSteamAPIContext.GetSteamInput(), ulinputHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns a localized string (from Steam's language setting) for the specified Xbox controller origin.</para>
|
||||
/// </summary>
|
||||
public static string GetStringForXboxOrigin(EXboxOrigin eOrigin) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamInput_GetStringForXboxOrigin(CSteamAPIContext.GetSteamInput(), eOrigin));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Get a local path to art for on-screen glyph for a particular Xbox controller origin</para>
|
||||
/// </summary>
|
||||
public static string GetGlyphForXboxOrigin(EXboxOrigin eOrigin) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamInput_GetGlyphForXboxOrigin(CSteamAPIContext.GetSteamInput(), eOrigin));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Get the equivalent ActionOrigin for a given Xbox controller origin this can be chained with GetGlyphForActionOrigin to provide future proof glyphs for</para>
|
||||
/// <para> non-Steam Input API action games. Note - this only translates the buttons directly and doesn't take into account any remapping a user has made in their configuration</para>
|
||||
/// </summary>
|
||||
public static EInputActionOrigin GetActionOriginFromXboxOrigin(InputHandle_t inputHandle, EXboxOrigin eOrigin) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInput_GetActionOriginFromXboxOrigin(CSteamAPIContext.GetSteamInput(), inputHandle, eOrigin);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Convert an origin to another controller type - for inputs not present on the other controller type this will return k_EInputActionOrigin_None</para>
|
||||
/// <para> When a new input type is added you will be able to pass in k_ESteamInputType_Unknown and the closest origin that your version of the SDK recognized will be returned</para>
|
||||
/// <para> ex: if a Playstation 5 controller was released this function would return Playstation 4 origins.</para>
|
||||
/// </summary>
|
||||
public static EInputActionOrigin TranslateActionOrigin(ESteamInputType eDestinationInputType, EInputActionOrigin eSourceOrigin) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInput_TranslateActionOrigin(CSteamAPIContext.GetSteamInput(), eDestinationInputType, eSourceOrigin);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Get the binding revision for a given device. Returns false if the handle was not valid or if a mapping is not yet loaded for the device</para>
|
||||
/// </summary>
|
||||
public static bool GetDeviceBindingRevision(InputHandle_t inputHandle, out int pMajor, out int pMinor) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInput_GetDeviceBindingRevision(CSteamAPIContext.GetSteamInput(), inputHandle, out pMajor, out pMinor);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Get the Steam Remote Play session ID associated with a device, or 0 if there is no session associated with it</para>
|
||||
/// <para> See isteamremoteplay.h for more information on Steam Remote Play sessions</para>
|
||||
/// </summary>
|
||||
public static uint GetRemotePlaySessionID(InputHandle_t inputHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInput_GetRemotePlaySessionID(CSteamAPIContext.GetSteamInput(), inputHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,471 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamInventory {
|
||||
/// <summary>
|
||||
/// <para> INVENTORY ASYNC RESULT MANAGEMENT</para>
|
||||
/// <para> Asynchronous inventory queries always output a result handle which can be used with</para>
|
||||
/// <para> GetResultStatus, GetResultItems, etc. A SteamInventoryResultReady_t callback will</para>
|
||||
/// <para> be triggered when the asynchronous result becomes ready (or fails).</para>
|
||||
/// <para> Find out the status of an asynchronous inventory result handle. Possible values:</para>
|
||||
/// <para> k_EResultPending - still in progress</para>
|
||||
/// <para> k_EResultOK - done, result ready</para>
|
||||
/// <para> k_EResultExpired - done, result ready, maybe out of date (see DeserializeResult)</para>
|
||||
/// <para> k_EResultInvalidParam - ERROR: invalid API call parameters</para>
|
||||
/// <para> k_EResultServiceUnavailable - ERROR: service temporarily down, you may retry later</para>
|
||||
/// <para> k_EResultLimitExceeded - ERROR: operation would exceed per-user inventory limits</para>
|
||||
/// <para> k_EResultFail - ERROR: unknown / generic error</para>
|
||||
/// </summary>
|
||||
public static EResult GetResultStatus(SteamInventoryResult_t resultHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInventory_GetResultStatus(CSteamAPIContext.GetSteamInventory(), resultHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Copies the contents of a result set into a flat array. The specific</para>
|
||||
/// <para> contents of the result set depend on which query which was used.</para>
|
||||
/// </summary>
|
||||
public static bool GetResultItems(SteamInventoryResult_t resultHandle, SteamItemDetails_t[] pOutItemsArray, ref uint punOutItemsArraySize) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
if (pOutItemsArray != null && pOutItemsArray.Length != punOutItemsArraySize) {
|
||||
throw new System.ArgumentException("pOutItemsArray must be the same size as punOutItemsArraySize!");
|
||||
}
|
||||
return NativeMethods.ISteamInventory_GetResultItems(CSteamAPIContext.GetSteamInventory(), resultHandle, pOutItemsArray, ref punOutItemsArraySize);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> In combination with GetResultItems, you can use GetResultItemProperty to retrieve</para>
|
||||
/// <para> dynamic string properties for a given item returned in the result set.</para>
|
||||
/// <para> Property names are always composed of ASCII letters, numbers, and/or underscores.</para>
|
||||
/// <para> Pass a NULL pointer for pchPropertyName to get a comma - separated list of available</para>
|
||||
/// <para> property names.</para>
|
||||
/// <para> If pchValueBuffer is NULL, *punValueBufferSize will contain the</para>
|
||||
/// <para> suggested buffer size. Otherwise it will be the number of bytes actually copied</para>
|
||||
/// <para> to pchValueBuffer. If the results do not fit in the given buffer, partial</para>
|
||||
/// <para> results may be copied.</para>
|
||||
/// </summary>
|
||||
public static bool GetResultItemProperty(SteamInventoryResult_t resultHandle, uint unItemIndex, string pchPropertyName, out string pchValueBuffer, ref uint punValueBufferSizeOut) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
IntPtr pchValueBuffer2 = Marshal.AllocHGlobal((int)punValueBufferSizeOut);
|
||||
using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName)) {
|
||||
bool ret = NativeMethods.ISteamInventory_GetResultItemProperty(CSteamAPIContext.GetSteamInventory(), resultHandle, unItemIndex, pchPropertyName2, pchValueBuffer2, ref punValueBufferSizeOut);
|
||||
pchValueBuffer = ret ? InteropHelp.PtrToStringUTF8(pchValueBuffer2) : null;
|
||||
Marshal.FreeHGlobal(pchValueBuffer2);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns the server time at which the result was generated. Compare against</para>
|
||||
/// <para> the value of IClientUtils::GetServerRealTime() to determine age.</para>
|
||||
/// </summary>
|
||||
public static uint GetResultTimestamp(SteamInventoryResult_t resultHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInventory_GetResultTimestamp(CSteamAPIContext.GetSteamInventory(), resultHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns true if the result belongs to the target steam ID, false if the</para>
|
||||
/// <para> result does not. This is important when using DeserializeResult, to verify</para>
|
||||
/// <para> that a remote player is not pretending to have a different user's inventory.</para>
|
||||
/// </summary>
|
||||
public static bool CheckResultSteamID(SteamInventoryResult_t resultHandle, CSteamID steamIDExpected) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInventory_CheckResultSteamID(CSteamAPIContext.GetSteamInventory(), resultHandle, steamIDExpected);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Destroys a result handle and frees all associated memory.</para>
|
||||
/// </summary>
|
||||
public static void DestroyResult(SteamInventoryResult_t resultHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamInventory_DestroyResult(CSteamAPIContext.GetSteamInventory(), resultHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> INVENTORY ASYNC QUERY</para>
|
||||
/// <para> Captures the entire state of the current user's Steam inventory.</para>
|
||||
/// <para> You must call DestroyResult on this handle when you are done with it.</para>
|
||||
/// <para> Returns false and sets *pResultHandle to zero if inventory is unavailable.</para>
|
||||
/// <para> Note: calls to this function are subject to rate limits and may return</para>
|
||||
/// <para> cached results if called too frequently. It is suggested that you call</para>
|
||||
/// <para> this function only when you are about to display the user's full inventory,</para>
|
||||
/// <para> or if you expect that the inventory may have changed.</para>
|
||||
/// </summary>
|
||||
public static bool GetAllItems(out SteamInventoryResult_t pResultHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInventory_GetAllItems(CSteamAPIContext.GetSteamInventory(), out pResultHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Captures the state of a subset of the current user's Steam inventory,</para>
|
||||
/// <para> identified by an array of item instance IDs. The results from this call</para>
|
||||
/// <para> can be serialized and passed to other players to "prove" that the current</para>
|
||||
/// <para> user owns specific items, without exposing the user's entire inventory.</para>
|
||||
/// <para> For example, you could call GetItemsByID with the IDs of the user's</para>
|
||||
/// <para> currently equipped cosmetic items and serialize this to a buffer, and</para>
|
||||
/// <para> then transmit this buffer to other players upon joining a game.</para>
|
||||
/// </summary>
|
||||
public static bool GetItemsByID(out SteamInventoryResult_t pResultHandle, SteamItemInstanceID_t[] pInstanceIDs, uint unCountInstanceIDs) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInventory_GetItemsByID(CSteamAPIContext.GetSteamInventory(), out pResultHandle, pInstanceIDs, unCountInstanceIDs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> RESULT SERIALIZATION AND AUTHENTICATION</para>
|
||||
/// <para> Serialized result sets contain a short signature which can't be forged</para>
|
||||
/// <para> or replayed across different game sessions. A result set can be serialized</para>
|
||||
/// <para> on the local client, transmitted to other players via your game networking,</para>
|
||||
/// <para> and deserialized by the remote players. This is a secure way of preventing</para>
|
||||
/// <para> hackers from lying about posessing rare/high-value items.</para>
|
||||
/// <para> Serializes a result set with signature bytes to an output buffer. Pass</para>
|
||||
/// <para> NULL as an output buffer to get the required size via punOutBufferSize.</para>
|
||||
/// <para> The size of a serialized result depends on the number items which are being</para>
|
||||
/// <para> serialized. When securely transmitting items to other players, it is</para>
|
||||
/// <para> recommended to use "GetItemsByID" first to create a minimal result set.</para>
|
||||
/// <para> Results have a built-in timestamp which will be considered "expired" after</para>
|
||||
/// <para> an hour has elapsed. See DeserializeResult for expiration handling.</para>
|
||||
/// </summary>
|
||||
public static bool SerializeResult(SteamInventoryResult_t resultHandle, byte[] pOutBuffer, out uint punOutBufferSize) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInventory_SerializeResult(CSteamAPIContext.GetSteamInventory(), resultHandle, pOutBuffer, out punOutBufferSize);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Deserializes a result set and verifies the signature bytes. Returns false</para>
|
||||
/// <para> if bRequireFullOnlineVerify is set but Steam is running in Offline mode.</para>
|
||||
/// <para> Otherwise returns true and then delivers error codes via GetResultStatus.</para>
|
||||
/// <para> The bRESERVED_MUST_BE_FALSE flag is reserved for future use and should not</para>
|
||||
/// <para> be set to true by your game at this time.</para>
|
||||
/// <para> DeserializeResult has a potential soft-failure mode where the handle status</para>
|
||||
/// <para> is set to k_EResultExpired. GetResultItems() still succeeds in this mode.</para>
|
||||
/// <para> The "expired" result could indicate that the data may be out of date - not</para>
|
||||
/// <para> just due to timed expiration (one hour), but also because one of the items</para>
|
||||
/// <para> in the result set may have been traded or consumed since the result set was</para>
|
||||
/// <para> generated. You could compare the timestamp from GetResultTimestamp() to</para>
|
||||
/// <para> ISteamUtils::GetServerRealTime() to determine how old the data is. You could</para>
|
||||
/// <para> simply ignore the "expired" result code and continue as normal, or you</para>
|
||||
/// <para> could challenge the player with expired data to send an updated result set.</para>
|
||||
/// </summary>
|
||||
public static bool DeserializeResult(out SteamInventoryResult_t pOutResultHandle, byte[] pBuffer, uint unBufferSize, bool bRESERVED_MUST_BE_FALSE = false) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInventory_DeserializeResult(CSteamAPIContext.GetSteamInventory(), out pOutResultHandle, pBuffer, unBufferSize, bRESERVED_MUST_BE_FALSE);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> INVENTORY ASYNC MODIFICATION</para>
|
||||
/// <para> GenerateItems() creates one or more items and then generates a SteamInventoryCallback_t</para>
|
||||
/// <para> notification with a matching nCallbackContext parameter. This API is only intended</para>
|
||||
/// <para> for prototyping - it is only usable by Steam accounts that belong to the publisher group</para>
|
||||
/// <para> for your game.</para>
|
||||
/// <para> If punArrayQuantity is not NULL, it should be the same length as pArrayItems and should</para>
|
||||
/// <para> describe the quantity of each item to generate.</para>
|
||||
/// </summary>
|
||||
public static bool GenerateItems(out SteamInventoryResult_t pResultHandle, SteamItemDef_t[] pArrayItemDefs, uint[] punArrayQuantity, uint unArrayLength) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInventory_GenerateItems(CSteamAPIContext.GetSteamInventory(), out pResultHandle, pArrayItemDefs, punArrayQuantity, unArrayLength);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> GrantPromoItems() checks the list of promotional items for which the user may be eligible</para>
|
||||
/// <para> and grants the items (one time only). On success, the result set will include items which</para>
|
||||
/// <para> were granted, if any. If no items were granted because the user isn't eligible for any</para>
|
||||
/// <para> promotions, this is still considered a success.</para>
|
||||
/// </summary>
|
||||
public static bool GrantPromoItems(out SteamInventoryResult_t pResultHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInventory_GrantPromoItems(CSteamAPIContext.GetSteamInventory(), out pResultHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> AddPromoItem() / AddPromoItems() are restricted versions of GrantPromoItems(). Instead of</para>
|
||||
/// <para> scanning for all eligible promotional items, the check is restricted to a single item</para>
|
||||
/// <para> definition or set of item definitions. This can be useful if your game has custom UI for</para>
|
||||
/// <para> showing a specific promo item to the user.</para>
|
||||
/// </summary>
|
||||
public static bool AddPromoItem(out SteamInventoryResult_t pResultHandle, SteamItemDef_t itemDef) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInventory_AddPromoItem(CSteamAPIContext.GetSteamInventory(), out pResultHandle, itemDef);
|
||||
}
|
||||
|
||||
public static bool AddPromoItems(out SteamInventoryResult_t pResultHandle, SteamItemDef_t[] pArrayItemDefs, uint unArrayLength) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInventory_AddPromoItems(CSteamAPIContext.GetSteamInventory(), out pResultHandle, pArrayItemDefs, unArrayLength);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> ConsumeItem() removes items from the inventory, permanently. They cannot be recovered.</para>
|
||||
/// <para> Not for the faint of heart - if your game implements item removal at all, a high-friction</para>
|
||||
/// <para> UI confirmation process is highly recommended.</para>
|
||||
/// </summary>
|
||||
public static bool ConsumeItem(out SteamInventoryResult_t pResultHandle, SteamItemInstanceID_t itemConsume, uint unQuantity) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInventory_ConsumeItem(CSteamAPIContext.GetSteamInventory(), out pResultHandle, itemConsume, unQuantity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> ExchangeItems() is an atomic combination of item generation and consumption.</para>
|
||||
/// <para> It can be used to implement crafting recipes or transmutations, or items which unpack</para>
|
||||
/// <para> themselves into other items (e.g., a chest).</para>
|
||||
/// <para> Exchange recipes are defined in the ItemDef, and explicitly list the required item</para>
|
||||
/// <para> types and resulting generated type.</para>
|
||||
/// <para> Exchange recipes are evaluated atomically by the Inventory Service; if the supplied</para>
|
||||
/// <para> components do not match the recipe, or do not contain sufficient quantity, the</para>
|
||||
/// <para> exchange will fail.</para>
|
||||
/// </summary>
|
||||
public static bool ExchangeItems(out SteamInventoryResult_t pResultHandle, SteamItemDef_t[] pArrayGenerate, uint[] punArrayGenerateQuantity, uint unArrayGenerateLength, SteamItemInstanceID_t[] pArrayDestroy, uint[] punArrayDestroyQuantity, uint unArrayDestroyLength) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInventory_ExchangeItems(CSteamAPIContext.GetSteamInventory(), out pResultHandle, pArrayGenerate, punArrayGenerateQuantity, unArrayGenerateLength, pArrayDestroy, punArrayDestroyQuantity, unArrayDestroyLength);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> TransferItemQuantity() is intended for use with items which are "stackable" (can have</para>
|
||||
/// <para> quantity greater than one). It can be used to split a stack into two, or to transfer</para>
|
||||
/// <para> quantity from one stack into another stack of identical items. To split one stack into</para>
|
||||
/// <para> two, pass k_SteamItemInstanceIDInvalid for itemIdDest and a new item will be generated.</para>
|
||||
/// </summary>
|
||||
public static bool TransferItemQuantity(out SteamInventoryResult_t pResultHandle, SteamItemInstanceID_t itemIdSource, uint unQuantity, SteamItemInstanceID_t itemIdDest) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInventory_TransferItemQuantity(CSteamAPIContext.GetSteamInventory(), out pResultHandle, itemIdSource, unQuantity, itemIdDest);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> TIMED DROPS AND PLAYTIME CREDIT</para>
|
||||
/// <para> Deprecated. Calling this method is not required for proper playtime accounting.</para>
|
||||
/// </summary>
|
||||
public static void SendItemDropHeartbeat() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamInventory_SendItemDropHeartbeat(CSteamAPIContext.GetSteamInventory());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Playtime credit must be consumed and turned into item drops by your game. Only item</para>
|
||||
/// <para> definitions which are marked as "playtime item generators" can be spawned. The call</para>
|
||||
/// <para> will return an empty result set if there is not enough playtime credit for a drop.</para>
|
||||
/// <para> Your game should call TriggerItemDrop at an appropriate time for the user to receive</para>
|
||||
/// <para> new items, such as between rounds or while the player is dead. Note that players who</para>
|
||||
/// <para> hack their clients could modify the value of "dropListDefinition", so do not use it</para>
|
||||
/// <para> to directly control rarity.</para>
|
||||
/// <para> See your Steamworks configuration to set playtime drop rates for individual itemdefs.</para>
|
||||
/// <para> The client library will suppress too-frequent calls to this method.</para>
|
||||
/// </summary>
|
||||
public static bool TriggerItemDrop(out SteamInventoryResult_t pResultHandle, SteamItemDef_t dropListDefinition) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInventory_TriggerItemDrop(CSteamAPIContext.GetSteamInventory(), out pResultHandle, dropListDefinition);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Deprecated. This method is not supported.</para>
|
||||
/// </summary>
|
||||
public static bool TradeItems(out SteamInventoryResult_t pResultHandle, CSteamID steamIDTradePartner, SteamItemInstanceID_t[] pArrayGive, uint[] pArrayGiveQuantity, uint nArrayGiveLength, SteamItemInstanceID_t[] pArrayGet, uint[] pArrayGetQuantity, uint nArrayGetLength) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInventory_TradeItems(CSteamAPIContext.GetSteamInventory(), out pResultHandle, steamIDTradePartner, pArrayGive, pArrayGiveQuantity, nArrayGiveLength, pArrayGet, pArrayGetQuantity, nArrayGetLength);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> ITEM DEFINITIONS</para>
|
||||
/// <para> Item definitions are a mapping of "definition IDs" (integers between 1 and 1000000)</para>
|
||||
/// <para> to a set of string properties. Some of these properties are required to display items</para>
|
||||
/// <para> on the Steam community web site. Other properties can be defined by applications.</para>
|
||||
/// <para> Use of these functions is optional; there is no reason to call LoadItemDefinitions</para>
|
||||
/// <para> if your game hardcodes the numeric definition IDs (eg, purple face mask = 20, blue</para>
|
||||
/// <para> weapon mod = 55) and does not allow for adding new item types without a client patch.</para>
|
||||
/// <para> LoadItemDefinitions triggers the automatic load and refresh of item definitions.</para>
|
||||
/// <para> Every time new item definitions are available (eg, from the dynamic addition of new</para>
|
||||
/// <para> item types while players are still in-game), a SteamInventoryDefinitionUpdate_t</para>
|
||||
/// <para> callback will be fired.</para>
|
||||
/// </summary>
|
||||
public static bool LoadItemDefinitions() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInventory_LoadItemDefinitions(CSteamAPIContext.GetSteamInventory());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> GetItemDefinitionIDs returns the set of all defined item definition IDs (which are</para>
|
||||
/// <para> defined via Steamworks configuration, and not necessarily contiguous integers).</para>
|
||||
/// <para> If pItemDefIDs is null, the call will return true and *punItemDefIDsArraySize will</para>
|
||||
/// <para> contain the total size necessary for a subsequent call. Otherwise, the call will</para>
|
||||
/// <para> return false if and only if there is not enough space in the output array.</para>
|
||||
/// </summary>
|
||||
public static bool GetItemDefinitionIDs(SteamItemDef_t[] pItemDefIDs, ref uint punItemDefIDsArraySize) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
if (pItemDefIDs != null && pItemDefIDs.Length != punItemDefIDsArraySize) {
|
||||
throw new System.ArgumentException("pItemDefIDs must be the same size as punItemDefIDsArraySize!");
|
||||
}
|
||||
return NativeMethods.ISteamInventory_GetItemDefinitionIDs(CSteamAPIContext.GetSteamInventory(), pItemDefIDs, ref punItemDefIDsArraySize);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> GetItemDefinitionProperty returns a string property from a given item definition.</para>
|
||||
/// <para> Note that some properties (for example, "name") may be localized and will depend</para>
|
||||
/// <para> on the current Steam language settings (see ISteamApps::GetCurrentGameLanguage).</para>
|
||||
/// <para> Property names are always composed of ASCII letters, numbers, and/or underscores.</para>
|
||||
/// <para> Pass a NULL pointer for pchPropertyName to get a comma - separated list of available</para>
|
||||
/// <para> property names. If pchValueBuffer is NULL, *punValueBufferSize will contain the</para>
|
||||
/// <para> suggested buffer size. Otherwise it will be the number of bytes actually copied</para>
|
||||
/// <para> to pchValueBuffer. If the results do not fit in the given buffer, partial</para>
|
||||
/// <para> results may be copied.</para>
|
||||
/// </summary>
|
||||
public static bool GetItemDefinitionProperty(SteamItemDef_t iDefinition, string pchPropertyName, out string pchValueBuffer, ref uint punValueBufferSizeOut) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
IntPtr pchValueBuffer2 = Marshal.AllocHGlobal((int)punValueBufferSizeOut);
|
||||
using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName)) {
|
||||
bool ret = NativeMethods.ISteamInventory_GetItemDefinitionProperty(CSteamAPIContext.GetSteamInventory(), iDefinition, pchPropertyName2, pchValueBuffer2, ref punValueBufferSizeOut);
|
||||
pchValueBuffer = ret ? InteropHelp.PtrToStringUTF8(pchValueBuffer2) : null;
|
||||
Marshal.FreeHGlobal(pchValueBuffer2);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Request the list of "eligible" promo items that can be manually granted to the given</para>
|
||||
/// <para> user. These are promo items of type "manual" that won't be granted automatically.</para>
|
||||
/// <para> An example usage of this is an item that becomes available every week.</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t RequestEligiblePromoItemDefinitionsIDs(CSteamID steamID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamInventory_RequestEligiblePromoItemDefinitionsIDs(CSteamAPIContext.GetSteamInventory(), steamID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> After handling a SteamInventoryEligiblePromoItemDefIDs_t call result, use this</para>
|
||||
/// <para> function to pull out the list of item definition ids that the user can be</para>
|
||||
/// <para> manually granted via the AddPromoItems() call.</para>
|
||||
/// </summary>
|
||||
public static bool GetEligiblePromoItemDefinitionIDs(CSteamID steamID, SteamItemDef_t[] pItemDefIDs, ref uint punItemDefIDsArraySize) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
if (pItemDefIDs != null && pItemDefIDs.Length != punItemDefIDsArraySize) {
|
||||
throw new System.ArgumentException("pItemDefIDs must be the same size as punItemDefIDsArraySize!");
|
||||
}
|
||||
return NativeMethods.ISteamInventory_GetEligiblePromoItemDefinitionIDs(CSteamAPIContext.GetSteamInventory(), steamID, pItemDefIDs, ref punItemDefIDsArraySize);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Starts the purchase process for the given item definitions. The callback SteamInventoryStartPurchaseResult_t</para>
|
||||
/// <para> will be posted if Steam was able to initialize the transaction.</para>
|
||||
/// <para> Once the purchase has been authorized and completed by the user, the callback SteamInventoryResultReady_t</para>
|
||||
/// <para> will be posted.</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t StartPurchase(SteamItemDef_t[] pArrayItemDefs, uint[] punArrayQuantity, uint unArrayLength) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamInventory_StartPurchase(CSteamAPIContext.GetSteamInventory(), pArrayItemDefs, punArrayQuantity, unArrayLength);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Request current prices for all applicable item definitions</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t RequestPrices() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamInventory_RequestPrices(CSteamAPIContext.GetSteamInventory());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns the number of items with prices. Need to call RequestPrices() first.</para>
|
||||
/// </summary>
|
||||
public static uint GetNumItemsWithPrices() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInventory_GetNumItemsWithPrices(CSteamAPIContext.GetSteamInventory());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns item definition ids and their prices in the user's local currency.</para>
|
||||
/// <para> Need to call RequestPrices() first.</para>
|
||||
/// </summary>
|
||||
public static bool GetItemsWithPrices(SteamItemDef_t[] pArrayItemDefs, ulong[] pCurrentPrices, ulong[] pBasePrices, uint unArrayLength) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
if (pArrayItemDefs != null && pArrayItemDefs.Length != unArrayLength) {
|
||||
throw new System.ArgumentException("pArrayItemDefs must be the same size as unArrayLength!");
|
||||
}
|
||||
if (pCurrentPrices != null && pCurrentPrices.Length != unArrayLength) {
|
||||
throw new System.ArgumentException("pCurrentPrices must be the same size as unArrayLength!");
|
||||
}
|
||||
if (pBasePrices != null && pBasePrices.Length != unArrayLength) {
|
||||
throw new System.ArgumentException("pBasePrices must be the same size as unArrayLength!");
|
||||
}
|
||||
return NativeMethods.ISteamInventory_GetItemsWithPrices(CSteamAPIContext.GetSteamInventory(), pArrayItemDefs, pCurrentPrices, pBasePrices, unArrayLength);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Retrieves the price for the item definition id</para>
|
||||
/// <para> Returns false if there is no price stored for the item definition.</para>
|
||||
/// </summary>
|
||||
public static bool GetItemPrice(SteamItemDef_t iDefinition, out ulong pCurrentPrice, out ulong pBasePrice) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInventory_GetItemPrice(CSteamAPIContext.GetSteamInventory(), iDefinition, out pCurrentPrice, out pBasePrice);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Create a request to update properties on items</para>
|
||||
/// </summary>
|
||||
public static SteamInventoryUpdateHandle_t StartUpdateProperties() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamInventoryUpdateHandle_t)NativeMethods.ISteamInventory_StartUpdateProperties(CSteamAPIContext.GetSteamInventory());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Remove the property on the item</para>
|
||||
/// </summary>
|
||||
public static bool RemoveProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName)) {
|
||||
return NativeMethods.ISteamInventory_RemoveProperty(CSteamAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Accessor methods to set properties on items</para>
|
||||
/// </summary>
|
||||
public static bool SetProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName, string pchPropertyValue) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName))
|
||||
using (var pchPropertyValue2 = new InteropHelp.UTF8StringHandle(pchPropertyValue)) {
|
||||
return NativeMethods.ISteamInventory_SetProperty(CSteamAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, pchPropertyValue2);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool SetProperty(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName, bool bValue) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName)) {
|
||||
return NativeMethods.ISteamInventory_SetProperty0(CSteamAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, bValue);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool SetProperty1(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName, long nValue) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName)) {
|
||||
return NativeMethods.ISteamInventory_SetProperty1(CSteamAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, nValue);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool SetProperty2(SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, string pchPropertyName, float flValue) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchPropertyName2 = new InteropHelp.UTF8StringHandle(pchPropertyName)) {
|
||||
return NativeMethods.ISteamInventory_SetProperty2(CSteamAPIContext.GetSteamInventory(), handle, nItemID, pchPropertyName2, flValue);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Submit the update request by handle</para>
|
||||
/// </summary>
|
||||
public static bool SubmitUpdateProperties(SteamInventoryUpdateHandle_t handle, out SteamInventoryResult_t pResultHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamInventory_SubmitUpdateProperties(CSteamAPIContext.GetSteamInventory(), handle, out pResultHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,892 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamMatchmaking {
|
||||
/// <summary>
|
||||
/// <para> game server favorites storage</para>
|
||||
/// <para> saves basic details about a multiplayer game server locally</para>
|
||||
/// <para> returns the number of favorites servers the user has stored</para>
|
||||
/// </summary>
|
||||
public static int GetFavoriteGameCount() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMatchmaking_GetFavoriteGameCount(CSteamAPIContext.GetSteamMatchmaking());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the details of the game server</para>
|
||||
/// <para> iGame is of range [0,GetFavoriteGameCount())</para>
|
||||
/// <para> *pnIP, *pnConnPort are filled in the with IP:port of the game server</para>
|
||||
/// <para> *punFlags specify whether the game server was stored as an explicit favorite or in the history of connections</para>
|
||||
/// <para> *pRTime32LastPlayedOnServer is filled in the with the Unix time the favorite was added</para>
|
||||
/// </summary>
|
||||
public static bool GetFavoriteGame(int iGame, out AppId_t pnAppID, out uint pnIP, out ushort pnConnPort, out ushort pnQueryPort, out uint punFlags, out uint pRTime32LastPlayedOnServer) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMatchmaking_GetFavoriteGame(CSteamAPIContext.GetSteamMatchmaking(), iGame, out pnAppID, out pnIP, out pnConnPort, out pnQueryPort, out punFlags, out pRTime32LastPlayedOnServer);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> adds the game server to the local list; updates the time played of the server if it already exists in the list</para>
|
||||
/// </summary>
|
||||
public static int AddFavoriteGame(AppId_t nAppID, uint nIP, ushort nConnPort, ushort nQueryPort, uint unFlags, uint rTime32LastPlayedOnServer) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMatchmaking_AddFavoriteGame(CSteamAPIContext.GetSteamMatchmaking(), nAppID, nIP, nConnPort, nQueryPort, unFlags, rTime32LastPlayedOnServer);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> removes the game server from the local storage; returns true if one was removed</para>
|
||||
/// </summary>
|
||||
public static bool RemoveFavoriteGame(AppId_t nAppID, uint nIP, ushort nConnPort, ushort nQueryPort, uint unFlags) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMatchmaking_RemoveFavoriteGame(CSteamAPIContext.GetSteamMatchmaking(), nAppID, nIP, nConnPort, nQueryPort, unFlags);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>/////</para>
|
||||
/// <para> Game lobby functions</para>
|
||||
/// <para> Get a list of relevant lobbies</para>
|
||||
/// <para> this is an asynchronous request</para>
|
||||
/// <para> results will be returned by LobbyMatchList_t callback & call result, with the number of lobbies found</para>
|
||||
/// <para> this will never return lobbies that are full</para>
|
||||
/// <para> to add more filter, the filter calls below need to be call before each and every RequestLobbyList() call</para>
|
||||
/// <para> use the CCallResult<> object in steam_api.h to match the SteamAPICall_t call result to a function in an object, e.g.</para>
|
||||
/// <para> class CMyLobbyListManager</para>
|
||||
/// <para> {</para>
|
||||
/// <para> CCallResult<CMyLobbyListManager, LobbyMatchList_t> m_CallResultLobbyMatchList;</para>
|
||||
/// <para> void FindLobbies()</para>
|
||||
/// <para> {</para>
|
||||
/// <para> // SteamMatchmaking()->AddRequestLobbyListFilter*() functions would be called here, before RequestLobbyList()</para>
|
||||
/// <para> SteamAPICall_t hSteamAPICall = SteamMatchmaking()->RequestLobbyList();</para>
|
||||
/// <para> m_CallResultLobbyMatchList.Set( hSteamAPICall, this, &CMyLobbyListManager::OnLobbyMatchList );</para>
|
||||
/// <para> }</para>
|
||||
/// <para> void OnLobbyMatchList( LobbyMatchList_t *pLobbyMatchList, bool bIOFailure )</para>
|
||||
/// <para> {</para>
|
||||
/// <para> // lobby list has be retrieved from Steam back-end, use results</para>
|
||||
/// <para> }</para>
|
||||
/// <para> }</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t RequestLobbyList() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamMatchmaking_RequestLobbyList(CSteamAPIContext.GetSteamMatchmaking());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> filters for lobbies</para>
|
||||
/// <para> this needs to be called before RequestLobbyList() to take effect</para>
|
||||
/// <para> these are cleared on each call to RequestLobbyList()</para>
|
||||
/// </summary>
|
||||
public static void AddRequestLobbyListStringFilter(string pchKeyToMatch, string pchValueToMatch, ELobbyComparison eComparisonType) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchKeyToMatch2 = new InteropHelp.UTF8StringHandle(pchKeyToMatch))
|
||||
using (var pchValueToMatch2 = new InteropHelp.UTF8StringHandle(pchValueToMatch)) {
|
||||
NativeMethods.ISteamMatchmaking_AddRequestLobbyListStringFilter(CSteamAPIContext.GetSteamMatchmaking(), pchKeyToMatch2, pchValueToMatch2, eComparisonType);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> numerical comparison</para>
|
||||
/// </summary>
|
||||
public static void AddRequestLobbyListNumericalFilter(string pchKeyToMatch, int nValueToMatch, ELobbyComparison eComparisonType) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchKeyToMatch2 = new InteropHelp.UTF8StringHandle(pchKeyToMatch)) {
|
||||
NativeMethods.ISteamMatchmaking_AddRequestLobbyListNumericalFilter(CSteamAPIContext.GetSteamMatchmaking(), pchKeyToMatch2, nValueToMatch, eComparisonType);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns results closest to the specified value. Multiple near filters can be added, with early filters taking precedence</para>
|
||||
/// </summary>
|
||||
public static void AddRequestLobbyListNearValueFilter(string pchKeyToMatch, int nValueToBeCloseTo) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchKeyToMatch2 = new InteropHelp.UTF8StringHandle(pchKeyToMatch)) {
|
||||
NativeMethods.ISteamMatchmaking_AddRequestLobbyListNearValueFilter(CSteamAPIContext.GetSteamMatchmaking(), pchKeyToMatch2, nValueToBeCloseTo);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns only lobbies with the specified number of slots available</para>
|
||||
/// </summary>
|
||||
public static void AddRequestLobbyListFilterSlotsAvailable(int nSlotsAvailable) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable(CSteamAPIContext.GetSteamMatchmaking(), nSlotsAvailable);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> sets the distance for which we should search for lobbies (based on users IP address to location map on the Steam backed)</para>
|
||||
/// </summary>
|
||||
public static void AddRequestLobbyListDistanceFilter(ELobbyDistanceFilter eLobbyDistanceFilter) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamMatchmaking_AddRequestLobbyListDistanceFilter(CSteamAPIContext.GetSteamMatchmaking(), eLobbyDistanceFilter);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> sets how many results to return, the lower the count the faster it is to download the lobby results & details to the client</para>
|
||||
/// </summary>
|
||||
public static void AddRequestLobbyListResultCountFilter(int cMaxResults) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamMatchmaking_AddRequestLobbyListResultCountFilter(CSteamAPIContext.GetSteamMatchmaking(), cMaxResults);
|
||||
}
|
||||
|
||||
public static void AddRequestLobbyListCompatibleMembersFilter(CSteamID steamIDLobby) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the CSteamID of a lobby, as retrieved by a RequestLobbyList call</para>
|
||||
/// <para> should only be called after a LobbyMatchList_t callback is received</para>
|
||||
/// <para> iLobby is of the range [0, LobbyMatchList_t::m_nLobbiesMatching)</para>
|
||||
/// <para> the returned CSteamID::IsValid() will be false if iLobby is out of range</para>
|
||||
/// </summary>
|
||||
public static CSteamID GetLobbyByIndex(int iLobby) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (CSteamID)NativeMethods.ISteamMatchmaking_GetLobbyByIndex(CSteamAPIContext.GetSteamMatchmaking(), iLobby);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Create a lobby on the Steam servers.</para>
|
||||
/// <para> If private, then the lobby will not be returned by any RequestLobbyList() call; the CSteamID</para>
|
||||
/// <para> of the lobby will need to be communicated via game channels or via InviteUserToLobby()</para>
|
||||
/// <para> this is an asynchronous request</para>
|
||||
/// <para> results will be returned by LobbyCreated_t callback and call result; lobby is joined & ready to use at this point</para>
|
||||
/// <para> a LobbyEnter_t callback will also be received (since the local user is joining their own lobby)</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t CreateLobby(ELobbyType eLobbyType, int cMaxMembers) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamMatchmaking_CreateLobby(CSteamAPIContext.GetSteamMatchmaking(), eLobbyType, cMaxMembers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Joins an existing lobby</para>
|
||||
/// <para> this is an asynchronous request</para>
|
||||
/// <para> results will be returned by LobbyEnter_t callback & call result, check m_EChatRoomEnterResponse to see if was successful</para>
|
||||
/// <para> lobby metadata is available to use immediately on this call completing</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t JoinLobby(CSteamID steamIDLobby) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamMatchmaking_JoinLobby(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Leave a lobby; this will take effect immediately on the client side</para>
|
||||
/// <para> other users in the lobby will be notified by a LobbyChatUpdate_t callback</para>
|
||||
/// </summary>
|
||||
public static void LeaveLobby(CSteamID steamIDLobby) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamMatchmaking_LeaveLobby(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Invite another user to the lobby</para>
|
||||
/// <para> the target user will receive a LobbyInvite_t callback</para>
|
||||
/// <para> will return true if the invite is successfully sent, whether or not the target responds</para>
|
||||
/// <para> returns false if the local user is not connected to the Steam servers</para>
|
||||
/// <para> if the other user clicks the join link, a GameLobbyJoinRequested_t will be posted if the user is in-game,</para>
|
||||
/// <para> or if the game isn't running yet the game will be launched with the parameter +connect_lobby <64-bit lobby id></para>
|
||||
/// </summary>
|
||||
public static bool InviteUserToLobby(CSteamID steamIDLobby, CSteamID steamIDInvitee) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMatchmaking_InviteUserToLobby(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, steamIDInvitee);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Lobby iteration, for viewing details of users in a lobby</para>
|
||||
/// <para> only accessible if the lobby user is a member of the specified lobby</para>
|
||||
/// <para> persona information for other lobby members (name, avatar, etc.) will be asynchronously received</para>
|
||||
/// <para> and accessible via ISteamFriends interface</para>
|
||||
/// <para> returns the number of users in the specified lobby</para>
|
||||
/// </summary>
|
||||
public static int GetNumLobbyMembers(CSteamID steamIDLobby) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMatchmaking_GetNumLobbyMembers(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the CSteamID of a user in the lobby</para>
|
||||
/// <para> iMember is of range [0,GetNumLobbyMembers())</para>
|
||||
/// <para> note that the current user must be in a lobby to retrieve CSteamIDs of other users in that lobby</para>
|
||||
/// </summary>
|
||||
public static CSteamID GetLobbyMemberByIndex(CSteamID steamIDLobby, int iMember) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (CSteamID)NativeMethods.ISteamMatchmaking_GetLobbyMemberByIndex(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, iMember);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Get data associated with this lobby</para>
|
||||
/// <para> takes a simple key, and returns the string associated with it</para>
|
||||
/// <para> "" will be returned if no value is set, or if steamIDLobby is invalid</para>
|
||||
/// </summary>
|
||||
public static string GetLobbyData(CSteamID steamIDLobby, string pchKey) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchKey2 = new InteropHelp.UTF8StringHandle(pchKey)) {
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamMatchmaking_GetLobbyData(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, pchKey2));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Sets a key/value pair in the lobby metadata</para>
|
||||
/// <para> each user in the lobby will be broadcast this new value, and any new users joining will receive any existing data</para>
|
||||
/// <para> this can be used to set lobby names, map, etc.</para>
|
||||
/// <para> to reset a key, just set it to ""</para>
|
||||
/// <para> other users in the lobby will receive notification of the lobby data change via a LobbyDataUpdate_t callback</para>
|
||||
/// </summary>
|
||||
public static bool SetLobbyData(CSteamID steamIDLobby, string pchKey, string pchValue) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchKey2 = new InteropHelp.UTF8StringHandle(pchKey))
|
||||
using (var pchValue2 = new InteropHelp.UTF8StringHandle(pchValue)) {
|
||||
return NativeMethods.ISteamMatchmaking_SetLobbyData(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, pchKey2, pchValue2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the number of metadata keys set on the specified lobby</para>
|
||||
/// </summary>
|
||||
public static int GetLobbyDataCount(CSteamID steamIDLobby) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMatchmaking_GetLobbyDataCount(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns a lobby metadata key/values pair by index, of range [0, GetLobbyDataCount())</para>
|
||||
/// </summary>
|
||||
public static bool GetLobbyDataByIndex(CSteamID steamIDLobby, int iLobbyData, out string pchKey, int cchKeyBufferSize, out string pchValue, int cchValueBufferSize) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
IntPtr pchKey2 = Marshal.AllocHGlobal(cchKeyBufferSize);
|
||||
IntPtr pchValue2 = Marshal.AllocHGlobal(cchValueBufferSize);
|
||||
bool ret = NativeMethods.ISteamMatchmaking_GetLobbyDataByIndex(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, iLobbyData, pchKey2, cchKeyBufferSize, pchValue2, cchValueBufferSize);
|
||||
pchKey = ret ? InteropHelp.PtrToStringUTF8(pchKey2) : null;
|
||||
Marshal.FreeHGlobal(pchKey2);
|
||||
pchValue = ret ? InteropHelp.PtrToStringUTF8(pchValue2) : null;
|
||||
Marshal.FreeHGlobal(pchValue2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> removes a metadata key from the lobby</para>
|
||||
/// </summary>
|
||||
public static bool DeleteLobbyData(CSteamID steamIDLobby, string pchKey) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchKey2 = new InteropHelp.UTF8StringHandle(pchKey)) {
|
||||
return NativeMethods.ISteamMatchmaking_DeleteLobbyData(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, pchKey2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Gets per-user metadata for someone in this lobby</para>
|
||||
/// </summary>
|
||||
public static string GetLobbyMemberData(CSteamID steamIDLobby, CSteamID steamIDUser, string pchKey) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchKey2 = new InteropHelp.UTF8StringHandle(pchKey)) {
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamMatchmaking_GetLobbyMemberData(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, steamIDUser, pchKey2));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Sets per-user metadata (for the local user implicitly)</para>
|
||||
/// </summary>
|
||||
public static void SetLobbyMemberData(CSteamID steamIDLobby, string pchKey, string pchValue) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchKey2 = new InteropHelp.UTF8StringHandle(pchKey))
|
||||
using (var pchValue2 = new InteropHelp.UTF8StringHandle(pchValue)) {
|
||||
NativeMethods.ISteamMatchmaking_SetLobbyMemberData(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, pchKey2, pchValue2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Broadcasts a chat message to the all the users in the lobby</para>
|
||||
/// <para> users in the lobby (including the local user) will receive a LobbyChatMsg_t callback</para>
|
||||
/// <para> returns true if the message is successfully sent</para>
|
||||
/// <para> pvMsgBody can be binary or text data, up to 4k</para>
|
||||
/// <para> if pvMsgBody is text, cubMsgBody should be strlen( text ) + 1, to include the null terminator</para>
|
||||
/// </summary>
|
||||
public static bool SendLobbyChatMsg(CSteamID steamIDLobby, byte[] pvMsgBody, int cubMsgBody) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMatchmaking_SendLobbyChatMsg(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, pvMsgBody, cubMsgBody);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Get a chat message as specified in a LobbyChatMsg_t callback</para>
|
||||
/// <para> iChatID is the LobbyChatMsg_t::m_iChatID value in the callback</para>
|
||||
/// <para> *pSteamIDUser is filled in with the CSteamID of the member</para>
|
||||
/// <para> *pvData is filled in with the message itself</para>
|
||||
/// <para> return value is the number of bytes written into the buffer</para>
|
||||
/// </summary>
|
||||
public static int GetLobbyChatEntry(CSteamID steamIDLobby, int iChatID, out CSteamID pSteamIDUser, byte[] pvData, int cubData, out EChatEntryType peChatEntryType) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMatchmaking_GetLobbyChatEntry(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, iChatID, out pSteamIDUser, pvData, cubData, out peChatEntryType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Refreshes metadata for a lobby you're not necessarily in right now</para>
|
||||
/// <para> you never do this for lobbies you're a member of, only if your</para>
|
||||
/// <para> this will send down all the metadata associated with a lobby</para>
|
||||
/// <para> this is an asynchronous call</para>
|
||||
/// <para> returns false if the local user is not connected to the Steam servers</para>
|
||||
/// <para> results will be returned by a LobbyDataUpdate_t callback</para>
|
||||
/// <para> if the specified lobby doesn't exist, LobbyDataUpdate_t::m_bSuccess will be set to false</para>
|
||||
/// </summary>
|
||||
public static bool RequestLobbyData(CSteamID steamIDLobby) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMatchmaking_RequestLobbyData(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> sets the game server associated with the lobby</para>
|
||||
/// <para> usually at this point, the users will join the specified game server</para>
|
||||
/// <para> either the IP/Port or the steamID of the game server has to be valid, depending on how you want the clients to be able to connect</para>
|
||||
/// </summary>
|
||||
public static void SetLobbyGameServer(CSteamID steamIDLobby, uint unGameServerIP, ushort unGameServerPort, CSteamID steamIDGameServer) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamMatchmaking_SetLobbyGameServer(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, unGameServerIP, unGameServerPort, steamIDGameServer);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the details of a game server set in a lobby - returns false if there is no game server set, or that lobby doesn't exist</para>
|
||||
/// </summary>
|
||||
public static bool GetLobbyGameServer(CSteamID steamIDLobby, out uint punGameServerIP, out ushort punGameServerPort, out CSteamID psteamIDGameServer) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMatchmaking_GetLobbyGameServer(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, out punGameServerIP, out punGameServerPort, out psteamIDGameServer);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> set the limit on the # of users who can join the lobby</para>
|
||||
/// </summary>
|
||||
public static bool SetLobbyMemberLimit(CSteamID steamIDLobby, int cMaxMembers) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMatchmaking_SetLobbyMemberLimit(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, cMaxMembers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the current limit on the # of users who can join the lobby; returns 0 if no limit is defined</para>
|
||||
/// </summary>
|
||||
public static int GetLobbyMemberLimit(CSteamID steamIDLobby) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMatchmaking_GetLobbyMemberLimit(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> updates which type of lobby it is</para>
|
||||
/// <para> only lobbies that are k_ELobbyTypePublic or k_ELobbyTypeInvisible, and are set to joinable, will be returned by RequestLobbyList() calls</para>
|
||||
/// </summary>
|
||||
public static bool SetLobbyType(CSteamID steamIDLobby, ELobbyType eLobbyType) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMatchmaking_SetLobbyType(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, eLobbyType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> sets whether or not a lobby is joinable - defaults to true for a new lobby</para>
|
||||
/// <para> if set to false, no user can join, even if they are a friend or have been invited</para>
|
||||
/// </summary>
|
||||
public static bool SetLobbyJoinable(CSteamID steamIDLobby, bool bLobbyJoinable) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMatchmaking_SetLobbyJoinable(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, bLobbyJoinable);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the current lobby owner</para>
|
||||
/// <para> you must be a member of the lobby to access this</para>
|
||||
/// <para> there always one lobby owner - if the current owner leaves, another user will become the owner</para>
|
||||
/// <para> it is possible (bur rare) to join a lobby just as the owner is leaving, thus entering a lobby with self as the owner</para>
|
||||
/// </summary>
|
||||
public static CSteamID GetLobbyOwner(CSteamID steamIDLobby) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (CSteamID)NativeMethods.ISteamMatchmaking_GetLobbyOwner(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> changes who the lobby owner is</para>
|
||||
/// <para> you must be the lobby owner for this to succeed, and steamIDNewOwner must be in the lobby</para>
|
||||
/// <para> after completion, the local user will no longer be the owner</para>
|
||||
/// </summary>
|
||||
public static bool SetLobbyOwner(CSteamID steamIDLobby, CSteamID steamIDNewOwner) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMatchmaking_SetLobbyOwner(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, steamIDNewOwner);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> link two lobbies for the purposes of checking player compatibility</para>
|
||||
/// <para> you must be the lobby owner of both lobbies</para>
|
||||
/// </summary>
|
||||
public static bool SetLinkedLobby(CSteamID steamIDLobby, CSteamID steamIDLobbyDependent) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMatchmaking_SetLinkedLobby(CSteamAPIContext.GetSteamMatchmaking(), steamIDLobby, steamIDLobbyDependent);
|
||||
}
|
||||
#if _PS3
|
||||
/// <summary>
|
||||
/// <para> changes who the lobby owner is</para>
|
||||
/// <para> you must be the lobby owner for this to succeed, and steamIDNewOwner must be in the lobby</para>
|
||||
/// <para> after completion, the local user will no longer be the owner</para>
|
||||
/// </summary>
|
||||
public static void CheckForPSNGameBootInvite(uint iGameBootAttributes) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamMatchmaking_CheckForPSNGameBootInvite(CSteamAPIContext.GetSteamMatchmaking(), iGameBootAttributes);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
public static class SteamMatchmakingServers {
|
||||
/// <summary>
|
||||
/// <para> Request a new list of servers of a particular type. These calls each correspond to one of the EMatchMakingType values.</para>
|
||||
/// <para> Each call allocates a new asynchronous request object.</para>
|
||||
/// <para> Request object must be released by calling ReleaseRequest( hServerListRequest )</para>
|
||||
/// </summary>
|
||||
public static HServerListRequest RequestInternetServerList(AppId_t iApp, MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, ISteamMatchmakingServerListResponse pRequestServersResponse) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (HServerListRequest)NativeMethods.ISteamMatchmakingServers_RequestInternetServerList(CSteamAPIContext.GetSteamMatchmakingServers(), iApp, new MMKVPMarshaller(ppchFilters), nFilters, (IntPtr)pRequestServersResponse);
|
||||
}
|
||||
|
||||
public static HServerListRequest RequestLANServerList(AppId_t iApp, ISteamMatchmakingServerListResponse pRequestServersResponse) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (HServerListRequest)NativeMethods.ISteamMatchmakingServers_RequestLANServerList(CSteamAPIContext.GetSteamMatchmakingServers(), iApp, (IntPtr)pRequestServersResponse);
|
||||
}
|
||||
|
||||
public static HServerListRequest RequestFriendsServerList(AppId_t iApp, MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, ISteamMatchmakingServerListResponse pRequestServersResponse) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (HServerListRequest)NativeMethods.ISteamMatchmakingServers_RequestFriendsServerList(CSteamAPIContext.GetSteamMatchmakingServers(), iApp, new MMKVPMarshaller(ppchFilters), nFilters, (IntPtr)pRequestServersResponse);
|
||||
}
|
||||
|
||||
public static HServerListRequest RequestFavoritesServerList(AppId_t iApp, MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, ISteamMatchmakingServerListResponse pRequestServersResponse) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (HServerListRequest)NativeMethods.ISteamMatchmakingServers_RequestFavoritesServerList(CSteamAPIContext.GetSteamMatchmakingServers(), iApp, new MMKVPMarshaller(ppchFilters), nFilters, (IntPtr)pRequestServersResponse);
|
||||
}
|
||||
|
||||
public static HServerListRequest RequestHistoryServerList(AppId_t iApp, MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, ISteamMatchmakingServerListResponse pRequestServersResponse) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (HServerListRequest)NativeMethods.ISteamMatchmakingServers_RequestHistoryServerList(CSteamAPIContext.GetSteamMatchmakingServers(), iApp, new MMKVPMarshaller(ppchFilters), nFilters, (IntPtr)pRequestServersResponse);
|
||||
}
|
||||
|
||||
public static HServerListRequest RequestSpectatorServerList(AppId_t iApp, MatchMakingKeyValuePair_t[] ppchFilters, uint nFilters, ISteamMatchmakingServerListResponse pRequestServersResponse) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (HServerListRequest)NativeMethods.ISteamMatchmakingServers_RequestSpectatorServerList(CSteamAPIContext.GetSteamMatchmakingServers(), iApp, new MMKVPMarshaller(ppchFilters), nFilters, (IntPtr)pRequestServersResponse);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Releases the asynchronous request object and cancels any pending query on it if there's a pending query in progress.</para>
|
||||
/// <para> RefreshComplete callback is not posted when request is released.</para>
|
||||
/// </summary>
|
||||
public static void ReleaseRequest(HServerListRequest hServerListRequest) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamMatchmakingServers_ReleaseRequest(CSteamAPIContext.GetSteamMatchmakingServers(), hServerListRequest);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> the filter operation codes that go in the key part of MatchMakingKeyValuePair_t should be one of these:</para>
|
||||
/// <para> "map"</para>
|
||||
/// <para> - Server passes the filter if the server is playing the specified map.</para>
|
||||
/// <para> "gamedataand"</para>
|
||||
/// <para> - Server passes the filter if the server's game data (ISteamGameServer::SetGameData) contains all of the</para>
|
||||
/// <para> specified strings. The value field is a comma-delimited list of strings to match.</para>
|
||||
/// <para> "gamedataor"</para>
|
||||
/// <para> - Server passes the filter if the server's game data (ISteamGameServer::SetGameData) contains at least one of the</para>
|
||||
/// <para> specified strings. The value field is a comma-delimited list of strings to match.</para>
|
||||
/// <para> "gamedatanor"</para>
|
||||
/// <para> - Server passes the filter if the server's game data (ISteamGameServer::SetGameData) does not contain any</para>
|
||||
/// <para> of the specified strings. The value field is a comma-delimited list of strings to check.</para>
|
||||
/// <para> "gametagsand"</para>
|
||||
/// <para> - Server passes the filter if the server's game tags (ISteamGameServer::SetGameTags) contains all</para>
|
||||
/// <para> of the specified strings. The value field is a comma-delimited list of strings to check.</para>
|
||||
/// <para> "gametagsnor"</para>
|
||||
/// <para> - Server passes the filter if the server's game tags (ISteamGameServer::SetGameTags) does not contain any</para>
|
||||
/// <para> of the specified strings. The value field is a comma-delimited list of strings to check.</para>
|
||||
/// <para> "and" (x1 && x2 && ... && xn)</para>
|
||||
/// <para> "or" (x1 || x2 || ... || xn)</para>
|
||||
/// <para> "nand" !(x1 && x2 && ... && xn)</para>
|
||||
/// <para> "nor" !(x1 || x2 || ... || xn)</para>
|
||||
/// <para> - Performs Boolean operation on the following filters. The operand to this filter specifies</para>
|
||||
/// <para> the "size" of the Boolean inputs to the operation, in Key/value pairs. (The keyvalue</para>
|
||||
/// <para> pairs must immediately follow, i.e. this is a prefix logical operator notation.)</para>
|
||||
/// <para> In the simplest case where Boolean expressions are not nested, this is simply</para>
|
||||
/// <para> the number of operands.</para>
|
||||
/// <para> For example, to match servers on a particular map or with a particular tag, would would</para>
|
||||
/// <para> use these filters.</para>
|
||||
/// <para> ( server.map == "cp_dustbowl" || server.gametags.contains("payload") )</para>
|
||||
/// <para> "or", "2"</para>
|
||||
/// <para> "map", "cp_dustbowl"</para>
|
||||
/// <para> "gametagsand", "payload"</para>
|
||||
/// <para> If logical inputs are nested, then the operand specifies the size of the entire</para>
|
||||
/// <para> "length" of its operands, not the number of immediate children.</para>
|
||||
/// <para> ( server.map == "cp_dustbowl" || ( server.gametags.contains("payload") && !server.gametags.contains("payloadrace") ) )</para>
|
||||
/// <para> "or", "4"</para>
|
||||
/// <para> "map", "cp_dustbowl"</para>
|
||||
/// <para> "and", "2"</para>
|
||||
/// <para> "gametagsand", "payload"</para>
|
||||
/// <para> "gametagsnor", "payloadrace"</para>
|
||||
/// <para> Unary NOT can be achieved using either "nand" or "nor" with a single operand.</para>
|
||||
/// <para> "addr"</para>
|
||||
/// <para> - Server passes the filter if the server's query address matches the specified IP or IP:port.</para>
|
||||
/// <para> "gameaddr"</para>
|
||||
/// <para> - Server passes the filter if the server's game address matches the specified IP or IP:port.</para>
|
||||
/// <para> The following filter operations ignore the "value" part of MatchMakingKeyValuePair_t</para>
|
||||
/// <para> "dedicated"</para>
|
||||
/// <para> - Server passes the filter if it passed true to SetDedicatedServer.</para>
|
||||
/// <para> "secure"</para>
|
||||
/// <para> - Server passes the filter if the server is VAC-enabled.</para>
|
||||
/// <para> "notfull"</para>
|
||||
/// <para> - Server passes the filter if the player count is less than the reported max player count.</para>
|
||||
/// <para> "hasplayers"</para>
|
||||
/// <para> - Server passes the filter if the player count is greater than zero.</para>
|
||||
/// <para> "noplayers"</para>
|
||||
/// <para> - Server passes the filter if it doesn't have any players.</para>
|
||||
/// <para> "linux"</para>
|
||||
/// <para> - Server passes the filter if it's a linux server</para>
|
||||
/// <para> Get details on a given server in the list, you can get the valid range of index</para>
|
||||
/// <para> values by calling GetServerCount(). You will also receive index values in</para>
|
||||
/// <para> ISteamMatchmakingServerListResponse::ServerResponded() callbacks</para>
|
||||
/// </summary>
|
||||
public static gameserveritem_t GetServerDetails(HServerListRequest hRequest, int iServer) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (gameserveritem_t)Marshal.PtrToStructure(NativeMethods.ISteamMatchmakingServers_GetServerDetails(CSteamAPIContext.GetSteamMatchmakingServers(), hRequest, iServer), typeof(gameserveritem_t));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Cancel an request which is operation on the given list type. You should call this to cancel</para>
|
||||
/// <para> any in-progress requests before destructing a callback object that may have been passed</para>
|
||||
/// <para> to one of the above list request calls. Not doing so may result in a crash when a callback</para>
|
||||
/// <para> occurs on the destructed object.</para>
|
||||
/// <para> Canceling a query does not release the allocated request handle.</para>
|
||||
/// <para> The request handle must be released using ReleaseRequest( hRequest )</para>
|
||||
/// </summary>
|
||||
public static void CancelQuery(HServerListRequest hRequest) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamMatchmakingServers_CancelQuery(CSteamAPIContext.GetSteamMatchmakingServers(), hRequest);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Ping every server in your list again but don't update the list of servers</para>
|
||||
/// <para> Query callback installed when the server list was requested will be used</para>
|
||||
/// <para> again to post notifications and RefreshComplete, so the callback must remain</para>
|
||||
/// <para> valid until another RefreshComplete is called on it or the request</para>
|
||||
/// <para> is released with ReleaseRequest( hRequest )</para>
|
||||
/// </summary>
|
||||
public static void RefreshQuery(HServerListRequest hRequest) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamMatchmakingServers_RefreshQuery(CSteamAPIContext.GetSteamMatchmakingServers(), hRequest);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns true if the list is currently refreshing its server list</para>
|
||||
/// </summary>
|
||||
public static bool IsRefreshing(HServerListRequest hRequest) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMatchmakingServers_IsRefreshing(CSteamAPIContext.GetSteamMatchmakingServers(), hRequest);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> How many servers in the given list, GetServerDetails above takes 0... GetServerCount() - 1</para>
|
||||
/// </summary>
|
||||
public static int GetServerCount(HServerListRequest hRequest) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMatchmakingServers_GetServerCount(CSteamAPIContext.GetSteamMatchmakingServers(), hRequest);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Refresh a single server inside of a query (rather than all the servers )</para>
|
||||
/// </summary>
|
||||
public static void RefreshServer(HServerListRequest hRequest, int iServer) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamMatchmakingServers_RefreshServer(CSteamAPIContext.GetSteamMatchmakingServers(), hRequest, iServer);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>-----------------------------------------------------------------------------</para>
|
||||
/// <para> Queries to individual servers directly via IP/Port</para>
|
||||
/// <para>-----------------------------------------------------------------------------</para>
|
||||
/// <para> Request updated ping time and other details from a single server</para>
|
||||
/// </summary>
|
||||
public static HServerQuery PingServer(uint unIP, ushort usPort, ISteamMatchmakingPingResponse pRequestServersResponse) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (HServerQuery)NativeMethods.ISteamMatchmakingServers_PingServer(CSteamAPIContext.GetSteamMatchmakingServers(), unIP, usPort, (IntPtr)pRequestServersResponse);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Request the list of players currently playing on a server</para>
|
||||
/// </summary>
|
||||
public static HServerQuery PlayerDetails(uint unIP, ushort usPort, ISteamMatchmakingPlayersResponse pRequestServersResponse) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (HServerQuery)NativeMethods.ISteamMatchmakingServers_PlayerDetails(CSteamAPIContext.GetSteamMatchmakingServers(), unIP, usPort, (IntPtr)pRequestServersResponse);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Request the list of rules that the server is running (See ISteamGameServer::SetKeyValue() to set the rules server side)</para>
|
||||
/// </summary>
|
||||
public static HServerQuery ServerRules(uint unIP, ushort usPort, ISteamMatchmakingRulesResponse pRequestServersResponse) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (HServerQuery)NativeMethods.ISteamMatchmakingServers_ServerRules(CSteamAPIContext.GetSteamMatchmakingServers(), unIP, usPort, (IntPtr)pRequestServersResponse);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Cancel an outstanding Ping/Players/Rules query from above. You should call this to cancel</para>
|
||||
/// <para> any in-progress requests before destructing a callback object that may have been passed</para>
|
||||
/// <para> to one of the above calls to avoid crashing when callbacks occur.</para>
|
||||
/// </summary>
|
||||
public static void CancelServerQuery(HServerQuery hServerQuery) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamMatchmakingServers_CancelServerQuery(CSteamAPIContext.GetSteamMatchmakingServers(), hServerQuery);
|
||||
}
|
||||
}
|
||||
public static class SteamGameSearch {
|
||||
/// <summary>
|
||||
/// <para> =============================================================================================</para>
|
||||
/// <para> Game Player APIs</para>
|
||||
/// <para> a keyname and a list of comma separated values: one of which is must be found in order for the match to qualify</para>
|
||||
/// <para> fails if a search is currently in progress</para>
|
||||
/// </summary>
|
||||
public static EGameSearchErrorCode_t AddGameSearchParams(string pchKeyToFind, string pchValuesToFind) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchKeyToFind2 = new InteropHelp.UTF8StringHandle(pchKeyToFind))
|
||||
using (var pchValuesToFind2 = new InteropHelp.UTF8StringHandle(pchValuesToFind)) {
|
||||
return NativeMethods.ISteamGameSearch_AddGameSearchParams(CSteamAPIContext.GetSteamGameSearch(), pchKeyToFind2, pchValuesToFind2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> all players in lobby enter the queue and await a SearchForGameNotificationCallback_t callback. fails if another search is currently in progress</para>
|
||||
/// <para> if not the owner of the lobby or search already in progress this call fails</para>
|
||||
/// <para> periodic callbacks will be sent as queue time estimates change</para>
|
||||
/// </summary>
|
||||
public static EGameSearchErrorCode_t SearchForGameWithLobby(CSteamID steamIDLobby, int nPlayerMin, int nPlayerMax) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamGameSearch_SearchForGameWithLobby(CSteamAPIContext.GetSteamGameSearch(), steamIDLobby, nPlayerMin, nPlayerMax);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> user enter the queue and await a SearchForGameNotificationCallback_t callback. fails if another search is currently in progress</para>
|
||||
/// <para> periodic callbacks will be sent as queue time estimates change</para>
|
||||
/// </summary>
|
||||
public static EGameSearchErrorCode_t SearchForGameSolo(int nPlayerMin, int nPlayerMax) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamGameSearch_SearchForGameSolo(CSteamAPIContext.GetSteamGameSearch(), nPlayerMin, nPlayerMax);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> after receiving SearchForGameResultCallback_t, accept or decline the game</para>
|
||||
/// <para> multiple SearchForGameResultCallback_t will follow as players accept game until the host starts or cancels the game</para>
|
||||
/// </summary>
|
||||
public static EGameSearchErrorCode_t AcceptGame() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamGameSearch_AcceptGame(CSteamAPIContext.GetSteamGameSearch());
|
||||
}
|
||||
|
||||
public static EGameSearchErrorCode_t DeclineGame() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamGameSearch_DeclineGame(CSteamAPIContext.GetSteamGameSearch());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> after receiving GameStartedByHostCallback_t get connection details to server</para>
|
||||
/// </summary>
|
||||
public static EGameSearchErrorCode_t RetrieveConnectionDetails(CSteamID steamIDHost, out string pchConnectionDetails, int cubConnectionDetails) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
IntPtr pchConnectionDetails2 = Marshal.AllocHGlobal(cubConnectionDetails);
|
||||
EGameSearchErrorCode_t ret = NativeMethods.ISteamGameSearch_RetrieveConnectionDetails(CSteamAPIContext.GetSteamGameSearch(), steamIDHost, pchConnectionDetails2, cubConnectionDetails);
|
||||
pchConnectionDetails = ret != 0 ? InteropHelp.PtrToStringUTF8(pchConnectionDetails2) : null;
|
||||
Marshal.FreeHGlobal(pchConnectionDetails2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> leaves queue if still waiting</para>
|
||||
/// </summary>
|
||||
public static EGameSearchErrorCode_t EndGameSearch() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamGameSearch_EndGameSearch(CSteamAPIContext.GetSteamGameSearch());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> =============================================================================================</para>
|
||||
/// <para> Game Host APIs</para>
|
||||
/// <para> a keyname and a list of comma separated values: all the values you allow</para>
|
||||
/// </summary>
|
||||
public static EGameSearchErrorCode_t SetGameHostParams(string pchKey, string pchValue) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchKey2 = new InteropHelp.UTF8StringHandle(pchKey))
|
||||
using (var pchValue2 = new InteropHelp.UTF8StringHandle(pchValue)) {
|
||||
return NativeMethods.ISteamGameSearch_SetGameHostParams(CSteamAPIContext.GetSteamGameSearch(), pchKey2, pchValue2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> set connection details for players once game is found so they can connect to this server</para>
|
||||
/// </summary>
|
||||
public static EGameSearchErrorCode_t SetConnectionDetails(string pchConnectionDetails, int cubConnectionDetails) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchConnectionDetails2 = new InteropHelp.UTF8StringHandle(pchConnectionDetails)) {
|
||||
return NativeMethods.ISteamGameSearch_SetConnectionDetails(CSteamAPIContext.GetSteamGameSearch(), pchConnectionDetails2, cubConnectionDetails);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> mark server as available for more players with nPlayerMin,nPlayerMax desired</para>
|
||||
/// <para> accept no lobbies with playercount greater than nMaxTeamSize</para>
|
||||
/// <para> the set of lobbies returned must be partitionable into teams of no more than nMaxTeamSize</para>
|
||||
/// <para> RequestPlayersForGameNotificationCallback_t callback will be sent when the search has started</para>
|
||||
/// <para> multple RequestPlayersForGameResultCallback_t callbacks will follow when players are found</para>
|
||||
/// </summary>
|
||||
public static EGameSearchErrorCode_t RequestPlayersForGame(int nPlayerMin, int nPlayerMax, int nMaxTeamSize) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamGameSearch_RequestPlayersForGame(CSteamAPIContext.GetSteamGameSearch(), nPlayerMin, nPlayerMax, nMaxTeamSize);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> accept the player list and release connection details to players</para>
|
||||
/// <para> players will only be given connection details and host steamid when this is called</para>
|
||||
/// <para> ( allows host to accept after all players confirm, some confirm, or none confirm. decision is entirely up to the host )</para>
|
||||
/// </summary>
|
||||
public static EGameSearchErrorCode_t HostConfirmGameStart(ulong ullUniqueGameID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamGameSearch_HostConfirmGameStart(CSteamAPIContext.GetSteamGameSearch(), ullUniqueGameID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> cancel request and leave the pool of game hosts looking for players</para>
|
||||
/// <para> if a set of players has already been sent to host, all players will receive SearchForGameHostFailedToConfirm_t</para>
|
||||
/// </summary>
|
||||
public static EGameSearchErrorCode_t CancelRequestPlayersForGame() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamGameSearch_CancelRequestPlayersForGame(CSteamAPIContext.GetSteamGameSearch());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> submit a result for one player. does not end the game. ullUniqueGameID continues to describe this game</para>
|
||||
/// </summary>
|
||||
public static EGameSearchErrorCode_t SubmitPlayerResult(ulong ullUniqueGameID, CSteamID steamIDPlayer, EPlayerResult_t EPlayerResult) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamGameSearch_SubmitPlayerResult(CSteamAPIContext.GetSteamGameSearch(), ullUniqueGameID, steamIDPlayer, EPlayerResult);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> ends the game. no further SubmitPlayerResults for ullUniqueGameID will be accepted</para>
|
||||
/// <para> any future requests will provide a new ullUniqueGameID</para>
|
||||
/// </summary>
|
||||
public static EGameSearchErrorCode_t EndGame(ulong ullUniqueGameID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamGameSearch_EndGame(CSteamAPIContext.GetSteamGameSearch(), ullUniqueGameID);
|
||||
}
|
||||
}
|
||||
public static class SteamParties {
|
||||
/// <summary>
|
||||
/// <para> =============================================================================================</para>
|
||||
/// <para> Party Client APIs</para>
|
||||
/// <para> Enumerate any active beacons for parties you may wish to join</para>
|
||||
/// </summary>
|
||||
public static uint GetNumActiveBeacons() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamParties_GetNumActiveBeacons(CSteamAPIContext.GetSteamParties());
|
||||
}
|
||||
|
||||
public static PartyBeaconID_t GetBeaconByIndex(uint unIndex) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (PartyBeaconID_t)NativeMethods.ISteamParties_GetBeaconByIndex(CSteamAPIContext.GetSteamParties(), unIndex);
|
||||
}
|
||||
|
||||
public static bool GetBeaconDetails(PartyBeaconID_t ulBeaconID, out CSteamID pSteamIDBeaconOwner, out SteamPartyBeaconLocation_t pLocation, out string pchMetadata, int cchMetadata) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
IntPtr pchMetadata2 = Marshal.AllocHGlobal(cchMetadata);
|
||||
bool ret = NativeMethods.ISteamParties_GetBeaconDetails(CSteamAPIContext.GetSteamParties(), ulBeaconID, out pSteamIDBeaconOwner, out pLocation, pchMetadata2, cchMetadata);
|
||||
pchMetadata = ret ? InteropHelp.PtrToStringUTF8(pchMetadata2) : null;
|
||||
Marshal.FreeHGlobal(pchMetadata2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Join an open party. Steam will reserve one beacon slot for your SteamID,</para>
|
||||
/// <para> and return the necessary JoinGame string for you to use to connect</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t JoinParty(PartyBeaconID_t ulBeaconID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamParties_JoinParty(CSteamAPIContext.GetSteamParties(), ulBeaconID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> =============================================================================================</para>
|
||||
/// <para> Party Host APIs</para>
|
||||
/// <para> Get a list of possible beacon locations</para>
|
||||
/// </summary>
|
||||
public static bool GetNumAvailableBeaconLocations(out uint puNumLocations) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamParties_GetNumAvailableBeaconLocations(CSteamAPIContext.GetSteamParties(), out puNumLocations);
|
||||
}
|
||||
|
||||
public static bool GetAvailableBeaconLocations(SteamPartyBeaconLocation_t[] pLocationList, uint uMaxNumLocations) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamParties_GetAvailableBeaconLocations(CSteamAPIContext.GetSteamParties(), pLocationList, uMaxNumLocations);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Create a new party beacon and activate it in the selected location.</para>
|
||||
/// <para> unOpenSlots is the maximum number of users that Steam will send to you.</para>
|
||||
/// <para> When people begin responding to your beacon, Steam will send you</para>
|
||||
/// <para> PartyReservationCallback_t callbacks to let you know who is on the way.</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t CreateBeacon(uint unOpenSlots, ref SteamPartyBeaconLocation_t pBeaconLocation, string pchConnectString, string pchMetadata) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchConnectString2 = new InteropHelp.UTF8StringHandle(pchConnectString))
|
||||
using (var pchMetadata2 = new InteropHelp.UTF8StringHandle(pchMetadata)) {
|
||||
return (SteamAPICall_t)NativeMethods.ISteamParties_CreateBeacon(CSteamAPIContext.GetSteamParties(), unOpenSlots, ref pBeaconLocation, pchConnectString2, pchMetadata2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Call this function when a user that had a reservation (see callback below)</para>
|
||||
/// <para> has successfully joined your party.</para>
|
||||
/// <para> Steam will manage the remaining open slots automatically.</para>
|
||||
/// </summary>
|
||||
public static void OnReservationCompleted(PartyBeaconID_t ulBeacon, CSteamID steamIDUser) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamParties_OnReservationCompleted(CSteamAPIContext.GetSteamParties(), ulBeacon, steamIDUser);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> To cancel a reservation (due to timeout or user input), call this.</para>
|
||||
/// <para> Steam will open a new reservation slot.</para>
|
||||
/// <para> 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.</para>
|
||||
/// </summary>
|
||||
public static void CancelReservation(PartyBeaconID_t ulBeacon, CSteamID steamIDUser) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamParties_CancelReservation(CSteamAPIContext.GetSteamParties(), ulBeacon, steamIDUser);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Change the number of open beacon reservation slots.</para>
|
||||
/// <para> Call this if, for example, someone without a reservation joins your party (eg a friend, or via your own matchmaking system).</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t ChangeNumOpenSlots(PartyBeaconID_t ulBeacon, uint unOpenSlots) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamParties_ChangeNumOpenSlots(CSteamAPIContext.GetSteamParties(), ulBeacon, unOpenSlots);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Turn off the beacon.</para>
|
||||
/// </summary>
|
||||
public static bool DestroyBeacon(PartyBeaconID_t ulBeacon) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamParties_DestroyBeacon(CSteamAPIContext.GetSteamParties(), ulBeacon);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Utils</para>
|
||||
/// </summary>
|
||||
public static bool GetBeaconLocationData(SteamPartyBeaconLocation_t BeaconLocation, ESteamPartyBeaconLocationData eData, out string pchDataStringOut, int cchDataStringOut) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
IntPtr pchDataStringOut2 = Marshal.AllocHGlobal(cchDataStringOut);
|
||||
bool ret = NativeMethods.ISteamParties_GetBeaconLocationData(CSteamAPIContext.GetSteamParties(), BeaconLocation, eData, pchDataStringOut2, cchDataStringOut);
|
||||
pchDataStringOut = ret ? InteropHelp.PtrToStringUTF8(pchDataStringOut2) : null;
|
||||
Marshal.FreeHGlobal(pchDataStringOut2);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,69 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamMusic {
|
||||
public static bool BIsEnabled() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusic_BIsEnabled(CSteamAPIContext.GetSteamMusic());
|
||||
}
|
||||
|
||||
public static bool BIsPlaying() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusic_BIsPlaying(CSteamAPIContext.GetSteamMusic());
|
||||
}
|
||||
|
||||
public static AudioPlayback_Status GetPlaybackStatus() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusic_GetPlaybackStatus(CSteamAPIContext.GetSteamMusic());
|
||||
}
|
||||
|
||||
public static void Play() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamMusic_Play(CSteamAPIContext.GetSteamMusic());
|
||||
}
|
||||
|
||||
public static void Pause() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamMusic_Pause(CSteamAPIContext.GetSteamMusic());
|
||||
}
|
||||
|
||||
public static void PlayPrevious() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamMusic_PlayPrevious(CSteamAPIContext.GetSteamMusic());
|
||||
}
|
||||
|
||||
public static void PlayNext() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamMusic_PlayNext(CSteamAPIContext.GetSteamMusic());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> volume is between 0.0 and 1.0</para>
|
||||
/// </summary>
|
||||
public static void SetVolume(float flVolume) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamMusic_SetVolume(CSteamAPIContext.GetSteamMusic(), flVolume);
|
||||
}
|
||||
|
||||
public static float GetVolume() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusic_GetVolume(CSteamAPIContext.GetSteamMusic());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,212 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamMusicRemote {
|
||||
/// <summary>
|
||||
/// <para> Service Definition</para>
|
||||
/// </summary>
|
||||
public static bool RegisterSteamMusicRemote(string pchName) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) {
|
||||
return NativeMethods.ISteamMusicRemote_RegisterSteamMusicRemote(CSteamAPIContext.GetSteamMusicRemote(), pchName2);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool DeregisterSteamMusicRemote() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusicRemote_DeregisterSteamMusicRemote(CSteamAPIContext.GetSteamMusicRemote());
|
||||
}
|
||||
|
||||
public static bool BIsCurrentMusicRemote() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusicRemote_BIsCurrentMusicRemote(CSteamAPIContext.GetSteamMusicRemote());
|
||||
}
|
||||
|
||||
public static bool BActivationSuccess(bool bValue) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusicRemote_BActivationSuccess(CSteamAPIContext.GetSteamMusicRemote(), bValue);
|
||||
}
|
||||
|
||||
public static bool SetDisplayName(string pchDisplayName) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchDisplayName2 = new InteropHelp.UTF8StringHandle(pchDisplayName)) {
|
||||
return NativeMethods.ISteamMusicRemote_SetDisplayName(CSteamAPIContext.GetSteamMusicRemote(), pchDisplayName2);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool SetPNGIcon_64x64(byte[] pvBuffer, uint cbBufferLength) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusicRemote_SetPNGIcon_64x64(CSteamAPIContext.GetSteamMusicRemote(), pvBuffer, cbBufferLength);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Abilities for the user interface</para>
|
||||
/// </summary>
|
||||
public static bool EnablePlayPrevious(bool bValue) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusicRemote_EnablePlayPrevious(CSteamAPIContext.GetSteamMusicRemote(), bValue);
|
||||
}
|
||||
|
||||
public static bool EnablePlayNext(bool bValue) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusicRemote_EnablePlayNext(CSteamAPIContext.GetSteamMusicRemote(), bValue);
|
||||
}
|
||||
|
||||
public static bool EnableShuffled(bool bValue) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusicRemote_EnableShuffled(CSteamAPIContext.GetSteamMusicRemote(), bValue);
|
||||
}
|
||||
|
||||
public static bool EnableLooped(bool bValue) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusicRemote_EnableLooped(CSteamAPIContext.GetSteamMusicRemote(), bValue);
|
||||
}
|
||||
|
||||
public static bool EnableQueue(bool bValue) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusicRemote_EnableQueue(CSteamAPIContext.GetSteamMusicRemote(), bValue);
|
||||
}
|
||||
|
||||
public static bool EnablePlaylists(bool bValue) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusicRemote_EnablePlaylists(CSteamAPIContext.GetSteamMusicRemote(), bValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Status</para>
|
||||
/// </summary>
|
||||
public static bool UpdatePlaybackStatus(AudioPlayback_Status nStatus) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusicRemote_UpdatePlaybackStatus(CSteamAPIContext.GetSteamMusicRemote(), nStatus);
|
||||
}
|
||||
|
||||
public static bool UpdateShuffled(bool bValue) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusicRemote_UpdateShuffled(CSteamAPIContext.GetSteamMusicRemote(), bValue);
|
||||
}
|
||||
|
||||
public static bool UpdateLooped(bool bValue) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusicRemote_UpdateLooped(CSteamAPIContext.GetSteamMusicRemote(), bValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> volume is between 0.0 and 1.0</para>
|
||||
/// </summary>
|
||||
public static bool UpdateVolume(float flValue) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusicRemote_UpdateVolume(CSteamAPIContext.GetSteamMusicRemote(), flValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Current Entry</para>
|
||||
/// </summary>
|
||||
public static bool CurrentEntryWillChange() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusicRemote_CurrentEntryWillChange(CSteamAPIContext.GetSteamMusicRemote());
|
||||
}
|
||||
|
||||
public static bool CurrentEntryIsAvailable(bool bAvailable) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusicRemote_CurrentEntryIsAvailable(CSteamAPIContext.GetSteamMusicRemote(), bAvailable);
|
||||
}
|
||||
|
||||
public static bool UpdateCurrentEntryText(string pchText) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchText2 = new InteropHelp.UTF8StringHandle(pchText)) {
|
||||
return NativeMethods.ISteamMusicRemote_UpdateCurrentEntryText(CSteamAPIContext.GetSteamMusicRemote(), pchText2);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool UpdateCurrentEntryElapsedSeconds(int nValue) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds(CSteamAPIContext.GetSteamMusicRemote(), nValue);
|
||||
}
|
||||
|
||||
public static bool UpdateCurrentEntryCoverArt(byte[] pvBuffer, uint cbBufferLength) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusicRemote_UpdateCurrentEntryCoverArt(CSteamAPIContext.GetSteamMusicRemote(), pvBuffer, cbBufferLength);
|
||||
}
|
||||
|
||||
public static bool CurrentEntryDidChange() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusicRemote_CurrentEntryDidChange(CSteamAPIContext.GetSteamMusicRemote());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Queue</para>
|
||||
/// </summary>
|
||||
public static bool QueueWillChange() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusicRemote_QueueWillChange(CSteamAPIContext.GetSteamMusicRemote());
|
||||
}
|
||||
|
||||
public static bool ResetQueueEntries() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusicRemote_ResetQueueEntries(CSteamAPIContext.GetSteamMusicRemote());
|
||||
}
|
||||
|
||||
public static bool SetQueueEntry(int nID, int nPosition, string pchEntryText) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchEntryText2 = new InteropHelp.UTF8StringHandle(pchEntryText)) {
|
||||
return NativeMethods.ISteamMusicRemote_SetQueueEntry(CSteamAPIContext.GetSteamMusicRemote(), nID, nPosition, pchEntryText2);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool SetCurrentQueueEntry(int nID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusicRemote_SetCurrentQueueEntry(CSteamAPIContext.GetSteamMusicRemote(), nID);
|
||||
}
|
||||
|
||||
public static bool QueueDidChange() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusicRemote_QueueDidChange(CSteamAPIContext.GetSteamMusicRemote());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Playlist</para>
|
||||
/// </summary>
|
||||
public static bool PlaylistWillChange() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusicRemote_PlaylistWillChange(CSteamAPIContext.GetSteamMusicRemote());
|
||||
}
|
||||
|
||||
public static bool ResetPlaylistEntries() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusicRemote_ResetPlaylistEntries(CSteamAPIContext.GetSteamMusicRemote());
|
||||
}
|
||||
|
||||
public static bool SetPlaylistEntry(int nID, int nPosition, string pchEntryText) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchEntryText2 = new InteropHelp.UTF8StringHandle(pchEntryText)) {
|
||||
return NativeMethods.ISteamMusicRemote_SetPlaylistEntry(CSteamAPIContext.GetSteamMusicRemote(), nID, nPosition, pchEntryText2);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool SetCurrentPlaylistEntry(int nID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusicRemote_SetCurrentPlaylistEntry(CSteamAPIContext.GetSteamMusicRemote(), nID);
|
||||
}
|
||||
|
||||
public static bool PlaylistDidChange() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamMusicRemote_PlaylistDidChange(CSteamAPIContext.GetSteamMusicRemote());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,263 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamNetworking {
|
||||
/// <summary>
|
||||
/// <para>//////////////////////////////////////////////////////////////////////////////////////////</para>
|
||||
/// <para> UDP-style (connectionless) networking interface. These functions send messages using</para>
|
||||
/// <para> an API organized around the destination. Reliable and unreliable messages are supported.</para>
|
||||
/// <para> For a more TCP-style interface (meaning you have a connection handle), see the functions below.</para>
|
||||
/// <para> Both interface styles can send both reliable and unreliable messages.</para>
|
||||
/// <para> Automatically establishes NAT-traversing or Relay server connections</para>
|
||||
/// <para> Sends a P2P packet to the specified user</para>
|
||||
/// <para> UDP-like, unreliable and a max packet size of 1200 bytes</para>
|
||||
/// <para> the first packet send may be delayed as the NAT-traversal code runs</para>
|
||||
/// <para> if we can't get through to the user, an error will be posted via the callback P2PSessionConnectFail_t</para>
|
||||
/// <para> see EP2PSend enum above for the descriptions of the different ways of sending packets</para>
|
||||
/// <para> nChannel is a routing number you can use to help route message to different systems - you'll have to call ReadP2PPacket()</para>
|
||||
/// <para> with the same channel number in order to retrieve the data on the other end</para>
|
||||
/// <para> using different channels to talk to the same user will still use the same underlying p2p connection, saving on resources</para>
|
||||
/// </summary>
|
||||
public static bool SendP2PPacket(CSteamID steamIDRemote, byte[] pubData, uint cubData, EP2PSend eP2PSendType, int nChannel = 0) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamNetworking_SendP2PPacket(CSteamAPIContext.GetSteamNetworking(), steamIDRemote, pubData, cubData, eP2PSendType, nChannel);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns true if any data is available for read, and the amount of data that will need to be read</para>
|
||||
/// </summary>
|
||||
public static bool IsP2PPacketAvailable(out uint pcubMsgSize, int nChannel = 0) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamNetworking_IsP2PPacketAvailable(CSteamAPIContext.GetSteamNetworking(), out pcubMsgSize, nChannel);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> reads in a packet that has been sent from another user via SendP2PPacket()</para>
|
||||
/// <para> returns the size of the message and the steamID of the user who sent it in the last two parameters</para>
|
||||
/// <para> if the buffer passed in is too small, the message will be truncated</para>
|
||||
/// <para> this call is not blocking, and will return false if no data is available</para>
|
||||
/// </summary>
|
||||
public static bool ReadP2PPacket(byte[] pubDest, uint cubDest, out uint pcubMsgSize, out CSteamID psteamIDRemote, int nChannel = 0) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamNetworking_ReadP2PPacket(CSteamAPIContext.GetSteamNetworking(), pubDest, cubDest, out pcubMsgSize, out psteamIDRemote, nChannel);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> AcceptP2PSessionWithUser() should only be called in response to a P2PSessionRequest_t callback</para>
|
||||
/// <para> P2PSessionRequest_t will be posted if another user tries to send you a packet that you haven't talked to yet</para>
|
||||
/// <para> if you don't want to talk to the user, just ignore the request</para>
|
||||
/// <para> if the user continues to send you packets, another P2PSessionRequest_t will be posted periodically</para>
|
||||
/// <para> this may be called multiple times for a single user</para>
|
||||
/// <para> (if you've called SendP2PPacket() on the other user, this implicitly accepts the session request)</para>
|
||||
/// </summary>
|
||||
public static bool AcceptP2PSessionWithUser(CSteamID steamIDRemote) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamNetworking_AcceptP2PSessionWithUser(CSteamAPIContext.GetSteamNetworking(), steamIDRemote);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> call CloseP2PSessionWithUser() when you're done talking to a user, will free up resources under-the-hood</para>
|
||||
/// <para> if the remote user tries to send data to you again, another P2PSessionRequest_t callback will be posted</para>
|
||||
/// </summary>
|
||||
public static bool CloseP2PSessionWithUser(CSteamID steamIDRemote) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamNetworking_CloseP2PSessionWithUser(CSteamAPIContext.GetSteamNetworking(), steamIDRemote);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> call CloseP2PChannelWithUser() when you're done talking to a user on a specific channel. Once all channels</para>
|
||||
/// <para> open channels to a user have been closed, the open session to the user will be closed and new data from this</para>
|
||||
/// <para> user will trigger a P2PSessionRequest_t callback</para>
|
||||
/// </summary>
|
||||
public static bool CloseP2PChannelWithUser(CSteamID steamIDRemote, int nChannel) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamNetworking_CloseP2PChannelWithUser(CSteamAPIContext.GetSteamNetworking(), steamIDRemote, nChannel);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> fills out P2PSessionState_t structure with details about the underlying connection to the user</para>
|
||||
/// <para> should only needed for debugging purposes</para>
|
||||
/// <para> returns false if no connection exists to the specified user</para>
|
||||
/// </summary>
|
||||
public static bool GetP2PSessionState(CSteamID steamIDRemote, out P2PSessionState_t pConnectionState) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamNetworking_GetP2PSessionState(CSteamAPIContext.GetSteamNetworking(), steamIDRemote, out pConnectionState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Allow P2P connections to fall back to being relayed through the Steam servers if a direct connection</para>
|
||||
/// <para> or NAT-traversal cannot be established. Only applies to connections created after setting this value,</para>
|
||||
/// <para> or to existing connections that need to automatically reconnect after this value is set.</para>
|
||||
/// <para> P2P packet relay is allowed by default</para>
|
||||
/// </summary>
|
||||
public static bool AllowP2PPacketRelay(bool bAllow) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamNetworking_AllowP2PPacketRelay(CSteamAPIContext.GetSteamNetworking(), bAllow);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>//////////////////////////////////////////////////////////////////////////////////////////</para>
|
||||
/// <para> LISTEN / CONNECT connection-oriented interface functions</para>
|
||||
/// <para> These functions are more like a client-server TCP API. One side is the "server"</para>
|
||||
/// <para> and "listens" for incoming connections, which then must be "accepted." The "client"</para>
|
||||
/// <para> initiates a connection by "connecting." Sending and receiving is done through a</para>
|
||||
/// <para> connection handle.</para>
|
||||
/// <para> For a more UDP-style interface, where you do not track connection handles but</para>
|
||||
/// <para> simply send messages to a SteamID, use the UDP-style functions above.</para>
|
||||
/// <para> Both methods can send both reliable and unreliable methods.</para>
|
||||
/// <para>//////////////////////////////////////////////////////////////////////////////////////////</para>
|
||||
/// <para> creates a socket and listens others to connect</para>
|
||||
/// <para> will trigger a SocketStatusCallback_t callback on another client connecting</para>
|
||||
/// <para> nVirtualP2PPort is the unique ID that the client will connect to, in case you have multiple ports</para>
|
||||
/// <para> this can usually just be 0 unless you want multiple sets of connections</para>
|
||||
/// <para> unIP is the local IP address to bind to</para>
|
||||
/// <para> pass in 0 if you just want the default local IP</para>
|
||||
/// <para> unPort is the port to use</para>
|
||||
/// <para> pass in 0 if you don't want users to be able to connect via IP/Port, but expect to be always peer-to-peer connections only</para>
|
||||
/// </summary>
|
||||
public static SNetListenSocket_t CreateListenSocket(int nVirtualP2PPort, uint nIP, ushort nPort, bool bAllowUseOfPacketRelay) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SNetListenSocket_t)NativeMethods.ISteamNetworking_CreateListenSocket(CSteamAPIContext.GetSteamNetworking(), nVirtualP2PPort, nIP, nPort, bAllowUseOfPacketRelay);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> creates a socket and begin connection to a remote destination</para>
|
||||
/// <para> can connect via a known steamID (client or game server), or directly to an IP</para>
|
||||
/// <para> on success will trigger a SocketStatusCallback_t callback</para>
|
||||
/// <para> on failure or timeout will trigger a SocketStatusCallback_t callback with a failure code in m_eSNetSocketState</para>
|
||||
/// </summary>
|
||||
public static SNetSocket_t CreateP2PConnectionSocket(CSteamID steamIDTarget, int nVirtualPort, int nTimeoutSec, bool bAllowUseOfPacketRelay) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SNetSocket_t)NativeMethods.ISteamNetworking_CreateP2PConnectionSocket(CSteamAPIContext.GetSteamNetworking(), steamIDTarget, nVirtualPort, nTimeoutSec, bAllowUseOfPacketRelay);
|
||||
}
|
||||
|
||||
public static SNetSocket_t CreateConnectionSocket(uint nIP, ushort nPort, int nTimeoutSec) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SNetSocket_t)NativeMethods.ISteamNetworking_CreateConnectionSocket(CSteamAPIContext.GetSteamNetworking(), nIP, nPort, nTimeoutSec);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> disconnects the connection to the socket, if any, and invalidates the handle</para>
|
||||
/// <para> any unread data on the socket will be thrown away</para>
|
||||
/// <para> if bNotifyRemoteEnd is set, socket will not be completely destroyed until the remote end acknowledges the disconnect</para>
|
||||
/// </summary>
|
||||
public static bool DestroySocket(SNetSocket_t hSocket, bool bNotifyRemoteEnd) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamNetworking_DestroySocket(CSteamAPIContext.GetSteamNetworking(), hSocket, bNotifyRemoteEnd);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> destroying a listen socket will automatically kill all the regular sockets generated from it</para>
|
||||
/// </summary>
|
||||
public static bool DestroyListenSocket(SNetListenSocket_t hSocket, bool bNotifyRemoteEnd) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamNetworking_DestroyListenSocket(CSteamAPIContext.GetSteamNetworking(), hSocket, bNotifyRemoteEnd);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> sending data</para>
|
||||
/// <para> must be a handle to a connected socket</para>
|
||||
/// <para> data is all sent via UDP, and thus send sizes are limited to 1200 bytes; after this, many routers will start dropping packets</para>
|
||||
/// <para> use the reliable flag with caution; although the resend rate is pretty aggressive,</para>
|
||||
/// <para> it can still cause stalls in receiving data (like TCP)</para>
|
||||
/// </summary>
|
||||
public static bool SendDataOnSocket(SNetSocket_t hSocket, byte[] pubData, uint cubData, bool bReliable) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamNetworking_SendDataOnSocket(CSteamAPIContext.GetSteamNetworking(), hSocket, pubData, cubData, bReliable);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> receiving data</para>
|
||||
/// <para> returns false if there is no data remaining</para>
|
||||
/// <para> fills out *pcubMsgSize with the size of the next message, in bytes</para>
|
||||
/// </summary>
|
||||
public static bool IsDataAvailableOnSocket(SNetSocket_t hSocket, out uint pcubMsgSize) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamNetworking_IsDataAvailableOnSocket(CSteamAPIContext.GetSteamNetworking(), hSocket, out pcubMsgSize);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> fills in pubDest with the contents of the message</para>
|
||||
/// <para> messages are always complete, of the same size as was sent (i.e. packetized, not streaming)</para>
|
||||
/// <para> if *pcubMsgSize < cubDest, only partial data is written</para>
|
||||
/// <para> returns false if no data is available</para>
|
||||
/// </summary>
|
||||
public static bool RetrieveDataFromSocket(SNetSocket_t hSocket, byte[] pubDest, uint cubDest, out uint pcubMsgSize) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamNetworking_RetrieveDataFromSocket(CSteamAPIContext.GetSteamNetworking(), hSocket, pubDest, cubDest, out pcubMsgSize);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> checks for data from any socket that has been connected off this listen socket</para>
|
||||
/// <para> returns false if there is no data remaining</para>
|
||||
/// <para> fills out *pcubMsgSize with the size of the next message, in bytes</para>
|
||||
/// <para> fills out *phSocket with the socket that data is available on</para>
|
||||
/// </summary>
|
||||
public static bool IsDataAvailable(SNetListenSocket_t hListenSocket, out uint pcubMsgSize, out SNetSocket_t phSocket) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamNetworking_IsDataAvailable(CSteamAPIContext.GetSteamNetworking(), hListenSocket, out pcubMsgSize, out phSocket);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> retrieves data from any socket that has been connected off this listen socket</para>
|
||||
/// <para> fills in pubDest with the contents of the message</para>
|
||||
/// <para> messages are always complete, of the same size as was sent (i.e. packetized, not streaming)</para>
|
||||
/// <para> if *pcubMsgSize < cubDest, only partial data is written</para>
|
||||
/// <para> returns false if no data is available</para>
|
||||
/// <para> fills out *phSocket with the socket that data is available on</para>
|
||||
/// </summary>
|
||||
public static bool RetrieveData(SNetListenSocket_t hListenSocket, byte[] pubDest, uint cubDest, out uint pcubMsgSize, out SNetSocket_t phSocket) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamNetworking_RetrieveData(CSteamAPIContext.GetSteamNetworking(), hListenSocket, pubDest, cubDest, out pcubMsgSize, out phSocket);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns information about the specified socket, filling out the contents of the pointers</para>
|
||||
/// </summary>
|
||||
public static bool GetSocketInfo(SNetSocket_t hSocket, out CSteamID pSteamIDRemote, out int peSocketStatus, out uint punIPRemote, out ushort punPortRemote) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamNetworking_GetSocketInfo(CSteamAPIContext.GetSteamNetworking(), hSocket, out pSteamIDRemote, out peSocketStatus, out punIPRemote, out punPortRemote);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns which local port the listen socket is bound to</para>
|
||||
/// <para> *pnIP and *pnPort will be 0 if the socket is set to listen for P2P connections only</para>
|
||||
/// </summary>
|
||||
public static bool GetListenSocketInfo(SNetListenSocket_t hListenSocket, out uint pnIP, out ushort pnPort) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamNetworking_GetListenSocketInfo(CSteamAPIContext.GetSteamNetworking(), hListenSocket, out pnIP, out pnPort);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns true to describe how the socket ended up connecting</para>
|
||||
/// </summary>
|
||||
public static ESNetSocketConnectionType GetSocketConnectionType(SNetSocket_t hSocket) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamNetworking_GetSocketConnectionType(CSteamAPIContext.GetSteamNetworking(), hSocket);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> max packet size, in bytes</para>
|
||||
/// </summary>
|
||||
public static int GetMaxPacketSize(SNetSocket_t hSocket) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamNetworking_GetMaxPacketSize(CSteamAPIContext.GetSteamNetworking(), hSocket);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,51 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamParentalSettings {
|
||||
public static bool BIsParentalLockEnabled() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamParentalSettings_BIsParentalLockEnabled(CSteamAPIContext.GetSteamParentalSettings());
|
||||
}
|
||||
|
||||
public static bool BIsParentalLockLocked() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamParentalSettings_BIsParentalLockLocked(CSteamAPIContext.GetSteamParentalSettings());
|
||||
}
|
||||
|
||||
public static bool BIsAppBlocked(AppId_t nAppID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamParentalSettings_BIsAppBlocked(CSteamAPIContext.GetSteamParentalSettings(), nAppID);
|
||||
}
|
||||
|
||||
public static bool BIsAppInBlockList(AppId_t nAppID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamParentalSettings_BIsAppInBlockList(CSteamAPIContext.GetSteamParentalSettings(), nAppID);
|
||||
}
|
||||
|
||||
public static bool BIsFeatureBlocked(EParentalFeature eFeature) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamParentalSettings_BIsFeatureBlocked(CSteamAPIContext.GetSteamParentalSettings(), eFeature);
|
||||
}
|
||||
|
||||
public static bool BIsFeatureInBlockList(EParentalFeature eFeature) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamParentalSettings_BIsFeatureInBlockList(CSteamAPIContext.GetSteamParentalSettings(), eFeature);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,71 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamRemotePlay {
|
||||
/// <summary>
|
||||
/// <para> Get the number of currently connected Steam Remote Play sessions</para>
|
||||
/// </summary>
|
||||
public static uint GetSessionCount() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamRemotePlay_GetSessionCount(CSteamAPIContext.GetSteamRemotePlay());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Get the currently connected Steam Remote Play session ID at the specified index. Returns zero if index is out of bounds.</para>
|
||||
/// </summary>
|
||||
public static uint GetSessionID(int iSessionIndex) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamRemotePlay_GetSessionID(CSteamAPIContext.GetSteamRemotePlay(), iSessionIndex);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Get the SteamID of the connected user</para>
|
||||
/// </summary>
|
||||
public static CSteamID GetSessionSteamID(uint unSessionID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (CSteamID)NativeMethods.ISteamRemotePlay_GetSessionSteamID(CSteamAPIContext.GetSteamRemotePlay(), unSessionID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Get the name of the session client device</para>
|
||||
/// <para> This returns NULL if the sessionID is not valid</para>
|
||||
/// </summary>
|
||||
public static string GetSessionClientName(uint unSessionID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamRemotePlay_GetSessionClientName(CSteamAPIContext.GetSteamRemotePlay(), unSessionID));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Get the form factor of the session client device</para>
|
||||
/// </summary>
|
||||
public static ESteamDeviceFormFactor GetSessionClientFormFactor(uint unSessionID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamRemotePlay_GetSessionClientFormFactor(CSteamAPIContext.GetSteamRemotePlay(), unSessionID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Get the resolution, in pixels, of the session client device</para>
|
||||
/// <para> This is set to 0x0 if the resolution is not available</para>
|
||||
/// </summary>
|
||||
public static bool BGetSessionClientResolution(uint unSessionID, out int pnResolutionX, out int pnResolutionY) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamRemotePlay_BGetSessionClientResolution(CSteamAPIContext.GetSteamRemotePlay(), unSessionID, out pnResolutionX, out pnResolutionY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,461 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamRemoteStorage {
|
||||
/// <summary>
|
||||
/// <para> NOTE</para>
|
||||
/// <para> Filenames are case-insensitive, and will be converted to lowercase automatically.</para>
|
||||
/// <para> So "foo.bar" and "Foo.bar" are the same file, and if you write "Foo.bar" then</para>
|
||||
/// <para> iterate the files, the filename returned will be "foo.bar".</para>
|
||||
/// <para> file operations</para>
|
||||
/// </summary>
|
||||
public static bool FileWrite(string pchFile, byte[] pvData, int cubData) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) {
|
||||
return NativeMethods.ISteamRemoteStorage_FileWrite(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2, pvData, cubData);
|
||||
}
|
||||
}
|
||||
|
||||
public static int FileRead(string pchFile, byte[] pvData, int cubDataToRead) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) {
|
||||
return NativeMethods.ISteamRemoteStorage_FileRead(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2, pvData, cubDataToRead);
|
||||
}
|
||||
}
|
||||
|
||||
public static SteamAPICall_t FileWriteAsync(string pchFile, byte[] pvData, uint cubData) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) {
|
||||
return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_FileWriteAsync(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2, pvData, cubData);
|
||||
}
|
||||
}
|
||||
|
||||
public static SteamAPICall_t FileReadAsync(string pchFile, uint nOffset, uint cubToRead) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) {
|
||||
return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_FileReadAsync(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2, nOffset, cubToRead);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool FileReadAsyncComplete(SteamAPICall_t hReadCall, byte[] pvBuffer, uint cubToRead) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamRemoteStorage_FileReadAsyncComplete(CSteamAPIContext.GetSteamRemoteStorage(), hReadCall, pvBuffer, cubToRead);
|
||||
}
|
||||
|
||||
public static bool FileForget(string pchFile) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) {
|
||||
return NativeMethods.ISteamRemoteStorage_FileForget(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool FileDelete(string pchFile) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) {
|
||||
return NativeMethods.ISteamRemoteStorage_FileDelete(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2);
|
||||
}
|
||||
}
|
||||
|
||||
public static SteamAPICall_t FileShare(string pchFile) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) {
|
||||
return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_FileShare(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool SetSyncPlatforms(string pchFile, ERemoteStoragePlatform eRemoteStoragePlatform) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) {
|
||||
return NativeMethods.ISteamRemoteStorage_SetSyncPlatforms(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2, eRemoteStoragePlatform);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> file operations that cause network IO</para>
|
||||
/// </summary>
|
||||
public static UGCFileWriteStreamHandle_t FileWriteStreamOpen(string pchFile) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) {
|
||||
return (UGCFileWriteStreamHandle_t)NativeMethods.ISteamRemoteStorage_FileWriteStreamOpen(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool FileWriteStreamWriteChunk(UGCFileWriteStreamHandle_t writeHandle, byte[] pvData, int cubData) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamRemoteStorage_FileWriteStreamWriteChunk(CSteamAPIContext.GetSteamRemoteStorage(), writeHandle, pvData, cubData);
|
||||
}
|
||||
|
||||
public static bool FileWriteStreamClose(UGCFileWriteStreamHandle_t writeHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamRemoteStorage_FileWriteStreamClose(CSteamAPIContext.GetSteamRemoteStorage(), writeHandle);
|
||||
}
|
||||
|
||||
public static bool FileWriteStreamCancel(UGCFileWriteStreamHandle_t writeHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamRemoteStorage_FileWriteStreamCancel(CSteamAPIContext.GetSteamRemoteStorage(), writeHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> file information</para>
|
||||
/// </summary>
|
||||
public static bool FileExists(string pchFile) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) {
|
||||
return NativeMethods.ISteamRemoteStorage_FileExists(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool FilePersisted(string pchFile) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) {
|
||||
return NativeMethods.ISteamRemoteStorage_FilePersisted(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2);
|
||||
}
|
||||
}
|
||||
|
||||
public static int GetFileSize(string pchFile) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) {
|
||||
return NativeMethods.ISteamRemoteStorage_GetFileSize(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2);
|
||||
}
|
||||
}
|
||||
|
||||
public static long GetFileTimestamp(string pchFile) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) {
|
||||
return NativeMethods.ISteamRemoteStorage_GetFileTimestamp(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2);
|
||||
}
|
||||
}
|
||||
|
||||
public static ERemoteStoragePlatform GetSyncPlatforms(string pchFile) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) {
|
||||
return NativeMethods.ISteamRemoteStorage_GetSyncPlatforms(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> iteration</para>
|
||||
/// </summary>
|
||||
public static int GetFileCount() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamRemoteStorage_GetFileCount(CSteamAPIContext.GetSteamRemoteStorage());
|
||||
}
|
||||
|
||||
public static string GetFileNameAndSize(int iFile, out int pnFileSizeInBytes) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamRemoteStorage_GetFileNameAndSize(CSteamAPIContext.GetSteamRemoteStorage(), iFile, out pnFileSizeInBytes));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> configuration management</para>
|
||||
/// </summary>
|
||||
public static bool GetQuota(out ulong pnTotalBytes, out ulong puAvailableBytes) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamRemoteStorage_GetQuota(CSteamAPIContext.GetSteamRemoteStorage(), out pnTotalBytes, out puAvailableBytes);
|
||||
}
|
||||
|
||||
public static bool IsCloudEnabledForAccount() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamRemoteStorage_IsCloudEnabledForAccount(CSteamAPIContext.GetSteamRemoteStorage());
|
||||
}
|
||||
|
||||
public static bool IsCloudEnabledForApp() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamRemoteStorage_IsCloudEnabledForApp(CSteamAPIContext.GetSteamRemoteStorage());
|
||||
}
|
||||
|
||||
public static void SetCloudEnabledForApp(bool bEnabled) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamRemoteStorage_SetCloudEnabledForApp(CSteamAPIContext.GetSteamRemoteStorage(), bEnabled);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> user generated content</para>
|
||||
/// <para> Downloads a UGC file. A priority value of 0 will download the file immediately,</para>
|
||||
/// <para> otherwise it will wait to download the file until all downloads with a lower priority</para>
|
||||
/// <para> value are completed. Downloads with equal priority will occur simultaneously.</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t UGCDownload(UGCHandle_t hContent, uint unPriority) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_UGCDownload(CSteamAPIContext.GetSteamRemoteStorage(), hContent, unPriority);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Gets the amount of data downloaded so far for a piece of content. pnBytesExpected can be 0 if function returns false</para>
|
||||
/// <para> or if the transfer hasn't started yet, so be careful to check for that before dividing to get a percentage</para>
|
||||
/// </summary>
|
||||
public static bool GetUGCDownloadProgress(UGCHandle_t hContent, out int pnBytesDownloaded, out int pnBytesExpected) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamRemoteStorage_GetUGCDownloadProgress(CSteamAPIContext.GetSteamRemoteStorage(), hContent, out pnBytesDownloaded, out pnBytesExpected);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Gets metadata for a file after it has been downloaded. This is the same metadata given in the RemoteStorageDownloadUGCResult_t call result</para>
|
||||
/// </summary>
|
||||
public static bool GetUGCDetails(UGCHandle_t hContent, out AppId_t pnAppID, out string ppchName, out int pnFileSizeInBytes, out CSteamID pSteamIDOwner) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
IntPtr ppchName2;
|
||||
bool ret = NativeMethods.ISteamRemoteStorage_GetUGCDetails(CSteamAPIContext.GetSteamRemoteStorage(), hContent, out pnAppID, out ppchName2, out pnFileSizeInBytes, out pSteamIDOwner);
|
||||
ppchName = ret ? InteropHelp.PtrToStringUTF8(ppchName2) : null;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> After download, gets the content of the file.</para>
|
||||
/// <para> Small files can be read all at once by calling this function with an offset of 0 and cubDataToRead equal to the size of the file.</para>
|
||||
/// <para> Larger files can be read in chunks to reduce memory usage (since both sides of the IPC client and the game itself must allocate</para>
|
||||
/// <para> enough memory for each chunk). Once the last byte is read, the file is implicitly closed and further calls to UGCRead will fail</para>
|
||||
/// <para> unless UGCDownload is called again.</para>
|
||||
/// <para> For especially large files (anything over 100MB) it is a requirement that the file is read in chunks.</para>
|
||||
/// </summary>
|
||||
public static int UGCRead(UGCHandle_t hContent, byte[] pvData, int cubDataToRead, uint cOffset, EUGCReadAction eAction) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamRemoteStorage_UGCRead(CSteamAPIContext.GetSteamRemoteStorage(), hContent, pvData, cubDataToRead, cOffset, eAction);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Functions to iterate through UGC that has finished downloading but has not yet been read via UGCRead()</para>
|
||||
/// </summary>
|
||||
public static int GetCachedUGCCount() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamRemoteStorage_GetCachedUGCCount(CSteamAPIContext.GetSteamRemoteStorage());
|
||||
}
|
||||
|
||||
public static UGCHandle_t GetCachedUGCHandle(int iCachedContent) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (UGCHandle_t)NativeMethods.ISteamRemoteStorage_GetCachedUGCHandle(CSteamAPIContext.GetSteamRemoteStorage(), iCachedContent);
|
||||
}
|
||||
#if _PS3 || _SERVER
|
||||
/// <summary>
|
||||
/// <para> The following functions are only necessary on the Playstation 3. On PC & Mac, the Steam client will handle these operations for you</para>
|
||||
/// <para> On Playstation 3, the game controls which files are stored in the cloud, via FilePersist, FileFetch, and FileForget.</para>
|
||||
/// <para> Connect to Steam and get a list of files in the Cloud - results in a RemoteStorageAppSyncStatusCheck_t callback</para>
|
||||
/// </summary>
|
||||
public static void GetFileListFromServer() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamRemoteStorage_GetFileListFromServer(CSteamAPIContext.GetSteamRemoteStorage());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Indicate this file should be downloaded in the next sync</para>
|
||||
/// </summary>
|
||||
public static bool FileFetch(string pchFile) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) {
|
||||
return NativeMethods.ISteamRemoteStorage_FileFetch(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Indicate this file should be persisted in the next sync</para>
|
||||
/// </summary>
|
||||
public static bool FilePersist(string pchFile) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) {
|
||||
return NativeMethods.ISteamRemoteStorage_FilePersist(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Pull any requested files down from the Cloud - results in a RemoteStorageAppSyncedClient_t callback</para>
|
||||
/// </summary>
|
||||
public static bool SynchronizeToClient() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamRemoteStorage_SynchronizeToClient(CSteamAPIContext.GetSteamRemoteStorage());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Upload any requested files to the Cloud - results in a RemoteStorageAppSyncedServer_t callback</para>
|
||||
/// </summary>
|
||||
public static bool SynchronizeToServer() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamRemoteStorage_SynchronizeToServer(CSteamAPIContext.GetSteamRemoteStorage());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Reset any fetch/persist/etc requests</para>
|
||||
/// </summary>
|
||||
public static bool ResetFileRequestState() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamRemoteStorage_ResetFileRequestState(CSteamAPIContext.GetSteamRemoteStorage());
|
||||
}
|
||||
#endif
|
||||
/// <summary>
|
||||
/// <para> publishing UGC</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t PublishWorkshopFile(string pchFile, string pchPreviewFile, AppId_t nConsumerAppId, string pchTitle, string pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, System.Collections.Generic.IList<string> pTags, EWorkshopFileType eWorkshopFileType) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile))
|
||||
using (var pchPreviewFile2 = new InteropHelp.UTF8StringHandle(pchPreviewFile))
|
||||
using (var pchTitle2 = new InteropHelp.UTF8StringHandle(pchTitle))
|
||||
using (var pchDescription2 = new InteropHelp.UTF8StringHandle(pchDescription)) {
|
||||
return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_PublishWorkshopFile(CSteamAPIContext.GetSteamRemoteStorage(), pchFile2, pchPreviewFile2, nConsumerAppId, pchTitle2, pchDescription2, eVisibility, new InteropHelp.SteamParamStringArray(pTags), eWorkshopFileType);
|
||||
}
|
||||
}
|
||||
|
||||
public static PublishedFileUpdateHandle_t CreatePublishedFileUpdateRequest(PublishedFileId_t unPublishedFileId) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (PublishedFileUpdateHandle_t)NativeMethods.ISteamRemoteStorage_CreatePublishedFileUpdateRequest(CSteamAPIContext.GetSteamRemoteStorage(), unPublishedFileId);
|
||||
}
|
||||
|
||||
public static bool UpdatePublishedFileFile(PublishedFileUpdateHandle_t updateHandle, string pchFile) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) {
|
||||
return NativeMethods.ISteamRemoteStorage_UpdatePublishedFileFile(CSteamAPIContext.GetSteamRemoteStorage(), updateHandle, pchFile2);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool UpdatePublishedFilePreviewFile(PublishedFileUpdateHandle_t updateHandle, string pchPreviewFile) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchPreviewFile2 = new InteropHelp.UTF8StringHandle(pchPreviewFile)) {
|
||||
return NativeMethods.ISteamRemoteStorage_UpdatePublishedFilePreviewFile(CSteamAPIContext.GetSteamRemoteStorage(), updateHandle, pchPreviewFile2);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool UpdatePublishedFileTitle(PublishedFileUpdateHandle_t updateHandle, string pchTitle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchTitle2 = new InteropHelp.UTF8StringHandle(pchTitle)) {
|
||||
return NativeMethods.ISteamRemoteStorage_UpdatePublishedFileTitle(CSteamAPIContext.GetSteamRemoteStorage(), updateHandle, pchTitle2);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool UpdatePublishedFileDescription(PublishedFileUpdateHandle_t updateHandle, string pchDescription) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchDescription2 = new InteropHelp.UTF8StringHandle(pchDescription)) {
|
||||
return NativeMethods.ISteamRemoteStorage_UpdatePublishedFileDescription(CSteamAPIContext.GetSteamRemoteStorage(), updateHandle, pchDescription2);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool UpdatePublishedFileVisibility(PublishedFileUpdateHandle_t updateHandle, ERemoteStoragePublishedFileVisibility eVisibility) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamRemoteStorage_UpdatePublishedFileVisibility(CSteamAPIContext.GetSteamRemoteStorage(), updateHandle, eVisibility);
|
||||
}
|
||||
|
||||
public static bool UpdatePublishedFileTags(PublishedFileUpdateHandle_t updateHandle, System.Collections.Generic.IList<string> pTags) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamRemoteStorage_UpdatePublishedFileTags(CSteamAPIContext.GetSteamRemoteStorage(), updateHandle, new InteropHelp.SteamParamStringArray(pTags));
|
||||
}
|
||||
|
||||
public static SteamAPICall_t CommitPublishedFileUpdate(PublishedFileUpdateHandle_t updateHandle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_CommitPublishedFileUpdate(CSteamAPIContext.GetSteamRemoteStorage(), updateHandle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Gets published file details for the given publishedfileid. If unMaxSecondsOld is greater than 0,</para>
|
||||
/// <para> cached data may be returned, depending on how long ago it was cached. A value of 0 will force a refresh.</para>
|
||||
/// <para> A value of k_WorkshopForceLoadPublishedFileDetailsFromCache will use cached data if it exists, no matter how old it is.</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t GetPublishedFileDetails(PublishedFileId_t unPublishedFileId, uint unMaxSecondsOld) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_GetPublishedFileDetails(CSteamAPIContext.GetSteamRemoteStorage(), unPublishedFileId, unMaxSecondsOld);
|
||||
}
|
||||
|
||||
public static SteamAPICall_t DeletePublishedFile(PublishedFileId_t unPublishedFileId) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_DeletePublishedFile(CSteamAPIContext.GetSteamRemoteStorage(), unPublishedFileId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> enumerate the files that the current user published with this app</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t EnumerateUserPublishedFiles(uint unStartIndex) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_EnumerateUserPublishedFiles(CSteamAPIContext.GetSteamRemoteStorage(), unStartIndex);
|
||||
}
|
||||
|
||||
public static SteamAPICall_t SubscribePublishedFile(PublishedFileId_t unPublishedFileId) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_SubscribePublishedFile(CSteamAPIContext.GetSteamRemoteStorage(), unPublishedFileId);
|
||||
}
|
||||
|
||||
public static SteamAPICall_t EnumerateUserSubscribedFiles(uint unStartIndex) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_EnumerateUserSubscribedFiles(CSteamAPIContext.GetSteamRemoteStorage(), unStartIndex);
|
||||
}
|
||||
|
||||
public static SteamAPICall_t UnsubscribePublishedFile(PublishedFileId_t unPublishedFileId) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_UnsubscribePublishedFile(CSteamAPIContext.GetSteamRemoteStorage(), unPublishedFileId);
|
||||
}
|
||||
|
||||
public static bool UpdatePublishedFileSetChangeDescription(PublishedFileUpdateHandle_t updateHandle, string pchChangeDescription) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchChangeDescription2 = new InteropHelp.UTF8StringHandle(pchChangeDescription)) {
|
||||
return NativeMethods.ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription(CSteamAPIContext.GetSteamRemoteStorage(), updateHandle, pchChangeDescription2);
|
||||
}
|
||||
}
|
||||
|
||||
public static SteamAPICall_t GetPublishedItemVoteDetails(PublishedFileId_t unPublishedFileId) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_GetPublishedItemVoteDetails(CSteamAPIContext.GetSteamRemoteStorage(), unPublishedFileId);
|
||||
}
|
||||
|
||||
public static SteamAPICall_t UpdateUserPublishedItemVote(PublishedFileId_t unPublishedFileId, bool bVoteUp) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_UpdateUserPublishedItemVote(CSteamAPIContext.GetSteamRemoteStorage(), unPublishedFileId, bVoteUp);
|
||||
}
|
||||
|
||||
public static SteamAPICall_t GetUserPublishedItemVoteDetails(PublishedFileId_t unPublishedFileId) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_GetUserPublishedItemVoteDetails(CSteamAPIContext.GetSteamRemoteStorage(), unPublishedFileId);
|
||||
}
|
||||
|
||||
public static SteamAPICall_t EnumerateUserSharedWorkshopFiles(CSteamID steamId, uint unStartIndex, System.Collections.Generic.IList<string> pRequiredTags, System.Collections.Generic.IList<string> pExcludedTags) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles(CSteamAPIContext.GetSteamRemoteStorage(), steamId, unStartIndex, new InteropHelp.SteamParamStringArray(pRequiredTags), new InteropHelp.SteamParamStringArray(pExcludedTags));
|
||||
}
|
||||
|
||||
public static SteamAPICall_t PublishVideo(EWorkshopVideoProvider eVideoProvider, string pchVideoAccount, string pchVideoIdentifier, string pchPreviewFile, AppId_t nConsumerAppId, string pchTitle, string pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, System.Collections.Generic.IList<string> pTags) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchVideoAccount2 = new InteropHelp.UTF8StringHandle(pchVideoAccount))
|
||||
using (var pchVideoIdentifier2 = new InteropHelp.UTF8StringHandle(pchVideoIdentifier))
|
||||
using (var pchPreviewFile2 = new InteropHelp.UTF8StringHandle(pchPreviewFile))
|
||||
using (var pchTitle2 = new InteropHelp.UTF8StringHandle(pchTitle))
|
||||
using (var pchDescription2 = new InteropHelp.UTF8StringHandle(pchDescription)) {
|
||||
return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_PublishVideo(CSteamAPIContext.GetSteamRemoteStorage(), eVideoProvider, pchVideoAccount2, pchVideoIdentifier2, pchPreviewFile2, nConsumerAppId, pchTitle2, pchDescription2, eVisibility, new InteropHelp.SteamParamStringArray(pTags));
|
||||
}
|
||||
}
|
||||
|
||||
public static SteamAPICall_t SetUserPublishedFileAction(PublishedFileId_t unPublishedFileId, EWorkshopFileAction eAction) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_SetUserPublishedFileAction(CSteamAPIContext.GetSteamRemoteStorage(), unPublishedFileId, eAction);
|
||||
}
|
||||
|
||||
public static SteamAPICall_t EnumeratePublishedFilesByUserAction(EWorkshopFileAction eAction, uint unStartIndex) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_EnumeratePublishedFilesByUserAction(CSteamAPIContext.GetSteamRemoteStorage(), eAction, unStartIndex);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> this method enumerates the public view of workshop files</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t EnumeratePublishedWorkshopFiles(EWorkshopEnumerationType eEnumerationType, uint unStartIndex, uint unCount, uint unDays, System.Collections.Generic.IList<string> pTags, System.Collections.Generic.IList<string> pUserTags) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_EnumeratePublishedWorkshopFiles(CSteamAPIContext.GetSteamRemoteStorage(), eEnumerationType, unStartIndex, unCount, unDays, new InteropHelp.SteamParamStringArray(pTags), new InteropHelp.SteamParamStringArray(pUserTags));
|
||||
}
|
||||
|
||||
public static SteamAPICall_t UGCDownloadToLocation(UGCHandle_t hContent, string pchLocation, uint unPriority) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchLocation2 = new InteropHelp.UTF8StringHandle(pchLocation)) {
|
||||
return (SteamAPICall_t)NativeMethods.ISteamRemoteStorage_UGCDownloadToLocation(CSteamAPIContext.GetSteamRemoteStorage(), hContent, pchLocation2, unPriority);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,111 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamScreenshots {
|
||||
/// <summary>
|
||||
/// <para> Writes a screenshot to the user's screenshot library given the raw image data, which must be in RGB format.</para>
|
||||
/// <para> The return value is a handle that is valid for the duration of the game process and can be used to apply tags.</para>
|
||||
/// </summary>
|
||||
public static ScreenshotHandle WriteScreenshot(byte[] pubRGB, uint cubRGB, int nWidth, int nHeight) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (ScreenshotHandle)NativeMethods.ISteamScreenshots_WriteScreenshot(CSteamAPIContext.GetSteamScreenshots(), pubRGB, cubRGB, nWidth, nHeight);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> 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</para>
|
||||
/// <para> 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.</para>
|
||||
/// <para> The return value is a handle that is valid for the duration of the game process and can be used to apply tags.</para>
|
||||
/// <para> JPEG, TGA, and PNG formats are supported.</para>
|
||||
/// </summary>
|
||||
public static ScreenshotHandle AddScreenshotToLibrary(string pchFilename, string pchThumbnailFilename, int nWidth, int nHeight) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchFilename2 = new InteropHelp.UTF8StringHandle(pchFilename))
|
||||
using (var pchThumbnailFilename2 = new InteropHelp.UTF8StringHandle(pchThumbnailFilename)) {
|
||||
return (ScreenshotHandle)NativeMethods.ISteamScreenshots_AddScreenshotToLibrary(CSteamAPIContext.GetSteamScreenshots(), pchFilename2, pchThumbnailFilename2, nWidth, nHeight);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Causes the Steam overlay to take a screenshot. If screenshots are being hooked by the game then a ScreenshotRequested_t callback is sent back to the game instead.</para>
|
||||
/// </summary>
|
||||
public static void TriggerScreenshot() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamScreenshots_TriggerScreenshot(CSteamAPIContext.GetSteamScreenshots());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Toggles whether the overlay handles screenshots when the user presses the screenshot hotkey, or the game handles them. If the game is hooking screenshots,</para>
|
||||
/// <para> then the ScreenshotRequested_t callback will be sent if the user presses the hotkey, and the game is expected to call WriteScreenshot or AddScreenshotToLibrary</para>
|
||||
/// <para> in response.</para>
|
||||
/// </summary>
|
||||
public static void HookScreenshots(bool bHook) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamScreenshots_HookScreenshots(CSteamAPIContext.GetSteamScreenshots(), bHook);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Sets metadata about a screenshot's location (for example, the name of the map)</para>
|
||||
/// </summary>
|
||||
public static bool SetLocation(ScreenshotHandle hScreenshot, string pchLocation) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchLocation2 = new InteropHelp.UTF8StringHandle(pchLocation)) {
|
||||
return NativeMethods.ISteamScreenshots_SetLocation(CSteamAPIContext.GetSteamScreenshots(), hScreenshot, pchLocation2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Tags a user as being visible in the screenshot</para>
|
||||
/// </summary>
|
||||
public static bool TagUser(ScreenshotHandle hScreenshot, CSteamID steamID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamScreenshots_TagUser(CSteamAPIContext.GetSteamScreenshots(), hScreenshot, steamID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Tags a published file as being visible in the screenshot</para>
|
||||
/// </summary>
|
||||
public static bool TagPublishedFile(ScreenshotHandle hScreenshot, PublishedFileId_t unPublishedFileID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamScreenshots_TagPublishedFile(CSteamAPIContext.GetSteamScreenshots(), hScreenshot, unPublishedFileID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns true if the app has hooked the screenshot</para>
|
||||
/// </summary>
|
||||
public static bool IsScreenshotsHooked() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamScreenshots_IsScreenshotsHooked(CSteamAPIContext.GetSteamScreenshots());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Adds a VR screenshot to the user's screenshot library from disk in the supported type.</para>
|
||||
/// <para> pchFilename should be the normal 2D image used in the library view</para>
|
||||
/// <para> pchVRFilename should contain the image that matches the correct type</para>
|
||||
/// <para> The return value is a handle that is valid for the duration of the game process and can be used to apply tags.</para>
|
||||
/// <para> JPEG, TGA, and PNG formats are supported.</para>
|
||||
/// </summary>
|
||||
public static ScreenshotHandle AddVRScreenshotToLibrary(EVRScreenshotType eType, string pchFilename, string pchVRFilename) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchFilename2 = new InteropHelp.UTF8StringHandle(pchFilename))
|
||||
using (var pchVRFilename2 = new InteropHelp.UTF8StringHandle(pchVRFilename)) {
|
||||
return (ScreenshotHandle)NativeMethods.ISteamScreenshots_AddVRScreenshotToLibrary(CSteamAPIContext.GetSteamScreenshots(), eType, pchFilename2, pchVRFilename2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,637 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamUGC {
|
||||
/// <summary>
|
||||
/// <para> Query UGC associated with a user. Creator app id or consumer app id must be valid and be set to the current running app. unPage should start at 1.</para>
|
||||
/// </summary>
|
||||
public static UGCQueryHandle_t CreateQueryUserUGCRequest(AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint unPage) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (UGCQueryHandle_t)NativeMethods.ISteamUGC_CreateQueryUserUGCRequest(CSteamAPIContext.GetSteamUGC(), unAccountID, eListType, eMatchingUGCType, eSortOrder, nCreatorAppID, nConsumerAppID, unPage);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Query for all matching UGC. Creator app id or consumer app id must be valid and be set to the current running app. unPage should start at 1.</para>
|
||||
/// </summary>
|
||||
public static UGCQueryHandle_t CreateQueryAllUGCRequest(EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint unPage) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (UGCQueryHandle_t)NativeMethods.ISteamUGC_CreateQueryAllUGCRequest(CSteamAPIContext.GetSteamUGC(), eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, unPage);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Query for all matching UGC using the new deep paging interface. Creator app id or consumer app id must be valid and be set to the current running app. pchCursor should be set to NULL or "*" to get the first result set.</para>
|
||||
/// </summary>
|
||||
public static UGCQueryHandle_t CreateQueryAllUGCRequest(EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, string pchCursor = null) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchCursor2 = new InteropHelp.UTF8StringHandle(pchCursor)) {
|
||||
return (UGCQueryHandle_t)NativeMethods.ISteamUGC_CreateQueryAllUGCRequest0(CSteamAPIContext.GetSteamUGC(), eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, pchCursor2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Query for the details of the given published file ids (the RequestUGCDetails call is deprecated and replaced with this)</para>
|
||||
/// </summary>
|
||||
public static UGCQueryHandle_t CreateQueryUGCDetailsRequest(PublishedFileId_t[] pvecPublishedFileID, uint unNumPublishedFileIDs) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (UGCQueryHandle_t)NativeMethods.ISteamUGC_CreateQueryUGCDetailsRequest(CSteamAPIContext.GetSteamUGC(), pvecPublishedFileID, unNumPublishedFileIDs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Send the query to Steam</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t SendQueryUGCRequest(UGCQueryHandle_t handle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_SendQueryUGCRequest(CSteamAPIContext.GetSteamUGC(), handle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Retrieve an individual result after receiving the callback for querying UGC</para>
|
||||
/// </summary>
|
||||
public static bool GetQueryUGCResult(UGCQueryHandle_t handle, uint index, out SteamUGCDetails_t pDetails) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUGC_GetQueryUGCResult(CSteamAPIContext.GetSteamUGC(), handle, index, out pDetails);
|
||||
}
|
||||
|
||||
public static bool GetQueryUGCPreviewURL(UGCQueryHandle_t handle, uint index, out string pchURL, uint cchURLSize) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
IntPtr pchURL2 = Marshal.AllocHGlobal((int)cchURLSize);
|
||||
bool ret = NativeMethods.ISteamUGC_GetQueryUGCPreviewURL(CSteamAPIContext.GetSteamUGC(), handle, index, pchURL2, cchURLSize);
|
||||
pchURL = ret ? InteropHelp.PtrToStringUTF8(pchURL2) : null;
|
||||
Marshal.FreeHGlobal(pchURL2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static bool GetQueryUGCMetadata(UGCQueryHandle_t handle, uint index, out string pchMetadata, uint cchMetadatasize) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
IntPtr pchMetadata2 = Marshal.AllocHGlobal((int)cchMetadatasize);
|
||||
bool ret = NativeMethods.ISteamUGC_GetQueryUGCMetadata(CSteamAPIContext.GetSteamUGC(), handle, index, pchMetadata2, cchMetadatasize);
|
||||
pchMetadata = ret ? InteropHelp.PtrToStringUTF8(pchMetadata2) : null;
|
||||
Marshal.FreeHGlobal(pchMetadata2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static bool GetQueryUGCChildren(UGCQueryHandle_t handle, uint index, PublishedFileId_t[] pvecPublishedFileID, uint cMaxEntries) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUGC_GetQueryUGCChildren(CSteamAPIContext.GetSteamUGC(), handle, index, pvecPublishedFileID, cMaxEntries);
|
||||
}
|
||||
|
||||
public static bool GetQueryUGCStatistic(UGCQueryHandle_t handle, uint index, EItemStatistic eStatType, out ulong pStatValue) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUGC_GetQueryUGCStatistic(CSteamAPIContext.GetSteamUGC(), handle, index, eStatType, out pStatValue);
|
||||
}
|
||||
|
||||
public static uint GetQueryUGCNumAdditionalPreviews(UGCQueryHandle_t handle, uint index) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUGC_GetQueryUGCNumAdditionalPreviews(CSteamAPIContext.GetSteamUGC(), handle, index);
|
||||
}
|
||||
|
||||
public static bool GetQueryUGCAdditionalPreview(UGCQueryHandle_t handle, uint index, uint previewIndex, out string pchURLOrVideoID, uint cchURLSize, out string pchOriginalFileName, uint cchOriginalFileNameSize, out EItemPreviewType pPreviewType) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
IntPtr pchURLOrVideoID2 = Marshal.AllocHGlobal((int)cchURLSize);
|
||||
IntPtr pchOriginalFileName2 = Marshal.AllocHGlobal((int)cchOriginalFileNameSize);
|
||||
bool ret = NativeMethods.ISteamUGC_GetQueryUGCAdditionalPreview(CSteamAPIContext.GetSteamUGC(), handle, index, previewIndex, pchURLOrVideoID2, cchURLSize, pchOriginalFileName2, cchOriginalFileNameSize, out pPreviewType);
|
||||
pchURLOrVideoID = ret ? InteropHelp.PtrToStringUTF8(pchURLOrVideoID2) : null;
|
||||
Marshal.FreeHGlobal(pchURLOrVideoID2);
|
||||
pchOriginalFileName = ret ? InteropHelp.PtrToStringUTF8(pchOriginalFileName2) : null;
|
||||
Marshal.FreeHGlobal(pchOriginalFileName2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static uint GetQueryUGCNumKeyValueTags(UGCQueryHandle_t handle, uint index) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUGC_GetQueryUGCNumKeyValueTags(CSteamAPIContext.GetSteamUGC(), handle, index);
|
||||
}
|
||||
|
||||
public static bool GetQueryUGCKeyValueTag(UGCQueryHandle_t handle, uint index, uint keyValueTagIndex, out string pchKey, uint cchKeySize, out string pchValue, uint cchValueSize) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
IntPtr pchKey2 = Marshal.AllocHGlobal((int)cchKeySize);
|
||||
IntPtr pchValue2 = Marshal.AllocHGlobal((int)cchValueSize);
|
||||
bool ret = NativeMethods.ISteamUGC_GetQueryUGCKeyValueTag(CSteamAPIContext.GetSteamUGC(), handle, index, keyValueTagIndex, pchKey2, cchKeySize, pchValue2, cchValueSize);
|
||||
pchKey = ret ? InteropHelp.PtrToStringUTF8(pchKey2) : null;
|
||||
Marshal.FreeHGlobal(pchKey2);
|
||||
pchValue = ret ? InteropHelp.PtrToStringUTF8(pchValue2) : null;
|
||||
Marshal.FreeHGlobal(pchValue2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Return the first value matching the pchKey. Note that a key may map to multiple values. Returns false if there was an error or no matching value was found.</para>
|
||||
/// </summary>
|
||||
public static bool GetQueryUGCKeyValueTag(UGCQueryHandle_t handle, uint index, string pchKey, out string pchValue, uint cchValueSize) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
IntPtr pchValue2 = Marshal.AllocHGlobal((int)cchValueSize);
|
||||
using (var pchKey2 = new InteropHelp.UTF8StringHandle(pchKey)) {
|
||||
bool ret = NativeMethods.ISteamUGC_GetQueryUGCKeyValueTag0(CSteamAPIContext.GetSteamUGC(), handle, index, pchKey2, pchValue2, cchValueSize);
|
||||
pchValue = ret ? InteropHelp.PtrToStringUTF8(pchValue2) : null;
|
||||
Marshal.FreeHGlobal(pchValue2);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Release the request to free up memory, after retrieving results</para>
|
||||
/// </summary>
|
||||
public static bool ReleaseQueryUGCRequest(UGCQueryHandle_t handle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUGC_ReleaseQueryUGCRequest(CSteamAPIContext.GetSteamUGC(), handle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Options to set for querying UGC</para>
|
||||
/// </summary>
|
||||
public static bool AddRequiredTag(UGCQueryHandle_t handle, string pTagName) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pTagName2 = new InteropHelp.UTF8StringHandle(pTagName)) {
|
||||
return NativeMethods.ISteamUGC_AddRequiredTag(CSteamAPIContext.GetSteamUGC(), handle, pTagName2);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool AddExcludedTag(UGCQueryHandle_t handle, string pTagName) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pTagName2 = new InteropHelp.UTF8StringHandle(pTagName)) {
|
||||
return NativeMethods.ISteamUGC_AddExcludedTag(CSteamAPIContext.GetSteamUGC(), handle, pTagName2);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool SetReturnOnlyIDs(UGCQueryHandle_t handle, bool bReturnOnlyIDs) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUGC_SetReturnOnlyIDs(CSteamAPIContext.GetSteamUGC(), handle, bReturnOnlyIDs);
|
||||
}
|
||||
|
||||
public static bool SetReturnKeyValueTags(UGCQueryHandle_t handle, bool bReturnKeyValueTags) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUGC_SetReturnKeyValueTags(CSteamAPIContext.GetSteamUGC(), handle, bReturnKeyValueTags);
|
||||
}
|
||||
|
||||
public static bool SetReturnLongDescription(UGCQueryHandle_t handle, bool bReturnLongDescription) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUGC_SetReturnLongDescription(CSteamAPIContext.GetSteamUGC(), handle, bReturnLongDescription);
|
||||
}
|
||||
|
||||
public static bool SetReturnMetadata(UGCQueryHandle_t handle, bool bReturnMetadata) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUGC_SetReturnMetadata(CSteamAPIContext.GetSteamUGC(), handle, bReturnMetadata);
|
||||
}
|
||||
|
||||
public static bool SetReturnChildren(UGCQueryHandle_t handle, bool bReturnChildren) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUGC_SetReturnChildren(CSteamAPIContext.GetSteamUGC(), handle, bReturnChildren);
|
||||
}
|
||||
|
||||
public static bool SetReturnAdditionalPreviews(UGCQueryHandle_t handle, bool bReturnAdditionalPreviews) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUGC_SetReturnAdditionalPreviews(CSteamAPIContext.GetSteamUGC(), handle, bReturnAdditionalPreviews);
|
||||
}
|
||||
|
||||
public static bool SetReturnTotalOnly(UGCQueryHandle_t handle, bool bReturnTotalOnly) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUGC_SetReturnTotalOnly(CSteamAPIContext.GetSteamUGC(), handle, bReturnTotalOnly);
|
||||
}
|
||||
|
||||
public static bool SetReturnPlaytimeStats(UGCQueryHandle_t handle, uint unDays) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUGC_SetReturnPlaytimeStats(CSteamAPIContext.GetSteamUGC(), handle, unDays);
|
||||
}
|
||||
|
||||
public static bool SetLanguage(UGCQueryHandle_t handle, string pchLanguage) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchLanguage2 = new InteropHelp.UTF8StringHandle(pchLanguage)) {
|
||||
return NativeMethods.ISteamUGC_SetLanguage(CSteamAPIContext.GetSteamUGC(), handle, pchLanguage2);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool SetAllowCachedResponse(UGCQueryHandle_t handle, uint unMaxAgeSeconds) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUGC_SetAllowCachedResponse(CSteamAPIContext.GetSteamUGC(), handle, unMaxAgeSeconds);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Options only for querying user UGC</para>
|
||||
/// </summary>
|
||||
public static bool SetCloudFileNameFilter(UGCQueryHandle_t handle, string pMatchCloudFileName) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pMatchCloudFileName2 = new InteropHelp.UTF8StringHandle(pMatchCloudFileName)) {
|
||||
return NativeMethods.ISteamUGC_SetCloudFileNameFilter(CSteamAPIContext.GetSteamUGC(), handle, pMatchCloudFileName2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Options only for querying all UGC</para>
|
||||
/// </summary>
|
||||
public static bool SetMatchAnyTag(UGCQueryHandle_t handle, bool bMatchAnyTag) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUGC_SetMatchAnyTag(CSteamAPIContext.GetSteamUGC(), handle, bMatchAnyTag);
|
||||
}
|
||||
|
||||
public static bool SetSearchText(UGCQueryHandle_t handle, string pSearchText) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pSearchText2 = new InteropHelp.UTF8StringHandle(pSearchText)) {
|
||||
return NativeMethods.ISteamUGC_SetSearchText(CSteamAPIContext.GetSteamUGC(), handle, pSearchText2);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool SetRankedByTrendDays(UGCQueryHandle_t handle, uint unDays) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUGC_SetRankedByTrendDays(CSteamAPIContext.GetSteamUGC(), handle, unDays);
|
||||
}
|
||||
|
||||
public static bool AddRequiredKeyValueTag(UGCQueryHandle_t handle, string pKey, string pValue) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pKey2 = new InteropHelp.UTF8StringHandle(pKey))
|
||||
using (var pValue2 = new InteropHelp.UTF8StringHandle(pValue)) {
|
||||
return NativeMethods.ISteamUGC_AddRequiredKeyValueTag(CSteamAPIContext.GetSteamUGC(), handle, pKey2, pValue2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> DEPRECATED - Use CreateQueryUGCDetailsRequest call above instead!</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t RequestUGCDetails(PublishedFileId_t nPublishedFileID, uint unMaxAgeSeconds) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_RequestUGCDetails(CSteamAPIContext.GetSteamUGC(), nPublishedFileID, unMaxAgeSeconds);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Steam Workshop Creator API</para>
|
||||
/// <para> create new item for this app with no content attached yet</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t CreateItem(AppId_t nConsumerAppId, EWorkshopFileType eFileType) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_CreateItem(CSteamAPIContext.GetSteamUGC(), nConsumerAppId, eFileType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> start an UGC item update. Set changed properties before commiting update with CommitItemUpdate()</para>
|
||||
/// </summary>
|
||||
public static UGCUpdateHandle_t StartItemUpdate(AppId_t nConsumerAppId, PublishedFileId_t nPublishedFileID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (UGCUpdateHandle_t)NativeMethods.ISteamUGC_StartItemUpdate(CSteamAPIContext.GetSteamUGC(), nConsumerAppId, nPublishedFileID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> change the title of an UGC item</para>
|
||||
/// </summary>
|
||||
public static bool SetItemTitle(UGCUpdateHandle_t handle, string pchTitle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchTitle2 = new InteropHelp.UTF8StringHandle(pchTitle)) {
|
||||
return NativeMethods.ISteamUGC_SetItemTitle(CSteamAPIContext.GetSteamUGC(), handle, pchTitle2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> change the description of an UGC item</para>
|
||||
/// </summary>
|
||||
public static bool SetItemDescription(UGCUpdateHandle_t handle, string pchDescription) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchDescription2 = new InteropHelp.UTF8StringHandle(pchDescription)) {
|
||||
return NativeMethods.ISteamUGC_SetItemDescription(CSteamAPIContext.GetSteamUGC(), handle, pchDescription2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> specify the language of the title or description that will be set</para>
|
||||
/// </summary>
|
||||
public static bool SetItemUpdateLanguage(UGCUpdateHandle_t handle, string pchLanguage) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchLanguage2 = new InteropHelp.UTF8StringHandle(pchLanguage)) {
|
||||
return NativeMethods.ISteamUGC_SetItemUpdateLanguage(CSteamAPIContext.GetSteamUGC(), handle, pchLanguage2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> change the metadata of an UGC item (max = k_cchDeveloperMetadataMax)</para>
|
||||
/// </summary>
|
||||
public static bool SetItemMetadata(UGCUpdateHandle_t handle, string pchMetaData) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchMetaData2 = new InteropHelp.UTF8StringHandle(pchMetaData)) {
|
||||
return NativeMethods.ISteamUGC_SetItemMetadata(CSteamAPIContext.GetSteamUGC(), handle, pchMetaData2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> change the visibility of an UGC item</para>
|
||||
/// </summary>
|
||||
public static bool SetItemVisibility(UGCUpdateHandle_t handle, ERemoteStoragePublishedFileVisibility eVisibility) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUGC_SetItemVisibility(CSteamAPIContext.GetSteamUGC(), handle, eVisibility);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> change the tags of an UGC item</para>
|
||||
/// </summary>
|
||||
public static bool SetItemTags(UGCUpdateHandle_t updateHandle, System.Collections.Generic.IList<string> pTags) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUGC_SetItemTags(CSteamAPIContext.GetSteamUGC(), updateHandle, new InteropHelp.SteamParamStringArray(pTags));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> update item content from this local folder</para>
|
||||
/// </summary>
|
||||
public static bool SetItemContent(UGCUpdateHandle_t handle, string pszContentFolder) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pszContentFolder2 = new InteropHelp.UTF8StringHandle(pszContentFolder)) {
|
||||
return NativeMethods.ISteamUGC_SetItemContent(CSteamAPIContext.GetSteamUGC(), handle, pszContentFolder2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> change preview image file for this item. pszPreviewFile points to local image file, which must be under 1MB in size</para>
|
||||
/// </summary>
|
||||
public static bool SetItemPreview(UGCUpdateHandle_t handle, string pszPreviewFile) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pszPreviewFile2 = new InteropHelp.UTF8StringHandle(pszPreviewFile)) {
|
||||
return NativeMethods.ISteamUGC_SetItemPreview(CSteamAPIContext.GetSteamUGC(), handle, pszPreviewFile2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> use legacy upload for a single small file. The parameter to SetItemContent() should either be a directory with one file or the full path to the file. The file must also be less than 10MB in size.</para>
|
||||
/// </summary>
|
||||
public static bool SetAllowLegacyUpload(UGCUpdateHandle_t handle, bool bAllowLegacyUpload) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUGC_SetAllowLegacyUpload(CSteamAPIContext.GetSteamUGC(), handle, bAllowLegacyUpload);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> remove all existing key-value tags (you can add new ones via the AddItemKeyValueTag function)</para>
|
||||
/// </summary>
|
||||
public static bool RemoveAllItemKeyValueTags(UGCUpdateHandle_t handle) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUGC_RemoveAllItemKeyValueTags(CSteamAPIContext.GetSteamUGC(), handle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> remove any existing key-value tags with the specified key</para>
|
||||
/// </summary>
|
||||
public static bool RemoveItemKeyValueTags(UGCUpdateHandle_t handle, string pchKey) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchKey2 = new InteropHelp.UTF8StringHandle(pchKey)) {
|
||||
return NativeMethods.ISteamUGC_RemoveItemKeyValueTags(CSteamAPIContext.GetSteamUGC(), handle, pchKey2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> add new key-value tags for the item. Note that there can be multiple values for a tag.</para>
|
||||
/// </summary>
|
||||
public static bool AddItemKeyValueTag(UGCUpdateHandle_t handle, string pchKey, string pchValue) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchKey2 = new InteropHelp.UTF8StringHandle(pchKey))
|
||||
using (var pchValue2 = new InteropHelp.UTF8StringHandle(pchValue)) {
|
||||
return NativeMethods.ISteamUGC_AddItemKeyValueTag(CSteamAPIContext.GetSteamUGC(), handle, pchKey2, pchValue2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> add preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size</para>
|
||||
/// </summary>
|
||||
public static bool AddItemPreviewFile(UGCUpdateHandle_t handle, string pszPreviewFile, EItemPreviewType type) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pszPreviewFile2 = new InteropHelp.UTF8StringHandle(pszPreviewFile)) {
|
||||
return NativeMethods.ISteamUGC_AddItemPreviewFile(CSteamAPIContext.GetSteamUGC(), handle, pszPreviewFile2, type);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> add preview video for this item</para>
|
||||
/// </summary>
|
||||
public static bool AddItemPreviewVideo(UGCUpdateHandle_t handle, string pszVideoID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pszVideoID2 = new InteropHelp.UTF8StringHandle(pszVideoID)) {
|
||||
return NativeMethods.ISteamUGC_AddItemPreviewVideo(CSteamAPIContext.GetSteamUGC(), handle, pszVideoID2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> updates an existing preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size</para>
|
||||
/// </summary>
|
||||
public static bool UpdateItemPreviewFile(UGCUpdateHandle_t handle, uint index, string pszPreviewFile) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pszPreviewFile2 = new InteropHelp.UTF8StringHandle(pszPreviewFile)) {
|
||||
return NativeMethods.ISteamUGC_UpdateItemPreviewFile(CSteamAPIContext.GetSteamUGC(), handle, index, pszPreviewFile2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> updates an existing preview video for this item</para>
|
||||
/// </summary>
|
||||
public static bool UpdateItemPreviewVideo(UGCUpdateHandle_t handle, uint index, string pszVideoID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pszVideoID2 = new InteropHelp.UTF8StringHandle(pszVideoID)) {
|
||||
return NativeMethods.ISteamUGC_UpdateItemPreviewVideo(CSteamAPIContext.GetSteamUGC(), handle, index, pszVideoID2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> remove a preview by index starting at 0 (previews are sorted)</para>
|
||||
/// </summary>
|
||||
public static bool RemoveItemPreview(UGCUpdateHandle_t handle, uint index) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUGC_RemoveItemPreview(CSteamAPIContext.GetSteamUGC(), handle, index);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> commit update process started with StartItemUpdate()</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t SubmitItemUpdate(UGCUpdateHandle_t handle, string pchChangeNote) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchChangeNote2 = new InteropHelp.UTF8StringHandle(pchChangeNote)) {
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_SubmitItemUpdate(CSteamAPIContext.GetSteamUGC(), handle, pchChangeNote2);
|
||||
}
|
||||
}
|
||||
|
||||
public static EItemUpdateStatus GetItemUpdateProgress(UGCUpdateHandle_t handle, out ulong punBytesProcessed, out ulong punBytesTotal) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUGC_GetItemUpdateProgress(CSteamAPIContext.GetSteamUGC(), handle, out punBytesProcessed, out punBytesTotal);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Steam Workshop Consumer API</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t SetUserItemVote(PublishedFileId_t nPublishedFileID, bool bVoteUp) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_SetUserItemVote(CSteamAPIContext.GetSteamUGC(), nPublishedFileID, bVoteUp);
|
||||
}
|
||||
|
||||
public static SteamAPICall_t GetUserItemVote(PublishedFileId_t nPublishedFileID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_GetUserItemVote(CSteamAPIContext.GetSteamUGC(), nPublishedFileID);
|
||||
}
|
||||
|
||||
public static SteamAPICall_t AddItemToFavorites(AppId_t nAppId, PublishedFileId_t nPublishedFileID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_AddItemToFavorites(CSteamAPIContext.GetSteamUGC(), nAppId, nPublishedFileID);
|
||||
}
|
||||
|
||||
public static SteamAPICall_t RemoveItemFromFavorites(AppId_t nAppId, PublishedFileId_t nPublishedFileID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_RemoveItemFromFavorites(CSteamAPIContext.GetSteamUGC(), nAppId, nPublishedFileID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> subscribe to this item, will be installed ASAP</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t SubscribeItem(PublishedFileId_t nPublishedFileID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_SubscribeItem(CSteamAPIContext.GetSteamUGC(), nPublishedFileID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> unsubscribe from this item, will be uninstalled after game quits</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t UnsubscribeItem(PublishedFileId_t nPublishedFileID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_UnsubscribeItem(CSteamAPIContext.GetSteamUGC(), nPublishedFileID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> number of subscribed items</para>
|
||||
/// </summary>
|
||||
public static uint GetNumSubscribedItems() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUGC_GetNumSubscribedItems(CSteamAPIContext.GetSteamUGC());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> all subscribed item PublishFileIDs</para>
|
||||
/// </summary>
|
||||
public static uint GetSubscribedItems(PublishedFileId_t[] pvecPublishedFileID, uint cMaxEntries) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUGC_GetSubscribedItems(CSteamAPIContext.GetSteamUGC(), pvecPublishedFileID, cMaxEntries);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> get EItemState flags about item on this client</para>
|
||||
/// </summary>
|
||||
public static uint GetItemState(PublishedFileId_t nPublishedFileID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUGC_GetItemState(CSteamAPIContext.GetSteamUGC(), nPublishedFileID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> get info about currently installed content on disc for items that have k_EItemStateInstalled set</para>
|
||||
/// <para> if k_EItemStateLegacyItem is set, pchFolder contains the path to the legacy file itself (not a folder)</para>
|
||||
/// </summary>
|
||||
public static bool GetItemInstallInfo(PublishedFileId_t nPublishedFileID, out ulong punSizeOnDisk, out string pchFolder, uint cchFolderSize, out uint punTimeStamp) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
IntPtr pchFolder2 = Marshal.AllocHGlobal((int)cchFolderSize);
|
||||
bool ret = NativeMethods.ISteamUGC_GetItemInstallInfo(CSteamAPIContext.GetSteamUGC(), nPublishedFileID, out punSizeOnDisk, pchFolder2, cchFolderSize, out punTimeStamp);
|
||||
pchFolder = ret ? InteropHelp.PtrToStringUTF8(pchFolder2) : null;
|
||||
Marshal.FreeHGlobal(pchFolder2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> get info about pending update for items that have k_EItemStateNeedsUpdate set. punBytesTotal will be valid after download started once</para>
|
||||
/// </summary>
|
||||
public static bool GetItemDownloadInfo(PublishedFileId_t nPublishedFileID, out ulong punBytesDownloaded, out ulong punBytesTotal) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUGC_GetItemDownloadInfo(CSteamAPIContext.GetSteamUGC(), nPublishedFileID, out punBytesDownloaded, out punBytesTotal);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> download new or update already installed item. If function returns true, wait for DownloadItemResult_t. If the item is already installed,</para>
|
||||
/// <para> then files on disk should not be used until callback received. If item is not subscribed to, it will be cached for some time.</para>
|
||||
/// <para> If bHighPriority is set, any other item download will be suspended and this item downloaded ASAP.</para>
|
||||
/// </summary>
|
||||
public static bool DownloadItem(PublishedFileId_t nPublishedFileID, bool bHighPriority) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUGC_DownloadItem(CSteamAPIContext.GetSteamUGC(), nPublishedFileID, bHighPriority);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> game servers can set a specific workshop folder before issuing any UGC commands.</para>
|
||||
/// <para> This is helpful if you want to support multiple game servers running out of the same install folder</para>
|
||||
/// </summary>
|
||||
public static bool BInitWorkshopForGameServer(DepotId_t unWorkshopDepotID, string pszFolder) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pszFolder2 = new InteropHelp.UTF8StringHandle(pszFolder)) {
|
||||
return NativeMethods.ISteamUGC_BInitWorkshopForGameServer(CSteamAPIContext.GetSteamUGC(), unWorkshopDepotID, pszFolder2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> SuspendDownloads( true ) will suspend all workshop downloads until SuspendDownloads( false ) is called or the game ends</para>
|
||||
/// </summary>
|
||||
public static void SuspendDownloads(bool bSuspend) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamUGC_SuspendDownloads(CSteamAPIContext.GetSteamUGC(), bSuspend);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> usage tracking</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t StartPlaytimeTracking(PublishedFileId_t[] pvecPublishedFileID, uint unNumPublishedFileIDs) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_StartPlaytimeTracking(CSteamAPIContext.GetSteamUGC(), pvecPublishedFileID, unNumPublishedFileIDs);
|
||||
}
|
||||
|
||||
public static SteamAPICall_t StopPlaytimeTracking(PublishedFileId_t[] pvecPublishedFileID, uint unNumPublishedFileIDs) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_StopPlaytimeTracking(CSteamAPIContext.GetSteamUGC(), pvecPublishedFileID, unNumPublishedFileIDs);
|
||||
}
|
||||
|
||||
public static SteamAPICall_t StopPlaytimeTrackingForAllItems() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_StopPlaytimeTrackingForAllItems(CSteamAPIContext.GetSteamUGC());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> parent-child relationship or dependency management</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t AddDependency(PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_AddDependency(CSteamAPIContext.GetSteamUGC(), nParentPublishedFileID, nChildPublishedFileID);
|
||||
}
|
||||
|
||||
public static SteamAPICall_t RemoveDependency(PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_RemoveDependency(CSteamAPIContext.GetSteamUGC(), nParentPublishedFileID, nChildPublishedFileID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> add/remove app dependence/requirements (usually DLC)</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t AddAppDependency(PublishedFileId_t nPublishedFileID, AppId_t nAppID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_AddAppDependency(CSteamAPIContext.GetSteamUGC(), nPublishedFileID, nAppID);
|
||||
}
|
||||
|
||||
public static SteamAPICall_t RemoveAppDependency(PublishedFileId_t nPublishedFileID, AppId_t nAppID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_RemoveAppDependency(CSteamAPIContext.GetSteamUGC(), nPublishedFileID, nAppID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> request app dependencies. note that whatever callback you register for GetAppDependenciesResult_t may be called multiple times</para>
|
||||
/// <para> until all app dependencies have been returned</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t GetAppDependencies(PublishedFileId_t nPublishedFileID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_GetAppDependencies(CSteamAPIContext.GetSteamUGC(), nPublishedFileID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> delete the item without prompting the user</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t DeleteItem(PublishedFileId_t nPublishedFileID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUGC_DeleteItem(CSteamAPIContext.GetSteamUGC(), nPublishedFileID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,20 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
|
||||
// This file is no longer needed. Valve has removed the functionality.
|
||||
// We continue to generate this file to provide a small amount of backwards compatability.
|
||||
@@ -0,0 +1,346 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamUser {
|
||||
/// <summary>
|
||||
/// <para> returns the HSteamUser this interface represents</para>
|
||||
/// <para> this is only used internally by the API, and by a few select interfaces that support multi-user</para>
|
||||
/// </summary>
|
||||
public static HSteamUser GetHSteamUser() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (HSteamUser)NativeMethods.ISteamUser_GetHSteamUser(CSteamAPIContext.GetSteamUser());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns true if the Steam client current has a live connection to the Steam servers.</para>
|
||||
/// <para> If false, it means there is no active connection due to either a networking issue on the local machine, or the Steam server is down/busy.</para>
|
||||
/// <para> The Steam client will automatically be trying to recreate the connection as often as possible.</para>
|
||||
/// </summary>
|
||||
public static bool BLoggedOn() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUser_BLoggedOn(CSteamAPIContext.GetSteamUser());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the CSteamID of the account currently logged into the Steam client</para>
|
||||
/// <para> a CSteamID is a unique identifier for an account, and used to differentiate users in all parts of the Steamworks API</para>
|
||||
/// </summary>
|
||||
public static CSteamID GetSteamID() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (CSteamID)NativeMethods.ISteamUser_GetSteamID(CSteamAPIContext.GetSteamUser());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Multiplayer Authentication functions</para>
|
||||
/// <para> InitiateGameConnection() starts the state machine for authenticating the game client with the game server</para>
|
||||
/// <para> It is the client portion of a three-way handshake between the client, the game server, and the steam servers</para>
|
||||
/// <para> Parameters:</para>
|
||||
/// <para> void *pAuthBlob - a pointer to empty memory that will be filled in with the authentication token.</para>
|
||||
/// <para> int cbMaxAuthBlob - the number of bytes of allocated memory in pBlob. Should be at least 2048 bytes.</para>
|
||||
/// <para> CSteamID steamIDGameServer - the steamID of the game server, received from the game server by the client</para>
|
||||
/// <para> CGameID gameID - the ID of the current game. For games without mods, this is just CGameID( <appID> )</para>
|
||||
/// <para> uint32 unIPServer, uint16 usPortServer - the IP address of the game server</para>
|
||||
/// <para> bool bSecure - whether or not the client thinks that the game server is reporting itself as secure (i.e. VAC is running)</para>
|
||||
/// <para> return value - returns the number of bytes written to pBlob. If the return is 0, then the buffer passed in was too small, and the call has failed</para>
|
||||
/// <para> The contents of pBlob should then be sent to the game server, for it to use to complete the authentication process.</para>
|
||||
/// </summary>
|
||||
public static int InitiateGameConnection(byte[] pAuthBlob, int cbMaxAuthBlob, CSteamID steamIDGameServer, uint unIPServer, ushort usPortServer, bool bSecure) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUser_InitiateGameConnection(CSteamAPIContext.GetSteamUser(), pAuthBlob, cbMaxAuthBlob, steamIDGameServer, unIPServer, usPortServer, bSecure);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> notify of disconnect</para>
|
||||
/// <para> needs to occur when the game client leaves the specified game server, needs to match with the InitiateGameConnection() call</para>
|
||||
/// </summary>
|
||||
public static void TerminateGameConnection(uint unIPServer, ushort usPortServer) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamUser_TerminateGameConnection(CSteamAPIContext.GetSteamUser(), unIPServer, usPortServer);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Legacy functions</para>
|
||||
/// <para> used by only a few games to track usage events</para>
|
||||
/// </summary>
|
||||
public static void TrackAppUsageEvent(CGameID gameID, int eAppUsageEvent, string pchExtraInfo = "") {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchExtraInfo2 = new InteropHelp.UTF8StringHandle(pchExtraInfo)) {
|
||||
NativeMethods.ISteamUser_TrackAppUsageEvent(CSteamAPIContext.GetSteamUser(), gameID, eAppUsageEvent, pchExtraInfo2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> get the local storage folder for current Steam account to write application data, e.g. save games, configs etc.</para>
|
||||
/// <para> this will usually be something like "C:\Progam Files\Steam\userdata\<SteamID>\<AppID>\local"</para>
|
||||
/// </summary>
|
||||
public static bool GetUserDataFolder(out string pchBuffer, int cubBuffer) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
IntPtr pchBuffer2 = Marshal.AllocHGlobal(cubBuffer);
|
||||
bool ret = NativeMethods.ISteamUser_GetUserDataFolder(CSteamAPIContext.GetSteamUser(), pchBuffer2, cubBuffer);
|
||||
pchBuffer = ret ? InteropHelp.PtrToStringUTF8(pchBuffer2) : null;
|
||||
Marshal.FreeHGlobal(pchBuffer2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Starts voice recording. Once started, use GetVoice() to get the data</para>
|
||||
/// </summary>
|
||||
public static void StartVoiceRecording() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamUser_StartVoiceRecording(CSteamAPIContext.GetSteamUser());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Stops voice recording. Because people often release push-to-talk keys early, the system will keep recording for</para>
|
||||
/// <para> a little bit after this function is called. GetVoice() should continue to be called until it returns</para>
|
||||
/// <para> k_eVoiceResultNotRecording</para>
|
||||
/// </summary>
|
||||
public static void StopVoiceRecording() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamUser_StopVoiceRecording(CSteamAPIContext.GetSteamUser());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Determine the size of captured audio data that is available from GetVoice.</para>
|
||||
/// <para> Most applications will only use compressed data and should ignore the other</para>
|
||||
/// <para> parameters, which exist primarily for backwards compatibility. See comments</para>
|
||||
/// <para> below for further explanation of "uncompressed" data.</para>
|
||||
/// </summary>
|
||||
public static EVoiceResult GetAvailableVoice(out uint pcbCompressed) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUser_GetAvailableVoice(CSteamAPIContext.GetSteamUser(), out pcbCompressed, IntPtr.Zero, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> ---------------------------------------------------------------------------</para>
|
||||
/// <para> NOTE: "uncompressed" audio is a deprecated feature and should not be used</para>
|
||||
/// <para> by most applications. It is raw single-channel 16-bit PCM wave data which</para>
|
||||
/// <para> may have been run through preprocessing filters and/or had silence removed,</para>
|
||||
/// <para> so the uncompressed audio could have a shorter duration than you expect.</para>
|
||||
/// <para> There may be no data at all during long periods of silence. Also, fetching</para>
|
||||
/// <para> uncompressed audio will cause GetVoice to discard any leftover compressed</para>
|
||||
/// <para> audio, so you must fetch both types at once. Finally, GetAvailableVoice is</para>
|
||||
/// <para> not precisely accurate when the uncompressed size is requested. So if you</para>
|
||||
/// <para> really need to use uncompressed audio, you should call GetVoice frequently</para>
|
||||
/// <para> with two very large (20kb+) output buffers instead of trying to allocate</para>
|
||||
/// <para> perfectly-sized buffers. But most applications should ignore all of these</para>
|
||||
/// <para> details and simply leave the "uncompressed" parameters as NULL/zero.</para>
|
||||
/// <para> ---------------------------------------------------------------------------</para>
|
||||
/// <para> Read captured audio data from the microphone buffer. This should be called</para>
|
||||
/// <para> at least once per frame, and preferably every few milliseconds, to keep the</para>
|
||||
/// <para> microphone input delay as low as possible. Most applications will only use</para>
|
||||
/// <para> compressed data and should pass NULL/zero for the "uncompressed" parameters.</para>
|
||||
/// <para> Compressed data can be transmitted by your application and decoded into raw</para>
|
||||
/// <para> using the DecompressVoice function below.</para>
|
||||
/// </summary>
|
||||
public static EVoiceResult GetVoice(bool bWantCompressed, byte[] pDestBuffer, uint cbDestBufferSize, out uint nBytesWritten) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUser_GetVoice(CSteamAPIContext.GetSteamUser(), bWantCompressed, pDestBuffer, cbDestBufferSize, out nBytesWritten, false, IntPtr.Zero, 0, IntPtr.Zero, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Decodes the compressed voice data returned by GetVoice. The output data is</para>
|
||||
/// <para> raw single-channel 16-bit PCM audio. The decoder supports any sample rate</para>
|
||||
/// <para> from 11025 to 48000; see GetVoiceOptimalSampleRate() below for details.</para>
|
||||
/// <para> If the output buffer is not large enough, then *nBytesWritten will be set</para>
|
||||
/// <para> to the required buffer size, and k_EVoiceResultBufferTooSmall is returned.</para>
|
||||
/// <para> It is suggested to start with a 20kb buffer and reallocate as necessary.</para>
|
||||
/// </summary>
|
||||
public static EVoiceResult DecompressVoice(byte[] pCompressed, uint cbCompressed, byte[] pDestBuffer, uint cbDestBufferSize, out uint nBytesWritten, uint nDesiredSampleRate) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUser_DecompressVoice(CSteamAPIContext.GetSteamUser(), pCompressed, cbCompressed, pDestBuffer, cbDestBufferSize, out nBytesWritten, nDesiredSampleRate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> This returns the native sample rate of the Steam voice decompressor; using</para>
|
||||
/// <para> this sample rate for DecompressVoice will perform the least CPU processing.</para>
|
||||
/// <para> However, the final audio quality will depend on how well the audio device</para>
|
||||
/// <para> (and/or your application's audio output SDK) deals with lower sample rates.</para>
|
||||
/// <para> You may find that you get the best audio output quality when you ignore</para>
|
||||
/// <para> this function and use the native sample rate of your audio output device,</para>
|
||||
/// <para> which is usually 48000 or 44100.</para>
|
||||
/// </summary>
|
||||
public static uint GetVoiceOptimalSampleRate() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUser_GetVoiceOptimalSampleRate(CSteamAPIContext.GetSteamUser());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Retrieve ticket to be sent to the entity who wishes to authenticate you.</para>
|
||||
/// <para> pcbTicket retrieves the length of the actual ticket.</para>
|
||||
/// </summary>
|
||||
public static HAuthTicket GetAuthSessionTicket(byte[] pTicket, int cbMaxTicket, out uint pcbTicket) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (HAuthTicket)NativeMethods.ISteamUser_GetAuthSessionTicket(CSteamAPIContext.GetSteamUser(), pTicket, cbMaxTicket, out pcbTicket);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Authenticate ticket from entity steamID to be sure it is valid and isnt reused</para>
|
||||
/// <para> Registers for callbacks if the entity goes offline or cancels the ticket ( see ValidateAuthTicketResponse_t callback and EAuthSessionResponse )</para>
|
||||
/// </summary>
|
||||
public static EBeginAuthSessionResult BeginAuthSession(byte[] pAuthTicket, int cbAuthTicket, CSteamID steamID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUser_BeginAuthSession(CSteamAPIContext.GetSteamUser(), pAuthTicket, cbAuthTicket, steamID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Stop tracking started by BeginAuthSession - called when no longer playing game with this entity</para>
|
||||
/// </summary>
|
||||
public static void EndAuthSession(CSteamID steamID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamUser_EndAuthSession(CSteamAPIContext.GetSteamUser(), steamID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Cancel auth ticket from GetAuthSessionTicket, called when no longer playing game with the entity you gave the ticket to</para>
|
||||
/// </summary>
|
||||
public static void CancelAuthTicket(HAuthTicket hAuthTicket) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamUser_CancelAuthTicket(CSteamAPIContext.GetSteamUser(), hAuthTicket);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> After receiving a user's authentication data, and passing it to BeginAuthSession, use this function</para>
|
||||
/// <para> to determine if the user owns downloadable content specified by the provided AppID.</para>
|
||||
/// </summary>
|
||||
public static EUserHasLicenseForAppResult UserHasLicenseForApp(CSteamID steamID, AppId_t appID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUser_UserHasLicenseForApp(CSteamAPIContext.GetSteamUser(), steamID, appID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns true if this users looks like they are behind a NAT device. Only valid once the user has connected to steam</para>
|
||||
/// <para> (i.e a SteamServersConnected_t has been issued) and may not catch all forms of NAT.</para>
|
||||
/// </summary>
|
||||
public static bool BIsBehindNAT() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUser_BIsBehindNAT(CSteamAPIContext.GetSteamUser());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> set data to be replicated to friends so that they can join your game</para>
|
||||
/// <para> CSteamID steamIDGameServer - the steamID of the game server, received from the game server by the client</para>
|
||||
/// <para> uint32 unIPServer, uint16 usPortServer - the IP address of the game server</para>
|
||||
/// </summary>
|
||||
public static void AdvertiseGame(CSteamID steamIDGameServer, uint unIPServer, ushort usPortServer) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamUser_AdvertiseGame(CSteamAPIContext.GetSteamUser(), steamIDGameServer, unIPServer, usPortServer);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Requests a ticket encrypted with an app specific shared key</para>
|
||||
/// <para> pDataToInclude, cbDataToInclude will be encrypted into the ticket</para>
|
||||
/// <para> ( This is asynchronous, you must wait for the ticket to be completed by the server )</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t RequestEncryptedAppTicket(byte[] pDataToInclude, int cbDataToInclude) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUser_RequestEncryptedAppTicket(CSteamAPIContext.GetSteamUser(), pDataToInclude, cbDataToInclude);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> retrieve a finished ticket</para>
|
||||
/// </summary>
|
||||
public static bool GetEncryptedAppTicket(byte[] pTicket, int cbMaxTicket, out uint pcbTicket) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUser_GetEncryptedAppTicket(CSteamAPIContext.GetSteamUser(), pTicket, cbMaxTicket, out pcbTicket);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Trading Card badges data access</para>
|
||||
/// <para> if you only have one set of cards, the series will be 1</para>
|
||||
/// <para> the user has can have two different badges for a series; the regular (max level 5) and the foil (max level 1)</para>
|
||||
/// </summary>
|
||||
public static int GetGameBadgeLevel(int nSeries, bool bFoil) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUser_GetGameBadgeLevel(CSteamAPIContext.GetSteamUser(), nSeries, bFoil);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> gets the Steam Level of the user, as shown on their profile</para>
|
||||
/// </summary>
|
||||
public static int GetPlayerSteamLevel() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUser_GetPlayerSteamLevel(CSteamAPIContext.GetSteamUser());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Requests a URL which authenticates an in-game browser for store check-out,</para>
|
||||
/// <para> and then redirects to the specified URL. As long as the in-game browser</para>
|
||||
/// <para> accepts and handles session cookies, Steam microtransaction checkout pages</para>
|
||||
/// <para> will automatically recognize the user instead of presenting a login page.</para>
|
||||
/// <para> The result of this API call will be a StoreAuthURLResponse_t callback.</para>
|
||||
/// <para> NOTE: The URL has a very short lifetime to prevent history-snooping attacks,</para>
|
||||
/// <para> so you should only call this API when you are about to launch the browser,</para>
|
||||
/// <para> or else immediately navigate to the result URL using a hidden browser window.</para>
|
||||
/// <para> NOTE 2: The resulting authorization cookie has an expiration time of one day,</para>
|
||||
/// <para> so it would be a good idea to request and visit a new auth URL every 12 hours.</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t RequestStoreAuthURL(string pchRedirectURL) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchRedirectURL2 = new InteropHelp.UTF8StringHandle(pchRedirectURL)) {
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUser_RequestStoreAuthURL(CSteamAPIContext.GetSteamUser(), pchRedirectURL2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> gets whether the users phone number is verified</para>
|
||||
/// </summary>
|
||||
public static bool BIsPhoneVerified() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUser_BIsPhoneVerified(CSteamAPIContext.GetSteamUser());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> gets whether the user has two factor enabled on their account</para>
|
||||
/// </summary>
|
||||
public static bool BIsTwoFactorEnabled() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUser_BIsTwoFactorEnabled(CSteamAPIContext.GetSteamUser());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> gets whether the users phone number is identifying</para>
|
||||
/// </summary>
|
||||
public static bool BIsPhoneIdentifying() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUser_BIsPhoneIdentifying(CSteamAPIContext.GetSteamUser());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> gets whether the users phone number is awaiting (re)verification</para>
|
||||
/// </summary>
|
||||
public static bool BIsPhoneRequiringVerification() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUser_BIsPhoneRequiringVerification(CSteamAPIContext.GetSteamUser());
|
||||
}
|
||||
|
||||
public static SteamAPICall_t GetMarketEligibility() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUser_GetMarketEligibility(CSteamAPIContext.GetSteamUser());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Retrieves anti indulgence / duration control for current user</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t GetDurationControl() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUser_GetDurationControl(CSteamAPIContext.GetSteamUser());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,494 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamUserStats {
|
||||
/// <summary>
|
||||
/// <para> Ask the server to send down this user's data and achievements for this game</para>
|
||||
/// </summary>
|
||||
public static bool RequestCurrentStats() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUserStats_RequestCurrentStats(CSteamAPIContext.GetSteamUserStats());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Data accessors</para>
|
||||
/// </summary>
|
||||
public static bool GetStat(string pchName, out int pData) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) {
|
||||
return NativeMethods.ISteamUserStats_GetStat(CSteamAPIContext.GetSteamUserStats(), pchName2, out pData);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool GetStat(string pchName, out float pData) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) {
|
||||
return NativeMethods.ISteamUserStats_GetStat0(CSteamAPIContext.GetSteamUserStats(), pchName2, out pData);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Set / update data</para>
|
||||
/// </summary>
|
||||
public static bool SetStat(string pchName, int nData) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) {
|
||||
return NativeMethods.ISteamUserStats_SetStat(CSteamAPIContext.GetSteamUserStats(), pchName2, nData);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool SetStat(string pchName, float fData) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) {
|
||||
return NativeMethods.ISteamUserStats_SetStat0(CSteamAPIContext.GetSteamUserStats(), pchName2, fData);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool UpdateAvgRateStat(string pchName, float flCountThisSession, double dSessionLength) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) {
|
||||
return NativeMethods.ISteamUserStats_UpdateAvgRateStat(CSteamAPIContext.GetSteamUserStats(), pchName2, flCountThisSession, dSessionLength);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Achievement flag accessors</para>
|
||||
/// </summary>
|
||||
public static bool GetAchievement(string pchName, out bool pbAchieved) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) {
|
||||
return NativeMethods.ISteamUserStats_GetAchievement(CSteamAPIContext.GetSteamUserStats(), pchName2, out pbAchieved);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool SetAchievement(string pchName) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) {
|
||||
return NativeMethods.ISteamUserStats_SetAchievement(CSteamAPIContext.GetSteamUserStats(), pchName2);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool ClearAchievement(string pchName) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) {
|
||||
return NativeMethods.ISteamUserStats_ClearAchievement(CSteamAPIContext.GetSteamUserStats(), pchName2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Get the achievement status, and the time it was unlocked if unlocked.</para>
|
||||
/// <para> If the return value is true, but the unlock time is zero, that means it was unlocked before Steam</para>
|
||||
/// <para> began tracking achievement unlock times (December 2009). Time is seconds since January 1, 1970.</para>
|
||||
/// </summary>
|
||||
public static bool GetAchievementAndUnlockTime(string pchName, out bool pbAchieved, out uint punUnlockTime) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) {
|
||||
return NativeMethods.ISteamUserStats_GetAchievementAndUnlockTime(CSteamAPIContext.GetSteamUserStats(), pchName2, out pbAchieved, out punUnlockTime);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Store the current data on the server, will get a callback when set</para>
|
||||
/// <para> And one callback for every new achievement</para>
|
||||
/// <para> If the callback has a result of k_EResultInvalidParam, one or more stats</para>
|
||||
/// <para> uploaded has been rejected, either because they broke constraints</para>
|
||||
/// <para> or were out of date. In this case the server sends back updated values.</para>
|
||||
/// <para> The stats should be re-iterated to keep in sync.</para>
|
||||
/// </summary>
|
||||
public static bool StoreStats() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUserStats_StoreStats(CSteamAPIContext.GetSteamUserStats());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Achievement / GroupAchievement metadata</para>
|
||||
/// <para> Gets the icon of the achievement, which is a handle to be used in ISteamUtils::GetImageRGBA(), or 0 if none set.</para>
|
||||
/// <para> A return value of 0 may indicate we are still fetching data, and you can wait for the UserAchievementIconFetched_t callback</para>
|
||||
/// <para> which will notify you when the bits are ready. If the callback still returns zero, then there is no image set for the</para>
|
||||
/// <para> specified achievement.</para>
|
||||
/// </summary>
|
||||
public static int GetAchievementIcon(string pchName) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) {
|
||||
return NativeMethods.ISteamUserStats_GetAchievementIcon(CSteamAPIContext.GetSteamUserStats(), pchName2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Get general attributes for an achievement. Accepts the following keys:</para>
|
||||
/// <para> - "name" and "desc" for retrieving the localized achievement name and description (returned in UTF8)</para>
|
||||
/// <para> - "hidden" for retrieving if an achievement is hidden (returns "0" when not hidden, "1" when hidden)</para>
|
||||
/// </summary>
|
||||
public static string GetAchievementDisplayAttribute(string pchName, string pchKey) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName))
|
||||
using (var pchKey2 = new InteropHelp.UTF8StringHandle(pchKey)) {
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamUserStats_GetAchievementDisplayAttribute(CSteamAPIContext.GetSteamUserStats(), pchName2, pchKey2));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Achievement progress - triggers an AchievementProgress callback, that is all.</para>
|
||||
/// <para> Calling this w/ N out of N progress will NOT set the achievement, the game must still do that.</para>
|
||||
/// </summary>
|
||||
public static bool IndicateAchievementProgress(string pchName, uint nCurProgress, uint nMaxProgress) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) {
|
||||
return NativeMethods.ISteamUserStats_IndicateAchievementProgress(CSteamAPIContext.GetSteamUserStats(), pchName2, nCurProgress, nMaxProgress);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Used for iterating achievements. In general games should not need these functions because they should have a</para>
|
||||
/// <para> list of existing achievements compiled into them</para>
|
||||
/// </summary>
|
||||
public static uint GetNumAchievements() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUserStats_GetNumAchievements(CSteamAPIContext.GetSteamUserStats());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Get achievement name iAchievement in [0,GetNumAchievements)</para>
|
||||
/// </summary>
|
||||
public static string GetAchievementName(uint iAchievement) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamUserStats_GetAchievementName(CSteamAPIContext.GetSteamUserStats(), iAchievement));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Friends stats & achievements</para>
|
||||
/// <para> downloads stats for the user</para>
|
||||
/// <para> returns a UserStatsReceived_t received when completed</para>
|
||||
/// <para> if the other user has no stats, UserStatsReceived_t.m_eResult will be set to k_EResultFail</para>
|
||||
/// <para> these stats won't be auto-updated; you'll need to call RequestUserStats() again to refresh any data</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t RequestUserStats(CSteamID steamIDUser) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUserStats_RequestUserStats(CSteamAPIContext.GetSteamUserStats(), steamIDUser);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> requests stat information for a user, usable after a successful call to RequestUserStats()</para>
|
||||
/// </summary>
|
||||
public static bool GetUserStat(CSteamID steamIDUser, string pchName, out int pData) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) {
|
||||
return NativeMethods.ISteamUserStats_GetUserStat(CSteamAPIContext.GetSteamUserStats(), steamIDUser, pchName2, out pData);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool GetUserStat(CSteamID steamIDUser, string pchName, out float pData) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) {
|
||||
return NativeMethods.ISteamUserStats_GetUserStat0(CSteamAPIContext.GetSteamUserStats(), steamIDUser, pchName2, out pData);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool GetUserAchievement(CSteamID steamIDUser, string pchName, out bool pbAchieved) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) {
|
||||
return NativeMethods.ISteamUserStats_GetUserAchievement(CSteamAPIContext.GetSteamUserStats(), steamIDUser, pchName2, out pbAchieved);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> See notes for GetAchievementAndUnlockTime above</para>
|
||||
/// </summary>
|
||||
public static bool GetUserAchievementAndUnlockTime(CSteamID steamIDUser, string pchName, out bool pbAchieved, out uint punUnlockTime) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) {
|
||||
return NativeMethods.ISteamUserStats_GetUserAchievementAndUnlockTime(CSteamAPIContext.GetSteamUserStats(), steamIDUser, pchName2, out pbAchieved, out punUnlockTime);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Reset stats</para>
|
||||
/// </summary>
|
||||
public static bool ResetAllStats(bool bAchievementsToo) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUserStats_ResetAllStats(CSteamAPIContext.GetSteamUserStats(), bAchievementsToo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Leaderboard functions</para>
|
||||
/// <para> asks the Steam back-end for a leaderboard by name, and will create it if it's not yet</para>
|
||||
/// <para> This call is asynchronous, with the result returned in LeaderboardFindResult_t</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t FindOrCreateLeaderboard(string pchLeaderboardName, ELeaderboardSortMethod eLeaderboardSortMethod, ELeaderboardDisplayType eLeaderboardDisplayType) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchLeaderboardName2 = new InteropHelp.UTF8StringHandle(pchLeaderboardName)) {
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUserStats_FindOrCreateLeaderboard(CSteamAPIContext.GetSteamUserStats(), pchLeaderboardName2, eLeaderboardSortMethod, eLeaderboardDisplayType);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> as above, but won't create the leaderboard if it's not found</para>
|
||||
/// <para> This call is asynchronous, with the result returned in LeaderboardFindResult_t</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t FindLeaderboard(string pchLeaderboardName) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchLeaderboardName2 = new InteropHelp.UTF8StringHandle(pchLeaderboardName)) {
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUserStats_FindLeaderboard(CSteamAPIContext.GetSteamUserStats(), pchLeaderboardName2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the name of a leaderboard</para>
|
||||
/// </summary>
|
||||
public static string GetLeaderboardName(SteamLeaderboard_t hSteamLeaderboard) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamUserStats_GetLeaderboardName(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboard));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the total number of entries in a leaderboard, as of the last request</para>
|
||||
/// </summary>
|
||||
public static int GetLeaderboardEntryCount(SteamLeaderboard_t hSteamLeaderboard) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUserStats_GetLeaderboardEntryCount(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboard);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the sort method of the leaderboard</para>
|
||||
/// </summary>
|
||||
public static ELeaderboardSortMethod GetLeaderboardSortMethod(SteamLeaderboard_t hSteamLeaderboard) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUserStats_GetLeaderboardSortMethod(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboard);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the display type of the leaderboard</para>
|
||||
/// </summary>
|
||||
public static ELeaderboardDisplayType GetLeaderboardDisplayType(SteamLeaderboard_t hSteamLeaderboard) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUserStats_GetLeaderboardDisplayType(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboard);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Asks the Steam back-end for a set of rows in the leaderboard.</para>
|
||||
/// <para> This call is asynchronous, with the result returned in LeaderboardScoresDownloaded_t</para>
|
||||
/// <para> LeaderboardScoresDownloaded_t will contain a handle to pull the results from GetDownloadedLeaderboardEntries() (below)</para>
|
||||
/// <para> You can ask for more entries than exist, and it will return as many as do exist.</para>
|
||||
/// <para> k_ELeaderboardDataRequestGlobal requests rows in the leaderboard from the full table, with nRangeStart & nRangeEnd in the range [1, TotalEntries]</para>
|
||||
/// <para> k_ELeaderboardDataRequestGlobalAroundUser requests rows around the current user, nRangeStart being negate</para>
|
||||
/// <para> e.g. DownloadLeaderboardEntries( hLeaderboard, k_ELeaderboardDataRequestGlobalAroundUser, -3, 3 ) will return 7 rows, 3 before the user, 3 after</para>
|
||||
/// <para> k_ELeaderboardDataRequestFriends requests all the rows for friends of the current user</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t DownloadLeaderboardEntries(SteamLeaderboard_t hSteamLeaderboard, ELeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUserStats_DownloadLeaderboardEntries(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboard, eLeaderboardDataRequest, nRangeStart, nRangeEnd);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> as above, but downloads leaderboard entries for an arbitrary set of users - ELeaderboardDataRequest is k_ELeaderboardDataRequestUsers</para>
|
||||
/// <para> if a user doesn't have a leaderboard entry, they won't be included in the result</para>
|
||||
/// <para> a max of 100 users can be downloaded at a time, with only one outstanding call at a time</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t DownloadLeaderboardEntriesForUsers(SteamLeaderboard_t hSteamLeaderboard, CSteamID[] prgUsers, int cUsers) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUserStats_DownloadLeaderboardEntriesForUsers(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboard, prgUsers, cUsers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns data about a single leaderboard entry</para>
|
||||
/// <para> use a for loop from 0 to LeaderboardScoresDownloaded_t::m_cEntryCount to get all the downloaded entries</para>
|
||||
/// <para> e.g.</para>
|
||||
/// <para> void OnLeaderboardScoresDownloaded( LeaderboardScoresDownloaded_t *pLeaderboardScoresDownloaded )</para>
|
||||
/// <para> {</para>
|
||||
/// <para> for ( int index = 0; index < pLeaderboardScoresDownloaded->m_cEntryCount; index++ )</para>
|
||||
/// <para> {</para>
|
||||
/// <para> LeaderboardEntry_t leaderboardEntry;</para>
|
||||
/// <para> int32 details[3]; // we know this is how many we've stored previously</para>
|
||||
/// <para> GetDownloadedLeaderboardEntry( pLeaderboardScoresDownloaded->m_hSteamLeaderboardEntries, index, &leaderboardEntry, details, 3 );</para>
|
||||
/// <para> assert( leaderboardEntry.m_cDetails == 3 );</para>
|
||||
/// <para> ...</para>
|
||||
/// <para> }</para>
|
||||
/// <para> once you've accessed all the entries, the data will be free'd, and the SteamLeaderboardEntries_t handle will become invalid</para>
|
||||
/// </summary>
|
||||
public static bool GetDownloadedLeaderboardEntry(SteamLeaderboardEntries_t hSteamLeaderboardEntries, int index, out LeaderboardEntry_t pLeaderboardEntry, int[] pDetails, int cDetailsMax) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUserStats_GetDownloadedLeaderboardEntry(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboardEntries, index, out pLeaderboardEntry, pDetails, cDetailsMax);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Uploads a user score to the Steam back-end.</para>
|
||||
/// <para> This call is asynchronous, with the result returned in LeaderboardScoreUploaded_t</para>
|
||||
/// <para> Details are extra game-defined information regarding how the user got that score</para>
|
||||
/// <para> pScoreDetails points to an array of int32's, cScoreDetailsCount is the number of int32's in the list</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t UploadLeaderboardScore(SteamLeaderboard_t hSteamLeaderboard, ELeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int nScore, int[] pScoreDetails, int cScoreDetailsCount) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUserStats_UploadLeaderboardScore(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboard, eLeaderboardUploadScoreMethod, nScore, pScoreDetails, cScoreDetailsCount);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Attaches a piece of user generated content the user's entry on a leaderboard.</para>
|
||||
/// <para> hContent is a handle to a piece of user generated content that was shared using ISteamUserRemoteStorage::FileShare().</para>
|
||||
/// <para> This call is asynchronous, with the result returned in LeaderboardUGCSet_t.</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t AttachLeaderboardUGC(SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUserStats_AttachLeaderboardUGC(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboard, hUGC);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Retrieves the number of players currently playing your game (online + offline)</para>
|
||||
/// <para> This call is asynchronous, with the result returned in NumberOfCurrentPlayers_t</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t GetNumberOfCurrentPlayers() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUserStats_GetNumberOfCurrentPlayers(CSteamAPIContext.GetSteamUserStats());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Requests that Steam fetch data on the percentage of players who have received each achievement</para>
|
||||
/// <para> for the game globally.</para>
|
||||
/// <para> This call is asynchronous, with the result returned in GlobalAchievementPercentagesReady_t.</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t RequestGlobalAchievementPercentages() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUserStats_RequestGlobalAchievementPercentages(CSteamAPIContext.GetSteamUserStats());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Get the info on the most achieved achievement for the game, returns an iterator index you can use to fetch</para>
|
||||
/// <para> the next most achieved afterwards. Will return -1 if there is no data on achievement</para>
|
||||
/// <para> percentages (ie, you haven't called RequestGlobalAchievementPercentages and waited on the callback).</para>
|
||||
/// </summary>
|
||||
public static int GetMostAchievedAchievementInfo(out string pchName, uint unNameBufLen, out float pflPercent, out bool pbAchieved) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
IntPtr pchName2 = Marshal.AllocHGlobal((int)unNameBufLen);
|
||||
int ret = NativeMethods.ISteamUserStats_GetMostAchievedAchievementInfo(CSteamAPIContext.GetSteamUserStats(), pchName2, unNameBufLen, out pflPercent, out pbAchieved);
|
||||
pchName = ret != -1 ? InteropHelp.PtrToStringUTF8(pchName2) : null;
|
||||
Marshal.FreeHGlobal(pchName2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Get the info on the next most achieved achievement for the game. Call this after GetMostAchievedAchievementInfo or another</para>
|
||||
/// <para> GetNextMostAchievedAchievementInfo call passing the iterator from the previous call. Returns -1 after the last</para>
|
||||
/// <para> achievement has been iterated.</para>
|
||||
/// </summary>
|
||||
public static int GetNextMostAchievedAchievementInfo(int iIteratorPrevious, out string pchName, uint unNameBufLen, out float pflPercent, out bool pbAchieved) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
IntPtr pchName2 = Marshal.AllocHGlobal((int)unNameBufLen);
|
||||
int ret = NativeMethods.ISteamUserStats_GetNextMostAchievedAchievementInfo(CSteamAPIContext.GetSteamUserStats(), iIteratorPrevious, pchName2, unNameBufLen, out pflPercent, out pbAchieved);
|
||||
pchName = ret != -1 ? InteropHelp.PtrToStringUTF8(pchName2) : null;
|
||||
Marshal.FreeHGlobal(pchName2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns the percentage of users who have achieved the specified achievement.</para>
|
||||
/// </summary>
|
||||
public static bool GetAchievementAchievedPercent(string pchName, out float pflPercent) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) {
|
||||
return NativeMethods.ISteamUserStats_GetAchievementAchievedPercent(CSteamAPIContext.GetSteamUserStats(), pchName2, out pflPercent);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Requests global stats data, which is available for stats marked as "aggregated".</para>
|
||||
/// <para> This call is asynchronous, with the results returned in GlobalStatsReceived_t.</para>
|
||||
/// <para> nHistoryDays specifies how many days of day-by-day history to retrieve in addition</para>
|
||||
/// <para> to the overall totals. The limit is 60.</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t RequestGlobalStats(int nHistoryDays) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUserStats_RequestGlobalStats(CSteamAPIContext.GetSteamUserStats(), nHistoryDays);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Gets the lifetime totals for an aggregated stat</para>
|
||||
/// </summary>
|
||||
public static bool GetGlobalStat(string pchStatName, out long pData) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchStatName2 = new InteropHelp.UTF8StringHandle(pchStatName)) {
|
||||
return NativeMethods.ISteamUserStats_GetGlobalStat(CSteamAPIContext.GetSteamUserStats(), pchStatName2, out pData);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool GetGlobalStat(string pchStatName, out double pData) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchStatName2 = new InteropHelp.UTF8StringHandle(pchStatName)) {
|
||||
return NativeMethods.ISteamUserStats_GetGlobalStat0(CSteamAPIContext.GetSteamUserStats(), pchStatName2, out pData);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Gets history for an aggregated stat. pData will be filled with daily values, starting with today.</para>
|
||||
/// <para> So when called, pData[0] will be today, pData[1] will be yesterday, and pData[2] will be two days ago,</para>
|
||||
/// <para> etc. cubData is the size in bytes of the pubData buffer. Returns the number of</para>
|
||||
/// <para> elements actually set.</para>
|
||||
/// </summary>
|
||||
public static int GetGlobalStatHistory(string pchStatName, long[] pData, uint cubData) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchStatName2 = new InteropHelp.UTF8StringHandle(pchStatName)) {
|
||||
return NativeMethods.ISteamUserStats_GetGlobalStatHistory(CSteamAPIContext.GetSteamUserStats(), pchStatName2, pData, cubData);
|
||||
}
|
||||
}
|
||||
|
||||
public static int GetGlobalStatHistory(string pchStatName, double[] pData, uint cubData) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchStatName2 = new InteropHelp.UTF8StringHandle(pchStatName)) {
|
||||
return NativeMethods.ISteamUserStats_GetGlobalStatHistory0(CSteamAPIContext.GetSteamUserStats(), pchStatName2, pData, cubData);
|
||||
}
|
||||
}
|
||||
#if _PS3
|
||||
/// <summary>
|
||||
/// <para> Call to kick off installation of the PS3 trophies. This call is asynchronous, and the results will be returned in a PS3TrophiesInstalled_t</para>
|
||||
/// <para> callback.</para>
|
||||
/// </summary>
|
||||
public static bool InstallPS3Trophies() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUserStats_InstallPS3Trophies(CSteamAPIContext.GetSteamUserStats());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns the amount of space required at boot to install trophies. This value can be used when comparing the amount of space needed</para>
|
||||
/// <para> by the game to the available space value passed to the game at boot. The value is set during InstallPS3Trophies().</para>
|
||||
/// </summary>
|
||||
public static ulong GetTrophySpaceRequiredBeforeInstall() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUserStats_GetTrophySpaceRequiredBeforeInstall(CSteamAPIContext.GetSteamUserStats());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> On PS3, user stats & achievement progress through Steam must be stored with the user's saved game data.</para>
|
||||
/// <para> At startup, before calling RequestCurrentStats(), you must pass the user's stats data to Steam via this method.</para>
|
||||
/// <para> If you do not have any user data, call this function with pvData = NULL and cubData = 0</para>
|
||||
/// </summary>
|
||||
public static bool SetUserStatsData(IntPtr pvData, uint cubData) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUserStats_SetUserStatsData(CSteamAPIContext.GetSteamUserStats(), pvData, cubData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Call to get the user's current stats data. You should retrieve this data after receiving successful UserStatsReceived_t & UserStatsStored_t</para>
|
||||
/// <para> callbacks, and store the data with the user's save game data. You can call this method with pvData = NULL and cubData = 0 to get the required</para>
|
||||
/// <para> buffer size.</para>
|
||||
/// </summary>
|
||||
public static bool GetUserStatsData(IntPtr pvData, uint cubData, out uint pcubWritten) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUserStats_GetUserStatsData(CSteamAPIContext.GetSteamUserStats(), pvData, cubData, out pcubWritten);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,318 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamUtils {
|
||||
/// <summary>
|
||||
/// <para> return the number of seconds since the user</para>
|
||||
/// </summary>
|
||||
public static uint GetSecondsSinceAppActive() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUtils_GetSecondsSinceAppActive(CSteamAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
public static uint GetSecondsSinceComputerActive() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUtils_GetSecondsSinceComputerActive(CSteamAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> the universe this client is connecting to</para>
|
||||
/// </summary>
|
||||
public static EUniverse GetConnectedUniverse() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUtils_GetConnectedUniverse(CSteamAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Steam server time. Number of seconds since January 1, 1970, GMT (i.e unix time)</para>
|
||||
/// </summary>
|
||||
public static uint GetServerRealTime() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUtils_GetServerRealTime(CSteamAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> 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)</para>
|
||||
/// <para> e.g "US" or "UK".</para>
|
||||
/// </summary>
|
||||
public static string GetIPCountry() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamUtils_GetIPCountry(CSteamAPIContext.GetSteamUtils()));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns true if the image exists, and valid sizes were filled out</para>
|
||||
/// </summary>
|
||||
public static bool GetImageSize(int iImage, out uint pnWidth, out uint pnHeight) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUtils_GetImageSize(CSteamAPIContext.GetSteamUtils(), iImage, out pnWidth, out pnHeight);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns true if the image exists, and the buffer was successfully filled out</para>
|
||||
/// <para> results are returned in RGBA format</para>
|
||||
/// <para> the destination buffer size should be 4 * height * width * sizeof(char)</para>
|
||||
/// </summary>
|
||||
public static bool GetImageRGBA(int iImage, byte[] pubDest, int nDestBufferSize) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUtils_GetImageRGBA(CSteamAPIContext.GetSteamUtils(), iImage, pubDest, nDestBufferSize);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the IP of the reporting server for valve - currently only used in Source engine games</para>
|
||||
/// </summary>
|
||||
public static bool GetCSERIPPort(out uint unIP, out ushort usPort) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUtils_GetCSERIPPort(CSteamAPIContext.GetSteamUtils(), out unIP, out usPort);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> return the amount of battery power left in the current system in % [0..100], 255 for being on AC power</para>
|
||||
/// </summary>
|
||||
public static byte GetCurrentBatteryPower() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUtils_GetCurrentBatteryPower(CSteamAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the appID of the current process</para>
|
||||
/// </summary>
|
||||
public static AppId_t GetAppID() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return (AppId_t)NativeMethods.ISteamUtils_GetAppID(CSteamAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Sets the position where the overlay instance for the currently calling game should show notifications.</para>
|
||||
/// <para> This position is per-game and if this function is called from outside of a game context it will do nothing.</para>
|
||||
/// </summary>
|
||||
public static void SetOverlayNotificationPosition(ENotificationPosition eNotificationPosition) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamUtils_SetOverlayNotificationPosition(CSteamAPIContext.GetSteamUtils(), eNotificationPosition);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> API asynchronous call results</para>
|
||||
/// <para> can be used directly, but more commonly used via the callback dispatch API (see steam_api.h)</para>
|
||||
/// </summary>
|
||||
public static bool IsAPICallCompleted(SteamAPICall_t hSteamAPICall, out bool pbFailed) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUtils_IsAPICallCompleted(CSteamAPIContext.GetSteamUtils(), hSteamAPICall, out pbFailed);
|
||||
}
|
||||
|
||||
public static ESteamAPICallFailure GetAPICallFailureReason(SteamAPICall_t hSteamAPICall) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUtils_GetAPICallFailureReason(CSteamAPIContext.GetSteamUtils(), hSteamAPICall);
|
||||
}
|
||||
|
||||
public static bool GetAPICallResult(SteamAPICall_t hSteamAPICall, IntPtr pCallback, int cubCallback, int iCallbackExpected, out bool pbFailed) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUtils_GetAPICallResult(CSteamAPIContext.GetSteamUtils(), hSteamAPICall, pCallback, cubCallback, iCallbackExpected, out pbFailed);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the number of IPC calls made since the last time this function was called</para>
|
||||
/// <para> Used for perf debugging so you can understand how many IPC calls your game makes per frame</para>
|
||||
/// <para> Every IPC call is at minimum a thread context switch if not a process one so you want to rate</para>
|
||||
/// <para> control how often you do them.</para>
|
||||
/// </summary>
|
||||
public static uint GetIPCCallCount() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUtils_GetIPCCallCount(CSteamAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> API warning handling</para>
|
||||
/// <para> 'int' is the severity; 0 for msg, 1 for warning</para>
|
||||
/// <para> 'const char *' is the text of the message</para>
|
||||
/// <para> callbacks will occur directly after the API function is called that generated the warning or message</para>
|
||||
/// </summary>
|
||||
public static void SetWarningMessageHook(SteamAPIWarningMessageHook_t pFunction) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamUtils_SetWarningMessageHook(CSteamAPIContext.GetSteamUtils(), pFunction);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns true if the overlay is running & the user can access it. The overlay process could take a few seconds to</para>
|
||||
/// <para> start & hook the game process, so this function will initially return false while the overlay is loading.</para>
|
||||
/// </summary>
|
||||
public static bool IsOverlayEnabled() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUtils_IsOverlayEnabled(CSteamAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Normally this call is unneeded if your game has a constantly running frame loop that calls the</para>
|
||||
/// <para> D3D Present API, or OGL SwapBuffers API every frame.</para>
|
||||
/// <para> However, if you have a game that only refreshes the screen on an event driven basis then that can break</para>
|
||||
/// <para> the overlay, as it uses your Present/SwapBuffers calls to drive it's internal frame loop and it may also</para>
|
||||
/// <para> need to Present() to the screen any time an even needing a notification happens or when the overlay is</para>
|
||||
/// <para> brought up over the game by a user. You can use this API to ask the overlay if it currently need a present</para>
|
||||
/// <para> in that case, and then you can check for this periodically (roughly 33hz is desirable) and make sure you</para>
|
||||
/// <para> refresh the screen with Present or SwapBuffers to allow the overlay to do it's work.</para>
|
||||
/// </summary>
|
||||
public static bool BOverlayNeedsPresent() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUtils_BOverlayNeedsPresent(CSteamAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Asynchronous call to check if an executable file has been signed using the public key set on the signing tab</para>
|
||||
/// <para> of the partner site, for example to refuse to load modified executable files.</para>
|
||||
/// <para> The result is returned in CheckFileSignature_t.</para>
|
||||
/// <para> k_ECheckFileSignatureNoSignaturesFoundForThisApp - This app has not been configured on the signing tab of the partner site to enable this function.</para>
|
||||
/// <para> k_ECheckFileSignatureNoSignaturesFoundForThisFile - This file is not listed on the signing tab for the partner site.</para>
|
||||
/// <para> k_ECheckFileSignatureFileNotFound - The file does not exist on disk.</para>
|
||||
/// <para> k_ECheckFileSignatureInvalidSignature - The file exists, and the signing tab has been set for this file, but the file is either not signed or the signature does not match.</para>
|
||||
/// <para> k_ECheckFileSignatureValidSignature - The file is signed and the signature is valid.</para>
|
||||
/// </summary>
|
||||
public static SteamAPICall_t CheckFileSignature(string szFileName) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var szFileName2 = new InteropHelp.UTF8StringHandle(szFileName)) {
|
||||
return (SteamAPICall_t)NativeMethods.ISteamUtils_CheckFileSignature(CSteamAPIContext.GetSteamUtils(), szFileName2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Activates the Big Picture text input dialog which only supports gamepad input</para>
|
||||
/// </summary>
|
||||
public static bool ShowGamepadTextInput(EGamepadTextInputMode eInputMode, EGamepadTextInputLineMode eLineInputMode, string pchDescription, uint unCharMax, string pchExistingText) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
using (var pchDescription2 = new InteropHelp.UTF8StringHandle(pchDescription))
|
||||
using (var pchExistingText2 = new InteropHelp.UTF8StringHandle(pchExistingText)) {
|
||||
return NativeMethods.ISteamUtils_ShowGamepadTextInput(CSteamAPIContext.GetSteamUtils(), eInputMode, eLineInputMode, pchDescription2, unCharMax, pchExistingText2);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns previously entered text & length</para>
|
||||
/// </summary>
|
||||
public static uint GetEnteredGamepadTextLength() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUtils_GetEnteredGamepadTextLength(CSteamAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
public static bool GetEnteredGamepadTextInput(out string pchText, uint cchText) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
IntPtr pchText2 = Marshal.AllocHGlobal((int)cchText);
|
||||
bool ret = NativeMethods.ISteamUtils_GetEnteredGamepadTextInput(CSteamAPIContext.GetSteamUtils(), pchText2, cchText);
|
||||
pchText = ret ? InteropHelp.PtrToStringUTF8(pchText2) : null;
|
||||
Marshal.FreeHGlobal(pchText2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns the language the steam client is running in, you probably want ISteamApps::GetCurrentGameLanguage instead, this is for very special usage cases</para>
|
||||
/// </summary>
|
||||
public static string GetSteamUILanguage() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamUtils_GetSteamUILanguage(CSteamAPIContext.GetSteamUtils()));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns true if Steam itself is running in VR mode</para>
|
||||
/// </summary>
|
||||
public static bool IsSteamRunningInVR() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUtils_IsSteamRunningInVR(CSteamAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Sets the inset of the overlay notification from the corner specified by SetOverlayNotificationPosition.</para>
|
||||
/// </summary>
|
||||
public static void SetOverlayNotificationInset(int nHorizontalInset, int nVerticalInset) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamUtils_SetOverlayNotificationInset(CSteamAPIContext.GetSteamUtils(), nHorizontalInset, nVerticalInset);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns true if Steam & the Steam Overlay are running in Big Picture mode</para>
|
||||
/// <para> Games much be launched through the Steam client to enable the Big Picture overlay. During development,</para>
|
||||
/// <para> a game can be added as a non-steam game to the developers library to test this feature</para>
|
||||
/// </summary>
|
||||
public static bool IsSteamInBigPictureMode() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUtils_IsSteamInBigPictureMode(CSteamAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> ask SteamUI to create and render its OpenVR dashboard</para>
|
||||
/// </summary>
|
||||
public static void StartVRDashboard() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamUtils_StartVRDashboard(CSteamAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns true if the HMD content will be streamed via Steam In-Home Streaming</para>
|
||||
/// </summary>
|
||||
public static bool IsVRHeadsetStreamingEnabled() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUtils_IsVRHeadsetStreamingEnabled(CSteamAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Set whether the HMD content will be streamed via Steam In-Home Streaming</para>
|
||||
/// <para> If this is set to true, then the scene in the HMD headset will be streamed, and remote input will not be allowed.</para>
|
||||
/// <para> If this is set to false, then the application window will be streamed instead, and remote input will be allowed.</para>
|
||||
/// <para> The default is true unless "VRHeadsetStreaming" "0" is in the extended appinfo for a game.</para>
|
||||
/// <para> (this is useful for games that have asymmetric multiplayer gameplay)</para>
|
||||
/// </summary>
|
||||
public static void SetVRHeadsetStreamingEnabled(bool bEnabled) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamUtils_SetVRHeadsetStreamingEnabled(CSteamAPIContext.GetSteamUtils(), bEnabled);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Returns whether this steam client is a Steam China specific client, vs the global client.</para>
|
||||
/// </summary>
|
||||
public static bool IsSteamChinaLauncher() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUtils_IsSteamChinaLauncher(CSteamAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Initializes text filtering.</para>
|
||||
/// <para> Returns false if filtering is unavailable for the language the user is currently running in.</para>
|
||||
/// </summary>
|
||||
public static bool InitFilterText() {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamUtils_InitFilterText(CSteamAPIContext.GetSteamUtils());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Filters the provided input message and places the filtered result into pchOutFilteredText.</para>
|
||||
/// <para> pchOutFilteredText is where the output will be placed, even if no filtering or censoring is performed</para>
|
||||
/// <para> nByteSizeOutFilteredText is the size (in bytes) of pchOutFilteredText</para>
|
||||
/// <para> pchInputText is the input string that should be filtered, which can be ASCII or UTF-8</para>
|
||||
/// <para> bLegalOnly should be false if you want profanity and legally required filtering (where required) and true if you want legally required filtering only</para>
|
||||
/// <para> Returns the number of characters (not bytes) filtered.</para>
|
||||
/// </summary>
|
||||
public static int FilterText(out string pchOutFilteredText, uint nByteSizeOutFilteredText, string pchInputMessage, bool bLegalOnly) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
IntPtr pchOutFilteredText2 = Marshal.AllocHGlobal((int)nByteSizeOutFilteredText);
|
||||
using (var pchInputMessage2 = new InteropHelp.UTF8StringHandle(pchInputMessage)) {
|
||||
int ret = NativeMethods.ISteamUtils_FilterText(CSteamAPIContext.GetSteamUtils(), pchOutFilteredText2, nByteSizeOutFilteredText, pchInputMessage2, bLegalOnly);
|
||||
pchOutFilteredText = ret != -1 ? InteropHelp.PtrToStringUTF8(pchOutFilteredText2) : null;
|
||||
Marshal.FreeHGlobal(pchOutFilteredText2);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,54 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
public static class SteamVideo {
|
||||
/// <summary>
|
||||
/// <para> Get a URL suitable for streaming the given Video app ID's video</para>
|
||||
/// </summary>
|
||||
public static void GetVideoURL(AppId_t unVideoAppID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamVideo_GetVideoURL(CSteamAPIContext.GetSteamVideo(), unVideoAppID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> returns true if user is uploading a live broadcast</para>
|
||||
/// </summary>
|
||||
public static bool IsBroadcasting(out int pnNumViewers) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
return NativeMethods.ISteamVideo_IsBroadcasting(CSteamAPIContext.GetSteamVideo(), out pnNumViewers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Get the OPF Details for 360 Video Playback</para>
|
||||
/// </summary>
|
||||
public static void GetOPFSettings(AppId_t unVideoAppID) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
NativeMethods.ISteamVideo_GetOPFSettings(CSteamAPIContext.GetSteamVideo(), unVideoAppID);
|
||||
}
|
||||
|
||||
public static bool GetOPFStringForApp(AppId_t unVideoAppID, out string pchBuffer, ref int pnBufferSize) {
|
||||
InteropHelp.TestIfAvailableClient();
|
||||
IntPtr pchBuffer2 = Marshal.AllocHGlobal((int)pnBufferSize);
|
||||
bool ret = NativeMethods.ISteamVideo_GetOPFStringForApp(CSteamAPIContext.GetSteamVideo(), unVideoAppID, pchBuffer2, ref pnBufferSize);
|
||||
pchBuffer = ret ? InteropHelp.PtrToStringUTF8(pchBuffer2) : null;
|
||||
Marshal.FreeHGlobal(pchBuffer2);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
Binary file not shown.
@@ -0,0 +1,106 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
using System.Text;
|
||||
|
||||
namespace Steamworks {
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Data describing a single server
|
||||
//-----------------------------------------------------------------------------
|
||||
[StructLayout(LayoutKind.Sequential, Size = 372, Pack = 4)]
|
||||
[System.Serializable]
|
||||
public class gameserveritem_t {
|
||||
public string GetGameDir() {
|
||||
return Encoding.UTF8.GetString(m_szGameDir, 0, System.Array.IndexOf<byte>(m_szGameDir, 0));
|
||||
}
|
||||
|
||||
public void SetGameDir(string dir) {
|
||||
m_szGameDir = Encoding.UTF8.GetBytes(dir + '\0');
|
||||
}
|
||||
|
||||
public string GetMap() {
|
||||
return Encoding.UTF8.GetString(m_szMap, 0, System.Array.IndexOf<byte>(m_szMap, 0));
|
||||
}
|
||||
|
||||
public void SetMap(string map) {
|
||||
m_szMap = Encoding.UTF8.GetBytes(map + '\0');
|
||||
}
|
||||
|
||||
public string GetGameDescription() {
|
||||
return Encoding.UTF8.GetString(m_szGameDescription, 0, System.Array.IndexOf<byte>(m_szGameDescription, 0));
|
||||
}
|
||||
|
||||
public void SetGameDescription(string desc) {
|
||||
m_szGameDescription = Encoding.UTF8.GetBytes(desc + '\0');
|
||||
}
|
||||
|
||||
public string GetServerName() {
|
||||
// Use the IP address as the name if nothing is set yet.
|
||||
if (m_szServerName[0] == 0)
|
||||
return m_NetAdr.GetConnectionAddressString();
|
||||
else
|
||||
return Encoding.UTF8.GetString(m_szServerName, 0, System.Array.IndexOf<byte>(m_szServerName, 0));
|
||||
}
|
||||
|
||||
public void SetServerName(string name) {
|
||||
m_szServerName = Encoding.UTF8.GetBytes(name + '\0');
|
||||
}
|
||||
|
||||
public string GetGameTags() {
|
||||
return Encoding.UTF8.GetString(m_szGameTags, 0, System.Array.IndexOf<byte>(m_szGameTags, 0));
|
||||
}
|
||||
|
||||
public void SetGameTags(string tags) {
|
||||
m_szGameTags = Encoding.UTF8.GetBytes(tags + '\0');
|
||||
}
|
||||
|
||||
public servernetadr_t m_NetAdr; ///< IP/Query Port/Connection Port for this server
|
||||
public int m_nPing; ///< current ping time in milliseconds
|
||||
[MarshalAs(UnmanagedType.I1)]
|
||||
public bool m_bHadSuccessfulResponse; ///< server has responded successfully in the past
|
||||
[MarshalAs(UnmanagedType.I1)]
|
||||
public bool m_bDoNotRefresh; ///< server is marked as not responding and should no longer be refreshed
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cbMaxGameServerGameDir)]
|
||||
private byte[] m_szGameDir; ///< current game directory
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cbMaxGameServerMapName)]
|
||||
private byte[] m_szMap; ///< current map
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cbMaxGameServerGameDescription)]
|
||||
private byte[] m_szGameDescription; ///< game description
|
||||
public uint m_nAppID; ///< Steam App ID of this server
|
||||
public int m_nPlayers; ///< total number of players currently on the server. INCLUDES BOTS!!
|
||||
public int m_nMaxPlayers; ///< Maximum players that can join this server
|
||||
public int m_nBotPlayers; ///< Number of bots (i.e simulated players) on this server
|
||||
[MarshalAs(UnmanagedType.I1)]
|
||||
public bool m_bPassword; ///< true if this server needs a password to join
|
||||
[MarshalAs(UnmanagedType.I1)]
|
||||
public bool m_bSecure; ///< Is this server protected by VAC
|
||||
public uint m_ulTimeLastPlayed; ///< time (in unix time) when this server was last played on (for favorite/history servers)
|
||||
public int m_nServerVersion; ///< server version as reported to Steam
|
||||
|
||||
// Game server name
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cbMaxGameServerName)]
|
||||
private byte[] m_szServerName;
|
||||
|
||||
// the tags this server exposes
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cbMaxGameServerTags)]
|
||||
private byte[] m_szGameTags;
|
||||
|
||||
// steamID of the game server - invalid if it's doesn't have one (old server, or not connected to Steam)
|
||||
public CSteamID m_steamID;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,116 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
// servernetadr_t is all the addressing info the serverbrowser needs to know about a game server,
|
||||
// namely: its IP, its connection port, and its query port.
|
||||
[System.Serializable]
|
||||
public struct servernetadr_t {
|
||||
private ushort m_usConnectionPort; // (in HOST byte order)
|
||||
private ushort m_usQueryPort;
|
||||
private uint m_unIP;
|
||||
|
||||
public void Init(uint ip, ushort usQueryPort, ushort usConnectionPort) {
|
||||
m_unIP = ip;
|
||||
m_usQueryPort = usQueryPort;
|
||||
m_usConnectionPort = usConnectionPort;
|
||||
}
|
||||
|
||||
#if NETADR_H
|
||||
public netadr_t GetIPAndQueryPort() {
|
||||
return netadr_t( m_unIP, m_usQueryPort );
|
||||
}
|
||||
#endif
|
||||
|
||||
// Access the query port.
|
||||
public ushort GetQueryPort() {
|
||||
return m_usQueryPort;
|
||||
}
|
||||
|
||||
public void SetQueryPort(ushort usPort) {
|
||||
m_usQueryPort = usPort;
|
||||
}
|
||||
|
||||
// Access the connection port.
|
||||
public ushort GetConnectionPort() {
|
||||
return m_usConnectionPort;
|
||||
}
|
||||
|
||||
public void SetConnectionPort(ushort usPort) {
|
||||
m_usConnectionPort = usPort;
|
||||
}
|
||||
|
||||
// Access the IP
|
||||
public uint GetIP() {
|
||||
return m_unIP;
|
||||
}
|
||||
|
||||
public void SetIP(uint unIP) {
|
||||
m_unIP = unIP;
|
||||
}
|
||||
|
||||
// This gets the 'a.b.c.d:port' string with the connection port (instead of the query port).
|
||||
public string GetConnectionAddressString() {
|
||||
return ToString(m_unIP, m_usConnectionPort);
|
||||
}
|
||||
|
||||
public string GetQueryAddressString() {
|
||||
return ToString(m_unIP, m_usQueryPort);
|
||||
}
|
||||
|
||||
public static string ToString(uint unIP, ushort usPort) {
|
||||
#if VALVE_BIG_ENDIAN
|
||||
return string.Format("{0}.{1}.{2}.{3}:{4}", unIP & 0xFFul, (unIP >> 8) & 0xFFul, (unIP >> 16) & 0xFFul, (unIP >> 24) & 0xFFul, usPort);
|
||||
#else
|
||||
return string.Format("{0}.{1}.{2}.{3}:{4}", (unIP >> 24) & 0xFFul, (unIP >> 16) & 0xFFul, (unIP >> 8) & 0xFFul, unIP & 0xFFul, usPort);
|
||||
#endif
|
||||
}
|
||||
|
||||
public static bool operator <(servernetadr_t x, servernetadr_t y) {
|
||||
return (x.m_unIP < y.m_unIP) || (x.m_unIP == y.m_unIP && x.m_usQueryPort < y.m_usQueryPort);
|
||||
}
|
||||
|
||||
public static bool operator >(servernetadr_t x, servernetadr_t y) {
|
||||
return (x.m_unIP > y.m_unIP) || (x.m_unIP == y.m_unIP && x.m_usQueryPort > y.m_usQueryPort);
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is servernetadr_t && this == (servernetadr_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_unIP.GetHashCode() + m_usQueryPort.GetHashCode() + m_usConnectionPort.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(servernetadr_t x, servernetadr_t y) {
|
||||
return (x.m_unIP == y.m_unIP) && (x.m_usQueryPort == y.m_usQueryPort) && (x.m_usConnectionPort == y.m_usConnectionPort);
|
||||
}
|
||||
|
||||
public static bool operator !=(servernetadr_t x, servernetadr_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public bool Equals(servernetadr_t other) {
|
||||
return (m_unIP == other.m_unIP) && (m_usQueryPort == other.m_usQueryPort) && (m_usConnectionPort == other.m_usConnectionPort);
|
||||
}
|
||||
|
||||
public int CompareTo(servernetadr_t other) {
|
||||
return m_unIP.CompareTo(other.m_unIP) + m_usQueryPort.CompareTo(other.m_usQueryPort) + m_usConnectionPort.CompareTo(other.m_usConnectionPort);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,22 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)]
|
||||
public delegate void SteamAPIWarningMessageHook_t(int nSeverity, System.Text.StringBuilder pchDebugText);
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)] // TODO: This is probably wrong, will likely crash on some platform.
|
||||
public delegate void SteamAPI_CheckCallbackRegistered_t(int iCallbackNum);
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
|
||||
// This file is no longer needed. Valve has removed the functionality.
|
||||
// We continue to generate this file to provide a small amount of backwards compatability.
|
||||
@@ -0,0 +1,154 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct CGameID : System.IEquatable<CGameID>, System.IComparable<CGameID> {
|
||||
public ulong m_GameID;
|
||||
|
||||
public enum EGameIDType {
|
||||
k_EGameIDTypeApp = 0,
|
||||
k_EGameIDTypeGameMod = 1,
|
||||
k_EGameIDTypeShortcut = 2,
|
||||
k_EGameIDTypeP2P = 3,
|
||||
};
|
||||
|
||||
public CGameID(ulong GameID) {
|
||||
m_GameID = GameID;
|
||||
}
|
||||
|
||||
public CGameID(AppId_t nAppID) {
|
||||
m_GameID = 0;
|
||||
SetAppID(nAppID);
|
||||
}
|
||||
|
||||
public CGameID(AppId_t nAppID, uint nModID) {
|
||||
m_GameID = 0;
|
||||
SetAppID(nAppID);
|
||||
SetType(EGameIDType.k_EGameIDTypeGameMod);
|
||||
SetModID(nModID);
|
||||
}
|
||||
|
||||
public bool IsSteamApp() {
|
||||
return Type() == EGameIDType.k_EGameIDTypeApp;
|
||||
}
|
||||
|
||||
public bool IsMod() {
|
||||
return Type() == EGameIDType.k_EGameIDTypeGameMod;
|
||||
}
|
||||
|
||||
public bool IsShortcut() {
|
||||
return Type() == EGameIDType.k_EGameIDTypeShortcut;
|
||||
}
|
||||
|
||||
public bool IsP2PFile() {
|
||||
return Type() == EGameIDType.k_EGameIDTypeP2P;
|
||||
}
|
||||
|
||||
public AppId_t AppID() {
|
||||
return new AppId_t((uint)(m_GameID & 0xFFFFFFul));
|
||||
}
|
||||
|
||||
public EGameIDType Type() {
|
||||
return (EGameIDType)((m_GameID >> 24) & 0xFFul);
|
||||
}
|
||||
|
||||
public uint ModID() {
|
||||
return (uint)((m_GameID >> 32) & 0xFFFFFFFFul);
|
||||
}
|
||||
|
||||
public bool IsValid() {
|
||||
// Each type has it's own invalid fixed point:
|
||||
switch (Type()) {
|
||||
case EGameIDType.k_EGameIDTypeApp:
|
||||
return AppID() != AppId_t.Invalid;
|
||||
|
||||
case EGameIDType.k_EGameIDTypeGameMod:
|
||||
return AppID() != AppId_t.Invalid && (ModID() & 0x80000000) != 0;
|
||||
|
||||
case EGameIDType.k_EGameIDTypeShortcut:
|
||||
return (ModID() & 0x80000000) != 0;
|
||||
|
||||
case EGameIDType.k_EGameIDTypeP2P:
|
||||
return AppID() == AppId_t.Invalid && (ModID() & 0x80000000) != 0;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void Reset() {
|
||||
m_GameID = 0;
|
||||
}
|
||||
|
||||
public void Set(ulong GameID) {
|
||||
m_GameID = GameID;
|
||||
}
|
||||
|
||||
#region Private Setters for internal use
|
||||
private void SetAppID(AppId_t other) {
|
||||
m_GameID = (m_GameID & ~(0xFFFFFFul << (ushort)0)) | (((ulong)(other) & 0xFFFFFFul) << (ushort)0);
|
||||
}
|
||||
|
||||
private void SetType(EGameIDType other) {
|
||||
m_GameID = (m_GameID & ~(0xFFul << (ushort)24)) | (((ulong)(other) & 0xFFul) << (ushort)24);
|
||||
}
|
||||
|
||||
private void SetModID(uint other) {
|
||||
m_GameID = (m_GameID & ~(0xFFFFFFFFul << (ushort)32)) | (((ulong)(other) & 0xFFFFFFFFul) << (ushort)32);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Overrides
|
||||
public override string ToString() {
|
||||
return m_GameID.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is CGameID && this == (CGameID)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_GameID.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(CGameID x, CGameID y) {
|
||||
return x.m_GameID == y.m_GameID;
|
||||
}
|
||||
|
||||
public static bool operator !=(CGameID x, CGameID y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator CGameID(ulong value) {
|
||||
return new CGameID(value);
|
||||
}
|
||||
public static explicit operator ulong(CGameID that) {
|
||||
return that.m_GameID;
|
||||
}
|
||||
|
||||
public bool Equals(CGameID other) {
|
||||
return m_GameID == other.m_GameID;
|
||||
}
|
||||
|
||||
public int CompareTo(CGameID other) {
|
||||
return m_GameID.CompareTo(other.m_GameID);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,279 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 4)]
|
||||
public struct CSteamID : System.IEquatable<CSteamID>, System.IComparable<CSteamID> {
|
||||
public static readonly CSteamID Nil = new CSteamID();
|
||||
public static readonly CSteamID OutofDateGS = new CSteamID(new AccountID_t(0), 0, EUniverse.k_EUniverseInvalid, EAccountType.k_EAccountTypeInvalid);
|
||||
public static readonly CSteamID LanModeGS = new CSteamID(new AccountID_t(0), 0, EUniverse.k_EUniversePublic, EAccountType.k_EAccountTypeInvalid);
|
||||
public static readonly CSteamID NotInitYetGS = new CSteamID(new AccountID_t(1), 0, EUniverse.k_EUniverseInvalid, EAccountType.k_EAccountTypeInvalid);
|
||||
public static readonly CSteamID NonSteamGS = new CSteamID(new AccountID_t(2), 0, EUniverse.k_EUniverseInvalid, EAccountType.k_EAccountTypeInvalid);
|
||||
public ulong m_SteamID;
|
||||
|
||||
public CSteamID(AccountID_t unAccountID, EUniverse eUniverse, EAccountType eAccountType) {
|
||||
m_SteamID = 0;
|
||||
Set(unAccountID, eUniverse, eAccountType);
|
||||
}
|
||||
|
||||
public CSteamID(AccountID_t unAccountID, uint unAccountInstance, EUniverse eUniverse, EAccountType eAccountType) {
|
||||
m_SteamID = 0;
|
||||
#if _SERVER && Assert
|
||||
Assert( ! ( ( EAccountType.k_EAccountTypeIndividual == eAccountType ) && ( unAccountInstance > k_unSteamUserWebInstance ) ) ); // enforce that for individual accounts, instance is always 1
|
||||
#endif // _SERVER
|
||||
InstancedSet(unAccountID, unAccountInstance, eUniverse, eAccountType);
|
||||
}
|
||||
|
||||
public CSteamID(ulong ulSteamID) {
|
||||
m_SteamID = ulSteamID;
|
||||
}
|
||||
|
||||
public void Set(AccountID_t unAccountID, EUniverse eUniverse, EAccountType eAccountType) {
|
||||
SetAccountID(unAccountID);
|
||||
SetEUniverse(eUniverse);
|
||||
SetEAccountType(eAccountType);
|
||||
|
||||
if (eAccountType == EAccountType.k_EAccountTypeClan || eAccountType == EAccountType.k_EAccountTypeGameServer) {
|
||||
SetAccountInstance(0);
|
||||
}
|
||||
else {
|
||||
// by default we pick the desktop instance
|
||||
SetAccountInstance(Constants.k_unSteamUserDesktopInstance);
|
||||
}
|
||||
}
|
||||
|
||||
public void InstancedSet(AccountID_t unAccountID, uint unInstance, EUniverse eUniverse, EAccountType eAccountType) {
|
||||
SetAccountID(unAccountID);
|
||||
SetEUniverse(eUniverse);
|
||||
SetEAccountType(eAccountType);
|
||||
SetAccountInstance(unInstance);
|
||||
}
|
||||
|
||||
public void Clear() {
|
||||
m_SteamID = 0;
|
||||
}
|
||||
|
||||
public void CreateBlankAnonLogon(EUniverse eUniverse) {
|
||||
SetAccountID(new AccountID_t(0));
|
||||
SetEUniverse(eUniverse);
|
||||
SetEAccountType(EAccountType.k_EAccountTypeAnonGameServer);
|
||||
SetAccountInstance(0);
|
||||
}
|
||||
|
||||
public void CreateBlankAnonUserLogon(EUniverse eUniverse) {
|
||||
SetAccountID(new AccountID_t(0));
|
||||
SetEUniverse(eUniverse);
|
||||
SetEAccountType(EAccountType.k_EAccountTypeAnonUser);
|
||||
SetAccountInstance(0);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this an anonymous game server login that will be filled in?
|
||||
//-----------------------------------------------------------------------------
|
||||
public bool BBlankAnonAccount() {
|
||||
return GetAccountID() == new AccountID_t(0) && BAnonAccount() && GetUnAccountInstance() == 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a game server account id? (Either persistent or anonymous)
|
||||
//-----------------------------------------------------------------------------
|
||||
public bool BGameServerAccount() {
|
||||
return GetEAccountType() == EAccountType.k_EAccountTypeGameServer || GetEAccountType() == EAccountType.k_EAccountTypeAnonGameServer;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a persistent (not anonymous) game server account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
public bool BPersistentGameServerAccount() {
|
||||
return GetEAccountType() == EAccountType.k_EAccountTypeGameServer;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this an anonymous game server account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
public bool BAnonGameServerAccount() {
|
||||
return GetEAccountType() == EAccountType.k_EAccountTypeAnonGameServer;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a content server account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
public bool BContentServerAccount() {
|
||||
return GetEAccountType() == EAccountType.k_EAccountTypeContentServer;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a clan account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
public bool BClanAccount() {
|
||||
return GetEAccountType() == EAccountType.k_EAccountTypeClan;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a chat account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
public bool BChatAccount() {
|
||||
return GetEAccountType() == EAccountType.k_EAccountTypeChat;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a chat account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
public bool IsLobby() {
|
||||
return (GetEAccountType() == EAccountType.k_EAccountTypeChat)
|
||||
&& (GetUnAccountInstance() & (int)EChatSteamIDInstanceFlags.k_EChatInstanceFlagLobby) != 0;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this an individual user account id?
|
||||
//-----------------------------------------------------------------------------
|
||||
public bool BIndividualAccount() {
|
||||
return GetEAccountType() == EAccountType.k_EAccountTypeIndividual || GetEAccountType() == EAccountType.k_EAccountTypeConsoleUser;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this an anonymous account?
|
||||
//-----------------------------------------------------------------------------
|
||||
public bool BAnonAccount() {
|
||||
return GetEAccountType() == EAccountType.k_EAccountTypeAnonUser || GetEAccountType() == EAccountType.k_EAccountTypeAnonGameServer;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this an anonymous user account? ( used to create an account or reset a password )
|
||||
//-----------------------------------------------------------------------------
|
||||
public bool BAnonUserAccount() {
|
||||
return GetEAccountType() == EAccountType.k_EAccountTypeAnonUser;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Is this a faked up Steam ID for a PSN friend account?
|
||||
//-----------------------------------------------------------------------------
|
||||
public bool BConsoleUserAccount() {
|
||||
return GetEAccountType() == EAccountType.k_EAccountTypeConsoleUser;
|
||||
}
|
||||
|
||||
public void SetAccountID(AccountID_t other) {
|
||||
m_SteamID = (m_SteamID & ~(0xFFFFFFFFul << (ushort)0)) | (((ulong)(other) & 0xFFFFFFFFul) << (ushort)0);
|
||||
}
|
||||
|
||||
public void SetAccountInstance(uint other) {
|
||||
m_SteamID = (m_SteamID & ~(0xFFFFFul << (ushort)32)) | (((ulong)(other) & 0xFFFFFul) << (ushort)32);
|
||||
}
|
||||
|
||||
// This is a non standard/custom function not found in C++ Steamworks
|
||||
public void SetEAccountType(EAccountType other) {
|
||||
m_SteamID = (m_SteamID & ~(0xFul << (ushort)52)) | (((ulong)(other) & 0xFul) << (ushort)52);
|
||||
}
|
||||
|
||||
public void SetEUniverse(EUniverse other) {
|
||||
m_SteamID = (m_SteamID & ~(0xFFul << (ushort)56)) | (((ulong)(other) & 0xFFul) << (ushort)56);
|
||||
}
|
||||
|
||||
public void ClearIndividualInstance() {
|
||||
if (BIndividualAccount())
|
||||
SetAccountInstance(0);
|
||||
}
|
||||
|
||||
public bool HasNoIndividualInstance() {
|
||||
return BIndividualAccount() && (GetUnAccountInstance() == 0);
|
||||
}
|
||||
|
||||
public AccountID_t GetAccountID() {
|
||||
return new AccountID_t((uint)(m_SteamID & 0xFFFFFFFFul));
|
||||
}
|
||||
|
||||
public uint GetUnAccountInstance() {
|
||||
return (uint)((m_SteamID >> 32) & 0xFFFFFul);
|
||||
}
|
||||
|
||||
public EAccountType GetEAccountType() {
|
||||
return (EAccountType)((m_SteamID >> 52) & 0xFul);
|
||||
}
|
||||
|
||||
public EUniverse GetEUniverse() {
|
||||
return (EUniverse)((m_SteamID >> 56) & 0xFFul);
|
||||
}
|
||||
|
||||
public bool IsValid() {
|
||||
if (GetEAccountType() <= EAccountType.k_EAccountTypeInvalid || GetEAccountType() >= EAccountType.k_EAccountTypeMax)
|
||||
return false;
|
||||
|
||||
if (GetEUniverse() <= EUniverse.k_EUniverseInvalid || GetEUniverse() >= EUniverse.k_EUniverseMax)
|
||||
return false;
|
||||
|
||||
if (GetEAccountType() == EAccountType.k_EAccountTypeIndividual) {
|
||||
if (GetAccountID() == new AccountID_t(0) || GetUnAccountInstance() > Constants.k_unSteamUserWebInstance)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (GetEAccountType() == EAccountType.k_EAccountTypeClan) {
|
||||
if (GetAccountID() == new AccountID_t(0) || GetUnAccountInstance() != 0)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (GetEAccountType() == EAccountType.k_EAccountTypeGameServer) {
|
||||
if (GetAccountID() == new AccountID_t(0))
|
||||
return false;
|
||||
// Any limit on instances? We use them for local users and bots
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
#region Overrides
|
||||
public override string ToString() {
|
||||
return m_SteamID.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is CSteamID && this == (CSteamID)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_SteamID.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(CSteamID x, CSteamID y) {
|
||||
return x.m_SteamID == y.m_SteamID;
|
||||
}
|
||||
|
||||
public static bool operator !=(CSteamID x, CSteamID y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator CSteamID(ulong value) {
|
||||
return new CSteamID(value);
|
||||
}
|
||||
public static explicit operator ulong(CSteamID that) {
|
||||
return that.m_SteamID;
|
||||
}
|
||||
|
||||
public bool Equals(CSteamID other) {
|
||||
return m_SteamID == other.m_SteamID;
|
||||
}
|
||||
|
||||
public int CompareTo(CSteamID other) {
|
||||
return m_SteamID.CompareTo(other.m_SteamID);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,65 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct HAuthTicket : System.IEquatable<HAuthTicket>, System.IComparable<HAuthTicket> {
|
||||
public static readonly HAuthTicket Invalid = new HAuthTicket(0);
|
||||
public uint m_HAuthTicket;
|
||||
|
||||
public HAuthTicket(uint value) {
|
||||
m_HAuthTicket = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_HAuthTicket.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is HAuthTicket && this == (HAuthTicket)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_HAuthTicket.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(HAuthTicket x, HAuthTicket y) {
|
||||
return x.m_HAuthTicket == y.m_HAuthTicket;
|
||||
}
|
||||
|
||||
public static bool operator !=(HAuthTicket x, HAuthTicket y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator HAuthTicket(uint value) {
|
||||
return new HAuthTicket(value);
|
||||
}
|
||||
|
||||
public static explicit operator uint(HAuthTicket that) {
|
||||
return that.m_HAuthTicket;
|
||||
}
|
||||
|
||||
public bool Equals(HAuthTicket other) {
|
||||
return m_HAuthTicket == other.m_HAuthTicket;
|
||||
}
|
||||
|
||||
public int CompareTo(HAuthTicket other) {
|
||||
return m_HAuthTicket.CompareTo(other.m_HAuthTicket);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,64 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct ControllerActionSetHandle_t : System.IEquatable<ControllerActionSetHandle_t>, System.IComparable<ControllerActionSetHandle_t> {
|
||||
public ulong m_ControllerActionSetHandle;
|
||||
|
||||
public ControllerActionSetHandle_t(ulong value) {
|
||||
m_ControllerActionSetHandle = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_ControllerActionSetHandle.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is ControllerActionSetHandle_t && this == (ControllerActionSetHandle_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_ControllerActionSetHandle.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(ControllerActionSetHandle_t x, ControllerActionSetHandle_t y) {
|
||||
return x.m_ControllerActionSetHandle == y.m_ControllerActionSetHandle;
|
||||
}
|
||||
|
||||
public static bool operator !=(ControllerActionSetHandle_t x, ControllerActionSetHandle_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator ControllerActionSetHandle_t(ulong value) {
|
||||
return new ControllerActionSetHandle_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator ulong(ControllerActionSetHandle_t that) {
|
||||
return that.m_ControllerActionSetHandle;
|
||||
}
|
||||
|
||||
public bool Equals(ControllerActionSetHandle_t other) {
|
||||
return m_ControllerActionSetHandle == other.m_ControllerActionSetHandle;
|
||||
}
|
||||
|
||||
public int CompareTo(ControllerActionSetHandle_t other) {
|
||||
return m_ControllerActionSetHandle.CompareTo(other.m_ControllerActionSetHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct ControllerAnalogActionHandle_t : System.IEquatable<ControllerAnalogActionHandle_t>, System.IComparable<ControllerAnalogActionHandle_t> {
|
||||
public ulong m_ControllerAnalogActionHandle;
|
||||
|
||||
public ControllerAnalogActionHandle_t(ulong value) {
|
||||
m_ControllerAnalogActionHandle = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_ControllerAnalogActionHandle.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is ControllerAnalogActionHandle_t && this == (ControllerAnalogActionHandle_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_ControllerAnalogActionHandle.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(ControllerAnalogActionHandle_t x, ControllerAnalogActionHandle_t y) {
|
||||
return x.m_ControllerAnalogActionHandle == y.m_ControllerAnalogActionHandle;
|
||||
}
|
||||
|
||||
public static bool operator !=(ControllerAnalogActionHandle_t x, ControllerAnalogActionHandle_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator ControllerAnalogActionHandle_t(ulong value) {
|
||||
return new ControllerAnalogActionHandle_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator ulong(ControllerAnalogActionHandle_t that) {
|
||||
return that.m_ControllerAnalogActionHandle;
|
||||
}
|
||||
|
||||
public bool Equals(ControllerAnalogActionHandle_t other) {
|
||||
return m_ControllerAnalogActionHandle == other.m_ControllerAnalogActionHandle;
|
||||
}
|
||||
|
||||
public int CompareTo(ControllerAnalogActionHandle_t other) {
|
||||
return m_ControllerAnalogActionHandle.CompareTo(other.m_ControllerAnalogActionHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct ControllerDigitalActionHandle_t : System.IEquatable<ControllerDigitalActionHandle_t>, System.IComparable<ControllerDigitalActionHandle_t> {
|
||||
public ulong m_ControllerDigitalActionHandle;
|
||||
|
||||
public ControllerDigitalActionHandle_t(ulong value) {
|
||||
m_ControllerDigitalActionHandle = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_ControllerDigitalActionHandle.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is ControllerDigitalActionHandle_t && this == (ControllerDigitalActionHandle_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_ControllerDigitalActionHandle.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(ControllerDigitalActionHandle_t x, ControllerDigitalActionHandle_t y) {
|
||||
return x.m_ControllerDigitalActionHandle == y.m_ControllerDigitalActionHandle;
|
||||
}
|
||||
|
||||
public static bool operator !=(ControllerDigitalActionHandle_t x, ControllerDigitalActionHandle_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator ControllerDigitalActionHandle_t(ulong value) {
|
||||
return new ControllerDigitalActionHandle_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator ulong(ControllerDigitalActionHandle_t that) {
|
||||
return that.m_ControllerDigitalActionHandle;
|
||||
}
|
||||
|
||||
public bool Equals(ControllerDigitalActionHandle_t other) {
|
||||
return m_ControllerDigitalActionHandle == other.m_ControllerDigitalActionHandle;
|
||||
}
|
||||
|
||||
public int CompareTo(ControllerDigitalActionHandle_t other) {
|
||||
return m_ControllerDigitalActionHandle.CompareTo(other.m_ControllerDigitalActionHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,64 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct ControllerHandle_t : System.IEquatable<ControllerHandle_t>, System.IComparable<ControllerHandle_t> {
|
||||
public ulong m_ControllerHandle;
|
||||
|
||||
public ControllerHandle_t(ulong value) {
|
||||
m_ControllerHandle = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_ControllerHandle.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is ControllerHandle_t && this == (ControllerHandle_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_ControllerHandle.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(ControllerHandle_t x, ControllerHandle_t y) {
|
||||
return x.m_ControllerHandle == y.m_ControllerHandle;
|
||||
}
|
||||
|
||||
public static bool operator !=(ControllerHandle_t x, ControllerHandle_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator ControllerHandle_t(ulong value) {
|
||||
return new ControllerHandle_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator ulong(ControllerHandle_t that) {
|
||||
return that.m_ControllerHandle;
|
||||
}
|
||||
|
||||
public bool Equals(ControllerHandle_t other) {
|
||||
return m_ControllerHandle == other.m_ControllerHandle;
|
||||
}
|
||||
|
||||
public int CompareTo(ControllerHandle_t other) {
|
||||
return m_ControllerHandle.CompareTo(other.m_ControllerHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,65 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct FriendsGroupID_t : System.IEquatable<FriendsGroupID_t>, System.IComparable<FriendsGroupID_t> {
|
||||
public static readonly FriendsGroupID_t Invalid = new FriendsGroupID_t(-1);
|
||||
public short m_FriendsGroupID;
|
||||
|
||||
public FriendsGroupID_t(short value) {
|
||||
m_FriendsGroupID = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_FriendsGroupID.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is FriendsGroupID_t && this == (FriendsGroupID_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_FriendsGroupID.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(FriendsGroupID_t x, FriendsGroupID_t y) {
|
||||
return x.m_FriendsGroupID == y.m_FriendsGroupID;
|
||||
}
|
||||
|
||||
public static bool operator !=(FriendsGroupID_t x, FriendsGroupID_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator FriendsGroupID_t(short value) {
|
||||
return new FriendsGroupID_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator short(FriendsGroupID_t that) {
|
||||
return that.m_FriendsGroupID;
|
||||
}
|
||||
|
||||
public bool Equals(FriendsGroupID_t other) {
|
||||
return m_FriendsGroupID == other.m_FriendsGroupID;
|
||||
}
|
||||
|
||||
public int CompareTo(FriendsGroupID_t other) {
|
||||
return m_FriendsGroupID.CompareTo(other.m_FriendsGroupID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,65 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct HHTMLBrowser : System.IEquatable<HHTMLBrowser>, System.IComparable<HHTMLBrowser> {
|
||||
public static readonly HHTMLBrowser Invalid = new HHTMLBrowser(0);
|
||||
public uint m_HHTMLBrowser;
|
||||
|
||||
public HHTMLBrowser(uint value) {
|
||||
m_HHTMLBrowser = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_HHTMLBrowser.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is HHTMLBrowser && this == (HHTMLBrowser)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_HHTMLBrowser.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(HHTMLBrowser x, HHTMLBrowser y) {
|
||||
return x.m_HHTMLBrowser == y.m_HHTMLBrowser;
|
||||
}
|
||||
|
||||
public static bool operator !=(HHTMLBrowser x, HHTMLBrowser y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator HHTMLBrowser(uint value) {
|
||||
return new HHTMLBrowser(value);
|
||||
}
|
||||
|
||||
public static explicit operator uint(HHTMLBrowser that) {
|
||||
return that.m_HHTMLBrowser;
|
||||
}
|
||||
|
||||
public bool Equals(HHTMLBrowser other) {
|
||||
return m_HHTMLBrowser == other.m_HHTMLBrowser;
|
||||
}
|
||||
|
||||
public int CompareTo(HHTMLBrowser other) {
|
||||
return m_HHTMLBrowser.CompareTo(other.m_HHTMLBrowser);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,65 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct HTTPCookieContainerHandle : System.IEquatable<HTTPCookieContainerHandle>, System.IComparable<HTTPCookieContainerHandle> {
|
||||
public static readonly HTTPCookieContainerHandle Invalid = new HTTPCookieContainerHandle(0);
|
||||
public uint m_HTTPCookieContainerHandle;
|
||||
|
||||
public HTTPCookieContainerHandle(uint value) {
|
||||
m_HTTPCookieContainerHandle = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_HTTPCookieContainerHandle.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is HTTPCookieContainerHandle && this == (HTTPCookieContainerHandle)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_HTTPCookieContainerHandle.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(HTTPCookieContainerHandle x, HTTPCookieContainerHandle y) {
|
||||
return x.m_HTTPCookieContainerHandle == y.m_HTTPCookieContainerHandle;
|
||||
}
|
||||
|
||||
public static bool operator !=(HTTPCookieContainerHandle x, HTTPCookieContainerHandle y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator HTTPCookieContainerHandle(uint value) {
|
||||
return new HTTPCookieContainerHandle(value);
|
||||
}
|
||||
|
||||
public static explicit operator uint(HTTPCookieContainerHandle that) {
|
||||
return that.m_HTTPCookieContainerHandle;
|
||||
}
|
||||
|
||||
public bool Equals(HTTPCookieContainerHandle other) {
|
||||
return m_HTTPCookieContainerHandle == other.m_HTTPCookieContainerHandle;
|
||||
}
|
||||
|
||||
public int CompareTo(HTTPCookieContainerHandle other) {
|
||||
return m_HTTPCookieContainerHandle.CompareTo(other.m_HTTPCookieContainerHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,65 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct HTTPRequestHandle : System.IEquatable<HTTPRequestHandle>, System.IComparable<HTTPRequestHandle> {
|
||||
public static readonly HTTPRequestHandle Invalid = new HTTPRequestHandle(0);
|
||||
public uint m_HTTPRequestHandle;
|
||||
|
||||
public HTTPRequestHandle(uint value) {
|
||||
m_HTTPRequestHandle = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_HTTPRequestHandle.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is HTTPRequestHandle && this == (HTTPRequestHandle)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_HTTPRequestHandle.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(HTTPRequestHandle x, HTTPRequestHandle y) {
|
||||
return x.m_HTTPRequestHandle == y.m_HTTPRequestHandle;
|
||||
}
|
||||
|
||||
public static bool operator !=(HTTPRequestHandle x, HTTPRequestHandle y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator HTTPRequestHandle(uint value) {
|
||||
return new HTTPRequestHandle(value);
|
||||
}
|
||||
|
||||
public static explicit operator uint(HTTPRequestHandle that) {
|
||||
return that.m_HTTPRequestHandle;
|
||||
}
|
||||
|
||||
public bool Equals(HTTPRequestHandle other) {
|
||||
return m_HTTPRequestHandle == other.m_HTTPRequestHandle;
|
||||
}
|
||||
|
||||
public int CompareTo(HTTPRequestHandle other) {
|
||||
return m_HTTPRequestHandle.CompareTo(other.m_HTTPRequestHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,64 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct InputActionSetHandle_t : System.IEquatable<InputActionSetHandle_t>, System.IComparable<InputActionSetHandle_t> {
|
||||
public ulong m_InputActionSetHandle;
|
||||
|
||||
public InputActionSetHandle_t(ulong value) {
|
||||
m_InputActionSetHandle = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_InputActionSetHandle.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is InputActionSetHandle_t && this == (InputActionSetHandle_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_InputActionSetHandle.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(InputActionSetHandle_t x, InputActionSetHandle_t y) {
|
||||
return x.m_InputActionSetHandle == y.m_InputActionSetHandle;
|
||||
}
|
||||
|
||||
public static bool operator !=(InputActionSetHandle_t x, InputActionSetHandle_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator InputActionSetHandle_t(ulong value) {
|
||||
return new InputActionSetHandle_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator ulong(InputActionSetHandle_t that) {
|
||||
return that.m_InputActionSetHandle;
|
||||
}
|
||||
|
||||
public bool Equals(InputActionSetHandle_t other) {
|
||||
return m_InputActionSetHandle == other.m_InputActionSetHandle;
|
||||
}
|
||||
|
||||
public int CompareTo(InputActionSetHandle_t other) {
|
||||
return m_InputActionSetHandle.CompareTo(other.m_InputActionSetHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,64 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct InputAnalogActionHandle_t : System.IEquatable<InputAnalogActionHandle_t>, System.IComparable<InputAnalogActionHandle_t> {
|
||||
public ulong m_InputAnalogActionHandle;
|
||||
|
||||
public InputAnalogActionHandle_t(ulong value) {
|
||||
m_InputAnalogActionHandle = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_InputAnalogActionHandle.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is InputAnalogActionHandle_t && this == (InputAnalogActionHandle_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_InputAnalogActionHandle.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(InputAnalogActionHandle_t x, InputAnalogActionHandle_t y) {
|
||||
return x.m_InputAnalogActionHandle == y.m_InputAnalogActionHandle;
|
||||
}
|
||||
|
||||
public static bool operator !=(InputAnalogActionHandle_t x, InputAnalogActionHandle_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator InputAnalogActionHandle_t(ulong value) {
|
||||
return new InputAnalogActionHandle_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator ulong(InputAnalogActionHandle_t that) {
|
||||
return that.m_InputAnalogActionHandle;
|
||||
}
|
||||
|
||||
public bool Equals(InputAnalogActionHandle_t other) {
|
||||
return m_InputAnalogActionHandle == other.m_InputAnalogActionHandle;
|
||||
}
|
||||
|
||||
public int CompareTo(InputAnalogActionHandle_t other) {
|
||||
return m_InputAnalogActionHandle.CompareTo(other.m_InputAnalogActionHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,64 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct InputDigitalActionHandle_t : System.IEquatable<InputDigitalActionHandle_t>, System.IComparable<InputDigitalActionHandle_t> {
|
||||
public ulong m_InputDigitalActionHandle;
|
||||
|
||||
public InputDigitalActionHandle_t(ulong value) {
|
||||
m_InputDigitalActionHandle = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_InputDigitalActionHandle.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is InputDigitalActionHandle_t && this == (InputDigitalActionHandle_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_InputDigitalActionHandle.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(InputDigitalActionHandle_t x, InputDigitalActionHandle_t y) {
|
||||
return x.m_InputDigitalActionHandle == y.m_InputDigitalActionHandle;
|
||||
}
|
||||
|
||||
public static bool operator !=(InputDigitalActionHandle_t x, InputDigitalActionHandle_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator InputDigitalActionHandle_t(ulong value) {
|
||||
return new InputDigitalActionHandle_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator ulong(InputDigitalActionHandle_t that) {
|
||||
return that.m_InputDigitalActionHandle;
|
||||
}
|
||||
|
||||
public bool Equals(InputDigitalActionHandle_t other) {
|
||||
return m_InputDigitalActionHandle == other.m_InputDigitalActionHandle;
|
||||
}
|
||||
|
||||
public int CompareTo(InputDigitalActionHandle_t other) {
|
||||
return m_InputDigitalActionHandle.CompareTo(other.m_InputDigitalActionHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,64 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct InputHandle_t : System.IEquatable<InputHandle_t>, System.IComparable<InputHandle_t> {
|
||||
public ulong m_InputHandle;
|
||||
|
||||
public InputHandle_t(ulong value) {
|
||||
m_InputHandle = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_InputHandle.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is InputHandle_t && this == (InputHandle_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_InputHandle.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(InputHandle_t x, InputHandle_t y) {
|
||||
return x.m_InputHandle == y.m_InputHandle;
|
||||
}
|
||||
|
||||
public static bool operator !=(InputHandle_t x, InputHandle_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator InputHandle_t(ulong value) {
|
||||
return new InputHandle_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator ulong(InputHandle_t that) {
|
||||
return that.m_InputHandle;
|
||||
}
|
||||
|
||||
public bool Equals(InputHandle_t other) {
|
||||
return m_InputHandle == other.m_InputHandle;
|
||||
}
|
||||
|
||||
public int CompareTo(InputHandle_t other) {
|
||||
return m_InputHandle.CompareTo(other.m_InputHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,65 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct SteamInventoryResult_t : System.IEquatable<SteamInventoryResult_t>, System.IComparable<SteamInventoryResult_t> {
|
||||
public static readonly SteamInventoryResult_t Invalid = new SteamInventoryResult_t(-1);
|
||||
public int m_SteamInventoryResult;
|
||||
|
||||
public SteamInventoryResult_t(int value) {
|
||||
m_SteamInventoryResult = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_SteamInventoryResult.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is SteamInventoryResult_t && this == (SteamInventoryResult_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_SteamInventoryResult.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(SteamInventoryResult_t x, SteamInventoryResult_t y) {
|
||||
return x.m_SteamInventoryResult == y.m_SteamInventoryResult;
|
||||
}
|
||||
|
||||
public static bool operator !=(SteamInventoryResult_t x, SteamInventoryResult_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator SteamInventoryResult_t(int value) {
|
||||
return new SteamInventoryResult_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator int(SteamInventoryResult_t that) {
|
||||
return that.m_SteamInventoryResult;
|
||||
}
|
||||
|
||||
public bool Equals(SteamInventoryResult_t other) {
|
||||
return m_SteamInventoryResult == other.m_SteamInventoryResult;
|
||||
}
|
||||
|
||||
public int CompareTo(SteamInventoryResult_t other) {
|
||||
return m_SteamInventoryResult.CompareTo(other.m_SteamInventoryResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,65 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct SteamInventoryUpdateHandle_t : System.IEquatable<SteamInventoryUpdateHandle_t>, System.IComparable<SteamInventoryUpdateHandle_t> {
|
||||
public static readonly SteamInventoryUpdateHandle_t Invalid = new SteamInventoryUpdateHandle_t(0xffffffffffffffff);
|
||||
public ulong m_SteamInventoryUpdateHandle;
|
||||
|
||||
public SteamInventoryUpdateHandle_t(ulong value) {
|
||||
m_SteamInventoryUpdateHandle = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_SteamInventoryUpdateHandle.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is SteamInventoryUpdateHandle_t && this == (SteamInventoryUpdateHandle_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_SteamInventoryUpdateHandle.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(SteamInventoryUpdateHandle_t x, SteamInventoryUpdateHandle_t y) {
|
||||
return x.m_SteamInventoryUpdateHandle == y.m_SteamInventoryUpdateHandle;
|
||||
}
|
||||
|
||||
public static bool operator !=(SteamInventoryUpdateHandle_t x, SteamInventoryUpdateHandle_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator SteamInventoryUpdateHandle_t(ulong value) {
|
||||
return new SteamInventoryUpdateHandle_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator ulong(SteamInventoryUpdateHandle_t that) {
|
||||
return that.m_SteamInventoryUpdateHandle;
|
||||
}
|
||||
|
||||
public bool Equals(SteamInventoryUpdateHandle_t other) {
|
||||
return m_SteamInventoryUpdateHandle == other.m_SteamInventoryUpdateHandle;
|
||||
}
|
||||
|
||||
public int CompareTo(SteamInventoryUpdateHandle_t other) {
|
||||
return m_SteamInventoryUpdateHandle.CompareTo(other.m_SteamInventoryUpdateHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,64 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct SteamItemDef_t : System.IEquatable<SteamItemDef_t>, System.IComparable<SteamItemDef_t> {
|
||||
public int m_SteamItemDef;
|
||||
|
||||
public SteamItemDef_t(int value) {
|
||||
m_SteamItemDef = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_SteamItemDef.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is SteamItemDef_t && this == (SteamItemDef_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_SteamItemDef.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(SteamItemDef_t x, SteamItemDef_t y) {
|
||||
return x.m_SteamItemDef == y.m_SteamItemDef;
|
||||
}
|
||||
|
||||
public static bool operator !=(SteamItemDef_t x, SteamItemDef_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator SteamItemDef_t(int value) {
|
||||
return new SteamItemDef_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator int(SteamItemDef_t that) {
|
||||
return that.m_SteamItemDef;
|
||||
}
|
||||
|
||||
public bool Equals(SteamItemDef_t other) {
|
||||
return m_SteamItemDef == other.m_SteamItemDef;
|
||||
}
|
||||
|
||||
public int CompareTo(SteamItemDef_t other) {
|
||||
return m_SteamItemDef.CompareTo(other.m_SteamItemDef);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,65 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct SteamItemInstanceID_t : System.IEquatable<SteamItemInstanceID_t>, System.IComparable<SteamItemInstanceID_t> {
|
||||
public static readonly SteamItemInstanceID_t Invalid = new SteamItemInstanceID_t(0xFFFFFFFFFFFFFFFF);
|
||||
public ulong m_SteamItemInstanceID;
|
||||
|
||||
public SteamItemInstanceID_t(ulong value) {
|
||||
m_SteamItemInstanceID = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_SteamItemInstanceID.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is SteamItemInstanceID_t && this == (SteamItemInstanceID_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_SteamItemInstanceID.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(SteamItemInstanceID_t x, SteamItemInstanceID_t y) {
|
||||
return x.m_SteamItemInstanceID == y.m_SteamItemInstanceID;
|
||||
}
|
||||
|
||||
public static bool operator !=(SteamItemInstanceID_t x, SteamItemInstanceID_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator SteamItemInstanceID_t(ulong value) {
|
||||
return new SteamItemInstanceID_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator ulong(SteamItemInstanceID_t that) {
|
||||
return that.m_SteamItemInstanceID;
|
||||
}
|
||||
|
||||
public bool Equals(SteamItemInstanceID_t other) {
|
||||
return m_SteamItemInstanceID == other.m_SteamItemInstanceID;
|
||||
}
|
||||
|
||||
public int CompareTo(SteamItemInstanceID_t other) {
|
||||
return m_SteamItemInstanceID.CompareTo(other.m_SteamItemInstanceID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,61 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct HServerListRequest : System.IEquatable<HServerListRequest> {
|
||||
public static readonly HServerListRequest Invalid = new HServerListRequest(System.IntPtr.Zero);
|
||||
public System.IntPtr m_HServerListRequest;
|
||||
|
||||
public HServerListRequest(System.IntPtr value) {
|
||||
m_HServerListRequest = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_HServerListRequest.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is HServerListRequest && this == (HServerListRequest)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_HServerListRequest.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(HServerListRequest x, HServerListRequest y) {
|
||||
return x.m_HServerListRequest == y.m_HServerListRequest;
|
||||
}
|
||||
|
||||
public static bool operator !=(HServerListRequest x, HServerListRequest y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator HServerListRequest(System.IntPtr value) {
|
||||
return new HServerListRequest(value);
|
||||
}
|
||||
|
||||
public static explicit operator System.IntPtr(HServerListRequest that) {
|
||||
return that.m_HServerListRequest;
|
||||
}
|
||||
|
||||
public bool Equals(HServerListRequest other) {
|
||||
return m_HServerListRequest == other.m_HServerListRequest;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,65 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct HServerQuery : System.IEquatable<HServerQuery>, System.IComparable<HServerQuery> {
|
||||
public static readonly HServerQuery Invalid = new HServerQuery(-1);
|
||||
public int m_HServerQuery;
|
||||
|
||||
public HServerQuery(int value) {
|
||||
m_HServerQuery = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_HServerQuery.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is HServerQuery && this == (HServerQuery)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_HServerQuery.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(HServerQuery x, HServerQuery y) {
|
||||
return x.m_HServerQuery == y.m_HServerQuery;
|
||||
}
|
||||
|
||||
public static bool operator !=(HServerQuery x, HServerQuery y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator HServerQuery(int value) {
|
||||
return new HServerQuery(value);
|
||||
}
|
||||
|
||||
public static explicit operator int(HServerQuery that) {
|
||||
return that.m_HServerQuery;
|
||||
}
|
||||
|
||||
public bool Equals(HServerQuery other) {
|
||||
return m_HServerQuery == other.m_HServerQuery;
|
||||
}
|
||||
|
||||
public int CompareTo(HServerQuery other) {
|
||||
return m_HServerQuery.CompareTo(other.m_HServerQuery);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,64 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct SNetListenSocket_t : System.IEquatable<SNetListenSocket_t>, System.IComparable<SNetListenSocket_t> {
|
||||
public uint m_SNetListenSocket;
|
||||
|
||||
public SNetListenSocket_t(uint value) {
|
||||
m_SNetListenSocket = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_SNetListenSocket.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is SNetListenSocket_t && this == (SNetListenSocket_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_SNetListenSocket.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(SNetListenSocket_t x, SNetListenSocket_t y) {
|
||||
return x.m_SNetListenSocket == y.m_SNetListenSocket;
|
||||
}
|
||||
|
||||
public static bool operator !=(SNetListenSocket_t x, SNetListenSocket_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator SNetListenSocket_t(uint value) {
|
||||
return new SNetListenSocket_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator uint(SNetListenSocket_t that) {
|
||||
return that.m_SNetListenSocket;
|
||||
}
|
||||
|
||||
public bool Equals(SNetListenSocket_t other) {
|
||||
return m_SNetListenSocket == other.m_SNetListenSocket;
|
||||
}
|
||||
|
||||
public int CompareTo(SNetListenSocket_t other) {
|
||||
return m_SNetListenSocket.CompareTo(other.m_SNetListenSocket);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,64 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct SNetSocket_t : System.IEquatable<SNetSocket_t>, System.IComparable<SNetSocket_t> {
|
||||
public uint m_SNetSocket;
|
||||
|
||||
public SNetSocket_t(uint value) {
|
||||
m_SNetSocket = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_SNetSocket.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is SNetSocket_t && this == (SNetSocket_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_SNetSocket.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(SNetSocket_t x, SNetSocket_t y) {
|
||||
return x.m_SNetSocket == y.m_SNetSocket;
|
||||
}
|
||||
|
||||
public static bool operator !=(SNetSocket_t x, SNetSocket_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator SNetSocket_t(uint value) {
|
||||
return new SNetSocket_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator uint(SNetSocket_t that) {
|
||||
return that.m_SNetSocket;
|
||||
}
|
||||
|
||||
public bool Equals(SNetSocket_t other) {
|
||||
return m_SNetSocket == other.m_SNetSocket;
|
||||
}
|
||||
|
||||
public int CompareTo(SNetSocket_t other) {
|
||||
return m_SNetSocket.CompareTo(other.m_SNetSocket);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,65 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct PublishedFileId_t : System.IEquatable<PublishedFileId_t>, System.IComparable<PublishedFileId_t> {
|
||||
public static readonly PublishedFileId_t Invalid = new PublishedFileId_t(0);
|
||||
public ulong m_PublishedFileId;
|
||||
|
||||
public PublishedFileId_t(ulong value) {
|
||||
m_PublishedFileId = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_PublishedFileId.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is PublishedFileId_t && this == (PublishedFileId_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_PublishedFileId.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(PublishedFileId_t x, PublishedFileId_t y) {
|
||||
return x.m_PublishedFileId == y.m_PublishedFileId;
|
||||
}
|
||||
|
||||
public static bool operator !=(PublishedFileId_t x, PublishedFileId_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator PublishedFileId_t(ulong value) {
|
||||
return new PublishedFileId_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator ulong(PublishedFileId_t that) {
|
||||
return that.m_PublishedFileId;
|
||||
}
|
||||
|
||||
public bool Equals(PublishedFileId_t other) {
|
||||
return m_PublishedFileId == other.m_PublishedFileId;
|
||||
}
|
||||
|
||||
public int CompareTo(PublishedFileId_t other) {
|
||||
return m_PublishedFileId.CompareTo(other.m_PublishedFileId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct PublishedFileUpdateHandle_t : System.IEquatable<PublishedFileUpdateHandle_t>, System.IComparable<PublishedFileUpdateHandle_t> {
|
||||
public static readonly PublishedFileUpdateHandle_t Invalid = new PublishedFileUpdateHandle_t(0xffffffffffffffff);
|
||||
public ulong m_PublishedFileUpdateHandle;
|
||||
|
||||
public PublishedFileUpdateHandle_t(ulong value) {
|
||||
m_PublishedFileUpdateHandle = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_PublishedFileUpdateHandle.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is PublishedFileUpdateHandle_t && this == (PublishedFileUpdateHandle_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_PublishedFileUpdateHandle.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(PublishedFileUpdateHandle_t x, PublishedFileUpdateHandle_t y) {
|
||||
return x.m_PublishedFileUpdateHandle == y.m_PublishedFileUpdateHandle;
|
||||
}
|
||||
|
||||
public static bool operator !=(PublishedFileUpdateHandle_t x, PublishedFileUpdateHandle_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator PublishedFileUpdateHandle_t(ulong value) {
|
||||
return new PublishedFileUpdateHandle_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator ulong(PublishedFileUpdateHandle_t that) {
|
||||
return that.m_PublishedFileUpdateHandle;
|
||||
}
|
||||
|
||||
public bool Equals(PublishedFileUpdateHandle_t other) {
|
||||
return m_PublishedFileUpdateHandle == other.m_PublishedFileUpdateHandle;
|
||||
}
|
||||
|
||||
public int CompareTo(PublishedFileUpdateHandle_t other) {
|
||||
return m_PublishedFileUpdateHandle.CompareTo(other.m_PublishedFileUpdateHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct UGCFileWriteStreamHandle_t : System.IEquatable<UGCFileWriteStreamHandle_t>, System.IComparable<UGCFileWriteStreamHandle_t> {
|
||||
public static readonly UGCFileWriteStreamHandle_t Invalid = new UGCFileWriteStreamHandle_t(0xffffffffffffffff);
|
||||
public ulong m_UGCFileWriteStreamHandle;
|
||||
|
||||
public UGCFileWriteStreamHandle_t(ulong value) {
|
||||
m_UGCFileWriteStreamHandle = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_UGCFileWriteStreamHandle.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is UGCFileWriteStreamHandle_t && this == (UGCFileWriteStreamHandle_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_UGCFileWriteStreamHandle.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(UGCFileWriteStreamHandle_t x, UGCFileWriteStreamHandle_t y) {
|
||||
return x.m_UGCFileWriteStreamHandle == y.m_UGCFileWriteStreamHandle;
|
||||
}
|
||||
|
||||
public static bool operator !=(UGCFileWriteStreamHandle_t x, UGCFileWriteStreamHandle_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator UGCFileWriteStreamHandle_t(ulong value) {
|
||||
return new UGCFileWriteStreamHandle_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator ulong(UGCFileWriteStreamHandle_t that) {
|
||||
return that.m_UGCFileWriteStreamHandle;
|
||||
}
|
||||
|
||||
public bool Equals(UGCFileWriteStreamHandle_t other) {
|
||||
return m_UGCFileWriteStreamHandle == other.m_UGCFileWriteStreamHandle;
|
||||
}
|
||||
|
||||
public int CompareTo(UGCFileWriteStreamHandle_t other) {
|
||||
return m_UGCFileWriteStreamHandle.CompareTo(other.m_UGCFileWriteStreamHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,65 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct UGCHandle_t : System.IEquatable<UGCHandle_t>, System.IComparable<UGCHandle_t> {
|
||||
public static readonly UGCHandle_t Invalid = new UGCHandle_t(0xffffffffffffffff);
|
||||
public ulong m_UGCHandle;
|
||||
|
||||
public UGCHandle_t(ulong value) {
|
||||
m_UGCHandle = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_UGCHandle.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is UGCHandle_t && this == (UGCHandle_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_UGCHandle.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(UGCHandle_t x, UGCHandle_t y) {
|
||||
return x.m_UGCHandle == y.m_UGCHandle;
|
||||
}
|
||||
|
||||
public static bool operator !=(UGCHandle_t x, UGCHandle_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator UGCHandle_t(ulong value) {
|
||||
return new UGCHandle_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator ulong(UGCHandle_t that) {
|
||||
return that.m_UGCHandle;
|
||||
}
|
||||
|
||||
public bool Equals(UGCHandle_t other) {
|
||||
return m_UGCHandle == other.m_UGCHandle;
|
||||
}
|
||||
|
||||
public int CompareTo(UGCHandle_t other) {
|
||||
return m_UGCHandle.CompareTo(other.m_UGCHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,65 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct ScreenshotHandle : System.IEquatable<ScreenshotHandle>, System.IComparable<ScreenshotHandle> {
|
||||
public static readonly ScreenshotHandle Invalid = new ScreenshotHandle(0);
|
||||
public uint m_ScreenshotHandle;
|
||||
|
||||
public ScreenshotHandle(uint value) {
|
||||
m_ScreenshotHandle = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_ScreenshotHandle.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is ScreenshotHandle && this == (ScreenshotHandle)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_ScreenshotHandle.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(ScreenshotHandle x, ScreenshotHandle y) {
|
||||
return x.m_ScreenshotHandle == y.m_ScreenshotHandle;
|
||||
}
|
||||
|
||||
public static bool operator !=(ScreenshotHandle x, ScreenshotHandle y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator ScreenshotHandle(uint value) {
|
||||
return new ScreenshotHandle(value);
|
||||
}
|
||||
|
||||
public static explicit operator uint(ScreenshotHandle that) {
|
||||
return that.m_ScreenshotHandle;
|
||||
}
|
||||
|
||||
public bool Equals(ScreenshotHandle other) {
|
||||
return m_ScreenshotHandle == other.m_ScreenshotHandle;
|
||||
}
|
||||
|
||||
public int CompareTo(ScreenshotHandle other) {
|
||||
return m_ScreenshotHandle.CompareTo(other.m_ScreenshotHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,64 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct AccountID_t : System.IEquatable<AccountID_t>, System.IComparable<AccountID_t> {
|
||||
public uint m_AccountID;
|
||||
|
||||
public AccountID_t(uint value) {
|
||||
m_AccountID = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_AccountID.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is AccountID_t && this == (AccountID_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_AccountID.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(AccountID_t x, AccountID_t y) {
|
||||
return x.m_AccountID == y.m_AccountID;
|
||||
}
|
||||
|
||||
public static bool operator !=(AccountID_t x, AccountID_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator AccountID_t(uint value) {
|
||||
return new AccountID_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator uint(AccountID_t that) {
|
||||
return that.m_AccountID;
|
||||
}
|
||||
|
||||
public bool Equals(AccountID_t other) {
|
||||
return m_AccountID == other.m_AccountID;
|
||||
}
|
||||
|
||||
public int CompareTo(AccountID_t other) {
|
||||
return m_AccountID.CompareTo(other.m_AccountID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,65 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct AppId_t : System.IEquatable<AppId_t>, System.IComparable<AppId_t> {
|
||||
public static readonly AppId_t Invalid = new AppId_t(0x0);
|
||||
public uint m_AppId;
|
||||
|
||||
public AppId_t(uint value) {
|
||||
m_AppId = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_AppId.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is AppId_t && this == (AppId_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_AppId.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(AppId_t x, AppId_t y) {
|
||||
return x.m_AppId == y.m_AppId;
|
||||
}
|
||||
|
||||
public static bool operator !=(AppId_t x, AppId_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator AppId_t(uint value) {
|
||||
return new AppId_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator uint(AppId_t that) {
|
||||
return that.m_AppId;
|
||||
}
|
||||
|
||||
public bool Equals(AppId_t other) {
|
||||
return m_AppId == other.m_AppId;
|
||||
}
|
||||
|
||||
public int CompareTo(AppId_t other) {
|
||||
return m_AppId.CompareTo(other.m_AppId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,65 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct DepotId_t : System.IEquatable<DepotId_t>, System.IComparable<DepotId_t> {
|
||||
public static readonly DepotId_t Invalid = new DepotId_t(0x0);
|
||||
public uint m_DepotId;
|
||||
|
||||
public DepotId_t(uint value) {
|
||||
m_DepotId = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_DepotId.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is DepotId_t && this == (DepotId_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_DepotId.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(DepotId_t x, DepotId_t y) {
|
||||
return x.m_DepotId == y.m_DepotId;
|
||||
}
|
||||
|
||||
public static bool operator !=(DepotId_t x, DepotId_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator DepotId_t(uint value) {
|
||||
return new DepotId_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator uint(DepotId_t that) {
|
||||
return that.m_DepotId;
|
||||
}
|
||||
|
||||
public bool Equals(DepotId_t other) {
|
||||
return m_DepotId == other.m_DepotId;
|
||||
}
|
||||
|
||||
public int CompareTo(DepotId_t other) {
|
||||
return m_DepotId.CompareTo(other.m_DepotId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,65 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct ManifestId_t : System.IEquatable<ManifestId_t>, System.IComparable<ManifestId_t> {
|
||||
public static readonly ManifestId_t Invalid = new ManifestId_t(0x0);
|
||||
public ulong m_ManifestId;
|
||||
|
||||
public ManifestId_t(ulong value) {
|
||||
m_ManifestId = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_ManifestId.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is ManifestId_t && this == (ManifestId_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_ManifestId.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(ManifestId_t x, ManifestId_t y) {
|
||||
return x.m_ManifestId == y.m_ManifestId;
|
||||
}
|
||||
|
||||
public static bool operator !=(ManifestId_t x, ManifestId_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator ManifestId_t(ulong value) {
|
||||
return new ManifestId_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator ulong(ManifestId_t that) {
|
||||
return that.m_ManifestId;
|
||||
}
|
||||
|
||||
public bool Equals(ManifestId_t other) {
|
||||
return m_ManifestId == other.m_ManifestId;
|
||||
}
|
||||
|
||||
public int CompareTo(ManifestId_t other) {
|
||||
return m_ManifestId.CompareTo(other.m_ManifestId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,65 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct PartyBeaconID_t : System.IEquatable<PartyBeaconID_t>, System.IComparable<PartyBeaconID_t> {
|
||||
public static readonly PartyBeaconID_t Invalid = new PartyBeaconID_t(0);
|
||||
public ulong m_PartyBeaconID;
|
||||
|
||||
public PartyBeaconID_t(ulong value) {
|
||||
m_PartyBeaconID = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_PartyBeaconID.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is PartyBeaconID_t && this == (PartyBeaconID_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_PartyBeaconID.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(PartyBeaconID_t x, PartyBeaconID_t y) {
|
||||
return x.m_PartyBeaconID == y.m_PartyBeaconID;
|
||||
}
|
||||
|
||||
public static bool operator !=(PartyBeaconID_t x, PartyBeaconID_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator PartyBeaconID_t(ulong value) {
|
||||
return new PartyBeaconID_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator ulong(PartyBeaconID_t that) {
|
||||
return that.m_PartyBeaconID;
|
||||
}
|
||||
|
||||
public bool Equals(PartyBeaconID_t other) {
|
||||
return m_PartyBeaconID == other.m_PartyBeaconID;
|
||||
}
|
||||
|
||||
public int CompareTo(PartyBeaconID_t other) {
|
||||
return m_PartyBeaconID.CompareTo(other.m_PartyBeaconID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,64 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct RTime32 : System.IEquatable<RTime32>, System.IComparable<RTime32> {
|
||||
public uint m_RTime32;
|
||||
|
||||
public RTime32(uint value) {
|
||||
m_RTime32 = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_RTime32.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is RTime32 && this == (RTime32)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_RTime32.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(RTime32 x, RTime32 y) {
|
||||
return x.m_RTime32 == y.m_RTime32;
|
||||
}
|
||||
|
||||
public static bool operator !=(RTime32 x, RTime32 y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator RTime32(uint value) {
|
||||
return new RTime32(value);
|
||||
}
|
||||
|
||||
public static explicit operator uint(RTime32 that) {
|
||||
return that.m_RTime32;
|
||||
}
|
||||
|
||||
public bool Equals(RTime32 other) {
|
||||
return m_RTime32 == other.m_RTime32;
|
||||
}
|
||||
|
||||
public int CompareTo(RTime32 other) {
|
||||
return m_RTime32.CompareTo(other.m_RTime32);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,65 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct SiteId_t : System.IEquatable<SiteId_t>, System.IComparable<SiteId_t> {
|
||||
public static readonly SiteId_t Invalid = new SiteId_t(0);
|
||||
public ulong m_SiteId;
|
||||
|
||||
public SiteId_t(ulong value) {
|
||||
m_SiteId = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_SiteId.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is SiteId_t && this == (SiteId_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_SiteId.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(SiteId_t x, SiteId_t y) {
|
||||
return x.m_SiteId == y.m_SiteId;
|
||||
}
|
||||
|
||||
public static bool operator !=(SiteId_t x, SiteId_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator SiteId_t(ulong value) {
|
||||
return new SiteId_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator ulong(SiteId_t that) {
|
||||
return that.m_SiteId;
|
||||
}
|
||||
|
||||
public bool Equals(SiteId_t other) {
|
||||
return m_SiteId == other.m_SiteId;
|
||||
}
|
||||
|
||||
public int CompareTo(SiteId_t other) {
|
||||
return m_SiteId.CompareTo(other.m_SiteId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,65 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct SteamAPICall_t : System.IEquatable<SteamAPICall_t>, System.IComparable<SteamAPICall_t> {
|
||||
public static readonly SteamAPICall_t Invalid = new SteamAPICall_t(0x0);
|
||||
public ulong m_SteamAPICall;
|
||||
|
||||
public SteamAPICall_t(ulong value) {
|
||||
m_SteamAPICall = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_SteamAPICall.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is SteamAPICall_t && this == (SteamAPICall_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_SteamAPICall.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(SteamAPICall_t x, SteamAPICall_t y) {
|
||||
return x.m_SteamAPICall == y.m_SteamAPICall;
|
||||
}
|
||||
|
||||
public static bool operator !=(SteamAPICall_t x, SteamAPICall_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator SteamAPICall_t(ulong value) {
|
||||
return new SteamAPICall_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator ulong(SteamAPICall_t that) {
|
||||
return that.m_SteamAPICall;
|
||||
}
|
||||
|
||||
public bool Equals(SteamAPICall_t other) {
|
||||
return m_SteamAPICall == other.m_SteamAPICall;
|
||||
}
|
||||
|
||||
public int CompareTo(SteamAPICall_t other) {
|
||||
return m_SteamAPICall.CompareTo(other.m_SteamAPICall);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,65 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct UGCQueryHandle_t : System.IEquatable<UGCQueryHandle_t>, System.IComparable<UGCQueryHandle_t> {
|
||||
public static readonly UGCQueryHandle_t Invalid = new UGCQueryHandle_t(0xffffffffffffffff);
|
||||
public ulong m_UGCQueryHandle;
|
||||
|
||||
public UGCQueryHandle_t(ulong value) {
|
||||
m_UGCQueryHandle = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_UGCQueryHandle.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is UGCQueryHandle_t && this == (UGCQueryHandle_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_UGCQueryHandle.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(UGCQueryHandle_t x, UGCQueryHandle_t y) {
|
||||
return x.m_UGCQueryHandle == y.m_UGCQueryHandle;
|
||||
}
|
||||
|
||||
public static bool operator !=(UGCQueryHandle_t x, UGCQueryHandle_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator UGCQueryHandle_t(ulong value) {
|
||||
return new UGCQueryHandle_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator ulong(UGCQueryHandle_t that) {
|
||||
return that.m_UGCQueryHandle;
|
||||
}
|
||||
|
||||
public bool Equals(UGCQueryHandle_t other) {
|
||||
return m_UGCQueryHandle == other.m_UGCQueryHandle;
|
||||
}
|
||||
|
||||
public int CompareTo(UGCQueryHandle_t other) {
|
||||
return m_UGCQueryHandle.CompareTo(other.m_UGCQueryHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,65 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct UGCUpdateHandle_t : System.IEquatable<UGCUpdateHandle_t>, System.IComparable<UGCUpdateHandle_t> {
|
||||
public static readonly UGCUpdateHandle_t Invalid = new UGCUpdateHandle_t(0xffffffffffffffff);
|
||||
public ulong m_UGCUpdateHandle;
|
||||
|
||||
public UGCUpdateHandle_t(ulong value) {
|
||||
m_UGCUpdateHandle = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_UGCUpdateHandle.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is UGCUpdateHandle_t && this == (UGCUpdateHandle_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_UGCUpdateHandle.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(UGCUpdateHandle_t x, UGCUpdateHandle_t y) {
|
||||
return x.m_UGCUpdateHandle == y.m_UGCUpdateHandle;
|
||||
}
|
||||
|
||||
public static bool operator !=(UGCUpdateHandle_t x, UGCUpdateHandle_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator UGCUpdateHandle_t(ulong value) {
|
||||
return new UGCUpdateHandle_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator ulong(UGCUpdateHandle_t that) {
|
||||
return that.m_UGCUpdateHandle;
|
||||
}
|
||||
|
||||
public bool Equals(UGCUpdateHandle_t other) {
|
||||
return m_UGCUpdateHandle == other.m_UGCUpdateHandle;
|
||||
}
|
||||
|
||||
public int CompareTo(UGCUpdateHandle_t other) {
|
||||
return m_UGCUpdateHandle.CompareTo(other.m_UGCUpdateHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
|
||||
// This file is no longer needed. Valve has removed the functionality.
|
||||
// We continue to generate this file to provide a small amount of backwards compatability.
|
||||
@@ -0,0 +1,64 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct SteamLeaderboardEntries_t : System.IEquatable<SteamLeaderboardEntries_t>, System.IComparable<SteamLeaderboardEntries_t> {
|
||||
public ulong m_SteamLeaderboardEntries;
|
||||
|
||||
public SteamLeaderboardEntries_t(ulong value) {
|
||||
m_SteamLeaderboardEntries = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_SteamLeaderboardEntries.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is SteamLeaderboardEntries_t && this == (SteamLeaderboardEntries_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_SteamLeaderboardEntries.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(SteamLeaderboardEntries_t x, SteamLeaderboardEntries_t y) {
|
||||
return x.m_SteamLeaderboardEntries == y.m_SteamLeaderboardEntries;
|
||||
}
|
||||
|
||||
public static bool operator !=(SteamLeaderboardEntries_t x, SteamLeaderboardEntries_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator SteamLeaderboardEntries_t(ulong value) {
|
||||
return new SteamLeaderboardEntries_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator ulong(SteamLeaderboardEntries_t that) {
|
||||
return that.m_SteamLeaderboardEntries;
|
||||
}
|
||||
|
||||
public bool Equals(SteamLeaderboardEntries_t other) {
|
||||
return m_SteamLeaderboardEntries == other.m_SteamLeaderboardEntries;
|
||||
}
|
||||
|
||||
public int CompareTo(SteamLeaderboardEntries_t other) {
|
||||
return m_SteamLeaderboardEntries.CompareTo(other.m_SteamLeaderboardEntries);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,64 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct SteamLeaderboard_t : System.IEquatable<SteamLeaderboard_t>, System.IComparable<SteamLeaderboard_t> {
|
||||
public ulong m_SteamLeaderboard;
|
||||
|
||||
public SteamLeaderboard_t(ulong value) {
|
||||
m_SteamLeaderboard = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_SteamLeaderboard.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is SteamLeaderboard_t && this == (SteamLeaderboard_t)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_SteamLeaderboard.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(SteamLeaderboard_t x, SteamLeaderboard_t y) {
|
||||
return x.m_SteamLeaderboard == y.m_SteamLeaderboard;
|
||||
}
|
||||
|
||||
public static bool operator !=(SteamLeaderboard_t x, SteamLeaderboard_t y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator SteamLeaderboard_t(ulong value) {
|
||||
return new SteamLeaderboard_t(value);
|
||||
}
|
||||
|
||||
public static explicit operator ulong(SteamLeaderboard_t that) {
|
||||
return that.m_SteamLeaderboard;
|
||||
}
|
||||
|
||||
public bool Equals(SteamLeaderboard_t other) {
|
||||
return m_SteamLeaderboard == other.m_SteamLeaderboard;
|
||||
}
|
||||
|
||||
public int CompareTo(SteamLeaderboard_t other) {
|
||||
return m_SteamLeaderboard.CompareTo(other.m_SteamLeaderboard);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,64 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct HSteamPipe : System.IEquatable<HSteamPipe>, System.IComparable<HSteamPipe> {
|
||||
public int m_HSteamPipe;
|
||||
|
||||
public HSteamPipe(int value) {
|
||||
m_HSteamPipe = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_HSteamPipe.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is HSteamPipe && this == (HSteamPipe)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_HSteamPipe.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(HSteamPipe x, HSteamPipe y) {
|
||||
return x.m_HSteamPipe == y.m_HSteamPipe;
|
||||
}
|
||||
|
||||
public static bool operator !=(HSteamPipe x, HSteamPipe y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator HSteamPipe(int value) {
|
||||
return new HSteamPipe(value);
|
||||
}
|
||||
|
||||
public static explicit operator int(HSteamPipe that) {
|
||||
return that.m_HSteamPipe;
|
||||
}
|
||||
|
||||
public bool Equals(HSteamPipe other) {
|
||||
return m_HSteamPipe == other.m_HSteamPipe;
|
||||
}
|
||||
|
||||
public int CompareTo(HSteamPipe other) {
|
||||
return m_HSteamPipe.CompareTo(other.m_HSteamPipe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
@@ -0,0 +1,64 @@
|
||||
// This file is provided under The MIT License as part of Steamworks.NET.
|
||||
// Copyright (c) 2013-2019 Riley Labrecque
|
||||
// Please see the included LICENSE.txt for additional information.
|
||||
|
||||
// This file is automatically generated.
|
||||
// Changes to this file will be reverted when you update Steamworks.NET
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
|
||||
#define DISABLESTEAMWORKS
|
||||
#endif
|
||||
|
||||
#if !DISABLESTEAMWORKS
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
using IntPtr = System.IntPtr;
|
||||
|
||||
namespace Steamworks {
|
||||
[System.Serializable]
|
||||
public struct HSteamUser : System.IEquatable<HSteamUser>, System.IComparable<HSteamUser> {
|
||||
public int m_HSteamUser;
|
||||
|
||||
public HSteamUser(int value) {
|
||||
m_HSteamUser = value;
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return m_HSteamUser.ToString();
|
||||
}
|
||||
|
||||
public override bool Equals(object other) {
|
||||
return other is HSteamUser && this == (HSteamUser)other;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return m_HSteamUser.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(HSteamUser x, HSteamUser y) {
|
||||
return x.m_HSteamUser == y.m_HSteamUser;
|
||||
}
|
||||
|
||||
public static bool operator !=(HSteamUser x, HSteamUser y) {
|
||||
return !(x == y);
|
||||
}
|
||||
|
||||
public static explicit operator HSteamUser(int value) {
|
||||
return new HSteamUser(value);
|
||||
}
|
||||
|
||||
public static explicit operator int(HSteamUser that) {
|
||||
return that.m_HSteamUser;
|
||||
}
|
||||
|
||||
public bool Equals(HSteamUser other) {
|
||||
return m_HSteamUser == other.m_HSteamUser;
|
||||
}
|
||||
|
||||
public int CompareTo(HSteamUser other) {
|
||||
return m_HSteamUser.CompareTo(other.m_HSteamUser);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !DISABLESTEAMWORKS
|
||||
Reference in New Issue
Block a user