├── .gitignore ├── Binaries ├── libsteam_api.so ├── steam_api64.dll └── libsteam_api.dylib ├── Source ├── Version.cs ├── types │ ├── SteamClient │ │ ├── SteamAPIWarningMessageHook_t.cs │ │ └── SteamAPI_CheckCallbackRegistered_t.cs │ ├── SteamInput │ │ ├── SteamInputActionEventCallbackPointer.cs │ │ ├── InputHandle_t.cs │ │ ├── SteamInputActionEvent_t.cs │ │ ├── InputActionSetHandle_t.cs │ │ ├── InputAnalogActionHandle_t.cs │ │ └── InputDigitalActionHandle_t.cs │ ├── SteamNetworkingTypes │ │ ├── FSteamNetworkingSocketsDebugOutput.cs │ │ ├── SteamNetworkingErrMsg.cs │ │ ├── SteamNetworkingPOPID.cs │ │ ├── HSteamListenSocket.cs │ │ ├── HSteamNetPollGroup.cs │ │ ├── HSteamNetConnection.cs │ │ ├── SteamNetworkingMicroseconds.cs │ │ ├── SteamNetworkingConfigValue_t.cs │ │ ├── SteamNetworkingIPAddr.cs │ │ ├── SteamNetworkingMessage_t.cs │ │ └── SteamNetworkingIdentity.cs │ ├── SteamDatagramTickets │ │ ├── SteamDatagramHostedAddress.cs │ │ └── SteamDatagramRelayAuthTicket.cs │ ├── SteamTypes │ │ ├── RTime32.cs │ │ ├── AppId_t.cs │ │ ├── AccountID_t.cs │ │ ├── DepotId_t.cs │ │ ├── SteamAPICall_t.cs │ │ ├── PartyBeaconID_t.cs │ │ └── SteamIPAddress_t.cs │ ├── Steam_api_common │ │ ├── HSteamPipe.cs │ │ └── HSteamUser.cs │ ├── SteamNetworking │ │ ├── SNetSocket_t.cs │ │ └── SNetListenSocket_t.cs │ ├── SteamInventory │ │ ├── SteamItemDef_t.cs │ │ ├── SteamItemInstanceID_t.cs │ │ ├── SteamInventoryResult_t.cs │ │ └── SteamInventoryUpdateHandle_t.cs │ ├── SteamClientPublic │ │ ├── HAuthTicket.cs │ │ ├── CGameID.cs │ │ └── CSteamID.cs │ ├── SteamRemoteStorage │ │ ├── UGCHandle_t.cs │ │ ├── PublishedFileId_t.cs │ │ ├── UGCFileWriteStreamHandle_t.cs │ │ └── PublishedFileUpdateHandle_t.cs │ ├── SteamMatchmaking │ │ ├── HServerQuery.cs │ │ └── HServerListRequest.cs │ ├── SteamHTMLSurface │ │ └── HHTMLBrowser.cs │ ├── SteamUserStats │ │ ├── SteamLeaderboard_t.cs │ │ └── SteamLeaderboardEntries_t.cs │ ├── SteamFriends │ │ └── FriendsGroupID_t.cs │ ├── SteamUGC │ │ ├── UGCQueryHandle_t.cs │ │ └── UGCUpdateHandle_t.cs │ ├── SteamScreenshots │ │ └── ScreenshotHandle.cs │ ├── SteamHTTP │ │ ├── HTTPRequestHandle.cs │ │ └── HTTPCookieContainerHandle.cs │ ├── SteamRemotePlay │ │ └── RemotePlaySessionID_t.cs │ ├── SteamNetworkingSockets │ │ ├── ISteamNetworkingConnectionSignaling.cs │ │ └── ISteamNetworkingSignalingRecvContext.cs │ └── MatchmakingTypes │ │ ├── servernetadr_t.cs │ │ └── gameserveritem_t.cs ├── CallbackIdentity.cs ├── autogen │ ├── isteamparentalsettings.cs │ ├── isteamvideo.cs │ ├── isteammusic.cs │ ├── isteamapplist.cs │ ├── isteamremoteplay.cs │ ├── isteamgameserverstats.cs │ ├── isteamscreenshots.cs │ ├── isteammusicremote.cs │ └── isteamnetworkingmessages.cs ├── Packsize.cs └── InteropHelp.cs ├── LICENSE.txt ├── README.md └── Steamworks.NET.Dissent.csproj /.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | obj/ 3 | .vs/ 4 | __pycache__/ 5 | /CodeGen/steam/lib/ 6 | -------------------------------------------------------------------------------- /Binaries/libsteam_api.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoonsideGames/Steamworks.NET.Dissent/HEAD/Binaries/libsteam_api.so -------------------------------------------------------------------------------- /Binaries/steam_api64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoonsideGames/Steamworks.NET.Dissent/HEAD/Binaries/steam_api64.dll -------------------------------------------------------------------------------- /Binaries/libsteam_api.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MoonsideGames/Steamworks.NET.Dissent/HEAD/Binaries/libsteam_api.dylib -------------------------------------------------------------------------------- /Source/Version.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | namespace Steamworks { 15 | public static class Version { 16 | public const string SteamworksNETVersion = "20.1.0"; 17 | public const string SteamworksSDKVersion = "1.53a"; 18 | public const string SteamAPIDLLVersion = "06.91.21.57"; 19 | public const int SteamAPIDLLSize = 263080; 20 | public const int SteamAPI64DLLSize = 295336; 21 | } 22 | } 23 | 24 | #endif // !DISABLESTEAMWORKS 25 | -------------------------------------------------------------------------------- /Source/types/SteamClient/SteamAPIWarningMessageHook_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] 19 | public delegate void SteamAPIWarningMessageHook_t(int nSeverity, System.Text.StringBuilder pchDebugText); 20 | } 21 | 22 | #endif // !DISABLESTEAMWORKS 23 | -------------------------------------------------------------------------------- /Source/types/SteamInput/SteamInputActionEventCallbackPointer.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] 19 | public delegate void SteamInputActionEventCallbackPointer(IntPtr /* SteamInputActionEvent_t* */ SteamInputActionEvent); 20 | } 21 | 22 | #endif // !DISABLESTEAMWORKS 23 | -------------------------------------------------------------------------------- /Source/types/SteamClient/SteamAPI_CheckCallbackRegistered_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)] // TODO: This is probably wrong, will likely crash on some platform. 19 | public delegate void SteamAPI_CheckCallbackRegistered_t(int iCallbackNum); 20 | } 21 | 22 | #endif // !DISABLESTEAMWORKS 23 | -------------------------------------------------------------------------------- /Source/types/SteamNetworkingTypes/FSteamNetworkingSocketsDebugOutput.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | /// Setup callback for debug output, and the desired verbosity you want. 19 | [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] 20 | public delegate void FSteamNetworkingSocketsDebugOutput(ESteamNetworkingSocketsDebugOutputType nType, System.Text.StringBuilder pszMsg); 21 | } 22 | 23 | #endif // !DISABLESTEAMWORKS 24 | -------------------------------------------------------------------------------- /Source/types/SteamNetworkingTypes/SteamNetworkingErrMsg.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks 18 | { 19 | /// Used to return English-language diagnostic error messages to caller. 20 | /// (For debugging or spewing to a console, etc. Not intended for UI.) 21 | [System.Serializable] 22 | [StructLayout(LayoutKind.Sequential)] 23 | public struct SteamNetworkingErrMsg 24 | { 25 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cchMaxSteamNetworkingErrMsg)] 26 | public byte[] m_SteamNetworkingErrMsg; 27 | } 28 | } 29 | 30 | #endif // !DISABLESTEAMWORKS -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013-2022 Riley Labrecque 4 | Copyright (c) 2022 Evan Hemsley 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /Source/CallbackIdentity.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | namespace Steamworks { 15 | class CallbackIdentities { 16 | public static int GetCallbackIdentity(System.Type callbackStruct) { 17 | #if UNITY_EDITOR || UNITY_STANDALONE || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX 18 | foreach (CallbackIdentityAttribute attribute in callbackStruct.GetCustomAttributes(typeof(CallbackIdentityAttribute), false)) { 19 | return attribute.Identity; 20 | } 21 | #endif 22 | throw new System.Exception("Callback number not found for struct " + callbackStruct); 23 | } 24 | } 25 | 26 | [System.AttributeUsage(System.AttributeTargets.Struct, AllowMultiple = false)] 27 | internal class CallbackIdentityAttribute : System.Attribute { 28 | public int Identity { get; set; } 29 | public CallbackIdentityAttribute(int callbackNum) { 30 | Identity = callbackNum; 31 | } 32 | } 33 | } 34 | 35 | #endif // !DISABLESTEAMWORKS 36 | -------------------------------------------------------------------------------- /Source/types/SteamDatagramTickets/SteamDatagramHostedAddress.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks 18 | { 19 | /// Network-routable identifier for a service. This is an intentionally 20 | /// opaque byte blob. The relays know how to use this to forward it on 21 | /// to the intended destination, but otherwise clients really should not 22 | /// need to know what's inside. (Indeed, we don't really want them to 23 | /// know, as it could reveal information useful to an attacker.) 24 | [System.Serializable] 25 | [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] 26 | public struct SteamDatagramHostedAddress 27 | { 28 | // Size of data blob. 29 | public int m_cbSize; 30 | 31 | // Opaque 32 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] 33 | public byte[] m_data; 34 | 35 | // Reset to empty state 36 | public void Clear() 37 | { 38 | m_cbSize = 0; 39 | m_data = new byte[128]; 40 | } 41 | } 42 | } 43 | 44 | #endif // !DISABLESTEAMWORKS -------------------------------------------------------------------------------- /Source/types/SteamTypes/RTime32.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct RTime32 : System.IEquatable, System.IComparable { 20 | public uint m_RTime32; 21 | 22 | public RTime32(uint value) { 23 | m_RTime32 = value; 24 | } 25 | 26 | public override string ToString() { 27 | return m_RTime32.ToString(); 28 | } 29 | 30 | public override bool Equals(object other) { 31 | return other is RTime32 && this == (RTime32)other; 32 | } 33 | 34 | public override int GetHashCode() { 35 | return m_RTime32.GetHashCode(); 36 | } 37 | 38 | public static bool operator ==(RTime32 x, RTime32 y) { 39 | return x.m_RTime32 == y.m_RTime32; 40 | } 41 | 42 | public static bool operator !=(RTime32 x, RTime32 y) { 43 | return !(x == y); 44 | } 45 | 46 | public static explicit operator RTime32(uint value) { 47 | return new RTime32(value); 48 | } 49 | 50 | public static explicit operator uint(RTime32 that) { 51 | return that.m_RTime32; 52 | } 53 | 54 | public bool Equals(RTime32 other) { 55 | return m_RTime32 == other.m_RTime32; 56 | } 57 | 58 | public int CompareTo(RTime32 other) { 59 | return m_RTime32.CompareTo(other.m_RTime32); 60 | } 61 | } 62 | } 63 | 64 | #endif // !DISABLESTEAMWORKS 65 | -------------------------------------------------------------------------------- /Source/types/SteamTypes/AppId_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct AppId_t : System.IEquatable, System.IComparable { 20 | public static readonly AppId_t Invalid = new AppId_t(0x0); 21 | public uint m_AppId; 22 | 23 | public AppId_t(uint value) { 24 | m_AppId = value; 25 | } 26 | 27 | public override string ToString() { 28 | return m_AppId.ToString(); 29 | } 30 | 31 | public override bool Equals(object other) { 32 | return other is AppId_t && this == (AppId_t)other; 33 | } 34 | 35 | public override int GetHashCode() { 36 | return m_AppId.GetHashCode(); 37 | } 38 | 39 | public static bool operator ==(AppId_t x, AppId_t y) { 40 | return x.m_AppId == y.m_AppId; 41 | } 42 | 43 | public static bool operator !=(AppId_t x, AppId_t y) { 44 | return !(x == y); 45 | } 46 | 47 | public static explicit operator AppId_t(uint value) { 48 | return new AppId_t(value); 49 | } 50 | 51 | public static explicit operator uint(AppId_t that) { 52 | return that.m_AppId; 53 | } 54 | 55 | public bool Equals(AppId_t other) { 56 | return m_AppId == other.m_AppId; 57 | } 58 | 59 | public int CompareTo(AppId_t other) { 60 | return m_AppId.CompareTo(other.m_AppId); 61 | } 62 | } 63 | } 64 | 65 | #endif // !DISABLESTEAMWORKS 66 | -------------------------------------------------------------------------------- /Source/types/SteamTypes/AccountID_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct AccountID_t : System.IEquatable, System.IComparable { 20 | public uint m_AccountID; 21 | 22 | public AccountID_t(uint value) { 23 | m_AccountID = value; 24 | } 25 | 26 | public override string ToString() { 27 | return m_AccountID.ToString(); 28 | } 29 | 30 | public override bool Equals(object other) { 31 | return other is AccountID_t && this == (AccountID_t)other; 32 | } 33 | 34 | public override int GetHashCode() { 35 | return m_AccountID.GetHashCode(); 36 | } 37 | 38 | public static bool operator ==(AccountID_t x, AccountID_t y) { 39 | return x.m_AccountID == y.m_AccountID; 40 | } 41 | 42 | public static bool operator !=(AccountID_t x, AccountID_t y) { 43 | return !(x == y); 44 | } 45 | 46 | public static explicit operator AccountID_t(uint value) { 47 | return new AccountID_t(value); 48 | } 49 | 50 | public static explicit operator uint(AccountID_t that) { 51 | return that.m_AccountID; 52 | } 53 | 54 | public bool Equals(AccountID_t other) { 55 | return m_AccountID == other.m_AccountID; 56 | } 57 | 58 | public int CompareTo(AccountID_t other) { 59 | return m_AccountID.CompareTo(other.m_AccountID); 60 | } 61 | } 62 | } 63 | 64 | #endif // !DISABLESTEAMWORKS 65 | -------------------------------------------------------------------------------- /Source/types/Steam_api_common/HSteamPipe.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct HSteamPipe : System.IEquatable, System.IComparable { 20 | public int m_HSteamPipe; 21 | 22 | public HSteamPipe(int value) { 23 | m_HSteamPipe = value; 24 | } 25 | 26 | public override string ToString() { 27 | return m_HSteamPipe.ToString(); 28 | } 29 | 30 | public override bool Equals(object other) { 31 | return other is HSteamPipe && this == (HSteamPipe)other; 32 | } 33 | 34 | public override int GetHashCode() { 35 | return m_HSteamPipe.GetHashCode(); 36 | } 37 | 38 | public static bool operator ==(HSteamPipe x, HSteamPipe y) { 39 | return x.m_HSteamPipe == y.m_HSteamPipe; 40 | } 41 | 42 | public static bool operator !=(HSteamPipe x, HSteamPipe y) { 43 | return !(x == y); 44 | } 45 | 46 | public static explicit operator HSteamPipe(int value) { 47 | return new HSteamPipe(value); 48 | } 49 | 50 | public static explicit operator int(HSteamPipe that) { 51 | return that.m_HSteamPipe; 52 | } 53 | 54 | public bool Equals(HSteamPipe other) { 55 | return m_HSteamPipe == other.m_HSteamPipe; 56 | } 57 | 58 | public int CompareTo(HSteamPipe other) { 59 | return m_HSteamPipe.CompareTo(other.m_HSteamPipe); 60 | } 61 | } 62 | } 63 | 64 | #endif // !DISABLESTEAMWORKS 65 | -------------------------------------------------------------------------------- /Source/types/Steam_api_common/HSteamUser.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct HSteamUser : System.IEquatable, System.IComparable { 20 | public int m_HSteamUser; 21 | 22 | public HSteamUser(int value) { 23 | m_HSteamUser = value; 24 | } 25 | 26 | public override string ToString() { 27 | return m_HSteamUser.ToString(); 28 | } 29 | 30 | public override bool Equals(object other) { 31 | return other is HSteamUser && this == (HSteamUser)other; 32 | } 33 | 34 | public override int GetHashCode() { 35 | return m_HSteamUser.GetHashCode(); 36 | } 37 | 38 | public static bool operator ==(HSteamUser x, HSteamUser y) { 39 | return x.m_HSteamUser == y.m_HSteamUser; 40 | } 41 | 42 | public static bool operator !=(HSteamUser x, HSteamUser y) { 43 | return !(x == y); 44 | } 45 | 46 | public static explicit operator HSteamUser(int value) { 47 | return new HSteamUser(value); 48 | } 49 | 50 | public static explicit operator int(HSteamUser that) { 51 | return that.m_HSteamUser; 52 | } 53 | 54 | public bool Equals(HSteamUser other) { 55 | return m_HSteamUser == other.m_HSteamUser; 56 | } 57 | 58 | public int CompareTo(HSteamUser other) { 59 | return m_HSteamUser.CompareTo(other.m_HSteamUser); 60 | } 61 | } 62 | } 63 | 64 | #endif // !DISABLESTEAMWORKS 65 | -------------------------------------------------------------------------------- /Source/types/SteamTypes/DepotId_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct DepotId_t : System.IEquatable, System.IComparable { 20 | public static readonly DepotId_t Invalid = new DepotId_t(0x0); 21 | public uint m_DepotId; 22 | 23 | public DepotId_t(uint value) { 24 | m_DepotId = value; 25 | } 26 | 27 | public override string ToString() { 28 | return m_DepotId.ToString(); 29 | } 30 | 31 | public override bool Equals(object other) { 32 | return other is DepotId_t && this == (DepotId_t)other; 33 | } 34 | 35 | public override int GetHashCode() { 36 | return m_DepotId.GetHashCode(); 37 | } 38 | 39 | public static bool operator ==(DepotId_t x, DepotId_t y) { 40 | return x.m_DepotId == y.m_DepotId; 41 | } 42 | 43 | public static bool operator !=(DepotId_t x, DepotId_t y) { 44 | return !(x == y); 45 | } 46 | 47 | public static explicit operator DepotId_t(uint value) { 48 | return new DepotId_t(value); 49 | } 50 | 51 | public static explicit operator uint(DepotId_t that) { 52 | return that.m_DepotId; 53 | } 54 | 55 | public bool Equals(DepotId_t other) { 56 | return m_DepotId == other.m_DepotId; 57 | } 58 | 59 | public int CompareTo(DepotId_t other) { 60 | return m_DepotId.CompareTo(other.m_DepotId); 61 | } 62 | } 63 | } 64 | 65 | #endif // !DISABLESTEAMWORKS 66 | -------------------------------------------------------------------------------- /Source/types/SteamNetworking/SNetSocket_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct SNetSocket_t : System.IEquatable, System.IComparable { 20 | public uint m_SNetSocket; 21 | 22 | public SNetSocket_t(uint value) { 23 | m_SNetSocket = value; 24 | } 25 | 26 | public override string ToString() { 27 | return m_SNetSocket.ToString(); 28 | } 29 | 30 | public override bool Equals(object other) { 31 | return other is SNetSocket_t && this == (SNetSocket_t)other; 32 | } 33 | 34 | public override int GetHashCode() { 35 | return m_SNetSocket.GetHashCode(); 36 | } 37 | 38 | public static bool operator ==(SNetSocket_t x, SNetSocket_t y) { 39 | return x.m_SNetSocket == y.m_SNetSocket; 40 | } 41 | 42 | public static bool operator !=(SNetSocket_t x, SNetSocket_t y) { 43 | return !(x == y); 44 | } 45 | 46 | public static explicit operator SNetSocket_t(uint value) { 47 | return new SNetSocket_t(value); 48 | } 49 | 50 | public static explicit operator uint(SNetSocket_t that) { 51 | return that.m_SNetSocket; 52 | } 53 | 54 | public bool Equals(SNetSocket_t other) { 55 | return m_SNetSocket == other.m_SNetSocket; 56 | } 57 | 58 | public int CompareTo(SNetSocket_t other) { 59 | return m_SNetSocket.CompareTo(other.m_SNetSocket); 60 | } 61 | } 62 | } 63 | 64 | #endif // !DISABLESTEAMWORKS 65 | -------------------------------------------------------------------------------- /Source/types/SteamInput/InputHandle_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct InputHandle_t : System.IEquatable, System.IComparable { 20 | public ulong m_InputHandle; 21 | 22 | public InputHandle_t(ulong value) { 23 | m_InputHandle = value; 24 | } 25 | 26 | public override string ToString() { 27 | return m_InputHandle.ToString(); 28 | } 29 | 30 | public override bool Equals(object other) { 31 | return other is InputHandle_t && this == (InputHandle_t)other; 32 | } 33 | 34 | public override int GetHashCode() { 35 | return m_InputHandle.GetHashCode(); 36 | } 37 | 38 | public static bool operator ==(InputHandle_t x, InputHandle_t y) { 39 | return x.m_InputHandle == y.m_InputHandle; 40 | } 41 | 42 | public static bool operator !=(InputHandle_t x, InputHandle_t y) { 43 | return !(x == y); 44 | } 45 | 46 | public static explicit operator InputHandle_t(ulong value) { 47 | return new InputHandle_t(value); 48 | } 49 | 50 | public static explicit operator ulong(InputHandle_t that) { 51 | return that.m_InputHandle; 52 | } 53 | 54 | public bool Equals(InputHandle_t other) { 55 | return m_InputHandle == other.m_InputHandle; 56 | } 57 | 58 | public int CompareTo(InputHandle_t other) { 59 | return m_InputHandle.CompareTo(other.m_InputHandle); 60 | } 61 | } 62 | } 63 | 64 | #endif // !DISABLESTEAMWORKS 65 | -------------------------------------------------------------------------------- /Source/types/SteamInventory/SteamItemDef_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct SteamItemDef_t : System.IEquatable, System.IComparable { 20 | public int m_SteamItemDef; 21 | 22 | public SteamItemDef_t(int value) { 23 | m_SteamItemDef = value; 24 | } 25 | 26 | public override string ToString() { 27 | return m_SteamItemDef.ToString(); 28 | } 29 | 30 | public override bool Equals(object other) { 31 | return other is SteamItemDef_t && this == (SteamItemDef_t)other; 32 | } 33 | 34 | public override int GetHashCode() { 35 | return m_SteamItemDef.GetHashCode(); 36 | } 37 | 38 | public static bool operator ==(SteamItemDef_t x, SteamItemDef_t y) { 39 | return x.m_SteamItemDef == y.m_SteamItemDef; 40 | } 41 | 42 | public static bool operator !=(SteamItemDef_t x, SteamItemDef_t y) { 43 | return !(x == y); 44 | } 45 | 46 | public static explicit operator SteamItemDef_t(int value) { 47 | return new SteamItemDef_t(value); 48 | } 49 | 50 | public static explicit operator int(SteamItemDef_t that) { 51 | return that.m_SteamItemDef; 52 | } 53 | 54 | public bool Equals(SteamItemDef_t other) { 55 | return m_SteamItemDef == other.m_SteamItemDef; 56 | } 57 | 58 | public int CompareTo(SteamItemDef_t other) { 59 | return m_SteamItemDef.CompareTo(other.m_SteamItemDef); 60 | } 61 | } 62 | } 63 | 64 | #endif // !DISABLESTEAMWORKS 65 | -------------------------------------------------------------------------------- /Source/types/SteamInput/SteamInputActionEvent_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks 18 | { 19 | //----------------------------------------------------------------------------- 20 | // Purpose: when callbacks are enabled this fires each time a controller action 21 | // state changes 22 | //----------------------------------------------------------------------------- 23 | [System.Serializable] 24 | [StructLayout(LayoutKind.Sequential)] 25 | public struct SteamInputActionEvent_t 26 | { 27 | public InputHandle_t controllerHandle; 28 | 29 | public ESteamInputActionEventType eEventType; 30 | 31 | /// Option value 32 | public OptionValue m_val; 33 | 34 | [System.Serializable] 35 | [StructLayout(LayoutKind.Sequential)] 36 | public struct AnalogAction_t 37 | { 38 | public InputAnalogActionHandle_t actionHandle; 39 | 40 | public InputAnalogActionData_t analogActionData; 41 | } 42 | 43 | [System.Serializable] 44 | [StructLayout(LayoutKind.Sequential)] 45 | public struct DigitalAction_t 46 | { 47 | public InputDigitalActionHandle_t actionHandle; 48 | 49 | public InputDigitalActionData_t digitalActionData; 50 | } 51 | 52 | [System.Serializable] 53 | [StructLayout(LayoutKind.Explicit)] 54 | public struct OptionValue 55 | { 56 | [FieldOffset(0)] 57 | public AnalogAction_t analogAction; 58 | 59 | [FieldOffset(0)] 60 | public DigitalAction_t digitalAction; 61 | } 62 | } 63 | } 64 | 65 | #endif // !DISABLESTEAMWORKS -------------------------------------------------------------------------------- /Source/types/SteamClientPublic/HAuthTicket.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct HAuthTicket : System.IEquatable, System.IComparable { 20 | public static readonly HAuthTicket Invalid = new HAuthTicket(0); 21 | public uint m_HAuthTicket; 22 | 23 | public HAuthTicket(uint value) { 24 | m_HAuthTicket = value; 25 | } 26 | 27 | public override string ToString() { 28 | return m_HAuthTicket.ToString(); 29 | } 30 | 31 | public override bool Equals(object other) { 32 | return other is HAuthTicket && this == (HAuthTicket)other; 33 | } 34 | 35 | public override int GetHashCode() { 36 | return m_HAuthTicket.GetHashCode(); 37 | } 38 | 39 | public static bool operator ==(HAuthTicket x, HAuthTicket y) { 40 | return x.m_HAuthTicket == y.m_HAuthTicket; 41 | } 42 | 43 | public static bool operator !=(HAuthTicket x, HAuthTicket y) { 44 | return !(x == y); 45 | } 46 | 47 | public static explicit operator HAuthTicket(uint value) { 48 | return new HAuthTicket(value); 49 | } 50 | 51 | public static explicit operator uint(HAuthTicket that) { 52 | return that.m_HAuthTicket; 53 | } 54 | 55 | public bool Equals(HAuthTicket other) { 56 | return m_HAuthTicket == other.m_HAuthTicket; 57 | } 58 | 59 | public int CompareTo(HAuthTicket other) { 60 | return m_HAuthTicket.CompareTo(other.m_HAuthTicket); 61 | } 62 | } 63 | } 64 | 65 | #endif // !DISABLESTEAMWORKS 66 | -------------------------------------------------------------------------------- /Source/types/SteamRemoteStorage/UGCHandle_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct UGCHandle_t : System.IEquatable, System.IComparable { 20 | public static readonly UGCHandle_t Invalid = new UGCHandle_t(0xffffffffffffffff); 21 | public ulong m_UGCHandle; 22 | 23 | public UGCHandle_t(ulong value) { 24 | m_UGCHandle = value; 25 | } 26 | 27 | public override string ToString() { 28 | return m_UGCHandle.ToString(); 29 | } 30 | 31 | public override bool Equals(object other) { 32 | return other is UGCHandle_t && this == (UGCHandle_t)other; 33 | } 34 | 35 | public override int GetHashCode() { 36 | return m_UGCHandle.GetHashCode(); 37 | } 38 | 39 | public static bool operator ==(UGCHandle_t x, UGCHandle_t y) { 40 | return x.m_UGCHandle == y.m_UGCHandle; 41 | } 42 | 43 | public static bool operator !=(UGCHandle_t x, UGCHandle_t y) { 44 | return !(x == y); 45 | } 46 | 47 | public static explicit operator UGCHandle_t(ulong value) { 48 | return new UGCHandle_t(value); 49 | } 50 | 51 | public static explicit operator ulong(UGCHandle_t that) { 52 | return that.m_UGCHandle; 53 | } 54 | 55 | public bool Equals(UGCHandle_t other) { 56 | return m_UGCHandle == other.m_UGCHandle; 57 | } 58 | 59 | public int CompareTo(UGCHandle_t other) { 60 | return m_UGCHandle.CompareTo(other.m_UGCHandle); 61 | } 62 | } 63 | } 64 | 65 | #endif // !DISABLESTEAMWORKS 66 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Steamworks.NET.Dissent 2 | 3 | _Steamworks.NET.Dissent_ is a C# Wrapper for Valve's Steamworks API, it can be used with your C# based application. It is derived from _Steamworks.NET_ but with Unity game engine garbage removed to make it more ergonomic for use in non-Unity projects. 4 | 5 | _Steamworks.NET_ was designed to be as close as possible to the original C++ API, as such the documentation provided from Valve largely covers usage of _Steamworks.NET_. 6 | Niceties and C# Idioms can be easily implemented on top of _Steamworks.NET_. 7 | 8 | _Steamworks.NET.Dissent_ fully supports Windows 64 bit, OSX, and Linux. Currently building against Steamworks SDK 1.53a. 9 | 10 | ## Usage 11 | 12 | Include this project as a submodule and add a reference to `Steamworks.NET.Dissent.csproj` in your project's .csproj file. 13 | 14 | ## Samples 15 | 16 | Check out these `Steamworks.NET` sample projects to get started: 17 | 18 | * [Steamworks.NET Example](https://github.com/rlabrecque/Steamworks.NET-Example) 19 | * [Steamworks.NET Test](https://github.com/rlabrecque/Steamworks.NET-Test) 20 | * [Steamworks.NET ChatClient](https://github.com/rlabrecque/Steamworks.NET-ChatClient) 21 | * [Steamworks.NET GameServerTest](https://github.com/rlabrecque/Steamworks.NET-GameServerTest) 22 | 23 | ## _Steamworks.NET_ Information 24 | 25 | * Author: [Riley Labrecque](https://github.com/rlabrecque) 26 | * License: [MIT](https://www.opensource.org/licenses/mit-license.php) 27 | * [Documentation](https://steamworks.github.io/) 28 | * [Discussion Thread](https://steamcommunity.com/groups/steamworks/discussions/0/666827974770212954/) 29 | * [Reporting Issues](https://github.com/rlabrecque/Steamworks.NET/issues) 30 | Note that only Steamworks.NET specific issues should be reported, general API questions/issues should be asked on the [Steamworks discussion board](http://steamcommunity.com/groups/steamworks/discussions). 31 | 32 | [![Support via Paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YFZZER8VNXKRC) 33 | -------------------------------------------------------------------------------- /Source/types/SteamMatchmaking/HServerQuery.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct HServerQuery : System.IEquatable, System.IComparable { 20 | public static readonly HServerQuery Invalid = new HServerQuery(-1); 21 | public int m_HServerQuery; 22 | 23 | public HServerQuery(int value) { 24 | m_HServerQuery = value; 25 | } 26 | 27 | public override string ToString() { 28 | return m_HServerQuery.ToString(); 29 | } 30 | 31 | public override bool Equals(object other) { 32 | return other is HServerQuery && this == (HServerQuery)other; 33 | } 34 | 35 | public override int GetHashCode() { 36 | return m_HServerQuery.GetHashCode(); 37 | } 38 | 39 | public static bool operator ==(HServerQuery x, HServerQuery y) { 40 | return x.m_HServerQuery == y.m_HServerQuery; 41 | } 42 | 43 | public static bool operator !=(HServerQuery x, HServerQuery y) { 44 | return !(x == y); 45 | } 46 | 47 | public static explicit operator HServerQuery(int value) { 48 | return new HServerQuery(value); 49 | } 50 | 51 | public static explicit operator int(HServerQuery that) { 52 | return that.m_HServerQuery; 53 | } 54 | 55 | public bool Equals(HServerQuery other) { 56 | return m_HServerQuery == other.m_HServerQuery; 57 | } 58 | 59 | public int CompareTo(HServerQuery other) { 60 | return m_HServerQuery.CompareTo(other.m_HServerQuery); 61 | } 62 | } 63 | } 64 | 65 | #endif // !DISABLESTEAMWORKS 66 | -------------------------------------------------------------------------------- /Source/types/SteamHTMLSurface/HHTMLBrowser.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct HHTMLBrowser : System.IEquatable, System.IComparable { 20 | public static readonly HHTMLBrowser Invalid = new HHTMLBrowser(0); 21 | public uint m_HHTMLBrowser; 22 | 23 | public HHTMLBrowser(uint value) { 24 | m_HHTMLBrowser = value; 25 | } 26 | 27 | public override string ToString() { 28 | return m_HHTMLBrowser.ToString(); 29 | } 30 | 31 | public override bool Equals(object other) { 32 | return other is HHTMLBrowser && this == (HHTMLBrowser)other; 33 | } 34 | 35 | public override int GetHashCode() { 36 | return m_HHTMLBrowser.GetHashCode(); 37 | } 38 | 39 | public static bool operator ==(HHTMLBrowser x, HHTMLBrowser y) { 40 | return x.m_HHTMLBrowser == y.m_HHTMLBrowser; 41 | } 42 | 43 | public static bool operator !=(HHTMLBrowser x, HHTMLBrowser y) { 44 | return !(x == y); 45 | } 46 | 47 | public static explicit operator HHTMLBrowser(uint value) { 48 | return new HHTMLBrowser(value); 49 | } 50 | 51 | public static explicit operator uint(HHTMLBrowser that) { 52 | return that.m_HHTMLBrowser; 53 | } 54 | 55 | public bool Equals(HHTMLBrowser other) { 56 | return m_HHTMLBrowser == other.m_HHTMLBrowser; 57 | } 58 | 59 | public int CompareTo(HHTMLBrowser other) { 60 | return m_HHTMLBrowser.CompareTo(other.m_HHTMLBrowser); 61 | } 62 | } 63 | } 64 | 65 | #endif // !DISABLESTEAMWORKS 66 | -------------------------------------------------------------------------------- /Source/types/SteamTypes/SteamAPICall_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct SteamAPICall_t : System.IEquatable, System.IComparable { 20 | public static readonly SteamAPICall_t Invalid = new SteamAPICall_t(0x0); 21 | public ulong m_SteamAPICall; 22 | 23 | public SteamAPICall_t(ulong value) { 24 | m_SteamAPICall = value; 25 | } 26 | 27 | public override string ToString() { 28 | return m_SteamAPICall.ToString(); 29 | } 30 | 31 | public override bool Equals(object other) { 32 | return other is SteamAPICall_t && this == (SteamAPICall_t)other; 33 | } 34 | 35 | public override int GetHashCode() { 36 | return m_SteamAPICall.GetHashCode(); 37 | } 38 | 39 | public static bool operator ==(SteamAPICall_t x, SteamAPICall_t y) { 40 | return x.m_SteamAPICall == y.m_SteamAPICall; 41 | } 42 | 43 | public static bool operator !=(SteamAPICall_t x, SteamAPICall_t y) { 44 | return !(x == y); 45 | } 46 | 47 | public static explicit operator SteamAPICall_t(ulong value) { 48 | return new SteamAPICall_t(value); 49 | } 50 | 51 | public static explicit operator ulong(SteamAPICall_t that) { 52 | return that.m_SteamAPICall; 53 | } 54 | 55 | public bool Equals(SteamAPICall_t other) { 56 | return m_SteamAPICall == other.m_SteamAPICall; 57 | } 58 | 59 | public int CompareTo(SteamAPICall_t other) { 60 | return m_SteamAPICall.CompareTo(other.m_SteamAPICall); 61 | } 62 | } 63 | } 64 | 65 | #endif // !DISABLESTEAMWORKS 66 | -------------------------------------------------------------------------------- /Source/types/SteamMatchmaking/HServerListRequest.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct HServerListRequest : System.IEquatable { 20 | public static readonly HServerListRequest Invalid = new HServerListRequest(System.IntPtr.Zero); 21 | public System.IntPtr m_HServerListRequest; 22 | 23 | public HServerListRequest(System.IntPtr value) { 24 | m_HServerListRequest = value; 25 | } 26 | 27 | public override string ToString() { 28 | return m_HServerListRequest.ToString(); 29 | } 30 | 31 | public override bool Equals(object other) { 32 | return other is HServerListRequest && this == (HServerListRequest)other; 33 | } 34 | 35 | public override int GetHashCode() { 36 | return m_HServerListRequest.GetHashCode(); 37 | } 38 | 39 | public static bool operator ==(HServerListRequest x, HServerListRequest y) { 40 | return x.m_HServerListRequest == y.m_HServerListRequest; 41 | } 42 | 43 | public static bool operator !=(HServerListRequest x, HServerListRequest y) { 44 | return !(x == y); 45 | } 46 | 47 | public static explicit operator HServerListRequest(System.IntPtr value) { 48 | return new HServerListRequest(value); 49 | } 50 | 51 | public static explicit operator System.IntPtr(HServerListRequest that) { 52 | return that.m_HServerListRequest; 53 | } 54 | 55 | public bool Equals(HServerListRequest other) { 56 | return m_HServerListRequest == other.m_HServerListRequest; 57 | } 58 | } 59 | } 60 | 61 | #endif // !DISABLESTEAMWORKS 62 | -------------------------------------------------------------------------------- /Source/types/SteamNetworking/SNetListenSocket_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct SNetListenSocket_t : System.IEquatable, System.IComparable { 20 | public uint m_SNetListenSocket; 21 | 22 | public SNetListenSocket_t(uint value) { 23 | m_SNetListenSocket = value; 24 | } 25 | 26 | public override string ToString() { 27 | return m_SNetListenSocket.ToString(); 28 | } 29 | 30 | public override bool Equals(object other) { 31 | return other is SNetListenSocket_t && this == (SNetListenSocket_t)other; 32 | } 33 | 34 | public override int GetHashCode() { 35 | return m_SNetListenSocket.GetHashCode(); 36 | } 37 | 38 | public static bool operator ==(SNetListenSocket_t x, SNetListenSocket_t y) { 39 | return x.m_SNetListenSocket == y.m_SNetListenSocket; 40 | } 41 | 42 | public static bool operator !=(SNetListenSocket_t x, SNetListenSocket_t y) { 43 | return !(x == y); 44 | } 45 | 46 | public static explicit operator SNetListenSocket_t(uint value) { 47 | return new SNetListenSocket_t(value); 48 | } 49 | 50 | public static explicit operator uint(SNetListenSocket_t that) { 51 | return that.m_SNetListenSocket; 52 | } 53 | 54 | public bool Equals(SNetListenSocket_t other) { 55 | return m_SNetListenSocket == other.m_SNetListenSocket; 56 | } 57 | 58 | public int CompareTo(SNetListenSocket_t other) { 59 | return m_SNetListenSocket.CompareTo(other.m_SNetListenSocket); 60 | } 61 | } 62 | } 63 | 64 | #endif // !DISABLESTEAMWORKS 65 | -------------------------------------------------------------------------------- /Source/types/SteamTypes/PartyBeaconID_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct PartyBeaconID_t : System.IEquatable, System.IComparable { 20 | public static readonly PartyBeaconID_t Invalid = new PartyBeaconID_t(0); 21 | public ulong m_PartyBeaconID; 22 | 23 | public PartyBeaconID_t(ulong value) { 24 | m_PartyBeaconID = value; 25 | } 26 | 27 | public override string ToString() { 28 | return m_PartyBeaconID.ToString(); 29 | } 30 | 31 | public override bool Equals(object other) { 32 | return other is PartyBeaconID_t && this == (PartyBeaconID_t)other; 33 | } 34 | 35 | public override int GetHashCode() { 36 | return m_PartyBeaconID.GetHashCode(); 37 | } 38 | 39 | public static bool operator ==(PartyBeaconID_t x, PartyBeaconID_t y) { 40 | return x.m_PartyBeaconID == y.m_PartyBeaconID; 41 | } 42 | 43 | public static bool operator !=(PartyBeaconID_t x, PartyBeaconID_t y) { 44 | return !(x == y); 45 | } 46 | 47 | public static explicit operator PartyBeaconID_t(ulong value) { 48 | return new PartyBeaconID_t(value); 49 | } 50 | 51 | public static explicit operator ulong(PartyBeaconID_t that) { 52 | return that.m_PartyBeaconID; 53 | } 54 | 55 | public bool Equals(PartyBeaconID_t other) { 56 | return m_PartyBeaconID == other.m_PartyBeaconID; 57 | } 58 | 59 | public int CompareTo(PartyBeaconID_t other) { 60 | return m_PartyBeaconID.CompareTo(other.m_PartyBeaconID); 61 | } 62 | } 63 | } 64 | 65 | #endif // !DISABLESTEAMWORKS 66 | -------------------------------------------------------------------------------- /Source/types/SteamUserStats/SteamLeaderboard_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct SteamLeaderboard_t : System.IEquatable, System.IComparable { 20 | public ulong m_SteamLeaderboard; 21 | 22 | public SteamLeaderboard_t(ulong value) { 23 | m_SteamLeaderboard = value; 24 | } 25 | 26 | public override string ToString() { 27 | return m_SteamLeaderboard.ToString(); 28 | } 29 | 30 | public override bool Equals(object other) { 31 | return other is SteamLeaderboard_t && this == (SteamLeaderboard_t)other; 32 | } 33 | 34 | public override int GetHashCode() { 35 | return m_SteamLeaderboard.GetHashCode(); 36 | } 37 | 38 | public static bool operator ==(SteamLeaderboard_t x, SteamLeaderboard_t y) { 39 | return x.m_SteamLeaderboard == y.m_SteamLeaderboard; 40 | } 41 | 42 | public static bool operator !=(SteamLeaderboard_t x, SteamLeaderboard_t y) { 43 | return !(x == y); 44 | } 45 | 46 | public static explicit operator SteamLeaderboard_t(ulong value) { 47 | return new SteamLeaderboard_t(value); 48 | } 49 | 50 | public static explicit operator ulong(SteamLeaderboard_t that) { 51 | return that.m_SteamLeaderboard; 52 | } 53 | 54 | public bool Equals(SteamLeaderboard_t other) { 55 | return m_SteamLeaderboard == other.m_SteamLeaderboard; 56 | } 57 | 58 | public int CompareTo(SteamLeaderboard_t other) { 59 | return m_SteamLeaderboard.CompareTo(other.m_SteamLeaderboard); 60 | } 61 | } 62 | } 63 | 64 | #endif // !DISABLESTEAMWORKS 65 | -------------------------------------------------------------------------------- /Source/types/SteamFriends/FriendsGroupID_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct FriendsGroupID_t : System.IEquatable, System.IComparable { 20 | public static readonly FriendsGroupID_t Invalid = new FriendsGroupID_t(-1); 21 | public short m_FriendsGroupID; 22 | 23 | public FriendsGroupID_t(short value) { 24 | m_FriendsGroupID = value; 25 | } 26 | 27 | public override string ToString() { 28 | return m_FriendsGroupID.ToString(); 29 | } 30 | 31 | public override bool Equals(object other) { 32 | return other is FriendsGroupID_t && this == (FriendsGroupID_t)other; 33 | } 34 | 35 | public override int GetHashCode() { 36 | return m_FriendsGroupID.GetHashCode(); 37 | } 38 | 39 | public static bool operator ==(FriendsGroupID_t x, FriendsGroupID_t y) { 40 | return x.m_FriendsGroupID == y.m_FriendsGroupID; 41 | } 42 | 43 | public static bool operator !=(FriendsGroupID_t x, FriendsGroupID_t y) { 44 | return !(x == y); 45 | } 46 | 47 | public static explicit operator FriendsGroupID_t(short value) { 48 | return new FriendsGroupID_t(value); 49 | } 50 | 51 | public static explicit operator short(FriendsGroupID_t that) { 52 | return that.m_FriendsGroupID; 53 | } 54 | 55 | public bool Equals(FriendsGroupID_t other) { 56 | return m_FriendsGroupID == other.m_FriendsGroupID; 57 | } 58 | 59 | public int CompareTo(FriendsGroupID_t other) { 60 | return m_FriendsGroupID.CompareTo(other.m_FriendsGroupID); 61 | } 62 | } 63 | } 64 | 65 | #endif // !DISABLESTEAMWORKS 66 | -------------------------------------------------------------------------------- /Source/types/SteamUGC/UGCQueryHandle_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct UGCQueryHandle_t : System.IEquatable, System.IComparable { 20 | public static readonly UGCQueryHandle_t Invalid = new UGCQueryHandle_t(0xffffffffffffffff); 21 | public ulong m_UGCQueryHandle; 22 | 23 | public UGCQueryHandle_t(ulong value) { 24 | m_UGCQueryHandle = value; 25 | } 26 | 27 | public override string ToString() { 28 | return m_UGCQueryHandle.ToString(); 29 | } 30 | 31 | public override bool Equals(object other) { 32 | return other is UGCQueryHandle_t && this == (UGCQueryHandle_t)other; 33 | } 34 | 35 | public override int GetHashCode() { 36 | return m_UGCQueryHandle.GetHashCode(); 37 | } 38 | 39 | public static bool operator ==(UGCQueryHandle_t x, UGCQueryHandle_t y) { 40 | return x.m_UGCQueryHandle == y.m_UGCQueryHandle; 41 | } 42 | 43 | public static bool operator !=(UGCQueryHandle_t x, UGCQueryHandle_t y) { 44 | return !(x == y); 45 | } 46 | 47 | public static explicit operator UGCQueryHandle_t(ulong value) { 48 | return new UGCQueryHandle_t(value); 49 | } 50 | 51 | public static explicit operator ulong(UGCQueryHandle_t that) { 52 | return that.m_UGCQueryHandle; 53 | } 54 | 55 | public bool Equals(UGCQueryHandle_t other) { 56 | return m_UGCQueryHandle == other.m_UGCQueryHandle; 57 | } 58 | 59 | public int CompareTo(UGCQueryHandle_t other) { 60 | return m_UGCQueryHandle.CompareTo(other.m_UGCQueryHandle); 61 | } 62 | } 63 | } 64 | 65 | #endif // !DISABLESTEAMWORKS 66 | -------------------------------------------------------------------------------- /Source/autogen/isteamparentalsettings.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | public static class SteamParentalSettings { 19 | public static bool BIsParentalLockEnabled() { 20 | InteropHelp.TestIfAvailableClient(); 21 | return NativeMethods.ISteamParentalSettings_BIsParentalLockEnabled(CSteamAPIContext.GetSteamParentalSettings()); 22 | } 23 | 24 | public static bool BIsParentalLockLocked() { 25 | InteropHelp.TestIfAvailableClient(); 26 | return NativeMethods.ISteamParentalSettings_BIsParentalLockLocked(CSteamAPIContext.GetSteamParentalSettings()); 27 | } 28 | 29 | public static bool BIsAppBlocked(AppId_t nAppID) { 30 | InteropHelp.TestIfAvailableClient(); 31 | return NativeMethods.ISteamParentalSettings_BIsAppBlocked(CSteamAPIContext.GetSteamParentalSettings(), nAppID); 32 | } 33 | 34 | public static bool BIsAppInBlockList(AppId_t nAppID) { 35 | InteropHelp.TestIfAvailableClient(); 36 | return NativeMethods.ISteamParentalSettings_BIsAppInBlockList(CSteamAPIContext.GetSteamParentalSettings(), nAppID); 37 | } 38 | 39 | public static bool BIsFeatureBlocked(EParentalFeature eFeature) { 40 | InteropHelp.TestIfAvailableClient(); 41 | return NativeMethods.ISteamParentalSettings_BIsFeatureBlocked(CSteamAPIContext.GetSteamParentalSettings(), eFeature); 42 | } 43 | 44 | public static bool BIsFeatureInBlockList(EParentalFeature eFeature) { 45 | InteropHelp.TestIfAvailableClient(); 46 | return NativeMethods.ISteamParentalSettings_BIsFeatureInBlockList(CSteamAPIContext.GetSteamParentalSettings(), eFeature); 47 | } 48 | } 49 | } 50 | 51 | #endif // !DISABLESTEAMWORKS 52 | -------------------------------------------------------------------------------- /Source/types/SteamScreenshots/ScreenshotHandle.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct ScreenshotHandle : System.IEquatable, System.IComparable { 20 | public static readonly ScreenshotHandle Invalid = new ScreenshotHandle(0); 21 | public uint m_ScreenshotHandle; 22 | 23 | public ScreenshotHandle(uint value) { 24 | m_ScreenshotHandle = value; 25 | } 26 | 27 | public override string ToString() { 28 | return m_ScreenshotHandle.ToString(); 29 | } 30 | 31 | public override bool Equals(object other) { 32 | return other is ScreenshotHandle && this == (ScreenshotHandle)other; 33 | } 34 | 35 | public override int GetHashCode() { 36 | return m_ScreenshotHandle.GetHashCode(); 37 | } 38 | 39 | public static bool operator ==(ScreenshotHandle x, ScreenshotHandle y) { 40 | return x.m_ScreenshotHandle == y.m_ScreenshotHandle; 41 | } 42 | 43 | public static bool operator !=(ScreenshotHandle x, ScreenshotHandle y) { 44 | return !(x == y); 45 | } 46 | 47 | public static explicit operator ScreenshotHandle(uint value) { 48 | return new ScreenshotHandle(value); 49 | } 50 | 51 | public static explicit operator uint(ScreenshotHandle that) { 52 | return that.m_ScreenshotHandle; 53 | } 54 | 55 | public bool Equals(ScreenshotHandle other) { 56 | return m_ScreenshotHandle == other.m_ScreenshotHandle; 57 | } 58 | 59 | public int CompareTo(ScreenshotHandle other) { 60 | return m_ScreenshotHandle.CompareTo(other.m_ScreenshotHandle); 61 | } 62 | } 63 | } 64 | 65 | #endif // !DISABLESTEAMWORKS 66 | -------------------------------------------------------------------------------- /Steamworks.NET.Dissent.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | Steamworks 6 | Steamworks.NET.Dissent 7 | true 8 | 9 | 10 | 11 | STEAMWORKS_WIN;STEAMWORKS_X64 12 | 13 | 14 | 15 | STEAMWORKS_LIN_OSX;STEAMWORKS_X64 16 | 17 | 18 | 19 | STEAMWORKS_LIN_OSX;STEAMWORKS_X64 20 | 21 | 22 | 23 | 24 | %(RecursiveDir)%(Filename)%(Extension) 25 | PreserveNewest 26 | 27 | 28 | 29 | 30 | 31 | %(RecursiveDir)%(Filename)%(Extension) 32 | PreserveNewest 33 | 34 | 35 | 36 | 37 | 38 | %(RecursiveDir)%(Filename)%(Extension) 39 | PreserveNewest 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /Source/types/SteamRemoteStorage/PublishedFileId_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct PublishedFileId_t : System.IEquatable, System.IComparable { 20 | public static readonly PublishedFileId_t Invalid = new PublishedFileId_t(0); 21 | public ulong m_PublishedFileId; 22 | 23 | public PublishedFileId_t(ulong value) { 24 | m_PublishedFileId = value; 25 | } 26 | 27 | public override string ToString() { 28 | return m_PublishedFileId.ToString(); 29 | } 30 | 31 | public override bool Equals(object other) { 32 | return other is PublishedFileId_t && this == (PublishedFileId_t)other; 33 | } 34 | 35 | public override int GetHashCode() { 36 | return m_PublishedFileId.GetHashCode(); 37 | } 38 | 39 | public static bool operator ==(PublishedFileId_t x, PublishedFileId_t y) { 40 | return x.m_PublishedFileId == y.m_PublishedFileId; 41 | } 42 | 43 | public static bool operator !=(PublishedFileId_t x, PublishedFileId_t y) { 44 | return !(x == y); 45 | } 46 | 47 | public static explicit operator PublishedFileId_t(ulong value) { 48 | return new PublishedFileId_t(value); 49 | } 50 | 51 | public static explicit operator ulong(PublishedFileId_t that) { 52 | return that.m_PublishedFileId; 53 | } 54 | 55 | public bool Equals(PublishedFileId_t other) { 56 | return m_PublishedFileId == other.m_PublishedFileId; 57 | } 58 | 59 | public int CompareTo(PublishedFileId_t other) { 60 | return m_PublishedFileId.CompareTo(other.m_PublishedFileId); 61 | } 62 | } 63 | } 64 | 65 | #endif // !DISABLESTEAMWORKS 66 | -------------------------------------------------------------------------------- /Source/types/SteamUGC/UGCUpdateHandle_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct UGCUpdateHandle_t : System.IEquatable, System.IComparable { 20 | public static readonly UGCUpdateHandle_t Invalid = new UGCUpdateHandle_t(0xffffffffffffffff); 21 | public ulong m_UGCUpdateHandle; 22 | 23 | public UGCUpdateHandle_t(ulong value) { 24 | m_UGCUpdateHandle = value; 25 | } 26 | 27 | public override string ToString() { 28 | return m_UGCUpdateHandle.ToString(); 29 | } 30 | 31 | public override bool Equals(object other) { 32 | return other is UGCUpdateHandle_t && this == (UGCUpdateHandle_t)other; 33 | } 34 | 35 | public override int GetHashCode() { 36 | return m_UGCUpdateHandle.GetHashCode(); 37 | } 38 | 39 | public static bool operator ==(UGCUpdateHandle_t x, UGCUpdateHandle_t y) { 40 | return x.m_UGCUpdateHandle == y.m_UGCUpdateHandle; 41 | } 42 | 43 | public static bool operator !=(UGCUpdateHandle_t x, UGCUpdateHandle_t y) { 44 | return !(x == y); 45 | } 46 | 47 | public static explicit operator UGCUpdateHandle_t(ulong value) { 48 | return new UGCUpdateHandle_t(value); 49 | } 50 | 51 | public static explicit operator ulong(UGCUpdateHandle_t that) { 52 | return that.m_UGCUpdateHandle; 53 | } 54 | 55 | public bool Equals(UGCUpdateHandle_t other) { 56 | return m_UGCUpdateHandle == other.m_UGCUpdateHandle; 57 | } 58 | 59 | public int CompareTo(UGCUpdateHandle_t other) { 60 | return m_UGCUpdateHandle.CompareTo(other.m_UGCUpdateHandle); 61 | } 62 | } 63 | } 64 | 65 | #endif // !DISABLESTEAMWORKS 66 | -------------------------------------------------------------------------------- /Source/types/SteamHTTP/HTTPRequestHandle.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct HTTPRequestHandle : System.IEquatable, System.IComparable { 20 | public static readonly HTTPRequestHandle Invalid = new HTTPRequestHandle(0); 21 | public uint m_HTTPRequestHandle; 22 | 23 | public HTTPRequestHandle(uint value) { 24 | m_HTTPRequestHandle = value; 25 | } 26 | 27 | public override string ToString() { 28 | return m_HTTPRequestHandle.ToString(); 29 | } 30 | 31 | public override bool Equals(object other) { 32 | return other is HTTPRequestHandle && this == (HTTPRequestHandle)other; 33 | } 34 | 35 | public override int GetHashCode() { 36 | return m_HTTPRequestHandle.GetHashCode(); 37 | } 38 | 39 | public static bool operator ==(HTTPRequestHandle x, HTTPRequestHandle y) { 40 | return x.m_HTTPRequestHandle == y.m_HTTPRequestHandle; 41 | } 42 | 43 | public static bool operator !=(HTTPRequestHandle x, HTTPRequestHandle y) { 44 | return !(x == y); 45 | } 46 | 47 | public static explicit operator HTTPRequestHandle(uint value) { 48 | return new HTTPRequestHandle(value); 49 | } 50 | 51 | public static explicit operator uint(HTTPRequestHandle that) { 52 | return that.m_HTTPRequestHandle; 53 | } 54 | 55 | public bool Equals(HTTPRequestHandle other) { 56 | return m_HTTPRequestHandle == other.m_HTTPRequestHandle; 57 | } 58 | 59 | public int CompareTo(HTTPRequestHandle other) { 60 | return m_HTTPRequestHandle.CompareTo(other.m_HTTPRequestHandle); 61 | } 62 | } 63 | } 64 | 65 | #endif // !DISABLESTEAMWORKS 66 | -------------------------------------------------------------------------------- /Source/types/SteamNetworkingTypes/SteamNetworkingPOPID.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct SteamNetworkingPOPID : System.IEquatable, System.IComparable { 20 | public uint m_SteamNetworkingPOPID; 21 | 22 | public SteamNetworkingPOPID(uint value) { 23 | m_SteamNetworkingPOPID = value; 24 | } 25 | 26 | public override string ToString() { 27 | return m_SteamNetworkingPOPID.ToString(); 28 | } 29 | 30 | public override bool Equals(object other) { 31 | return other is SteamNetworkingPOPID && this == (SteamNetworkingPOPID)other; 32 | } 33 | 34 | public override int GetHashCode() { 35 | return m_SteamNetworkingPOPID.GetHashCode(); 36 | } 37 | 38 | public static bool operator ==(SteamNetworkingPOPID x, SteamNetworkingPOPID y) { 39 | return x.m_SteamNetworkingPOPID == y.m_SteamNetworkingPOPID; 40 | } 41 | 42 | public static bool operator !=(SteamNetworkingPOPID x, SteamNetworkingPOPID y) { 43 | return !(x == y); 44 | } 45 | 46 | public static explicit operator SteamNetworkingPOPID(uint value) { 47 | return new SteamNetworkingPOPID(value); 48 | } 49 | 50 | public static explicit operator uint(SteamNetworkingPOPID that) { 51 | return that.m_SteamNetworkingPOPID; 52 | } 53 | 54 | public bool Equals(SteamNetworkingPOPID other) { 55 | return m_SteamNetworkingPOPID == other.m_SteamNetworkingPOPID; 56 | } 57 | 58 | public int CompareTo(SteamNetworkingPOPID other) { 59 | return m_SteamNetworkingPOPID.CompareTo(other.m_SteamNetworkingPOPID); 60 | } 61 | } 62 | } 63 | 64 | #endif // !DISABLESTEAMWORKS 65 | -------------------------------------------------------------------------------- /Source/types/SteamRemotePlay/RemotePlaySessionID_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct RemotePlaySessionID_t : System.IEquatable, System.IComparable { 20 | public uint m_RemotePlaySessionID; 21 | 22 | public RemotePlaySessionID_t(uint value) { 23 | m_RemotePlaySessionID = value; 24 | } 25 | 26 | public override string ToString() { 27 | return m_RemotePlaySessionID.ToString(); 28 | } 29 | 30 | public override bool Equals(object other) { 31 | return other is RemotePlaySessionID_t && this == (RemotePlaySessionID_t)other; 32 | } 33 | 34 | public override int GetHashCode() { 35 | return m_RemotePlaySessionID.GetHashCode(); 36 | } 37 | 38 | public static bool operator ==(RemotePlaySessionID_t x, RemotePlaySessionID_t y) { 39 | return x.m_RemotePlaySessionID == y.m_RemotePlaySessionID; 40 | } 41 | 42 | public static bool operator !=(RemotePlaySessionID_t x, RemotePlaySessionID_t y) { 43 | return !(x == y); 44 | } 45 | 46 | public static explicit operator RemotePlaySessionID_t(uint value) { 47 | return new RemotePlaySessionID_t(value); 48 | } 49 | 50 | public static explicit operator uint(RemotePlaySessionID_t that) { 51 | return that.m_RemotePlaySessionID; 52 | } 53 | 54 | public bool Equals(RemotePlaySessionID_t other) { 55 | return m_RemotePlaySessionID == other.m_RemotePlaySessionID; 56 | } 57 | 58 | public int CompareTo(RemotePlaySessionID_t other) { 59 | return m_RemotePlaySessionID.CompareTo(other.m_RemotePlaySessionID); 60 | } 61 | } 62 | } 63 | 64 | #endif // !DISABLESTEAMWORKS 65 | -------------------------------------------------------------------------------- /Source/autogen/isteamvideo.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | public static class SteamVideo { 19 | /// 20 | /// Get a URL suitable for streaming the given Video app ID's video 21 | /// 22 | public static void GetVideoURL(AppId_t unVideoAppID) { 23 | InteropHelp.TestIfAvailableClient(); 24 | NativeMethods.ISteamVideo_GetVideoURL(CSteamAPIContext.GetSteamVideo(), unVideoAppID); 25 | } 26 | 27 | /// 28 | /// returns true if user is uploading a live broadcast 29 | /// 30 | public static bool IsBroadcasting(out int pnNumViewers) { 31 | InteropHelp.TestIfAvailableClient(); 32 | return NativeMethods.ISteamVideo_IsBroadcasting(CSteamAPIContext.GetSteamVideo(), out pnNumViewers); 33 | } 34 | 35 | /// 36 | /// Get the OPF Details for 360 Video Playback 37 | /// 38 | public static void GetOPFSettings(AppId_t unVideoAppID) { 39 | InteropHelp.TestIfAvailableClient(); 40 | NativeMethods.ISteamVideo_GetOPFSettings(CSteamAPIContext.GetSteamVideo(), unVideoAppID); 41 | } 42 | 43 | public static bool GetOPFStringForApp(AppId_t unVideoAppID, out string pchBuffer, ref int pnBufferSize) { 44 | InteropHelp.TestIfAvailableClient(); 45 | IntPtr pchBuffer2 = Marshal.AllocHGlobal((int)pnBufferSize); 46 | bool ret = NativeMethods.ISteamVideo_GetOPFStringForApp(CSteamAPIContext.GetSteamVideo(), unVideoAppID, pchBuffer2, ref pnBufferSize); 47 | pchBuffer = ret ? InteropHelp.PtrToStringUTF8(pchBuffer2) : null; 48 | Marshal.FreeHGlobal(pchBuffer2); 49 | return ret; 50 | } 51 | } 52 | } 53 | 54 | #endif // !DISABLESTEAMWORKS 55 | -------------------------------------------------------------------------------- /Source/types/SteamInput/InputActionSetHandle_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct InputActionSetHandle_t : System.IEquatable, System.IComparable { 20 | public ulong m_InputActionSetHandle; 21 | 22 | public InputActionSetHandle_t(ulong value) { 23 | m_InputActionSetHandle = value; 24 | } 25 | 26 | public override string ToString() { 27 | return m_InputActionSetHandle.ToString(); 28 | } 29 | 30 | public override bool Equals(object other) { 31 | return other is InputActionSetHandle_t && this == (InputActionSetHandle_t)other; 32 | } 33 | 34 | public override int GetHashCode() { 35 | return m_InputActionSetHandle.GetHashCode(); 36 | } 37 | 38 | public static bool operator ==(InputActionSetHandle_t x, InputActionSetHandle_t y) { 39 | return x.m_InputActionSetHandle == y.m_InputActionSetHandle; 40 | } 41 | 42 | public static bool operator !=(InputActionSetHandle_t x, InputActionSetHandle_t y) { 43 | return !(x == y); 44 | } 45 | 46 | public static explicit operator InputActionSetHandle_t(ulong value) { 47 | return new InputActionSetHandle_t(value); 48 | } 49 | 50 | public static explicit operator ulong(InputActionSetHandle_t that) { 51 | return that.m_InputActionSetHandle; 52 | } 53 | 54 | public bool Equals(InputActionSetHandle_t other) { 55 | return m_InputActionSetHandle == other.m_InputActionSetHandle; 56 | } 57 | 58 | public int CompareTo(InputActionSetHandle_t other) { 59 | return m_InputActionSetHandle.CompareTo(other.m_InputActionSetHandle); 60 | } 61 | } 62 | } 63 | 64 | #endif // !DISABLESTEAMWORKS 65 | -------------------------------------------------------------------------------- /Source/types/SteamNetworkingTypes/HSteamListenSocket.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct HSteamListenSocket : System.IEquatable, System.IComparable { 20 | public static readonly HSteamListenSocket Invalid = new HSteamListenSocket(0); 21 | public uint m_HSteamListenSocket; 22 | 23 | public HSteamListenSocket(uint value) { 24 | m_HSteamListenSocket = value; 25 | } 26 | 27 | public override string ToString() { 28 | return m_HSteamListenSocket.ToString(); 29 | } 30 | 31 | public override bool Equals(object other) { 32 | return other is HSteamListenSocket && this == (HSteamListenSocket)other; 33 | } 34 | 35 | public override int GetHashCode() { 36 | return m_HSteamListenSocket.GetHashCode(); 37 | } 38 | 39 | public static bool operator ==(HSteamListenSocket x, HSteamListenSocket y) { 40 | return x.m_HSteamListenSocket == y.m_HSteamListenSocket; 41 | } 42 | 43 | public static bool operator !=(HSteamListenSocket x, HSteamListenSocket y) { 44 | return !(x == y); 45 | } 46 | 47 | public static explicit operator HSteamListenSocket(uint value) { 48 | return new HSteamListenSocket(value); 49 | } 50 | 51 | public static explicit operator uint(HSteamListenSocket that) { 52 | return that.m_HSteamListenSocket; 53 | } 54 | 55 | public bool Equals(HSteamListenSocket other) { 56 | return m_HSteamListenSocket == other.m_HSteamListenSocket; 57 | } 58 | 59 | public int CompareTo(HSteamListenSocket other) { 60 | return m_HSteamListenSocket.CompareTo(other.m_HSteamListenSocket); 61 | } 62 | } 63 | } 64 | 65 | #endif // !DISABLESTEAMWORKS 66 | -------------------------------------------------------------------------------- /Source/types/SteamNetworkingTypes/HSteamNetPollGroup.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct HSteamNetPollGroup : System.IEquatable, System.IComparable { 20 | public static readonly HSteamNetPollGroup Invalid = new HSteamNetPollGroup(0); 21 | public uint m_HSteamNetPollGroup; 22 | 23 | public HSteamNetPollGroup(uint value) { 24 | m_HSteamNetPollGroup = value; 25 | } 26 | 27 | public override string ToString() { 28 | return m_HSteamNetPollGroup.ToString(); 29 | } 30 | 31 | public override bool Equals(object other) { 32 | return other is HSteamNetPollGroup && this == (HSteamNetPollGroup)other; 33 | } 34 | 35 | public override int GetHashCode() { 36 | return m_HSteamNetPollGroup.GetHashCode(); 37 | } 38 | 39 | public static bool operator ==(HSteamNetPollGroup x, HSteamNetPollGroup y) { 40 | return x.m_HSteamNetPollGroup == y.m_HSteamNetPollGroup; 41 | } 42 | 43 | public static bool operator !=(HSteamNetPollGroup x, HSteamNetPollGroup y) { 44 | return !(x == y); 45 | } 46 | 47 | public static explicit operator HSteamNetPollGroup(uint value) { 48 | return new HSteamNetPollGroup(value); 49 | } 50 | 51 | public static explicit operator uint(HSteamNetPollGroup that) { 52 | return that.m_HSteamNetPollGroup; 53 | } 54 | 55 | public bool Equals(HSteamNetPollGroup other) { 56 | return m_HSteamNetPollGroup == other.m_HSteamNetPollGroup; 57 | } 58 | 59 | public int CompareTo(HSteamNetPollGroup other) { 60 | return m_HSteamNetPollGroup.CompareTo(other.m_HSteamNetPollGroup); 61 | } 62 | } 63 | } 64 | 65 | #endif // !DISABLESTEAMWORKS 66 | -------------------------------------------------------------------------------- /Source/types/SteamNetworkingTypes/HSteamNetConnection.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct HSteamNetConnection : System.IEquatable, System.IComparable { 20 | public static readonly HSteamNetConnection Invalid = new HSteamNetConnection(0); 21 | public uint m_HSteamNetConnection; 22 | 23 | public HSteamNetConnection(uint value) { 24 | m_HSteamNetConnection = value; 25 | } 26 | 27 | public override string ToString() { 28 | return m_HSteamNetConnection.ToString(); 29 | } 30 | 31 | public override bool Equals(object other) { 32 | return other is HSteamNetConnection && this == (HSteamNetConnection)other; 33 | } 34 | 35 | public override int GetHashCode() { 36 | return m_HSteamNetConnection.GetHashCode(); 37 | } 38 | 39 | public static bool operator ==(HSteamNetConnection x, HSteamNetConnection y) { 40 | return x.m_HSteamNetConnection == y.m_HSteamNetConnection; 41 | } 42 | 43 | public static bool operator !=(HSteamNetConnection x, HSteamNetConnection y) { 44 | return !(x == y); 45 | } 46 | 47 | public static explicit operator HSteamNetConnection(uint value) { 48 | return new HSteamNetConnection(value); 49 | } 50 | 51 | public static explicit operator uint(HSteamNetConnection that) { 52 | return that.m_HSteamNetConnection; 53 | } 54 | 55 | public bool Equals(HSteamNetConnection other) { 56 | return m_HSteamNetConnection == other.m_HSteamNetConnection; 57 | } 58 | 59 | public int CompareTo(HSteamNetConnection other) { 60 | return m_HSteamNetConnection.CompareTo(other.m_HSteamNetConnection); 61 | } 62 | } 63 | } 64 | 65 | #endif // !DISABLESTEAMWORKS 66 | -------------------------------------------------------------------------------- /Source/types/SteamInput/InputAnalogActionHandle_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct InputAnalogActionHandle_t : System.IEquatable, System.IComparable { 20 | public ulong m_InputAnalogActionHandle; 21 | 22 | public InputAnalogActionHandle_t(ulong value) { 23 | m_InputAnalogActionHandle = value; 24 | } 25 | 26 | public override string ToString() { 27 | return m_InputAnalogActionHandle.ToString(); 28 | } 29 | 30 | public override bool Equals(object other) { 31 | return other is InputAnalogActionHandle_t && this == (InputAnalogActionHandle_t)other; 32 | } 33 | 34 | public override int GetHashCode() { 35 | return m_InputAnalogActionHandle.GetHashCode(); 36 | } 37 | 38 | public static bool operator ==(InputAnalogActionHandle_t x, InputAnalogActionHandle_t y) { 39 | return x.m_InputAnalogActionHandle == y.m_InputAnalogActionHandle; 40 | } 41 | 42 | public static bool operator !=(InputAnalogActionHandle_t x, InputAnalogActionHandle_t y) { 43 | return !(x == y); 44 | } 45 | 46 | public static explicit operator InputAnalogActionHandle_t(ulong value) { 47 | return new InputAnalogActionHandle_t(value); 48 | } 49 | 50 | public static explicit operator ulong(InputAnalogActionHandle_t that) { 51 | return that.m_InputAnalogActionHandle; 52 | } 53 | 54 | public bool Equals(InputAnalogActionHandle_t other) { 55 | return m_InputAnalogActionHandle == other.m_InputAnalogActionHandle; 56 | } 57 | 58 | public int CompareTo(InputAnalogActionHandle_t other) { 59 | return m_InputAnalogActionHandle.CompareTo(other.m_InputAnalogActionHandle); 60 | } 61 | } 62 | } 63 | 64 | #endif // !DISABLESTEAMWORKS 65 | -------------------------------------------------------------------------------- /Source/types/SteamUserStats/SteamLeaderboardEntries_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct SteamLeaderboardEntries_t : System.IEquatable, System.IComparable { 20 | public ulong m_SteamLeaderboardEntries; 21 | 22 | public SteamLeaderboardEntries_t(ulong value) { 23 | m_SteamLeaderboardEntries = value; 24 | } 25 | 26 | public override string ToString() { 27 | return m_SteamLeaderboardEntries.ToString(); 28 | } 29 | 30 | public override bool Equals(object other) { 31 | return other is SteamLeaderboardEntries_t && this == (SteamLeaderboardEntries_t)other; 32 | } 33 | 34 | public override int GetHashCode() { 35 | return m_SteamLeaderboardEntries.GetHashCode(); 36 | } 37 | 38 | public static bool operator ==(SteamLeaderboardEntries_t x, SteamLeaderboardEntries_t y) { 39 | return x.m_SteamLeaderboardEntries == y.m_SteamLeaderboardEntries; 40 | } 41 | 42 | public static bool operator !=(SteamLeaderboardEntries_t x, SteamLeaderboardEntries_t y) { 43 | return !(x == y); 44 | } 45 | 46 | public static explicit operator SteamLeaderboardEntries_t(ulong value) { 47 | return new SteamLeaderboardEntries_t(value); 48 | } 49 | 50 | public static explicit operator ulong(SteamLeaderboardEntries_t that) { 51 | return that.m_SteamLeaderboardEntries; 52 | } 53 | 54 | public bool Equals(SteamLeaderboardEntries_t other) { 55 | return m_SteamLeaderboardEntries == other.m_SteamLeaderboardEntries; 56 | } 57 | 58 | public int CompareTo(SteamLeaderboardEntries_t other) { 59 | return m_SteamLeaderboardEntries.CompareTo(other.m_SteamLeaderboardEntries); 60 | } 61 | } 62 | } 63 | 64 | #endif // !DISABLESTEAMWORKS 65 | -------------------------------------------------------------------------------- /Source/types/SteamInventory/SteamItemInstanceID_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct SteamItemInstanceID_t : System.IEquatable, System.IComparable { 20 | public static readonly SteamItemInstanceID_t Invalid = new SteamItemInstanceID_t(0xFFFFFFFFFFFFFFFF); 21 | public ulong m_SteamItemInstanceID; 22 | 23 | public SteamItemInstanceID_t(ulong value) { 24 | m_SteamItemInstanceID = value; 25 | } 26 | 27 | public override string ToString() { 28 | return m_SteamItemInstanceID.ToString(); 29 | } 30 | 31 | public override bool Equals(object other) { 32 | return other is SteamItemInstanceID_t && this == (SteamItemInstanceID_t)other; 33 | } 34 | 35 | public override int GetHashCode() { 36 | return m_SteamItemInstanceID.GetHashCode(); 37 | } 38 | 39 | public static bool operator ==(SteamItemInstanceID_t x, SteamItemInstanceID_t y) { 40 | return x.m_SteamItemInstanceID == y.m_SteamItemInstanceID; 41 | } 42 | 43 | public static bool operator !=(SteamItemInstanceID_t x, SteamItemInstanceID_t y) { 44 | return !(x == y); 45 | } 46 | 47 | public static explicit operator SteamItemInstanceID_t(ulong value) { 48 | return new SteamItemInstanceID_t(value); 49 | } 50 | 51 | public static explicit operator ulong(SteamItemInstanceID_t that) { 52 | return that.m_SteamItemInstanceID; 53 | } 54 | 55 | public bool Equals(SteamItemInstanceID_t other) { 56 | return m_SteamItemInstanceID == other.m_SteamItemInstanceID; 57 | } 58 | 59 | public int CompareTo(SteamItemInstanceID_t other) { 60 | return m_SteamItemInstanceID.CompareTo(other.m_SteamItemInstanceID); 61 | } 62 | } 63 | } 64 | 65 | #endif // !DISABLESTEAMWORKS 66 | -------------------------------------------------------------------------------- /Source/types/SteamInventory/SteamInventoryResult_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct SteamInventoryResult_t : System.IEquatable, System.IComparable { 20 | public static readonly SteamInventoryResult_t Invalid = new SteamInventoryResult_t(-1); 21 | public int m_SteamInventoryResult; 22 | 23 | public SteamInventoryResult_t(int value) { 24 | m_SteamInventoryResult = value; 25 | } 26 | 27 | public override string ToString() { 28 | return m_SteamInventoryResult.ToString(); 29 | } 30 | 31 | public override bool Equals(object other) { 32 | return other is SteamInventoryResult_t && this == (SteamInventoryResult_t)other; 33 | } 34 | 35 | public override int GetHashCode() { 36 | return m_SteamInventoryResult.GetHashCode(); 37 | } 38 | 39 | public static bool operator ==(SteamInventoryResult_t x, SteamInventoryResult_t y) { 40 | return x.m_SteamInventoryResult == y.m_SteamInventoryResult; 41 | } 42 | 43 | public static bool operator !=(SteamInventoryResult_t x, SteamInventoryResult_t y) { 44 | return !(x == y); 45 | } 46 | 47 | public static explicit operator SteamInventoryResult_t(int value) { 48 | return new SteamInventoryResult_t(value); 49 | } 50 | 51 | public static explicit operator int(SteamInventoryResult_t that) { 52 | return that.m_SteamInventoryResult; 53 | } 54 | 55 | public bool Equals(SteamInventoryResult_t other) { 56 | return m_SteamInventoryResult == other.m_SteamInventoryResult; 57 | } 58 | 59 | public int CompareTo(SteamInventoryResult_t other) { 60 | return m_SteamInventoryResult.CompareTo(other.m_SteamInventoryResult); 61 | } 62 | } 63 | } 64 | 65 | #endif // !DISABLESTEAMWORKS 66 | -------------------------------------------------------------------------------- /Source/types/SteamInput/InputDigitalActionHandle_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct InputDigitalActionHandle_t : System.IEquatable, System.IComparable { 20 | public ulong m_InputDigitalActionHandle; 21 | 22 | public InputDigitalActionHandle_t(ulong value) { 23 | m_InputDigitalActionHandle = value; 24 | } 25 | 26 | public override string ToString() { 27 | return m_InputDigitalActionHandle.ToString(); 28 | } 29 | 30 | public override bool Equals(object other) { 31 | return other is InputDigitalActionHandle_t && this == (InputDigitalActionHandle_t)other; 32 | } 33 | 34 | public override int GetHashCode() { 35 | return m_InputDigitalActionHandle.GetHashCode(); 36 | } 37 | 38 | public static bool operator ==(InputDigitalActionHandle_t x, InputDigitalActionHandle_t y) { 39 | return x.m_InputDigitalActionHandle == y.m_InputDigitalActionHandle; 40 | } 41 | 42 | public static bool operator !=(InputDigitalActionHandle_t x, InputDigitalActionHandle_t y) { 43 | return !(x == y); 44 | } 45 | 46 | public static explicit operator InputDigitalActionHandle_t(ulong value) { 47 | return new InputDigitalActionHandle_t(value); 48 | } 49 | 50 | public static explicit operator ulong(InputDigitalActionHandle_t that) { 51 | return that.m_InputDigitalActionHandle; 52 | } 53 | 54 | public bool Equals(InputDigitalActionHandle_t other) { 55 | return m_InputDigitalActionHandle == other.m_InputDigitalActionHandle; 56 | } 57 | 58 | public int CompareTo(InputDigitalActionHandle_t other) { 59 | return m_InputDigitalActionHandle.CompareTo(other.m_InputDigitalActionHandle); 60 | } 61 | } 62 | } 63 | 64 | #endif // !DISABLESTEAMWORKS 65 | -------------------------------------------------------------------------------- /Source/types/SteamNetworkingTypes/SteamNetworkingMicroseconds.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct SteamNetworkingMicroseconds : System.IEquatable, System.IComparable { 20 | public long m_SteamNetworkingMicroseconds; 21 | 22 | public SteamNetworkingMicroseconds(long value) { 23 | m_SteamNetworkingMicroseconds = value; 24 | } 25 | 26 | public override string ToString() { 27 | return m_SteamNetworkingMicroseconds.ToString(); 28 | } 29 | 30 | public override bool Equals(object other) { 31 | return other is SteamNetworkingMicroseconds && this == (SteamNetworkingMicroseconds)other; 32 | } 33 | 34 | public override int GetHashCode() { 35 | return m_SteamNetworkingMicroseconds.GetHashCode(); 36 | } 37 | 38 | public static bool operator ==(SteamNetworkingMicroseconds x, SteamNetworkingMicroseconds y) { 39 | return x.m_SteamNetworkingMicroseconds == y.m_SteamNetworkingMicroseconds; 40 | } 41 | 42 | public static bool operator !=(SteamNetworkingMicroseconds x, SteamNetworkingMicroseconds y) { 43 | return !(x == y); 44 | } 45 | 46 | public static explicit operator SteamNetworkingMicroseconds(long value) { 47 | return new SteamNetworkingMicroseconds(value); 48 | } 49 | 50 | public static explicit operator long(SteamNetworkingMicroseconds that) { 51 | return that.m_SteamNetworkingMicroseconds; 52 | } 53 | 54 | public bool Equals(SteamNetworkingMicroseconds other) { 55 | return m_SteamNetworkingMicroseconds == other.m_SteamNetworkingMicroseconds; 56 | } 57 | 58 | public int CompareTo(SteamNetworkingMicroseconds other) { 59 | return m_SteamNetworkingMicroseconds.CompareTo(other.m_SteamNetworkingMicroseconds); 60 | } 61 | } 62 | } 63 | 64 | #endif // !DISABLESTEAMWORKS 65 | -------------------------------------------------------------------------------- /Source/types/SteamHTTP/HTTPCookieContainerHandle.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct HTTPCookieContainerHandle : System.IEquatable, System.IComparable { 20 | public static readonly HTTPCookieContainerHandle Invalid = new HTTPCookieContainerHandle(0); 21 | public uint m_HTTPCookieContainerHandle; 22 | 23 | public HTTPCookieContainerHandle(uint value) { 24 | m_HTTPCookieContainerHandle = value; 25 | } 26 | 27 | public override string ToString() { 28 | return m_HTTPCookieContainerHandle.ToString(); 29 | } 30 | 31 | public override bool Equals(object other) { 32 | return other is HTTPCookieContainerHandle && this == (HTTPCookieContainerHandle)other; 33 | } 34 | 35 | public override int GetHashCode() { 36 | return m_HTTPCookieContainerHandle.GetHashCode(); 37 | } 38 | 39 | public static bool operator ==(HTTPCookieContainerHandle x, HTTPCookieContainerHandle y) { 40 | return x.m_HTTPCookieContainerHandle == y.m_HTTPCookieContainerHandle; 41 | } 42 | 43 | public static bool operator !=(HTTPCookieContainerHandle x, HTTPCookieContainerHandle y) { 44 | return !(x == y); 45 | } 46 | 47 | public static explicit operator HTTPCookieContainerHandle(uint value) { 48 | return new HTTPCookieContainerHandle(value); 49 | } 50 | 51 | public static explicit operator uint(HTTPCookieContainerHandle that) { 52 | return that.m_HTTPCookieContainerHandle; 53 | } 54 | 55 | public bool Equals(HTTPCookieContainerHandle other) { 56 | return m_HTTPCookieContainerHandle == other.m_HTTPCookieContainerHandle; 57 | } 58 | 59 | public int CompareTo(HTTPCookieContainerHandle other) { 60 | return m_HTTPCookieContainerHandle.CompareTo(other.m_HTTPCookieContainerHandle); 61 | } 62 | } 63 | } 64 | 65 | #endif // !DISABLESTEAMWORKS 66 | -------------------------------------------------------------------------------- /Source/types/SteamNetworkingTypes/SteamNetworkingConfigValue_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks 18 | { 19 | /// In a few places we need to set configuration options on listen sockets and connections, and 20 | /// have them take effect *before* the listen socket or connection really starts doing anything. 21 | /// Creating the object and then setting the options "immediately" after creation doesn't work 22 | /// completely, because network packets could be received between the time the object is created and 23 | /// when the options are applied. To set options at creation time in a reliable way, they must be 24 | /// passed to the creation function. This structure is used to pass those options. 25 | /// 26 | /// For the meaning of these fields, see ISteamNetworkingUtils::SetConfigValue. Basically 27 | /// when the object is created, we just iterate over the list of options and call 28 | /// ISteamNetworkingUtils::SetConfigValueStruct, where the scope arguments are supplied by the 29 | /// object being created. 30 | [System.Serializable] 31 | [StructLayout(LayoutKind.Sequential)] 32 | public struct SteamNetworkingConfigValue_t 33 | { 34 | /// Which option is being set 35 | public ESteamNetworkingConfigValue m_eValue; 36 | 37 | /// Which field below did you fill in? 38 | public ESteamNetworkingConfigDataType m_eDataType; 39 | 40 | /// Option value 41 | public OptionValue m_val; 42 | 43 | [StructLayout(LayoutKind.Explicit)] 44 | public struct OptionValue 45 | { 46 | [FieldOffset(0)] 47 | public int m_int32; 48 | 49 | [FieldOffset(0)] 50 | public long m_int64; 51 | 52 | [FieldOffset(0)] 53 | public float m_float; 54 | 55 | [FieldOffset(0)] 56 | public IntPtr m_string; // Points to your '\0'-terminated buffer 57 | 58 | [FieldOffset(0)] 59 | public IntPtr m_functionPtr; 60 | } 61 | } 62 | } 63 | 64 | #endif // !DISABLESTEAMWORKS -------------------------------------------------------------------------------- /Source/autogen/isteammusic.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | public static class SteamMusic { 19 | public static bool BIsEnabled() { 20 | InteropHelp.TestIfAvailableClient(); 21 | return NativeMethods.ISteamMusic_BIsEnabled(CSteamAPIContext.GetSteamMusic()); 22 | } 23 | 24 | public static bool BIsPlaying() { 25 | InteropHelp.TestIfAvailableClient(); 26 | return NativeMethods.ISteamMusic_BIsPlaying(CSteamAPIContext.GetSteamMusic()); 27 | } 28 | 29 | public static AudioPlayback_Status GetPlaybackStatus() { 30 | InteropHelp.TestIfAvailableClient(); 31 | return NativeMethods.ISteamMusic_GetPlaybackStatus(CSteamAPIContext.GetSteamMusic()); 32 | } 33 | 34 | public static void Play() { 35 | InteropHelp.TestIfAvailableClient(); 36 | NativeMethods.ISteamMusic_Play(CSteamAPIContext.GetSteamMusic()); 37 | } 38 | 39 | public static void Pause() { 40 | InteropHelp.TestIfAvailableClient(); 41 | NativeMethods.ISteamMusic_Pause(CSteamAPIContext.GetSteamMusic()); 42 | } 43 | 44 | public static void PlayPrevious() { 45 | InteropHelp.TestIfAvailableClient(); 46 | NativeMethods.ISteamMusic_PlayPrevious(CSteamAPIContext.GetSteamMusic()); 47 | } 48 | 49 | public static void PlayNext() { 50 | InteropHelp.TestIfAvailableClient(); 51 | NativeMethods.ISteamMusic_PlayNext(CSteamAPIContext.GetSteamMusic()); 52 | } 53 | 54 | /// 55 | /// volume is between 0.0 and 1.0 56 | /// 57 | public static void SetVolume(float flVolume) { 58 | InteropHelp.TestIfAvailableClient(); 59 | NativeMethods.ISteamMusic_SetVolume(CSteamAPIContext.GetSteamMusic(), flVolume); 60 | } 61 | 62 | public static float GetVolume() { 63 | InteropHelp.TestIfAvailableClient(); 64 | return NativeMethods.ISteamMusic_GetVolume(CSteamAPIContext.GetSteamMusic()); 65 | } 66 | } 67 | } 68 | 69 | #endif // !DISABLESTEAMWORKS 70 | -------------------------------------------------------------------------------- /Source/types/SteamRemoteStorage/UGCFileWriteStreamHandle_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct UGCFileWriteStreamHandle_t : System.IEquatable, System.IComparable { 20 | public static readonly UGCFileWriteStreamHandle_t Invalid = new UGCFileWriteStreamHandle_t(0xffffffffffffffff); 21 | public ulong m_UGCFileWriteStreamHandle; 22 | 23 | public UGCFileWriteStreamHandle_t(ulong value) { 24 | m_UGCFileWriteStreamHandle = value; 25 | } 26 | 27 | public override string ToString() { 28 | return m_UGCFileWriteStreamHandle.ToString(); 29 | } 30 | 31 | public override bool Equals(object other) { 32 | return other is UGCFileWriteStreamHandle_t && this == (UGCFileWriteStreamHandle_t)other; 33 | } 34 | 35 | public override int GetHashCode() { 36 | return m_UGCFileWriteStreamHandle.GetHashCode(); 37 | } 38 | 39 | public static bool operator ==(UGCFileWriteStreamHandle_t x, UGCFileWriteStreamHandle_t y) { 40 | return x.m_UGCFileWriteStreamHandle == y.m_UGCFileWriteStreamHandle; 41 | } 42 | 43 | public static bool operator !=(UGCFileWriteStreamHandle_t x, UGCFileWriteStreamHandle_t y) { 44 | return !(x == y); 45 | } 46 | 47 | public static explicit operator UGCFileWriteStreamHandle_t(ulong value) { 48 | return new UGCFileWriteStreamHandle_t(value); 49 | } 50 | 51 | public static explicit operator ulong(UGCFileWriteStreamHandle_t that) { 52 | return that.m_UGCFileWriteStreamHandle; 53 | } 54 | 55 | public bool Equals(UGCFileWriteStreamHandle_t other) { 56 | return m_UGCFileWriteStreamHandle == other.m_UGCFileWriteStreamHandle; 57 | } 58 | 59 | public int CompareTo(UGCFileWriteStreamHandle_t other) { 60 | return m_UGCFileWriteStreamHandle.CompareTo(other.m_UGCFileWriteStreamHandle); 61 | } 62 | } 63 | } 64 | 65 | #endif // !DISABLESTEAMWORKS 66 | -------------------------------------------------------------------------------- /Source/types/SteamRemoteStorage/PublishedFileUpdateHandle_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct PublishedFileUpdateHandle_t : System.IEquatable, System.IComparable { 20 | public static readonly PublishedFileUpdateHandle_t Invalid = new PublishedFileUpdateHandle_t(0xffffffffffffffff); 21 | public ulong m_PublishedFileUpdateHandle; 22 | 23 | public PublishedFileUpdateHandle_t(ulong value) { 24 | m_PublishedFileUpdateHandle = value; 25 | } 26 | 27 | public override string ToString() { 28 | return m_PublishedFileUpdateHandle.ToString(); 29 | } 30 | 31 | public override bool Equals(object other) { 32 | return other is PublishedFileUpdateHandle_t && this == (PublishedFileUpdateHandle_t)other; 33 | } 34 | 35 | public override int GetHashCode() { 36 | return m_PublishedFileUpdateHandle.GetHashCode(); 37 | } 38 | 39 | public static bool operator ==(PublishedFileUpdateHandle_t x, PublishedFileUpdateHandle_t y) { 40 | return x.m_PublishedFileUpdateHandle == y.m_PublishedFileUpdateHandle; 41 | } 42 | 43 | public static bool operator !=(PublishedFileUpdateHandle_t x, PublishedFileUpdateHandle_t y) { 44 | return !(x == y); 45 | } 46 | 47 | public static explicit operator PublishedFileUpdateHandle_t(ulong value) { 48 | return new PublishedFileUpdateHandle_t(value); 49 | } 50 | 51 | public static explicit operator ulong(PublishedFileUpdateHandle_t that) { 52 | return that.m_PublishedFileUpdateHandle; 53 | } 54 | 55 | public bool Equals(PublishedFileUpdateHandle_t other) { 56 | return m_PublishedFileUpdateHandle == other.m_PublishedFileUpdateHandle; 57 | } 58 | 59 | public int CompareTo(PublishedFileUpdateHandle_t other) { 60 | return m_PublishedFileUpdateHandle.CompareTo(other.m_PublishedFileUpdateHandle); 61 | } 62 | } 63 | } 64 | 65 | #endif // !DISABLESTEAMWORKS 66 | -------------------------------------------------------------------------------- /Source/types/SteamInventory/SteamInventoryUpdateHandle_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct SteamInventoryUpdateHandle_t : System.IEquatable, System.IComparable { 20 | public static readonly SteamInventoryUpdateHandle_t Invalid = new SteamInventoryUpdateHandle_t(0xffffffffffffffff); 21 | public ulong m_SteamInventoryUpdateHandle; 22 | 23 | public SteamInventoryUpdateHandle_t(ulong value) { 24 | m_SteamInventoryUpdateHandle = value; 25 | } 26 | 27 | public override string ToString() { 28 | return m_SteamInventoryUpdateHandle.ToString(); 29 | } 30 | 31 | public override bool Equals(object other) { 32 | return other is SteamInventoryUpdateHandle_t && this == (SteamInventoryUpdateHandle_t)other; 33 | } 34 | 35 | public override int GetHashCode() { 36 | return m_SteamInventoryUpdateHandle.GetHashCode(); 37 | } 38 | 39 | public static bool operator ==(SteamInventoryUpdateHandle_t x, SteamInventoryUpdateHandle_t y) { 40 | return x.m_SteamInventoryUpdateHandle == y.m_SteamInventoryUpdateHandle; 41 | } 42 | 43 | public static bool operator !=(SteamInventoryUpdateHandle_t x, SteamInventoryUpdateHandle_t y) { 44 | return !(x == y); 45 | } 46 | 47 | public static explicit operator SteamInventoryUpdateHandle_t(ulong value) { 48 | return new SteamInventoryUpdateHandle_t(value); 49 | } 50 | 51 | public static explicit operator ulong(SteamInventoryUpdateHandle_t that) { 52 | return that.m_SteamInventoryUpdateHandle; 53 | } 54 | 55 | public bool Equals(SteamInventoryUpdateHandle_t other) { 56 | return m_SteamInventoryUpdateHandle == other.m_SteamInventoryUpdateHandle; 57 | } 58 | 59 | public int CompareTo(SteamInventoryUpdateHandle_t other) { 60 | return m_SteamInventoryUpdateHandle.CompareTo(other.m_SteamInventoryUpdateHandle); 61 | } 62 | } 63 | } 64 | 65 | #endif // !DISABLESTEAMWORKS 66 | -------------------------------------------------------------------------------- /Source/autogen/isteamapplist.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | public static class SteamAppList { 19 | public static uint GetNumInstalledApps() { 20 | InteropHelp.TestIfAvailableClient(); 21 | return NativeMethods.ISteamAppList_GetNumInstalledApps(CSteamAPIContext.GetSteamAppList()); 22 | } 23 | 24 | public static uint GetInstalledApps(AppId_t[] pvecAppID, uint unMaxAppIDs) { 25 | InteropHelp.TestIfAvailableClient(); 26 | return NativeMethods.ISteamAppList_GetInstalledApps(CSteamAPIContext.GetSteamAppList(), pvecAppID, unMaxAppIDs); 27 | } 28 | 29 | /// 30 | /// returns -1 if no name was found 31 | /// 32 | public static int GetAppName(AppId_t nAppID, out string pchName, int cchNameMax) { 33 | InteropHelp.TestIfAvailableClient(); 34 | IntPtr pchName2 = Marshal.AllocHGlobal(cchNameMax); 35 | int ret = NativeMethods.ISteamAppList_GetAppName(CSteamAPIContext.GetSteamAppList(), nAppID, pchName2, cchNameMax); 36 | pchName = ret != -1 ? InteropHelp.PtrToStringUTF8(pchName2) : null; 37 | Marshal.FreeHGlobal(pchName2); 38 | return ret; 39 | } 40 | 41 | /// 42 | /// returns -1 if no dir was found 43 | /// 44 | public static int GetAppInstallDir(AppId_t nAppID, out string pchDirectory, int cchNameMax) { 45 | InteropHelp.TestIfAvailableClient(); 46 | IntPtr pchDirectory2 = Marshal.AllocHGlobal(cchNameMax); 47 | int ret = NativeMethods.ISteamAppList_GetAppInstallDir(CSteamAPIContext.GetSteamAppList(), nAppID, pchDirectory2, cchNameMax); 48 | pchDirectory = ret != -1 ? InteropHelp.PtrToStringUTF8(pchDirectory2) : null; 49 | Marshal.FreeHGlobal(pchDirectory2); 50 | return ret; 51 | } 52 | 53 | /// 54 | /// return the buildid of this app, may change at any time based on backend updates to the game 55 | /// 56 | public static int GetAppBuildId(AppId_t nAppID) { 57 | InteropHelp.TestIfAvailableClient(); 58 | return NativeMethods.ISteamAppList_GetAppBuildId(CSteamAPIContext.GetSteamAppList(), nAppID); 59 | } 60 | } 61 | } 62 | 63 | #endif // !DISABLESTEAMWORKS 64 | -------------------------------------------------------------------------------- /Source/Packsize.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | // If we're running in the Unity Editor we need the editors platform. 15 | #if UNITY_EDITOR_WIN 16 | #define VALVE_CALLBACK_PACK_LARGE 17 | #elif UNITY_EDITOR_OSX || UNITY_EDITOR_LINUX 18 | #define VALVE_CALLBACK_PACK_SMALL 19 | 20 | // Otherwise we want the target platform. 21 | #elif UNITY_STANDALONE_WIN || STEAMWORKS_WIN 22 | #define VALVE_CALLBACK_PACK_LARGE 23 | #elif UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_LIN_OSX 24 | #define VALVE_CALLBACK_PACK_SMALL 25 | 26 | // 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. 27 | // It would be nice if Unity itself would define 'UNITY' or something like that... 28 | #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 29 | #define VALVE_CALLBACK_PACK_SMALL 30 | 31 | // But we do want to be explicit on the Standalone build for XNA/Monogame. 32 | #else 33 | #define VALVE_CALLBACK_PACK_LARGE 34 | #warning You need to define STEAMWORKS_WIN, or STEAMWORKS_LIN_OSX. Refer to the readme for more details. 35 | #endif 36 | 37 | using System.Runtime.InteropServices; 38 | using IntPtr = System.IntPtr; 39 | 40 | namespace Steamworks { 41 | public static class Packsize { 42 | #if VALVE_CALLBACK_PACK_LARGE 43 | public const int value = 8; 44 | #elif VALVE_CALLBACK_PACK_SMALL 45 | public const int value = 4; 46 | #endif 47 | 48 | public static bool Test() { 49 | int sentinelSize = Marshal.SizeOf(typeof(ValvePackingSentinel_t)); 50 | int subscribedFilesSize = Marshal.SizeOf(typeof(RemoteStorageEnumerateUserSubscribedFilesResult_t)); 51 | #if VALVE_CALLBACK_PACK_LARGE 52 | if (sentinelSize != 32 || subscribedFilesSize != (1 + 1 + 1 + 50 + 100) * 4 + 4) 53 | return false; 54 | #elif VALVE_CALLBACK_PACK_SMALL 55 | if (sentinelSize != 24 || subscribedFilesSize != (1 + 1 + 1 + 50 + 100) * 4) 56 | return false; 57 | #endif 58 | return true; 59 | } 60 | 61 | [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] 62 | struct ValvePackingSentinel_t { 63 | uint m_u32; 64 | ulong m_u64; 65 | ushort m_u16; 66 | double m_d; 67 | }; 68 | } 69 | } 70 | 71 | #endif // !DISABLESTEAMWORKS 72 | -------------------------------------------------------------------------------- /Source/types/SteamNetworkingSockets/ISteamNetworkingConnectionSignaling.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks 18 | { 19 | /// Interface used to send signaling messages for a particular connection. 20 | /// 21 | /// - For connections initiated locally, you will construct it and pass 22 | /// it to ISteamNetworkingSockets::ConnectP2PCustomSignaling. 23 | /// - For connections initiated remotely and "accepted" locally, you 24 | /// will return it from ISteamNetworkingSignalingRecvContext::OnConnectRequest 25 | [System.Serializable] 26 | [StructLayout(LayoutKind.Sequential)] 27 | public struct ISteamNetworkingConnectionSignaling 28 | { 29 | /// Called to send a rendezvous message to the remote peer. This may be called 30 | /// from any thread, at any time, so you need to be thread-safe! Don't take 31 | /// any locks that might hold while calling into SteamNetworkingSockets functions, 32 | /// because this could lead to deadlocks. 33 | /// 34 | /// Note that when initiating a connection, we may not know the identity 35 | /// of the peer, if you did not specify it in ConnectP2PCustomSignaling. 36 | /// 37 | /// Return true if a best-effort attempt was made to deliver the message. 38 | /// If you return false, it is assumed that the situation is fatal; 39 | /// the connection will be closed, and Release() will be called 40 | /// eventually. 41 | /// 42 | /// Signaling objects will not be shared between connections. 43 | /// You can assume that the same value of hConn will be used 44 | /// every time. 45 | public bool SendSignal(HSteamNetConnection hConn, ref SteamNetConnectionInfo_t info, IntPtr pMsg, int cbMsg) { 46 | return NativeMethods.SteamAPI_ISteamNetworkingConnectionSignaling_SendSignal(ref this, hConn, ref info, pMsg, cbMsg); 47 | } 48 | 49 | /// Called when the connection no longer needs to send signals. 50 | /// Note that this happens eventually (but not immediately) after 51 | /// the connection is closed. Signals may need to be sent for a brief 52 | /// time after the connection is closed, to clean up the connection. 53 | /// 54 | /// If you do not need to save any additional per-connection information 55 | /// and can handle SendSignal() using only the arguments supplied, you do 56 | /// not need to actually create different objects per connection. In that 57 | /// case, it is valid for all connections to use the same global object, and 58 | /// for this function to do nothing. 59 | public void Release() { 60 | NativeMethods.SteamAPI_ISteamNetworkingConnectionSignaling_Release(ref this); 61 | } 62 | } 63 | } 64 | 65 | #endif // !DISABLESTEAMWORKS -------------------------------------------------------------------------------- /Source/types/SteamTypes/SteamIPAddress_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks 18 | { 19 | [System.Serializable] 20 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 21 | public struct SteamIPAddress_t 22 | { 23 | private long m_ip0; 24 | private long m_ip1; 25 | 26 | private ESteamIPType m_eType; 27 | 28 | public SteamIPAddress_t(System.Net.IPAddress iPAddress) 29 | { 30 | byte[] bytes = iPAddress.GetAddressBytes(); 31 | switch (iPAddress.AddressFamily) 32 | { 33 | case System.Net.Sockets.AddressFamily.InterNetwork: 34 | { 35 | if (bytes.Length != 4) 36 | { 37 | throw new System.TypeInitializationException("SteamIPAddress_t: Unexpected byte length for Ipv4." + bytes.Length, null); 38 | } 39 | 40 | m_ip0 = (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3]; 41 | m_ip1 = 0; 42 | m_eType = ESteamIPType.k_ESteamIPTypeIPv4; 43 | break; 44 | } 45 | case System.Net.Sockets.AddressFamily.InterNetworkV6: 46 | { 47 | if (bytes.Length != 16) 48 | { 49 | throw new System.TypeInitializationException("SteamIPAddress_t: Unexpected byte length for Ipv6: " + bytes.Length, null); 50 | } 51 | 52 | m_ip0 = (bytes[1] << 56) | (bytes[0] << 48) | (bytes[3] << 40) | (bytes[2] << 32) | (bytes[5] << 24) | (bytes[4] << 16) | (bytes[7] << 8) | bytes[6]; 53 | m_ip1 = (bytes[9] << 56) | (bytes[8] << 48) | (bytes[11] << 40) | (bytes[10] << 32) | (bytes[13] << 24) | (bytes[12] << 16) | (bytes[15] << 8) | bytes[14]; 54 | m_eType = ESteamIPType.k_ESteamIPTypeIPv6; 55 | break; 56 | } 57 | default: 58 | { 59 | throw new System.TypeInitializationException("SteamIPAddress_t: Unexpected address family " + iPAddress.AddressFamily, null); 60 | } 61 | } 62 | } 63 | 64 | public System.Net.IPAddress ToIPAddress() 65 | { 66 | if (m_eType == ESteamIPType.k_ESteamIPTypeIPv4) 67 | { 68 | byte[] bytes = System.BitConverter.GetBytes(m_ip0); 69 | return new System.Net.IPAddress(new byte[] { bytes[3], bytes[2], bytes[1], bytes[0] }); 70 | } 71 | else 72 | { 73 | byte[] bytes = new byte[16]; 74 | System.BitConverter.GetBytes(m_ip0).CopyTo(bytes, 0); 75 | System.BitConverter.GetBytes(m_ip1).CopyTo(bytes, 8); 76 | return new System.Net.IPAddress(bytes); 77 | } 78 | } 79 | 80 | public override string ToString() 81 | { 82 | return ToIPAddress().ToString(); 83 | } 84 | 85 | public ESteamIPType GetIPType() 86 | { 87 | return m_eType; 88 | } 89 | 90 | public bool IsSet() 91 | { 92 | return m_ip0 != 0 || m_ip1 != 0; 93 | } 94 | } 95 | } 96 | 97 | #endif // !DISABLESTEAMWORKS 98 | -------------------------------------------------------------------------------- /Source/types/SteamNetworkingSockets/ISteamNetworkingSignalingRecvContext.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks 18 | { 19 | /// Interface used when a custom signal is received. 20 | /// See ISteamNetworkingSockets::ReceivedP2PCustomSignal 21 | [System.Serializable] 22 | [StructLayout(LayoutKind.Sequential)] 23 | public struct ISteamNetworkingSignalingRecvContext 24 | { 25 | /// Called when the signal represents a request for a new connection. 26 | /// 27 | /// If you want to ignore the request, just return NULL. In this case, 28 | /// the peer will NOT receive any reply. You should consider ignoring 29 | /// requests rather than actively rejecting them, as a security measure. 30 | /// If you actively reject requests, then this makes it possible to detect 31 | /// if a user is online or not, just by sending them a request. 32 | /// 33 | /// If you wish to send back a rejection, then use 34 | /// ISteamNetworkingSockets::CloseConnection() and then return NULL. 35 | /// We will marshal a properly formatted rejection signal and 36 | /// call SendRejectionSignal() so you can send it to them. 37 | /// 38 | /// If you return a signaling object, the connection is NOT immediately 39 | /// accepted by default. Instead, it stays in the "connecting" state, 40 | /// and the usual callback is posted, and your app can accept the 41 | /// connection using ISteamNetworkingSockets::AcceptConnection. This 42 | /// may be useful so that these sorts of connections can be more similar 43 | /// to your application code as other types of connections accepted on 44 | /// a listen socket. If this is not useful and you want to skip this 45 | /// callback process and immediately accept the connection, call 46 | /// ISteamNetworkingSockets::AcceptConnection before returning the 47 | /// signaling object. 48 | /// 49 | /// After accepting a connection (through either means), the connection 50 | /// will transition into the "finding route" state. 51 | public IntPtr OnConnectRequest(HSteamNetConnection hConn, ref SteamNetworkingIdentity identityPeer, int nLocalVirtualPort) { 52 | return NativeMethods.SteamAPI_ISteamNetworkingSignalingRecvContext_OnConnectRequest(ref this, hConn, ref identityPeer, nLocalVirtualPort); 53 | } 54 | 55 | /// This is called to actively communicate rejection or failure 56 | /// to the incoming message. If you intend to ignore all incoming requests 57 | /// that you do not wish to accept, then it's not strictly necessary to 58 | /// implement this. 59 | public void SendRejectionSignal(ref SteamNetworkingIdentity identityPeer, IntPtr pMsg, int cbMsg) { 60 | NativeMethods.SteamAPI_ISteamNetworkingSignalingRecvContext_SendRejectionSignal(ref this, ref identityPeer, pMsg, cbMsg); 61 | } 62 | } 63 | } 64 | 65 | #endif // !DISABLESTEAMWORKS -------------------------------------------------------------------------------- /Source/autogen/isteamremoteplay.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | public static class SteamRemotePlay { 19 | /// 20 | /// Get the number of currently connected Steam Remote Play sessions 21 | /// 22 | public static uint GetSessionCount() { 23 | InteropHelp.TestIfAvailableClient(); 24 | return NativeMethods.ISteamRemotePlay_GetSessionCount(CSteamAPIContext.GetSteamRemotePlay()); 25 | } 26 | 27 | /// 28 | /// Get the currently connected Steam Remote Play session ID at the specified index. Returns zero if index is out of bounds. 29 | /// 30 | public static RemotePlaySessionID_t GetSessionID(int iSessionIndex) { 31 | InteropHelp.TestIfAvailableClient(); 32 | return (RemotePlaySessionID_t)NativeMethods.ISteamRemotePlay_GetSessionID(CSteamAPIContext.GetSteamRemotePlay(), iSessionIndex); 33 | } 34 | 35 | /// 36 | /// Get the SteamID of the connected user 37 | /// 38 | public static CSteamID GetSessionSteamID(RemotePlaySessionID_t unSessionID) { 39 | InteropHelp.TestIfAvailableClient(); 40 | return (CSteamID)NativeMethods.ISteamRemotePlay_GetSessionSteamID(CSteamAPIContext.GetSteamRemotePlay(), unSessionID); 41 | } 42 | 43 | /// 44 | /// Get the name of the session client device 45 | /// This returns NULL if the sessionID is not valid 46 | /// 47 | public static string GetSessionClientName(RemotePlaySessionID_t unSessionID) { 48 | InteropHelp.TestIfAvailableClient(); 49 | return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamRemotePlay_GetSessionClientName(CSteamAPIContext.GetSteamRemotePlay(), unSessionID)); 50 | } 51 | 52 | /// 53 | /// Get the form factor of the session client device 54 | /// 55 | public static ESteamDeviceFormFactor GetSessionClientFormFactor(RemotePlaySessionID_t unSessionID) { 56 | InteropHelp.TestIfAvailableClient(); 57 | return NativeMethods.ISteamRemotePlay_GetSessionClientFormFactor(CSteamAPIContext.GetSteamRemotePlay(), unSessionID); 58 | } 59 | 60 | /// 61 | /// Get the resolution, in pixels, of the session client device 62 | /// This is set to 0x0 if the resolution is not available 63 | /// 64 | public static bool BGetSessionClientResolution(RemotePlaySessionID_t unSessionID, out int pnResolutionX, out int pnResolutionY) { 65 | InteropHelp.TestIfAvailableClient(); 66 | return NativeMethods.ISteamRemotePlay_BGetSessionClientResolution(CSteamAPIContext.GetSteamRemotePlay(), unSessionID, out pnResolutionX, out pnResolutionY); 67 | } 68 | 69 | /// 70 | /// Invite a friend to Remote Play Together 71 | /// This returns false if the invite can't be sent 72 | /// 73 | public static bool BSendRemotePlayTogetherInvite(CSteamID steamIDFriend) { 74 | InteropHelp.TestIfAvailableClient(); 75 | return NativeMethods.ISteamRemotePlay_BSendRemotePlayTogetherInvite(CSteamAPIContext.GetSteamRemotePlay(), steamIDFriend); 76 | } 77 | } 78 | } 79 | 80 | #endif // !DISABLESTEAMWORKS 81 | -------------------------------------------------------------------------------- /Source/types/MatchmakingTypes/servernetadr_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | // servernetadr_t is all the addressing info the serverbrowser needs to know about a game server, 19 | // namely: its IP, its connection port, and its query port. 20 | [System.Serializable] 21 | public struct servernetadr_t { 22 | private ushort m_usConnectionPort; // (in HOST byte order) 23 | private ushort m_usQueryPort; 24 | private uint m_unIP; 25 | 26 | public void Init(uint ip, ushort usQueryPort, ushort usConnectionPort) { 27 | m_unIP = ip; 28 | m_usQueryPort = usQueryPort; 29 | m_usConnectionPort = usConnectionPort; 30 | } 31 | 32 | #if NETADR_H 33 | public netadr_t GetIPAndQueryPort() { 34 | return netadr_t( m_unIP, m_usQueryPort ); 35 | } 36 | #endif 37 | 38 | // Access the query port. 39 | public ushort GetQueryPort() { 40 | return m_usQueryPort; 41 | } 42 | 43 | public void SetQueryPort(ushort usPort) { 44 | m_usQueryPort = usPort; 45 | } 46 | 47 | // Access the connection port. 48 | public ushort GetConnectionPort() { 49 | return m_usConnectionPort; 50 | } 51 | 52 | public void SetConnectionPort(ushort usPort) { 53 | m_usConnectionPort = usPort; 54 | } 55 | 56 | // Access the IP 57 | public uint GetIP() { 58 | return m_unIP; 59 | } 60 | 61 | public void SetIP(uint unIP) { 62 | m_unIP = unIP; 63 | } 64 | 65 | // This gets the 'a.b.c.d:port' string with the connection port (instead of the query port). 66 | public string GetConnectionAddressString() { 67 | return ToString(m_unIP, m_usConnectionPort); 68 | } 69 | 70 | public string GetQueryAddressString() { 71 | return ToString(m_unIP, m_usQueryPort); 72 | } 73 | 74 | public static string ToString(uint unIP, ushort usPort) { 75 | #if VALVE_BIG_ENDIAN 76 | return string.Format("{0}.{1}.{2}.{3}:{4}", unIP & 0xFFul, (unIP >> 8) & 0xFFul, (unIP >> 16) & 0xFFul, (unIP >> 24) & 0xFFul, usPort); 77 | #else 78 | return string.Format("{0}.{1}.{2}.{3}:{4}", (unIP >> 24) & 0xFFul, (unIP >> 16) & 0xFFul, (unIP >> 8) & 0xFFul, unIP & 0xFFul, usPort); 79 | #endif 80 | } 81 | 82 | public static bool operator <(servernetadr_t x, servernetadr_t y) { 83 | return (x.m_unIP < y.m_unIP) || (x.m_unIP == y.m_unIP && x.m_usQueryPort < y.m_usQueryPort); 84 | } 85 | 86 | public static bool operator >(servernetadr_t x, servernetadr_t y) { 87 | return (x.m_unIP > y.m_unIP) || (x.m_unIP == y.m_unIP && x.m_usQueryPort > y.m_usQueryPort); 88 | } 89 | 90 | public override bool Equals(object other) { 91 | return other is servernetadr_t && this == (servernetadr_t)other; 92 | } 93 | 94 | public override int GetHashCode() { 95 | return m_unIP.GetHashCode() + m_usQueryPort.GetHashCode() + m_usConnectionPort.GetHashCode(); 96 | } 97 | 98 | public static bool operator ==(servernetadr_t x, servernetadr_t y) { 99 | return (x.m_unIP == y.m_unIP) && (x.m_usQueryPort == y.m_usQueryPort) && (x.m_usConnectionPort == y.m_usConnectionPort); 100 | } 101 | 102 | public static bool operator !=(servernetadr_t x, servernetadr_t y) { 103 | return !(x == y); 104 | } 105 | 106 | public bool Equals(servernetadr_t other) { 107 | return (m_unIP == other.m_unIP) && (m_usQueryPort == other.m_usQueryPort) && (m_usConnectionPort == other.m_usConnectionPort); 108 | } 109 | 110 | public int CompareTo(servernetadr_t other) { 111 | return m_unIP.CompareTo(other.m_unIP) + m_usQueryPort.CompareTo(other.m_usQueryPort) + m_usConnectionPort.CompareTo(other.m_usConnectionPort); 112 | } 113 | } 114 | } 115 | 116 | #endif // !DISABLESTEAMWORKS 117 | -------------------------------------------------------------------------------- /Source/types/SteamClientPublic/CGameID.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | public struct CGameID : System.IEquatable, System.IComparable { 20 | public ulong m_GameID; 21 | 22 | public enum EGameIDType { 23 | k_EGameIDTypeApp = 0, 24 | k_EGameIDTypeGameMod = 1, 25 | k_EGameIDTypeShortcut = 2, 26 | k_EGameIDTypeP2P = 3, 27 | }; 28 | 29 | public CGameID(ulong GameID) { 30 | m_GameID = GameID; 31 | } 32 | 33 | public CGameID(AppId_t nAppID) { 34 | m_GameID = 0; 35 | SetAppID(nAppID); 36 | } 37 | 38 | public CGameID(AppId_t nAppID, uint nModID) { 39 | m_GameID = 0; 40 | SetAppID(nAppID); 41 | SetType(EGameIDType.k_EGameIDTypeGameMod); 42 | SetModID(nModID); 43 | } 44 | 45 | public bool IsSteamApp() { 46 | return Type() == EGameIDType.k_EGameIDTypeApp; 47 | } 48 | 49 | public bool IsMod() { 50 | return Type() == EGameIDType.k_EGameIDTypeGameMod; 51 | } 52 | 53 | public bool IsShortcut() { 54 | return Type() == EGameIDType.k_EGameIDTypeShortcut; 55 | } 56 | 57 | public bool IsP2PFile() { 58 | return Type() == EGameIDType.k_EGameIDTypeP2P; 59 | } 60 | 61 | public AppId_t AppID() { 62 | return new AppId_t((uint)(m_GameID & 0xFFFFFFul)); 63 | } 64 | 65 | public EGameIDType Type() { 66 | return (EGameIDType)((m_GameID >> 24) & 0xFFul); 67 | } 68 | 69 | public uint ModID() { 70 | return (uint)((m_GameID >> 32) & 0xFFFFFFFFul); 71 | } 72 | 73 | public bool IsValid() { 74 | // Each type has it's own invalid fixed point: 75 | switch (Type()) { 76 | case EGameIDType.k_EGameIDTypeApp: 77 | return AppID() != AppId_t.Invalid; 78 | 79 | case EGameIDType.k_EGameIDTypeGameMod: 80 | return AppID() != AppId_t.Invalid && (ModID() & 0x80000000) != 0; 81 | 82 | case EGameIDType.k_EGameIDTypeShortcut: 83 | return (ModID() & 0x80000000) != 0; 84 | 85 | case EGameIDType.k_EGameIDTypeP2P: 86 | return AppID() == AppId_t.Invalid && (ModID() & 0x80000000) != 0; 87 | 88 | default: 89 | return false; 90 | } 91 | } 92 | 93 | public void Reset() { 94 | m_GameID = 0; 95 | } 96 | 97 | public void Set(ulong GameID) { 98 | m_GameID = GameID; 99 | } 100 | 101 | #region Private Setters for internal use 102 | private void SetAppID(AppId_t other) { 103 | m_GameID = (m_GameID & ~(0xFFFFFFul << (ushort)0)) | (((ulong)(other) & 0xFFFFFFul) << (ushort)0); 104 | } 105 | 106 | private void SetType(EGameIDType other) { 107 | m_GameID = (m_GameID & ~(0xFFul << (ushort)24)) | (((ulong)(other) & 0xFFul) << (ushort)24); 108 | } 109 | 110 | private void SetModID(uint other) { 111 | m_GameID = (m_GameID & ~(0xFFFFFFFFul << (ushort)32)) | (((ulong)(other) & 0xFFFFFFFFul) << (ushort)32); 112 | } 113 | #endregion 114 | 115 | #region Overrides 116 | public override string ToString() { 117 | return m_GameID.ToString(); 118 | } 119 | 120 | public override bool Equals(object other) { 121 | return other is CGameID && this == (CGameID)other; 122 | } 123 | 124 | public override int GetHashCode() { 125 | return m_GameID.GetHashCode(); 126 | } 127 | 128 | public static bool operator ==(CGameID x, CGameID y) { 129 | return x.m_GameID == y.m_GameID; 130 | } 131 | 132 | public static bool operator !=(CGameID x, CGameID y) { 133 | return !(x == y); 134 | } 135 | 136 | public static explicit operator CGameID(ulong value) { 137 | return new CGameID(value); 138 | } 139 | public static explicit operator ulong(CGameID that) { 140 | return that.m_GameID; 141 | } 142 | 143 | public bool Equals(CGameID other) { 144 | return m_GameID == other.m_GameID; 145 | } 146 | 147 | public int CompareTo(CGameID other) { 148 | return m_GameID.CompareTo(other.m_GameID); 149 | } 150 | #endregion 151 | } 152 | } 153 | 154 | #endif // !DISABLESTEAMWORKS 155 | -------------------------------------------------------------------------------- /Source/types/MatchmakingTypes/gameserveritem_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | using System.Text; 18 | 19 | namespace Steamworks { 20 | //----------------------------------------------------------------------------- 21 | // Purpose: Data describing a single server 22 | //----------------------------------------------------------------------------- 23 | [StructLayout(LayoutKind.Sequential, Size = 372, Pack = 4)] 24 | [System.Serializable] 25 | public class gameserveritem_t { 26 | public string GetGameDir() { 27 | return Encoding.UTF8.GetString(m_szGameDir, 0, System.Array.IndexOf(m_szGameDir, 0)); 28 | } 29 | 30 | public void SetGameDir(string dir) { 31 | m_szGameDir = Encoding.UTF8.GetBytes(dir + '\0'); 32 | } 33 | 34 | public string GetMap() { 35 | return Encoding.UTF8.GetString(m_szMap, 0, System.Array.IndexOf(m_szMap, 0)); 36 | } 37 | 38 | public void SetMap(string map) { 39 | m_szMap = Encoding.UTF8.GetBytes(map + '\0'); 40 | } 41 | 42 | public string GetGameDescription() { 43 | return Encoding.UTF8.GetString(m_szGameDescription, 0, System.Array.IndexOf(m_szGameDescription, 0)); 44 | } 45 | 46 | public void SetGameDescription(string desc) { 47 | m_szGameDescription = Encoding.UTF8.GetBytes(desc + '\0'); 48 | } 49 | 50 | public string GetServerName() { 51 | // Use the IP address as the name if nothing is set yet. 52 | if (m_szServerName[0] == 0) 53 | return m_NetAdr.GetConnectionAddressString(); 54 | else 55 | return Encoding.UTF8.GetString(m_szServerName, 0, System.Array.IndexOf(m_szServerName, 0)); 56 | } 57 | 58 | public void SetServerName(string name) { 59 | m_szServerName = Encoding.UTF8.GetBytes(name + '\0'); 60 | } 61 | 62 | public string GetGameTags() { 63 | return Encoding.UTF8.GetString(m_szGameTags, 0, System.Array.IndexOf(m_szGameTags, 0)); 64 | } 65 | 66 | public void SetGameTags(string tags) { 67 | m_szGameTags = Encoding.UTF8.GetBytes(tags + '\0'); 68 | } 69 | 70 | public servernetadr_t m_NetAdr; ///< IP/Query Port/Connection Port for this server 71 | public int m_nPing; ///< current ping time in milliseconds 72 | [MarshalAs(UnmanagedType.I1)] 73 | public bool m_bHadSuccessfulResponse; ///< server has responded successfully in the past 74 | [MarshalAs(UnmanagedType.I1)] 75 | public bool m_bDoNotRefresh; ///< server is marked as not responding and should no longer be refreshed 76 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cbMaxGameServerGameDir)] 77 | private byte[] m_szGameDir; ///< current game directory 78 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cbMaxGameServerMapName)] 79 | private byte[] m_szMap; ///< current map 80 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cbMaxGameServerGameDescription)] 81 | private byte[] m_szGameDescription; ///< game description 82 | public uint m_nAppID; ///< Steam App ID of this server 83 | public int m_nPlayers; ///< total number of players currently on the server. INCLUDES BOTS!! 84 | public int m_nMaxPlayers; ///< Maximum players that can join this server 85 | public int m_nBotPlayers; ///< Number of bots (i.e simulated players) on this server 86 | [MarshalAs(UnmanagedType.I1)] 87 | public bool m_bPassword; ///< true if this server needs a password to join 88 | [MarshalAs(UnmanagedType.I1)] 89 | public bool m_bSecure; ///< Is this server protected by VAC 90 | public uint m_ulTimeLastPlayed; ///< time (in unix time) when this server was last played on (for favorite/history servers) 91 | public int m_nServerVersion; ///< server version as reported to Steam 92 | 93 | // Game server name 94 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cbMaxGameServerName)] 95 | private byte[] m_szServerName; 96 | 97 | // the tags this server exposes 98 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.k_cbMaxGameServerTags)] 99 | private byte[] m_szGameTags; 100 | 101 | // steamID of the game server - invalid if it's doesn't have one (old server, or not connected to Steam) 102 | public CSteamID m_steamID; 103 | } 104 | } 105 | 106 | #endif // !DISABLESTEAMWORKS 107 | -------------------------------------------------------------------------------- /Source/types/SteamNetworkingTypes/SteamNetworkingIPAddr.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks 18 | { 19 | /// Store an IP and port. IPv6 is always used; IPv4 is represented using 20 | /// "IPv4-mapped" addresses: IPv4 aa.bb.cc.dd => IPv6 ::ffff:aabb:ccdd 21 | /// (RFC 4291 section 2.5.5.2.) 22 | [System.Serializable] 23 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 24 | public struct SteamNetworkingIPAddr : System.IEquatable 25 | { 26 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] 27 | public byte[] m_ipv6; 28 | public ushort m_port; // Host byte order 29 | 30 | // Max length of the buffer needed to hold IP formatted using ToString, including '\0' 31 | // ([0123:4567:89ab:cdef:0123:4567:89ab:cdef]:12345) 32 | public const int k_cchMaxString = 48; 33 | 34 | // Set everything to zero. E.g. [::]:0 35 | public void Clear() { 36 | NativeMethods.SteamAPI_SteamNetworkingIPAddr_Clear(ref this); 37 | } 38 | 39 | // Return true if the IP is ::0. (Doesn't check port.) 40 | public bool IsIPv6AllZeros() { 41 | return NativeMethods.SteamAPI_SteamNetworkingIPAddr_IsIPv6AllZeros(ref this); 42 | } 43 | 44 | // Set IPv6 address. IP is interpreted as bytes, so there are no endian issues. (Same as inaddr_in6.) The IP can be a mapped IPv4 address 45 | public void SetIPv6(byte[] ipv6, ushort nPort) { 46 | NativeMethods.SteamAPI_SteamNetworkingIPAddr_SetIPv6(ref this, ipv6, nPort); 47 | } 48 | 49 | // Sets to IPv4 mapped address. IP and port are in host byte order. 50 | public void SetIPv4(uint nIP, ushort nPort) { 51 | NativeMethods.SteamAPI_SteamNetworkingIPAddr_SetIPv4(ref this, nIP, nPort); 52 | } 53 | 54 | // Return true if IP is mapped IPv4 55 | public bool IsIPv4() { 56 | return NativeMethods.SteamAPI_SteamNetworkingIPAddr_IsIPv4(ref this); 57 | } 58 | 59 | // Returns IP in host byte order (e.g. aa.bb.cc.dd as 0xaabbccdd). Returns 0 if IP is not mapped IPv4. 60 | public uint GetIPv4() { 61 | return NativeMethods.SteamAPI_SteamNetworkingIPAddr_GetIPv4(ref this); 62 | } 63 | 64 | // Set to the IPv6 localhost address ::1, and the specified port. 65 | public void SetIPv6LocalHost(ushort nPort = 0) { 66 | NativeMethods.SteamAPI_SteamNetworkingIPAddr_SetIPv6LocalHost(ref this, nPort); 67 | } 68 | 69 | // Return true if this identity is localhost. (Either IPv6 ::1, or IPv4 127.0.0.1) 70 | public bool IsLocalHost() { 71 | return NativeMethods.SteamAPI_SteamNetworkingIPAddr_IsLocalHost(ref this); 72 | } 73 | 74 | /// Print to a string, with or without the port. Mapped IPv4 addresses are printed 75 | /// as dotted decimal (12.34.56.78), otherwise this will print the canonical 76 | /// form according to RFC5952. If you include the port, IPv6 will be surrounded by 77 | /// brackets, e.g. [::1:2]:80. Your buffer should be at least k_cchMaxString bytes 78 | /// to avoid truncation 79 | /// 80 | /// See also SteamNetworkingIdentityRender 81 | public void ToString(out string buf, bool bWithPort) { 82 | IntPtr buf2 = Marshal.AllocHGlobal(k_cchMaxString); 83 | NativeMethods.SteamAPI_SteamNetworkingIPAddr_ToString(ref this, buf2, k_cchMaxString, bWithPort); 84 | buf = InteropHelp.PtrToStringUTF8(buf2); 85 | Marshal.FreeHGlobal(buf2); 86 | } 87 | 88 | /// Parse an IP address and optional port. If a port is not present, it is set to 0. 89 | /// (This means that you cannot tell if a zero port was explicitly specified.) 90 | public bool ParseString(string pszStr) { 91 | using (var pszStr2 = new InteropHelp.UTF8StringHandle(pszStr)) { 92 | return NativeMethods.SteamAPI_SteamNetworkingIPAddr_ParseString(ref this, pszStr2); 93 | } 94 | } 95 | 96 | /// See if two addresses are identical 97 | public bool Equals(SteamNetworkingIPAddr x) { 98 | return NativeMethods.SteamAPI_SteamNetworkingIPAddr_IsEqualTo(ref this, ref x); 99 | } 100 | 101 | /// Classify address as FakeIP. This function never returns 102 | /// k_ESteamNetworkingFakeIPType_Invalid. 103 | public ESteamNetworkingFakeIPType GetFakeIPType() { 104 | return NativeMethods.SteamAPI_SteamNetworkingIPAddr_GetFakeIPType(ref this); 105 | } 106 | 107 | /// Return true if we are a FakeIP 108 | public bool IsFakeIP() { 109 | return GetFakeIPType() > ESteamNetworkingFakeIPType.k_ESteamNetworkingFakeIPType_NotFake; 110 | } 111 | } 112 | } 113 | 114 | #endif // !DISABLESTEAMWORKS 115 | -------------------------------------------------------------------------------- /Source/types/SteamNetworkingTypes/SteamNetworkingMessage_t.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks 18 | { 19 | /// A message that has been received. 20 | [System.Serializable] 21 | [StructLayout(LayoutKind.Sequential)] 22 | public struct SteamNetworkingMessage_t 23 | { 24 | /// Message payload 25 | public IntPtr m_pData; 26 | 27 | /// Size of the payload. 28 | public int m_cbSize; 29 | 30 | /// For messages received on connections: what connection did this come from? 31 | /// For outgoing messages: what connection to send it to? 32 | /// Not used when using the ISteamNetworkingMessages interface 33 | public HSteamNetConnection m_conn; 34 | 35 | /// For inbound messages: Who sent this to us? 36 | /// For outbound messages on connections: not used. 37 | /// For outbound messages on the ad-hoc ISteamNetworkingMessages interface: who should we send this to? 38 | public SteamNetworkingIdentity m_identityPeer; 39 | 40 | /// For messages received on connections, this is the user data 41 | /// associated with the connection. 42 | /// 43 | /// This is *usually* the same as calling GetConnection() and then 44 | /// fetching the user data associated with that connection, but for 45 | /// the following subtle differences: 46 | /// 47 | /// - This user data will match the connection's user data at the time 48 | /// is captured at the time the message is returned by the API. 49 | /// If you subsequently change the userdata on the connection, 50 | /// this won't be updated. 51 | /// - This is an inline call, so it's *much* faster. 52 | /// - You might have closed the connection, so fetching the user data 53 | /// would not be possible. 54 | /// 55 | /// Not used when sending messages. 56 | public long m_nConnUserData; 57 | 58 | /// Local timestamp when the message was received 59 | /// Not used for outbound messages. 60 | public SteamNetworkingMicroseconds m_usecTimeReceived; 61 | 62 | /// Message number assigned by the sender. This is not used for outbound 63 | /// messages. Note that if multiple lanes are used, each lane has its own 64 | /// message numbers, which are assigned sequentially, so messages from 65 | /// different lanes will share the same numbers. 66 | public long m_nMessageNumber; 67 | 68 | /// Function used to free up m_pData. This mechanism exists so that 69 | /// apps can create messages with buffers allocated from their own 70 | /// heap, and pass them into the library. This function will 71 | /// usually be something like: 72 | /// 73 | /// free( pMsg->m_pData ); 74 | public IntPtr m_pfnFreeData; 75 | 76 | /// Function to used to decrement the internal reference count and, if 77 | /// it's zero, release the message. You should not set this function pointer, 78 | /// or need to access this directly! Use the Release() function instead! 79 | internal IntPtr m_pfnRelease; 80 | 81 | /// When using ISteamNetworkingMessages, the channel number the message was received on 82 | /// (Not used for messages sent or received on "connections") 83 | public int m_nChannel; 84 | 85 | /// Bitmask of k_nSteamNetworkingSend_xxx flags. 86 | /// For received messages, only the k_nSteamNetworkingSend_Reliable bit is valid. 87 | /// For outbound messages, all bits are relevant 88 | public int m_nFlags; 89 | 90 | /// Arbitrary user data that you can use when sending messages using 91 | /// ISteamNetworkingUtils::AllocateMessage and ISteamNetworkingSockets::SendMessage. 92 | /// (The callback you set in m_pfnFreeData might use this field.) 93 | /// 94 | /// Not used for received messages. 95 | public long m_nUserData; 96 | 97 | /// For outbound messages, which lane to use? See ISteamNetworkingSockets::ConfigureConnectionLanes. 98 | /// For inbound messages, what lane was the message received on? 99 | public ushort m_idxLane; 100 | 101 | public ushort _pad1__; 102 | 103 | /// You MUST call this when you're done with the object, 104 | /// to free up memory, etc. 105 | public void Release() { 106 | throw new System.NotImplementedException("Please use the static Release function instead which takes an IntPtr."); 107 | } 108 | 109 | /// You MUST call this when you're done with the object, 110 | /// to free up memory, etc. 111 | /// This is a Steamworks.NET extension. 112 | public static void Release(IntPtr pointer) { 113 | NativeMethods.SteamAPI_SteamNetworkingMessage_t_Release(pointer); 114 | } 115 | 116 | /// Convert an IntPtr received from ISteamNetworkingSockets.ReceiveMessagesOnPollGroup into our structure. 117 | /// This is a Steamworks.NET extension. 118 | public static SteamNetworkingMessage_t FromIntPtr(IntPtr pointer) { 119 | return (SteamNetworkingMessage_t)Marshal.PtrToStructure(pointer, typeof(SteamNetworkingMessage_t)); 120 | } 121 | } 122 | } 123 | 124 | #endif // !DISABLESTEAMWORKS 125 | -------------------------------------------------------------------------------- /Source/autogen/isteamgameserverstats.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | public static class SteamGameServerStats { 19 | /// 20 | /// downloads stats for the user 21 | /// returns a GSStatsReceived_t callback when completed 22 | /// if the user has no stats, GSStatsReceived_t.m_eResult will be set to k_EResultFail 23 | /// these stats will only be auto-updated for clients playing on the server. For other 24 | /// users you'll need to call RequestUserStats() again to refresh any data 25 | /// 26 | public static SteamAPICall_t RequestUserStats(CSteamID steamIDUser) { 27 | InteropHelp.TestIfAvailableGameServer(); 28 | return (SteamAPICall_t)NativeMethods.ISteamGameServerStats_RequestUserStats(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser); 29 | } 30 | 31 | /// 32 | /// requests stat information for a user, usable after a successful call to RequestUserStats() 33 | /// 34 | public static bool GetUserStat(CSteamID steamIDUser, string pchName, out int pData) { 35 | InteropHelp.TestIfAvailableGameServer(); 36 | using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) { 37 | return NativeMethods.ISteamGameServerStats_GetUserStatInt32(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser, pchName2, out pData); 38 | } 39 | } 40 | 41 | public static bool GetUserStat(CSteamID steamIDUser, string pchName, out float pData) { 42 | InteropHelp.TestIfAvailableGameServer(); 43 | using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) { 44 | return NativeMethods.ISteamGameServerStats_GetUserStatFloat(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser, pchName2, out pData); 45 | } 46 | } 47 | 48 | public static bool GetUserAchievement(CSteamID steamIDUser, string pchName, out bool pbAchieved) { 49 | InteropHelp.TestIfAvailableGameServer(); 50 | using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) { 51 | return NativeMethods.ISteamGameServerStats_GetUserAchievement(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser, pchName2, out pbAchieved); 52 | } 53 | } 54 | 55 | /// 56 | /// Set / update stats and achievements. 57 | /// Note: These updates will work only on stats game servers are allowed to edit and only for 58 | /// game servers that have been declared as officially controlled by the game creators. 59 | /// Set the IP range of your official servers on the Steamworks page 60 | /// 61 | public static bool SetUserStat(CSteamID steamIDUser, string pchName, int nData) { 62 | InteropHelp.TestIfAvailableGameServer(); 63 | using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) { 64 | return NativeMethods.ISteamGameServerStats_SetUserStatInt32(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser, pchName2, nData); 65 | } 66 | } 67 | 68 | public static bool SetUserStat(CSteamID steamIDUser, string pchName, float fData) { 69 | InteropHelp.TestIfAvailableGameServer(); 70 | using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) { 71 | return NativeMethods.ISteamGameServerStats_SetUserStatFloat(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser, pchName2, fData); 72 | } 73 | } 74 | 75 | public static bool UpdateUserAvgRateStat(CSteamID steamIDUser, string pchName, float flCountThisSession, double dSessionLength) { 76 | InteropHelp.TestIfAvailableGameServer(); 77 | using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) { 78 | return NativeMethods.ISteamGameServerStats_UpdateUserAvgRateStat(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser, pchName2, flCountThisSession, dSessionLength); 79 | } 80 | } 81 | 82 | public static bool SetUserAchievement(CSteamID steamIDUser, string pchName) { 83 | InteropHelp.TestIfAvailableGameServer(); 84 | using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) { 85 | return NativeMethods.ISteamGameServerStats_SetUserAchievement(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser, pchName2); 86 | } 87 | } 88 | 89 | public static bool ClearUserAchievement(CSteamID steamIDUser, string pchName) { 90 | InteropHelp.TestIfAvailableGameServer(); 91 | using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) { 92 | return NativeMethods.ISteamGameServerStats_ClearUserAchievement(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser, pchName2); 93 | } 94 | } 95 | 96 | /// 97 | /// Store the current data on the server, will get a GSStatsStored_t callback when set. 98 | /// If the callback has a result of k_EResultInvalidParam, one or more stats 99 | /// uploaded has been rejected, either because they broke constraints 100 | /// or were out of date. In this case the server sends back updated values. 101 | /// The stats should be re-iterated to keep in sync. 102 | /// 103 | public static SteamAPICall_t StoreUserStats(CSteamID steamIDUser) { 104 | InteropHelp.TestIfAvailableGameServer(); 105 | return (SteamAPICall_t)NativeMethods.ISteamGameServerStats_StoreUserStats(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser); 106 | } 107 | } 108 | } 109 | 110 | #endif // !DISABLESTEAMWORKS 111 | -------------------------------------------------------------------------------- /Source/types/SteamDatagramTickets/SteamDatagramRelayAuthTicket.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks 18 | { 19 | /// Network-routable identifier for a service. This is an intentionally 20 | /// opaque byte blob. The relays know how to use this to forward it on 21 | /// to the intended destination, but otherwise clients really should not 22 | /// need to know what's inside. (Indeed, we don't really want them to 23 | /// know, as it could reveal information useful to an attacker.) 24 | [System.Serializable] 25 | [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] 26 | public struct SteamDatagramRelayAuthTicket 27 | { 28 | /// Identity of the gameserver we want to talk to. This is required. 29 | SteamNetworkingIdentity m_identityGameserver; 30 | 31 | /// Identity of the person who was authorized. This is required. 32 | SteamNetworkingIdentity m_identityAuthorizedClient; 33 | 34 | /// SteamID is authorized to send from a particular public IP. If this 35 | /// is 0, then the sender is not restricted to a particular IP. 36 | /// 37 | /// Recommend to leave this set to zero. 38 | uint m_unPublicIP; 39 | 40 | /// Time when the ticket expires. Recommended: take the current 41 | /// time and add 6 hours, or maybe a bit longer if your gameplay 42 | /// sessions are longer. 43 | /// 44 | /// NOTE: relays may reject tickets with expiry times excessively 45 | /// far in the future, so contact us if you wish to use an expiry 46 | /// longer than, say, 24 hours. 47 | RTime32 m_rtimeTicketExpiry; 48 | 49 | /// Routing information where the gameserver is listening for 50 | /// relayed traffic. You should fill this in when generating 51 | /// a ticket. 52 | /// 53 | /// When generating tickets on your backend: 54 | /// - In production: The gameserver knows the proper routing 55 | /// information, so you need to call 56 | /// ISteamNetworkingSockets::GetHostedDedicatedServerAddress 57 | /// and send the info to your backend. 58 | /// - In development, you will need to provide public IP 59 | /// of the server using SteamDatagramServiceNetID::SetDevAddress. 60 | /// Relays need to be able to send UDP 61 | /// packets to this server. Since it's very likely that 62 | /// your server is behind a firewall/NAT, make sure that 63 | /// the address is the one that the outside world can use. 64 | /// The traffic from the relays will be "unsolicited", so 65 | /// stateful firewalls won't work -- you will probably have 66 | /// to set up an explicit port forward. 67 | /// On the client: 68 | /// - this field will always be blank. 69 | SteamDatagramHostedAddress m_routing; 70 | 71 | /// App ID this is for. This is required, and should be the 72 | /// App ID the client is running. (Even if your gameserver 73 | /// uses a different App ID.) 74 | uint m_nAppID; 75 | 76 | /// Restrict this ticket to be used for a particular virtual port? 77 | /// Set to -1 to allow any virtual port. 78 | /// 79 | /// This is useful as a security measure, and also so the client will 80 | /// use the right ticket (which might have extra fields that are useful 81 | /// for proper analytics), if the client happens to have more than one 82 | /// appropriate ticket. 83 | /// 84 | /// Note: if a client has more that one acceptable ticket, they will 85 | /// always use the one expiring the latest. 86 | int m_nRestrictToVirtualPort; 87 | 88 | // 89 | // Extra fields. 90 | // 91 | // These are collected for backend analytics. For example, you might 92 | // send a MatchID so that all of the records for a particular match can 93 | // be located. Or send a game mode field so that you can compare 94 | // the network characteristics of different game modes. 95 | // 96 | // (At the time of this writing we don't have a way to expose the data 97 | // we collect to partners, but we hope to in the future so that you can 98 | // get visibility into network conditions.) 99 | // 100 | [StructLayout(LayoutKind.Sequential, Pack = Packsize.value)] 101 | struct ExtraField 102 | { 103 | enum EType 104 | { 105 | k_EType_String, 106 | k_EType_Int, // For most small integral values. Uses google protobuf sint64, so it's small on the wire. WARNING: In some places this value may be transmitted in JSON, in which case precision may be lost in backend analytics. Don't use this for an "identifier", use it for a scalar quantity. 107 | k_EType_Fixed64, // 64 arbitrary bits. This value is treated as an "identifier". In places where JSON format is used, it will be serialized as a string. No aggregation / analytics can be performed on this value. 108 | }; 109 | EType m_eType; 110 | 111 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 28)] 112 | byte[] m_szName; 113 | 114 | [StructLayout(LayoutKind.Explicit)] 115 | struct OptionValue 116 | { 117 | [FieldOffset(0)] 118 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] 119 | byte[] m_szStringValue; 120 | 121 | [FieldOffset(0)] 122 | long m_nIntValue; 123 | 124 | [FieldOffset(0)] 125 | ulong m_nFixed64Value; 126 | } 127 | OptionValue m_val; 128 | }; 129 | 130 | const int k_nMaxExtraFields = 16; 131 | 132 | int m_nExtraFields; 133 | 134 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = k_nMaxExtraFields)] 135 | ExtraField[] m_vecExtraFields; 136 | 137 | // Reset all fields 138 | public void Clear() 139 | { 140 | } 141 | } 142 | } 143 | 144 | #endif // !DISABLESTEAMWORKS -------------------------------------------------------------------------------- /Source/autogen/isteamscreenshots.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | public static class SteamScreenshots { 19 | /// 20 | /// Writes a screenshot to the user's screenshot library given the raw image data, which must be in RGB format. 21 | /// The return value is a handle that is valid for the duration of the game process and can be used to apply tags. 22 | /// 23 | public static ScreenshotHandle WriteScreenshot(byte[] pubRGB, uint cubRGB, int nWidth, int nHeight) { 24 | InteropHelp.TestIfAvailableClient(); 25 | return (ScreenshotHandle)NativeMethods.ISteamScreenshots_WriteScreenshot(CSteamAPIContext.GetSteamScreenshots(), pubRGB, cubRGB, nWidth, nHeight); 26 | } 27 | 28 | /// 29 | /// 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 30 | /// 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. 31 | /// The return value is a handle that is valid for the duration of the game process and can be used to apply tags. 32 | /// JPEG, TGA, and PNG formats are supported. 33 | /// 34 | public static ScreenshotHandle AddScreenshotToLibrary(string pchFilename, string pchThumbnailFilename, int nWidth, int nHeight) { 35 | InteropHelp.TestIfAvailableClient(); 36 | using (var pchFilename2 = new InteropHelp.UTF8StringHandle(pchFilename)) 37 | using (var pchThumbnailFilename2 = new InteropHelp.UTF8StringHandle(pchThumbnailFilename)) { 38 | return (ScreenshotHandle)NativeMethods.ISteamScreenshots_AddScreenshotToLibrary(CSteamAPIContext.GetSteamScreenshots(), pchFilename2, pchThumbnailFilename2, nWidth, nHeight); 39 | } 40 | } 41 | 42 | /// 43 | /// 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. 44 | /// 45 | public static void TriggerScreenshot() { 46 | InteropHelp.TestIfAvailableClient(); 47 | NativeMethods.ISteamScreenshots_TriggerScreenshot(CSteamAPIContext.GetSteamScreenshots()); 48 | } 49 | 50 | /// 51 | /// Toggles whether the overlay handles screenshots when the user presses the screenshot hotkey, or the game handles them. If the game is hooking screenshots, 52 | /// then the ScreenshotRequested_t callback will be sent if the user presses the hotkey, and the game is expected to call WriteScreenshot or AddScreenshotToLibrary 53 | /// in response. 54 | /// 55 | public static void HookScreenshots(bool bHook) { 56 | InteropHelp.TestIfAvailableClient(); 57 | NativeMethods.ISteamScreenshots_HookScreenshots(CSteamAPIContext.GetSteamScreenshots(), bHook); 58 | } 59 | 60 | /// 61 | /// Sets metadata about a screenshot's location (for example, the name of the map) 62 | /// 63 | public static bool SetLocation(ScreenshotHandle hScreenshot, string pchLocation) { 64 | InteropHelp.TestIfAvailableClient(); 65 | using (var pchLocation2 = new InteropHelp.UTF8StringHandle(pchLocation)) { 66 | return NativeMethods.ISteamScreenshots_SetLocation(CSteamAPIContext.GetSteamScreenshots(), hScreenshot, pchLocation2); 67 | } 68 | } 69 | 70 | /// 71 | /// Tags a user as being visible in the screenshot 72 | /// 73 | public static bool TagUser(ScreenshotHandle hScreenshot, CSteamID steamID) { 74 | InteropHelp.TestIfAvailableClient(); 75 | return NativeMethods.ISteamScreenshots_TagUser(CSteamAPIContext.GetSteamScreenshots(), hScreenshot, steamID); 76 | } 77 | 78 | /// 79 | /// Tags a published file as being visible in the screenshot 80 | /// 81 | public static bool TagPublishedFile(ScreenshotHandle hScreenshot, PublishedFileId_t unPublishedFileID) { 82 | InteropHelp.TestIfAvailableClient(); 83 | return NativeMethods.ISteamScreenshots_TagPublishedFile(CSteamAPIContext.GetSteamScreenshots(), hScreenshot, unPublishedFileID); 84 | } 85 | 86 | /// 87 | /// Returns true if the app has hooked the screenshot 88 | /// 89 | public static bool IsScreenshotsHooked() { 90 | InteropHelp.TestIfAvailableClient(); 91 | return NativeMethods.ISteamScreenshots_IsScreenshotsHooked(CSteamAPIContext.GetSteamScreenshots()); 92 | } 93 | 94 | /// 95 | /// Adds a VR screenshot to the user's screenshot library from disk in the supported type. 96 | /// pchFilename should be the normal 2D image used in the library view 97 | /// pchVRFilename should contain the image that matches the correct type 98 | /// The return value is a handle that is valid for the duration of the game process and can be used to apply tags. 99 | /// JPEG, TGA, and PNG formats are supported. 100 | /// 101 | public static ScreenshotHandle AddVRScreenshotToLibrary(EVRScreenshotType eType, string pchFilename, string pchVRFilename) { 102 | InteropHelp.TestIfAvailableClient(); 103 | using (var pchFilename2 = new InteropHelp.UTF8StringHandle(pchFilename)) 104 | using (var pchVRFilename2 = new InteropHelp.UTF8StringHandle(pchVRFilename)) { 105 | return (ScreenshotHandle)NativeMethods.ISteamScreenshots_AddVRScreenshotToLibrary(CSteamAPIContext.GetSteamScreenshots(), eType, pchFilename2, pchVRFilename2); 106 | } 107 | } 108 | } 109 | } 110 | 111 | #endif // !DISABLESTEAMWORKS 112 | -------------------------------------------------------------------------------- /Source/types/SteamNetworkingTypes/SteamNetworkingIdentity.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks 18 | { 19 | /// An abstract way to represent the identity of a network host. All identities can 20 | /// be represented as simple string. Furthermore, this string representation is actually 21 | /// used on the wire in several places, even though it is less efficient, in order to 22 | /// facilitate forward compatibility. (Old client code can handle an identity type that 23 | /// it doesn't understand.) 24 | [System.Serializable] 25 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 26 | public struct SteamNetworkingIdentity : System.IEquatable 27 | { 28 | /// Type of identity. 29 | public ESteamNetworkingIdentityType m_eType; 30 | 31 | // 32 | // Internal representation. Don't access this directly, use the accessors! 33 | // 34 | // Number of bytes that are relevant below. This MUST ALWAYS be 35 | // set. (Use the accessors!) This is important to enable old code to work 36 | // with new identity types. 37 | private int m_cbSize; 38 | 39 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] 40 | private uint[] m_reserved; // Pad structure to leave easy room for future expansion 41 | 42 | // Max sizes 43 | public const int k_cchMaxString = 128; // Max length of the buffer needed to hold any identity, formatted in string format by ToString 44 | public const int k_cchMaxGenericString = 32; // Max length of the string for generic string identities. Including terminating '\0' 45 | public const int k_cbMaxGenericBytes = 32; 46 | 47 | // 48 | // Get/Set in various formats. 49 | // 50 | 51 | public void Clear() { 52 | NativeMethods.SteamAPI_SteamNetworkingIdentity_Clear(ref this); 53 | } 54 | 55 | // Return true if we are the invalid type. Does not make any other validity checks (e.g. is SteamID actually valid) 56 | public bool IsInvalid() { 57 | return NativeMethods.SteamAPI_SteamNetworkingIdentity_IsInvalid(ref this); 58 | } 59 | 60 | public void SetSteamID(CSteamID steamID) { 61 | NativeMethods.SteamAPI_SteamNetworkingIdentity_SetSteamID(ref this, (ulong)steamID); 62 | } 63 | 64 | // Return black CSteamID (!IsValid()) if identity is not a SteamID 65 | public CSteamID GetSteamID() { 66 | return (CSteamID)NativeMethods.SteamAPI_SteamNetworkingIdentity_GetSteamID(ref this); 67 | } 68 | 69 | // Takes SteamID as raw 64-bit number 70 | public void SetSteamID64(ulong steamID) { 71 | NativeMethods.SteamAPI_SteamNetworkingIdentity_SetSteamID64(ref this, steamID); 72 | } 73 | 74 | // Returns 0 if identity is not SteamID 75 | public ulong GetSteamID64() { 76 | return NativeMethods.SteamAPI_SteamNetworkingIdentity_GetSteamID64(ref this); 77 | } 78 | 79 | // Set to specified IP:port 80 | public void SetIPAddr(SteamNetworkingIPAddr addr) { 81 | NativeMethods.SteamAPI_SteamNetworkingIdentity_SetIPAddr(ref this, ref addr); 82 | } 83 | 84 | // returns null if we are not an IP address. 85 | public SteamNetworkingIPAddr GetIPAddr(){ 86 | throw new System.NotImplementedException(); 87 | // TODO: Should SteamNetworkingIPAddr be a class? 88 | // or should this return some kind of pointer instead? 89 | //return NativeMethods.SteamAPI_SteamNetworkingIdentity_GetIPAddr(ref this); 90 | } 91 | 92 | public void SetIPv4Addr(uint nIPv4, ushort nPort) { 93 | NativeMethods.SteamAPI_SteamNetworkingIdentity_SetIPv4Addr(ref this, nIPv4, nPort); 94 | } 95 | 96 | // returns 0 if we are not an IPv4 address. 97 | public uint GetIPv4() { 98 | return NativeMethods.SteamAPI_SteamNetworkingIdentity_GetIPv4(ref this); 99 | } 100 | 101 | public ESteamNetworkingFakeIPType GetFakeIPType() { 102 | return NativeMethods.SteamAPI_SteamNetworkingIdentity_GetFakeIPType(ref this); 103 | } 104 | 105 | public bool IsFakeIP() { 106 | return GetFakeIPType() > ESteamNetworkingFakeIPType.k_ESteamNetworkingFakeIPType_NotFake; 107 | } 108 | 109 | // "localhost" is equivalent for many purposes to "anonymous." Our remote 110 | // will identify us by the network address we use. 111 | // Set to localhost. (We always use IPv6 ::1 for this, not 127.0.0.1) 112 | public void SetLocalHost() { 113 | NativeMethods.SteamAPI_SteamNetworkingIdentity_SetLocalHost(ref this); 114 | } 115 | 116 | // Return true if this identity is localhost. 117 | public bool IsLocalHost() { 118 | return NativeMethods.SteamAPI_SteamNetworkingIdentity_IsLocalHost(ref this); 119 | } 120 | 121 | // Returns false if invalid length 122 | public bool SetGenericString(string pszString) { 123 | using (var pszString2 = new InteropHelp.UTF8StringHandle(pszString)) { 124 | return NativeMethods.SteamAPI_SteamNetworkingIdentity_SetGenericString(ref this, pszString2); 125 | } 126 | } 127 | 128 | // Returns nullptr if not generic string type 129 | public string GetGenericString() { 130 | return InteropHelp.PtrToStringUTF8(NativeMethods.SteamAPI_SteamNetworkingIdentity_GetGenericString(ref this)); 131 | } 132 | 133 | // Returns false if invalid size. 134 | public bool SetGenericBytes(byte[] data, uint cbLen) { 135 | return NativeMethods.SteamAPI_SteamNetworkingIdentity_SetGenericBytes(ref this, data, cbLen); 136 | } 137 | 138 | // Returns null if not generic bytes type 139 | public byte[] GetGenericBytes(out int cbLen) { 140 | throw new System.NotImplementedException(); 141 | //return NativeMethods.SteamAPI_SteamNetworkingIdentity_GetGenericBytes(ref this, out cbLen); 142 | } 143 | 144 | /// See if two identities are identical 145 | public bool Equals(SteamNetworkingIdentity x) { 146 | return NativeMethods.SteamAPI_SteamNetworkingIdentity_IsEqualTo(ref this, ref x); 147 | } 148 | 149 | /// Print to a human-readable string. This is suitable for debug messages 150 | /// or any other time you need to encode the identity as a string. It has a 151 | /// URL-like format (type:). Your buffer should be at least 152 | /// k_cchMaxString bytes big to avoid truncation. 153 | /// 154 | /// See also SteamNetworkingIPAddrRender 155 | public void ToString(out string buf) { 156 | IntPtr buf2 = Marshal.AllocHGlobal(k_cchMaxString); 157 | NativeMethods.SteamAPI_SteamNetworkingIdentity_ToString(ref this, buf2, k_cchMaxString); 158 | buf = InteropHelp.PtrToStringUTF8(buf2); 159 | Marshal.FreeHGlobal(buf2); 160 | } 161 | 162 | /// Parse back a string that was generated using ToString. If we don't understand the 163 | /// string, but it looks "reasonable" (it matches the pattern type: and doesn't 164 | /// have any funky characters, etc), then we will return true, and the type is set to 165 | /// k_ESteamNetworkingIdentityType_UnknownType. false will only be returned if the string 166 | /// looks invalid. 167 | public bool ParseString(string pszStr) { 168 | using (var pszStr2 = new InteropHelp.UTF8StringHandle(pszStr)) { 169 | return NativeMethods.SteamAPI_SteamNetworkingIdentity_ParseString(ref this, pszStr2); 170 | } 171 | } 172 | } 173 | } 174 | 175 | #endif // !DISABLESTEAMWORKS 176 | -------------------------------------------------------------------------------- /Source/autogen/isteammusicremote.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | public static class SteamMusicRemote { 19 | /// 20 | /// Service Definition 21 | /// 22 | public static bool RegisterSteamMusicRemote(string pchName) { 23 | InteropHelp.TestIfAvailableClient(); 24 | using (var pchName2 = new InteropHelp.UTF8StringHandle(pchName)) { 25 | return NativeMethods.ISteamMusicRemote_RegisterSteamMusicRemote(CSteamAPIContext.GetSteamMusicRemote(), pchName2); 26 | } 27 | } 28 | 29 | public static bool DeregisterSteamMusicRemote() { 30 | InteropHelp.TestIfAvailableClient(); 31 | return NativeMethods.ISteamMusicRemote_DeregisterSteamMusicRemote(CSteamAPIContext.GetSteamMusicRemote()); 32 | } 33 | 34 | public static bool BIsCurrentMusicRemote() { 35 | InteropHelp.TestIfAvailableClient(); 36 | return NativeMethods.ISteamMusicRemote_BIsCurrentMusicRemote(CSteamAPIContext.GetSteamMusicRemote()); 37 | } 38 | 39 | public static bool BActivationSuccess(bool bValue) { 40 | InteropHelp.TestIfAvailableClient(); 41 | return NativeMethods.ISteamMusicRemote_BActivationSuccess(CSteamAPIContext.GetSteamMusicRemote(), bValue); 42 | } 43 | 44 | public static bool SetDisplayName(string pchDisplayName) { 45 | InteropHelp.TestIfAvailableClient(); 46 | using (var pchDisplayName2 = new InteropHelp.UTF8StringHandle(pchDisplayName)) { 47 | return NativeMethods.ISteamMusicRemote_SetDisplayName(CSteamAPIContext.GetSteamMusicRemote(), pchDisplayName2); 48 | } 49 | } 50 | 51 | public static bool SetPNGIcon_64x64(byte[] pvBuffer, uint cbBufferLength) { 52 | InteropHelp.TestIfAvailableClient(); 53 | return NativeMethods.ISteamMusicRemote_SetPNGIcon_64x64(CSteamAPIContext.GetSteamMusicRemote(), pvBuffer, cbBufferLength); 54 | } 55 | 56 | /// 57 | /// Abilities for the user interface 58 | /// 59 | public static bool EnablePlayPrevious(bool bValue) { 60 | InteropHelp.TestIfAvailableClient(); 61 | return NativeMethods.ISteamMusicRemote_EnablePlayPrevious(CSteamAPIContext.GetSteamMusicRemote(), bValue); 62 | } 63 | 64 | public static bool EnablePlayNext(bool bValue) { 65 | InteropHelp.TestIfAvailableClient(); 66 | return NativeMethods.ISteamMusicRemote_EnablePlayNext(CSteamAPIContext.GetSteamMusicRemote(), bValue); 67 | } 68 | 69 | public static bool EnableShuffled(bool bValue) { 70 | InteropHelp.TestIfAvailableClient(); 71 | return NativeMethods.ISteamMusicRemote_EnableShuffled(CSteamAPIContext.GetSteamMusicRemote(), bValue); 72 | } 73 | 74 | public static bool EnableLooped(bool bValue) { 75 | InteropHelp.TestIfAvailableClient(); 76 | return NativeMethods.ISteamMusicRemote_EnableLooped(CSteamAPIContext.GetSteamMusicRemote(), bValue); 77 | } 78 | 79 | public static bool EnableQueue(bool bValue) { 80 | InteropHelp.TestIfAvailableClient(); 81 | return NativeMethods.ISteamMusicRemote_EnableQueue(CSteamAPIContext.GetSteamMusicRemote(), bValue); 82 | } 83 | 84 | public static bool EnablePlaylists(bool bValue) { 85 | InteropHelp.TestIfAvailableClient(); 86 | return NativeMethods.ISteamMusicRemote_EnablePlaylists(CSteamAPIContext.GetSteamMusicRemote(), bValue); 87 | } 88 | 89 | /// 90 | /// Status 91 | /// 92 | public static bool UpdatePlaybackStatus(AudioPlayback_Status nStatus) { 93 | InteropHelp.TestIfAvailableClient(); 94 | return NativeMethods.ISteamMusicRemote_UpdatePlaybackStatus(CSteamAPIContext.GetSteamMusicRemote(), nStatus); 95 | } 96 | 97 | public static bool UpdateShuffled(bool bValue) { 98 | InteropHelp.TestIfAvailableClient(); 99 | return NativeMethods.ISteamMusicRemote_UpdateShuffled(CSteamAPIContext.GetSteamMusicRemote(), bValue); 100 | } 101 | 102 | public static bool UpdateLooped(bool bValue) { 103 | InteropHelp.TestIfAvailableClient(); 104 | return NativeMethods.ISteamMusicRemote_UpdateLooped(CSteamAPIContext.GetSteamMusicRemote(), bValue); 105 | } 106 | 107 | /// 108 | /// volume is between 0.0 and 1.0 109 | /// 110 | public static bool UpdateVolume(float flValue) { 111 | InteropHelp.TestIfAvailableClient(); 112 | return NativeMethods.ISteamMusicRemote_UpdateVolume(CSteamAPIContext.GetSteamMusicRemote(), flValue); 113 | } 114 | 115 | /// 116 | /// Current Entry 117 | /// 118 | public static bool CurrentEntryWillChange() { 119 | InteropHelp.TestIfAvailableClient(); 120 | return NativeMethods.ISteamMusicRemote_CurrentEntryWillChange(CSteamAPIContext.GetSteamMusicRemote()); 121 | } 122 | 123 | public static bool CurrentEntryIsAvailable(bool bAvailable) { 124 | InteropHelp.TestIfAvailableClient(); 125 | return NativeMethods.ISteamMusicRemote_CurrentEntryIsAvailable(CSteamAPIContext.GetSteamMusicRemote(), bAvailable); 126 | } 127 | 128 | public static bool UpdateCurrentEntryText(string pchText) { 129 | InteropHelp.TestIfAvailableClient(); 130 | using (var pchText2 = new InteropHelp.UTF8StringHandle(pchText)) { 131 | return NativeMethods.ISteamMusicRemote_UpdateCurrentEntryText(CSteamAPIContext.GetSteamMusicRemote(), pchText2); 132 | } 133 | } 134 | 135 | public static bool UpdateCurrentEntryElapsedSeconds(int nValue) { 136 | InteropHelp.TestIfAvailableClient(); 137 | return NativeMethods.ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds(CSteamAPIContext.GetSteamMusicRemote(), nValue); 138 | } 139 | 140 | public static bool UpdateCurrentEntryCoverArt(byte[] pvBuffer, uint cbBufferLength) { 141 | InteropHelp.TestIfAvailableClient(); 142 | return NativeMethods.ISteamMusicRemote_UpdateCurrentEntryCoverArt(CSteamAPIContext.GetSteamMusicRemote(), pvBuffer, cbBufferLength); 143 | } 144 | 145 | public static bool CurrentEntryDidChange() { 146 | InteropHelp.TestIfAvailableClient(); 147 | return NativeMethods.ISteamMusicRemote_CurrentEntryDidChange(CSteamAPIContext.GetSteamMusicRemote()); 148 | } 149 | 150 | /// 151 | /// Queue 152 | /// 153 | public static bool QueueWillChange() { 154 | InteropHelp.TestIfAvailableClient(); 155 | return NativeMethods.ISteamMusicRemote_QueueWillChange(CSteamAPIContext.GetSteamMusicRemote()); 156 | } 157 | 158 | public static bool ResetQueueEntries() { 159 | InteropHelp.TestIfAvailableClient(); 160 | return NativeMethods.ISteamMusicRemote_ResetQueueEntries(CSteamAPIContext.GetSteamMusicRemote()); 161 | } 162 | 163 | public static bool SetQueueEntry(int nID, int nPosition, string pchEntryText) { 164 | InteropHelp.TestIfAvailableClient(); 165 | using (var pchEntryText2 = new InteropHelp.UTF8StringHandle(pchEntryText)) { 166 | return NativeMethods.ISteamMusicRemote_SetQueueEntry(CSteamAPIContext.GetSteamMusicRemote(), nID, nPosition, pchEntryText2); 167 | } 168 | } 169 | 170 | public static bool SetCurrentQueueEntry(int nID) { 171 | InteropHelp.TestIfAvailableClient(); 172 | return NativeMethods.ISteamMusicRemote_SetCurrentQueueEntry(CSteamAPIContext.GetSteamMusicRemote(), nID); 173 | } 174 | 175 | public static bool QueueDidChange() { 176 | InteropHelp.TestIfAvailableClient(); 177 | return NativeMethods.ISteamMusicRemote_QueueDidChange(CSteamAPIContext.GetSteamMusicRemote()); 178 | } 179 | 180 | /// 181 | /// Playlist 182 | /// 183 | public static bool PlaylistWillChange() { 184 | InteropHelp.TestIfAvailableClient(); 185 | return NativeMethods.ISteamMusicRemote_PlaylistWillChange(CSteamAPIContext.GetSteamMusicRemote()); 186 | } 187 | 188 | public static bool ResetPlaylistEntries() { 189 | InteropHelp.TestIfAvailableClient(); 190 | return NativeMethods.ISteamMusicRemote_ResetPlaylistEntries(CSteamAPIContext.GetSteamMusicRemote()); 191 | } 192 | 193 | public static bool SetPlaylistEntry(int nID, int nPosition, string pchEntryText) { 194 | InteropHelp.TestIfAvailableClient(); 195 | using (var pchEntryText2 = new InteropHelp.UTF8StringHandle(pchEntryText)) { 196 | return NativeMethods.ISteamMusicRemote_SetPlaylistEntry(CSteamAPIContext.GetSteamMusicRemote(), nID, nPosition, pchEntryText2); 197 | } 198 | } 199 | 200 | public static bool SetCurrentPlaylistEntry(int nID) { 201 | InteropHelp.TestIfAvailableClient(); 202 | return NativeMethods.ISteamMusicRemote_SetCurrentPlaylistEntry(CSteamAPIContext.GetSteamMusicRemote(), nID); 203 | } 204 | 205 | public static bool PlaylistDidChange() { 206 | InteropHelp.TestIfAvailableClient(); 207 | return NativeMethods.ISteamMusicRemote_PlaylistDidChange(CSteamAPIContext.GetSteamMusicRemote()); 208 | } 209 | } 210 | } 211 | 212 | #endif // !DISABLESTEAMWORKS 213 | -------------------------------------------------------------------------------- /Source/InteropHelp.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | using System.Text; 18 | 19 | namespace Steamworks { 20 | public class InteropHelp { 21 | public static void TestIfPlatformSupported() { 22 | #if !UNITY_EDITOR && !UNITY_STANDALONE && !STEAMWORKS_WIN && !STEAMWORKS_LIN_OSX 23 | throw new System.InvalidOperationException("Steamworks functions can only be called on platforms that Steam is available on."); 24 | #endif 25 | } 26 | 27 | public static void TestIfAvailableClient() { 28 | TestIfPlatformSupported(); 29 | if (CSteamAPIContext.GetSteamClient() == System.IntPtr.Zero) { 30 | if (!CSteamAPIContext.Init()) { 31 | throw new System.InvalidOperationException("Steamworks is not initialized."); 32 | } 33 | } 34 | } 35 | 36 | public static void TestIfAvailableGameServer() { 37 | TestIfPlatformSupported(); 38 | if (CSteamGameServerAPIContext.GetSteamClient() == System.IntPtr.Zero) { 39 | if (!CSteamGameServerAPIContext.Init()) { 40 | throw new System.InvalidOperationException("Steamworks GameServer is not initialized."); 41 | } 42 | } 43 | } 44 | 45 | // This continues to exist for both 'out string' and strings returned by Steamworks functions. 46 | public static string PtrToStringUTF8(IntPtr nativeUtf8) { 47 | if (nativeUtf8 == IntPtr.Zero) { 48 | return null; 49 | } 50 | 51 | int len = 0; 52 | 53 | while (Marshal.ReadByte(nativeUtf8, len) != 0) { 54 | ++len; 55 | } 56 | 57 | if (len == 0) { 58 | return string.Empty; 59 | } 60 | 61 | byte[] buffer = new byte[len]; 62 | Marshal.Copy(nativeUtf8, buffer, 0, buffer.Length); 63 | return Encoding.UTF8.GetString(buffer); 64 | } 65 | 66 | public static string ByteArrayToStringUTF8(byte[] buffer) { 67 | int length = 0; 68 | while (length < buffer.Length && buffer[length] != 0) { 69 | length++; 70 | } 71 | 72 | return Encoding.UTF8.GetString(buffer, 0, length); 73 | } 74 | 75 | public static void StringToByteArrayUTF8(string str, byte[] outArrayBuffer, int outArrayBufferSize) 76 | { 77 | outArrayBuffer = new byte[outArrayBufferSize]; 78 | int length = Encoding.UTF8.GetBytes(str, 0, str.Length, outArrayBuffer, 0); 79 | outArrayBuffer[length] = 0; 80 | } 81 | 82 | // This is for 'const char *' arguments which we need to ensure do not get GC'd while Steam is using them. 83 | // 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... 84 | #if UNITY_EDITOR || UNITY_STANDALONE || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX 85 | public class UTF8StringHandle : Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid { 86 | public UTF8StringHandle(string str) 87 | : base(true) { 88 | if (str == null) { 89 | SetHandle(IntPtr.Zero); 90 | return; 91 | } 92 | 93 | // +1 for '\0' 94 | byte[] strbuf = new byte[Encoding.UTF8.GetByteCount(str) + 1]; 95 | Encoding.UTF8.GetBytes(str, 0, str.Length, strbuf, 0); 96 | IntPtr buffer = Marshal.AllocHGlobal(strbuf.Length); 97 | Marshal.Copy(strbuf, 0, buffer, strbuf.Length); 98 | 99 | SetHandle(buffer); 100 | } 101 | 102 | protected override bool ReleaseHandle() { 103 | if (!IsInvalid) { 104 | Marshal.FreeHGlobal(handle); 105 | } 106 | return true; 107 | } 108 | } 109 | #else 110 | public class UTF8StringHandle : IDisposable { 111 | public UTF8StringHandle(string str) { } 112 | public void Dispose() {} 113 | } 114 | #endif 115 | 116 | // TODO - Should be IDisposable 117 | // We can't use an ICustomMarshaler because Unity dies when MarshalManagedToNative() gets called with a generic type. 118 | public class SteamParamStringArray { 119 | // The pointer to each AllocHGlobal() string 120 | IntPtr[] m_Strings; 121 | // The pointer to the condensed version of m_Strings 122 | IntPtr m_ptrStrings; 123 | // The pointer to the StructureToPtr version of SteamParamStringArray_t that will get marshaled 124 | IntPtr m_pSteamParamStringArray; 125 | 126 | public SteamParamStringArray(System.Collections.Generic.IList strings) { 127 | if (strings == null) { 128 | m_pSteamParamStringArray = IntPtr.Zero; 129 | return; 130 | } 131 | 132 | m_Strings = new IntPtr[strings.Count]; 133 | for (int i = 0; i < strings.Count; ++i) { 134 | byte[] strbuf = new byte[Encoding.UTF8.GetByteCount(strings[i]) + 1]; 135 | Encoding.UTF8.GetBytes(strings[i], 0, strings[i].Length, strbuf, 0); 136 | m_Strings[i] = Marshal.AllocHGlobal(strbuf.Length); 137 | Marshal.Copy(strbuf, 0, m_Strings[i], strbuf.Length); 138 | } 139 | 140 | m_ptrStrings = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr)) * m_Strings.Length); 141 | SteamParamStringArray_t stringArray = new SteamParamStringArray_t() { 142 | m_ppStrings = m_ptrStrings, 143 | m_nNumStrings = m_Strings.Length 144 | }; 145 | Marshal.Copy(m_Strings, 0, stringArray.m_ppStrings, m_Strings.Length); 146 | 147 | m_pSteamParamStringArray = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(SteamParamStringArray_t))); 148 | Marshal.StructureToPtr(stringArray, m_pSteamParamStringArray, false); 149 | } 150 | 151 | ~SteamParamStringArray() { 152 | if (m_Strings != null) { 153 | foreach (IntPtr ptr in m_Strings) { 154 | Marshal.FreeHGlobal(ptr); 155 | } 156 | } 157 | 158 | if (m_ptrStrings != IntPtr.Zero) { 159 | Marshal.FreeHGlobal(m_ptrStrings); 160 | } 161 | 162 | if (m_pSteamParamStringArray != IntPtr.Zero) { 163 | Marshal.FreeHGlobal(m_pSteamParamStringArray); 164 | } 165 | } 166 | 167 | public static implicit operator IntPtr(SteamParamStringArray that) { 168 | return that.m_pSteamParamStringArray; 169 | } 170 | } 171 | } 172 | 173 | // TODO - Should be IDisposable 174 | // MatchMaking Key-Value Pair Marshaller 175 | public class MMKVPMarshaller { 176 | private IntPtr m_pNativeArray; 177 | private IntPtr m_pArrayEntries; 178 | 179 | public MMKVPMarshaller(MatchMakingKeyValuePair_t[] filters) { 180 | if (filters == null) { 181 | return; 182 | } 183 | 184 | int sizeOfMMKVP = Marshal.SizeOf(typeof(MatchMakingKeyValuePair_t)); 185 | 186 | m_pNativeArray = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr)) * filters.Length); 187 | m_pArrayEntries = Marshal.AllocHGlobal(sizeOfMMKVP * filters.Length); 188 | for (int i = 0; i < filters.Length; ++i) { 189 | Marshal.StructureToPtr(filters[i], new IntPtr(m_pArrayEntries.ToInt64() + (i * sizeOfMMKVP)), false); 190 | } 191 | 192 | Marshal.WriteIntPtr(m_pNativeArray, m_pArrayEntries); 193 | } 194 | 195 | ~MMKVPMarshaller() { 196 | if (m_pArrayEntries != IntPtr.Zero) { 197 | Marshal.FreeHGlobal(m_pArrayEntries); 198 | } 199 | if (m_pNativeArray != IntPtr.Zero) { 200 | Marshal.FreeHGlobal(m_pNativeArray); 201 | } 202 | } 203 | 204 | public static implicit operator IntPtr(MMKVPMarshaller that) { 205 | return that.m_pNativeArray; 206 | } 207 | } 208 | 209 | public class DllCheck { 210 | #if DISABLED 211 | [DllImport("kernel32.dll")] 212 | public static extern IntPtr GetModuleHandle(string lpModuleName); 213 | 214 | [DllImport("kernel32.dll", CharSet = CharSet.Auto)] 215 | extern static int GetModuleFileName(IntPtr hModule, StringBuilder strFullPath, int nSize); 216 | #endif 217 | 218 | /// 219 | /// 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. 220 | /// 221 | public static bool Test() { 222 | #if DISABLED 223 | bool ret = CheckSteamAPIDLL(); 224 | #endif 225 | return true; 226 | } 227 | 228 | #if DISABLED 229 | private static bool CheckSteamAPIDLL() { 230 | string fileName; 231 | int fileBytes; 232 | if (IntPtr.Size == 4) { 233 | fileName = "steam_api.dll"; 234 | fileBytes = Version.SteamAPIDLLSize; 235 | } 236 | else { 237 | fileName = "steam_api64.dll"; 238 | fileBytes = Version.SteamAPI64DLLSize; 239 | } 240 | 241 | IntPtr handle = GetModuleHandle(fileName); 242 | if (handle == IntPtr.Zero) { 243 | return true; 244 | } 245 | 246 | StringBuilder filePath = new StringBuilder(256); 247 | GetModuleFileName(handle, filePath, filePath.Capacity); 248 | string file = filePath.ToString(); 249 | 250 | // If we can not find the file we'll just skip it and let the DllNotFoundException take care of it. 251 | if (System.IO.File.Exists(file)) { 252 | System.IO.FileInfo fInfo = new System.IO.FileInfo(file); 253 | if (fInfo.Length != fileBytes) { 254 | return false; 255 | } 256 | 257 | if (System.Diagnostics.FileVersionInfo.GetVersionInfo(file).FileVersion != Version.SteamAPIDLLVersion) { 258 | return false; 259 | } 260 | } 261 | return true; 262 | } 263 | #endif 264 | } 265 | } 266 | 267 | #endif // !DISABLESTEAMWORKS 268 | -------------------------------------------------------------------------------- /Source/autogen/isteamnetworkingmessages.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | public static class SteamNetworkingMessages { 19 | /// 20 | /// / Sends a message to the specified host. If we don't already have a session with that user, 21 | /// / a session is implicitly created. There might be some handshaking that needs to happen 22 | /// / before we can actually begin sending message data. If this handshaking fails and we can't 23 | /// / get through, an error will be posted via the callback SteamNetworkingMessagesSessionFailed_t. 24 | /// / There is no notification when the operation succeeds. (You should have the peer send a reply 25 | /// / for this purpose.) 26 | /// / 27 | /// / Sending a message to a host will also implicitly accept any incoming connection from that host. 28 | /// / 29 | /// / nSendFlags is a bitmask of k_nSteamNetworkingSend_xxx options 30 | /// / 31 | /// / nRemoteChannel is a routing number you can use to help route message to different systems. 32 | /// / You'll have to call ReceiveMessagesOnChannel() with the same channel number in order to retrieve 33 | /// / the data on the other end. 34 | /// / 35 | /// / Using different channels to talk to the same user will still use the same underlying 36 | /// / connection, saving on resources. If you don't need this feature, use 0. 37 | /// / Otherwise, small integers are the most efficient. 38 | /// / 39 | /// / It is guaranteed that reliable messages to the same host on the same channel 40 | /// / will be be received by the remote host (if they are received at all) exactly once, 41 | /// / and in the same order that they were sent. 42 | /// / 43 | /// / NO other order guarantees exist! In particular, unreliable messages may be dropped, 44 | /// / received out of order with respect to each other and with respect to reliable data, 45 | /// / or may be received multiple times. Messages on different channels are *not* guaranteed 46 | /// / to be received in the order they were sent. 47 | /// / 48 | /// / A note for those familiar with TCP/IP ports, or converting an existing codebase that 49 | /// / opened multiple sockets: You might notice that there is only one channel, and with 50 | /// / TCP/IP each endpoint has a port number. You can think of the channel number as the 51 | /// / *destination* port. If you need each message to also include a "source port" (so the 52 | /// / recipient can route the reply), then just put that in your message. That is essentially 53 | /// / how UDP works! 54 | /// / 55 | /// / Returns: 56 | /// / - k_EREsultOK on success. 57 | /// / - k_EResultNoConnection, if the session has failed or was closed by the peer and 58 | /// / k_nSteamNetworkingSend_AutoRestartBrokenSession was not specified. (You can 59 | /// / use GetSessionConnectionInfo to get the details.) In order to acknowledge the 60 | /// / broken session and start a new one, you must call CloseSessionWithUser, or you may 61 | /// / repeat the call with k_nSteamNetworkingSend_AutoRestartBrokenSession. See 62 | /// / k_nSteamNetworkingSend_AutoRestartBrokenSession for more details. 63 | /// / - See ISteamNetworkingSockets::SendMessageToConnection for more possible return values 64 | /// 65 | public static EResult SendMessageToUser(ref SteamNetworkingIdentity identityRemote, IntPtr pubData, uint cubData, int nSendFlags, int nRemoteChannel) { 66 | InteropHelp.TestIfAvailableClient(); 67 | return NativeMethods.ISteamNetworkingMessages_SendMessageToUser(CSteamAPIContext.GetSteamNetworkingMessages(), ref identityRemote, pubData, cubData, nSendFlags, nRemoteChannel); 68 | } 69 | 70 | /// 71 | /// / Reads the next message that has been sent from another user via SendMessageToUser() on the given channel. 72 | /// / Returns number of messages returned into your list. (0 if no message are available on that channel.) 73 | /// / 74 | /// / When you're done with the message object(s), make sure and call SteamNetworkingMessage_t::Release()! 75 | /// 76 | public static int ReceiveMessagesOnChannel(int nLocalChannel, IntPtr[] ppOutMessages, int nMaxMessages) { 77 | InteropHelp.TestIfAvailableClient(); 78 | return NativeMethods.ISteamNetworkingMessages_ReceiveMessagesOnChannel(CSteamAPIContext.GetSteamNetworkingMessages(), nLocalChannel, ppOutMessages, nMaxMessages); 79 | } 80 | 81 | /// 82 | /// / Call this in response to a SteamNetworkingMessagesSessionRequest_t callback. 83 | /// / SteamNetworkingMessagesSessionRequest_t are posted when a user tries to send you a message, 84 | /// / and you haven't tried to talk to them first. If you don't want to talk to them, just ignore 85 | /// / the request. If the user continues to send you messages, SteamNetworkingMessagesSessionRequest_t 86 | /// / callbacks will continue to be posted periodically. 87 | /// / 88 | /// / Returns false if there is no session with the user pending or otherwise. If there is an 89 | /// / existing active session, this function will return true, even if it is not pending. 90 | /// / 91 | /// / Calling SendMessageToUser() will implicitly accepts any pending session request to that user. 92 | /// 93 | public static bool AcceptSessionWithUser(ref SteamNetworkingIdentity identityRemote) { 94 | InteropHelp.TestIfAvailableClient(); 95 | return NativeMethods.ISteamNetworkingMessages_AcceptSessionWithUser(CSteamAPIContext.GetSteamNetworkingMessages(), ref identityRemote); 96 | } 97 | 98 | /// 99 | /// / Call this when you're done talking to a user to immediately free up resources under-the-hood. 100 | /// / If the remote user tries to send data to you again, another SteamNetworkingMessagesSessionRequest_t 101 | /// / callback will be posted. 102 | /// / 103 | /// / Note that sessions that go unused for a few minutes are automatically timed out. 104 | /// 105 | public static bool CloseSessionWithUser(ref SteamNetworkingIdentity identityRemote) { 106 | InteropHelp.TestIfAvailableClient(); 107 | return NativeMethods.ISteamNetworkingMessages_CloseSessionWithUser(CSteamAPIContext.GetSteamNetworkingMessages(), ref identityRemote); 108 | } 109 | 110 | /// 111 | /// / Call this when you're done talking to a user on a specific channel. Once all 112 | /// / open channels to a user have been closed, the open session to the user will be 113 | /// / closed, and any new data from this user will trigger a 114 | /// / SteamSteamNetworkingMessagesSessionRequest_t callback 115 | /// 116 | public static bool CloseChannelWithUser(ref SteamNetworkingIdentity identityRemote, int nLocalChannel) { 117 | InteropHelp.TestIfAvailableClient(); 118 | return NativeMethods.ISteamNetworkingMessages_CloseChannelWithUser(CSteamAPIContext.GetSteamNetworkingMessages(), ref identityRemote, nLocalChannel); 119 | } 120 | 121 | /// 122 | /// / Returns information about the latest state of a connection, if any, with the given peer. 123 | /// / Primarily intended for debugging purposes, but can also be used to get more detailed 124 | /// / failure information. (See SendMessageToUser and k_nSteamNetworkingSend_AutoRestartBrokenSession.) 125 | /// / 126 | /// / Returns the value of SteamNetConnectionInfo_t::m_eState, or k_ESteamNetworkingConnectionState_None 127 | /// / if no connection exists with specified peer. You may pass nullptr for either parameter if 128 | /// / you do not need the corresponding details. Note that sessions time out after a while, 129 | /// / so if a connection fails, or SendMessageToUser returns k_EResultNoConnection, you cannot wait 130 | /// / indefinitely to obtain the reason for failure. 131 | /// 132 | public static ESteamNetworkingConnectionState GetSessionConnectionInfo(ref SteamNetworkingIdentity identityRemote, out SteamNetConnectionInfo_t pConnectionInfo, out SteamNetConnectionRealTimeStatus_t pQuickStatus) { 133 | InteropHelp.TestIfAvailableClient(); 134 | return NativeMethods.ISteamNetworkingMessages_GetSessionConnectionInfo(CSteamAPIContext.GetSteamNetworkingMessages(), ref identityRemote, out pConnectionInfo, out pQuickStatus); 135 | } 136 | } 137 | } 138 | 139 | #endif // !DISABLESTEAMWORKS 140 | -------------------------------------------------------------------------------- /Source/types/SteamClientPublic/CSteamID.cs: -------------------------------------------------------------------------------- 1 | // This file is provided under The MIT License as part of Steamworks.NET. 2 | // Copyright (c) 2013-2022 Riley Labrecque 3 | // Please see the included LICENSE.txt for additional information. 4 | 5 | // This file is automatically generated. 6 | // Changes to this file will be reverted when you update Steamworks.NET 7 | 8 | #if !(UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX || UNITY_STANDALONE_OSX || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX) 9 | #define DISABLESTEAMWORKS 10 | #endif 11 | 12 | #if !DISABLESTEAMWORKS 13 | 14 | using System.Runtime.InteropServices; 15 | using IntPtr = System.IntPtr; 16 | 17 | namespace Steamworks { 18 | [System.Serializable] 19 | [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 4)] 20 | public struct CSteamID : System.IEquatable, System.IComparable { 21 | public static readonly CSteamID Nil = new CSteamID(); 22 | public static readonly CSteamID OutofDateGS = new CSteamID(new AccountID_t(0), 0, EUniverse.k_EUniverseInvalid, EAccountType.k_EAccountTypeInvalid); 23 | public static readonly CSteamID LanModeGS = new CSteamID(new AccountID_t(0), 0, EUniverse.k_EUniversePublic, EAccountType.k_EAccountTypeInvalid); 24 | public static readonly CSteamID NotInitYetGS = new CSteamID(new AccountID_t(1), 0, EUniverse.k_EUniverseInvalid, EAccountType.k_EAccountTypeInvalid); 25 | public static readonly CSteamID NonSteamGS = new CSteamID(new AccountID_t(2), 0, EUniverse.k_EUniverseInvalid, EAccountType.k_EAccountTypeInvalid); 26 | public ulong m_SteamID; 27 | 28 | public CSteamID(AccountID_t unAccountID, EUniverse eUniverse, EAccountType eAccountType) { 29 | m_SteamID = 0; 30 | Set(unAccountID, eUniverse, eAccountType); 31 | } 32 | 33 | public CSteamID(AccountID_t unAccountID, uint unAccountInstance, EUniverse eUniverse, EAccountType eAccountType) { 34 | m_SteamID = 0; 35 | #if _SERVER && Assert 36 | Assert( ! ( ( EAccountType.k_EAccountTypeIndividual == eAccountType ) && ( unAccountInstance > k_unSteamUserWebInstance ) ) ); // enforce that for individual accounts, instance is always 1 37 | #endif // _SERVER 38 | InstancedSet(unAccountID, unAccountInstance, eUniverse, eAccountType); 39 | } 40 | 41 | public CSteamID(ulong ulSteamID) { 42 | m_SteamID = ulSteamID; 43 | } 44 | 45 | public void Set(AccountID_t unAccountID, EUniverse eUniverse, EAccountType eAccountType) { 46 | SetAccountID(unAccountID); 47 | SetEUniverse(eUniverse); 48 | SetEAccountType(eAccountType); 49 | 50 | if (eAccountType == EAccountType.k_EAccountTypeClan || eAccountType == EAccountType.k_EAccountTypeGameServer) { 51 | SetAccountInstance(0); 52 | } 53 | else { 54 | SetAccountInstance(Constants.k_unSteamUserDefaultInstance); 55 | } 56 | } 57 | 58 | public void InstancedSet(AccountID_t unAccountID, uint unInstance, EUniverse eUniverse, EAccountType eAccountType) { 59 | SetAccountID(unAccountID); 60 | SetEUniverse(eUniverse); 61 | SetEAccountType(eAccountType); 62 | SetAccountInstance(unInstance); 63 | } 64 | 65 | public void Clear() { 66 | m_SteamID = 0; 67 | } 68 | 69 | public void CreateBlankAnonLogon(EUniverse eUniverse) { 70 | SetAccountID(new AccountID_t(0)); 71 | SetEUniverse(eUniverse); 72 | SetEAccountType(EAccountType.k_EAccountTypeAnonGameServer); 73 | SetAccountInstance(0); 74 | } 75 | 76 | public void CreateBlankAnonUserLogon(EUniverse eUniverse) { 77 | SetAccountID(new AccountID_t(0)); 78 | SetEUniverse(eUniverse); 79 | SetEAccountType(EAccountType.k_EAccountTypeAnonUser); 80 | SetAccountInstance(0); 81 | } 82 | 83 | //----------------------------------------------------------------------------- 84 | // Purpose: Is this an anonymous game server login that will be filled in? 85 | //----------------------------------------------------------------------------- 86 | public bool BBlankAnonAccount() { 87 | return GetAccountID() == new AccountID_t(0) && BAnonAccount() && GetUnAccountInstance() == 0; 88 | } 89 | 90 | //----------------------------------------------------------------------------- 91 | // Purpose: Is this a game server account id? (Either persistent or anonymous) 92 | //----------------------------------------------------------------------------- 93 | public bool BGameServerAccount() { 94 | return GetEAccountType() == EAccountType.k_EAccountTypeGameServer || GetEAccountType() == EAccountType.k_EAccountTypeAnonGameServer; 95 | } 96 | 97 | //----------------------------------------------------------------------------- 98 | // Purpose: Is this a persistent (not anonymous) game server account id? 99 | //----------------------------------------------------------------------------- 100 | public bool BPersistentGameServerAccount() { 101 | return GetEAccountType() == EAccountType.k_EAccountTypeGameServer; 102 | } 103 | 104 | //----------------------------------------------------------------------------- 105 | // Purpose: Is this an anonymous game server account id? 106 | //----------------------------------------------------------------------------- 107 | public bool BAnonGameServerAccount() { 108 | return GetEAccountType() == EAccountType.k_EAccountTypeAnonGameServer; 109 | } 110 | 111 | //----------------------------------------------------------------------------- 112 | // Purpose: Is this a content server account id? 113 | //----------------------------------------------------------------------------- 114 | public bool BContentServerAccount() { 115 | return GetEAccountType() == EAccountType.k_EAccountTypeContentServer; 116 | } 117 | 118 | 119 | //----------------------------------------------------------------------------- 120 | // Purpose: Is this a clan account id? 121 | //----------------------------------------------------------------------------- 122 | public bool BClanAccount() { 123 | return GetEAccountType() == EAccountType.k_EAccountTypeClan; 124 | } 125 | 126 | 127 | //----------------------------------------------------------------------------- 128 | // Purpose: Is this a chat account id? 129 | //----------------------------------------------------------------------------- 130 | public bool BChatAccount() { 131 | return GetEAccountType() == EAccountType.k_EAccountTypeChat; 132 | } 133 | 134 | //----------------------------------------------------------------------------- 135 | // Purpose: Is this a chat account id? 136 | //----------------------------------------------------------------------------- 137 | public bool IsLobby() { 138 | return (GetEAccountType() == EAccountType.k_EAccountTypeChat) 139 | && (GetUnAccountInstance() & (int)EChatSteamIDInstanceFlags.k_EChatInstanceFlagLobby) != 0; 140 | } 141 | 142 | 143 | //----------------------------------------------------------------------------- 144 | // Purpose: Is this an individual user account id? 145 | //----------------------------------------------------------------------------- 146 | public bool BIndividualAccount() { 147 | return GetEAccountType() == EAccountType.k_EAccountTypeIndividual || GetEAccountType() == EAccountType.k_EAccountTypeConsoleUser; 148 | } 149 | 150 | 151 | //----------------------------------------------------------------------------- 152 | // Purpose: Is this an anonymous account? 153 | //----------------------------------------------------------------------------- 154 | public bool BAnonAccount() { 155 | return GetEAccountType() == EAccountType.k_EAccountTypeAnonUser || GetEAccountType() == EAccountType.k_EAccountTypeAnonGameServer; 156 | } 157 | 158 | //----------------------------------------------------------------------------- 159 | // Purpose: Is this an anonymous user account? ( used to create an account or reset a password ) 160 | //----------------------------------------------------------------------------- 161 | public bool BAnonUserAccount() { 162 | return GetEAccountType() == EAccountType.k_EAccountTypeAnonUser; 163 | } 164 | 165 | //----------------------------------------------------------------------------- 166 | // Purpose: Is this a faked up Steam ID for a PSN friend account? 167 | //----------------------------------------------------------------------------- 168 | public bool BConsoleUserAccount() { 169 | return GetEAccountType() == EAccountType.k_EAccountTypeConsoleUser; 170 | } 171 | 172 | public void SetAccountID(AccountID_t other) { 173 | m_SteamID = (m_SteamID & ~(0xFFFFFFFFul << (ushort)0)) | (((ulong)(other) & 0xFFFFFFFFul) << (ushort)0); 174 | } 175 | 176 | public void SetAccountInstance(uint other) { 177 | m_SteamID = (m_SteamID & ~(0xFFFFFul << (ushort)32)) | (((ulong)(other) & 0xFFFFFul) << (ushort)32); 178 | } 179 | 180 | // This is a non standard/custom function not found in C++ Steamworks 181 | public void SetEAccountType(EAccountType other) { 182 | m_SteamID = (m_SteamID & ~(0xFul << (ushort)52)) | (((ulong)(other) & 0xFul) << (ushort)52); 183 | } 184 | 185 | public void SetEUniverse(EUniverse other) { 186 | m_SteamID = (m_SteamID & ~(0xFFul << (ushort)56)) | (((ulong)(other) & 0xFFul) << (ushort)56); 187 | } 188 | 189 | public AccountID_t GetAccountID() { 190 | return new AccountID_t((uint)(m_SteamID & 0xFFFFFFFFul)); 191 | } 192 | 193 | public uint GetUnAccountInstance() { 194 | return (uint)((m_SteamID >> 32) & 0xFFFFFul); 195 | } 196 | 197 | public EAccountType GetEAccountType() { 198 | return (EAccountType)((m_SteamID >> 52) & 0xFul); 199 | } 200 | 201 | public EUniverse GetEUniverse() { 202 | return (EUniverse)((m_SteamID >> 56) & 0xFFul); 203 | } 204 | 205 | public bool IsValid() { 206 | if (GetEAccountType() <= EAccountType.k_EAccountTypeInvalid || GetEAccountType() >= EAccountType.k_EAccountTypeMax) 207 | return false; 208 | 209 | if (GetEUniverse() <= EUniverse.k_EUniverseInvalid || GetEUniverse() >= EUniverse.k_EUniverseMax) 210 | return false; 211 | 212 | if (GetEAccountType() == EAccountType.k_EAccountTypeIndividual) { 213 | if (GetAccountID() == new AccountID_t(0) || GetUnAccountInstance() > Constants.k_unSteamUserDefaultInstance) 214 | return false; 215 | } 216 | 217 | if (GetEAccountType() == EAccountType.k_EAccountTypeClan) { 218 | if (GetAccountID() == new AccountID_t(0) || GetUnAccountInstance() != 0) 219 | return false; 220 | } 221 | 222 | if (GetEAccountType() == EAccountType.k_EAccountTypeGameServer) { 223 | if (GetAccountID() == new AccountID_t(0)) 224 | return false; 225 | // Any limit on instances? We use them for local users and bots 226 | } 227 | return true; 228 | } 229 | 230 | #region Overrides 231 | public override string ToString() { 232 | return m_SteamID.ToString(); 233 | } 234 | 235 | public override bool Equals(object other) { 236 | return other is CSteamID && this == (CSteamID)other; 237 | } 238 | 239 | public override int GetHashCode() { 240 | return m_SteamID.GetHashCode(); 241 | } 242 | 243 | public static bool operator ==(CSteamID x, CSteamID y) { 244 | return x.m_SteamID == y.m_SteamID; 245 | } 246 | 247 | public static bool operator !=(CSteamID x, CSteamID y) { 248 | return !(x == y); 249 | } 250 | 251 | public static explicit operator CSteamID(ulong value) { 252 | return new CSteamID(value); 253 | } 254 | public static explicit operator ulong(CSteamID that) { 255 | return that.m_SteamID; 256 | } 257 | 258 | public bool Equals(CSteamID other) { 259 | return m_SteamID == other.m_SteamID; 260 | } 261 | 262 | public int CompareTo(CSteamID other) { 263 | return m_SteamID.CompareTo(other.m_SteamID); 264 | } 265 | #endregion 266 | } 267 | } 268 | 269 | #endif // !DISABLESTEAMWORKS 270 | --------------------------------------------------------------------------------