// This file is provided under The MIT License as part of Steamworks.NET. // Copyright (c) 2013-2019 Riley Labrecque // Please see the included LICENSE.txt for additional information. // This file is automatically generated. // Changes to this file will be reverted when you update Steamworks.NET #if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH #define DISABLESTEAMWORKS #endif #if !DISABLESTEAMWORKS using System.Runtime.InteropServices; using IntPtr = System.IntPtr; namespace Steamworks { public static class SteamClient { /// /// Creates a communication pipe to the Steam client. /// NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling /// public static HSteamPipe CreateSteamPipe() { InteropHelp.TestIfAvailableClient(); return (HSteamPipe)NativeMethods.ISteamClient_CreateSteamPipe(CSteamAPIContext.GetSteamClient()); } /// /// Releases a previously created communications pipe /// NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling /// public static bool BReleaseSteamPipe(HSteamPipe hSteamPipe) { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamClient_BReleaseSteamPipe(CSteamAPIContext.GetSteamClient(), hSteamPipe); } /// /// connects to an existing global user, failing if none exists /// used by the game to coordinate with the steamUI /// NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling /// public static HSteamUser ConnectToGlobalUser(HSteamPipe hSteamPipe) { InteropHelp.TestIfAvailableClient(); return (HSteamUser)NativeMethods.ISteamClient_ConnectToGlobalUser(CSteamAPIContext.GetSteamClient(), hSteamPipe); } /// /// used by game servers, create a steam user that won't be shared with anyone else /// NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling /// public static HSteamUser CreateLocalUser(out HSteamPipe phSteamPipe, EAccountType eAccountType) { InteropHelp.TestIfAvailableClient(); return (HSteamUser)NativeMethods.ISteamClient_CreateLocalUser(CSteamAPIContext.GetSteamClient(), out phSteamPipe, eAccountType); } /// /// removes an allocated user /// NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling /// public static void ReleaseUser(HSteamPipe hSteamPipe, HSteamUser hUser) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamClient_ReleaseUser(CSteamAPIContext.GetSteamClient(), hSteamPipe, hUser); } /// /// retrieves the ISteamUser interface associated with the handle /// public static IntPtr GetISteamUser(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamUser(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } /// /// retrieves the ISteamGameServer interface associated with the handle /// public static IntPtr GetISteamGameServer(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamGameServer(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } /// /// set the local IP and Port to bind to /// this must be set before CreateLocalUser() /// public static void SetLocalIPBinding(uint unIP, ushort usPort) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamClient_SetLocalIPBinding(CSteamAPIContext.GetSteamClient(), unIP, usPort); } /// /// returns the ISteamFriends interface /// public static IntPtr GetISteamFriends(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamFriends(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } /// /// returns the ISteamUtils interface /// public static IntPtr GetISteamUtils(HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamUtils(CSteamAPIContext.GetSteamClient(), hSteamPipe, pchVersion2); } } /// /// returns the ISteamMatchmaking interface /// public static IntPtr GetISteamMatchmaking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamMatchmaking(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } /// /// returns the ISteamMatchmakingServers interface /// public static IntPtr GetISteamMatchmakingServers(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamMatchmakingServers(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } /// /// returns the a generic interface /// public static IntPtr GetISteamGenericInterface(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamGenericInterface(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } /// /// returns the ISteamUserStats interface /// public static IntPtr GetISteamUserStats(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamUserStats(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } /// /// returns the ISteamGameServerStats interface /// public static IntPtr GetISteamGameServerStats(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamGameServerStats(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } /// /// returns apps interface /// public static IntPtr GetISteamApps(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamApps(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } /// /// networking /// public static IntPtr GetISteamNetworking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamNetworking(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } /// /// remote storage /// public static IntPtr GetISteamRemoteStorage(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamRemoteStorage(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } /// /// user screenshots /// public static IntPtr GetISteamScreenshots(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamScreenshots(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } /// /// game search /// public static IntPtr GetISteamGameSearch(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamGameSearch(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } /// /// returns the number of IPC calls made since the last time this function was called /// Used for perf debugging so you can understand how many IPC calls your game makes per frame /// Every IPC call is at minimum a thread context switch if not a process one so you want to rate /// control how often you do them. /// public static uint GetIPCCallCount() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamClient_GetIPCCallCount(CSteamAPIContext.GetSteamClient()); } /// /// API warning handling /// 'int' is the severity; 0 for msg, 1 for warning /// 'const char *' is the text of the message /// callbacks will occur directly after the API function is called that generated the warning or message. /// public static void SetWarningMessageHook(SteamAPIWarningMessageHook_t pFunction) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamClient_SetWarningMessageHook(CSteamAPIContext.GetSteamClient(), pFunction); } /// /// Trigger global shutdown for the DLL /// public static bool BShutdownIfAllPipesClosed() { InteropHelp.TestIfAvailableClient(); return NativeMethods.ISteamClient_BShutdownIfAllPipesClosed(CSteamAPIContext.GetSteamClient()); } /// /// Expose HTTP interface /// public static IntPtr GetISteamHTTP(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamHTTP(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } /// /// Exposes the ISteamController interface - deprecated in favor of Steam Input /// public static IntPtr GetISteamController(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamController(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } /// /// Exposes the ISteamUGC interface /// public static IntPtr GetISteamUGC(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamUGC(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } /// /// returns app list interface, only available on specially registered apps /// public static IntPtr GetISteamAppList(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamAppList(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } /// /// Music Player /// public static IntPtr GetISteamMusic(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamMusic(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } /// /// Music Player Remote /// public static IntPtr GetISteamMusicRemote(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamMusicRemote(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } /// /// html page display /// public static IntPtr GetISteamHTMLSurface(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamHTMLSurface(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } /// /// inventory /// public static IntPtr GetISteamInventory(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamInventory(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } /// /// Video /// public static IntPtr GetISteamVideo(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamVideo(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } /// /// Parental controls /// public static IntPtr GetISteamParentalSettings(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamParentalSettings(CSteamAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } /// /// Exposes the Steam Input interface for controller support /// public static IntPtr GetISteamInput(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamInput(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } /// /// Steam Parties interface /// public static IntPtr GetISteamParties(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamParties(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } /// /// Steam Remote Play interface /// public static IntPtr GetISteamRemotePlay(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableClient(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamRemotePlay(CSteamAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } } } #endif // !DISABLESTEAMWORKS