// This file is provided under The MIT License as part of Steamworks.NET. // Copyright (c) 2013-2019 Riley Labrecque // Please see the included LICENSE.txt for additional information. // This file is automatically generated. // Changes to this file will be reverted when you update Steamworks.NET #if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH #define DISABLESTEAMWORKS #endif #if !DISABLESTEAMWORKS using System.Runtime.InteropServices; using IntPtr = System.IntPtr; namespace Steamworks { public static class SteamGameServerClient { /// /// 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.TestIfAvailableGameServer(); return (HSteamPipe)NativeMethods.ISteamClient_CreateSteamPipe(CSteamGameServerAPIContext.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.TestIfAvailableGameServer(); return NativeMethods.ISteamClient_BReleaseSteamPipe(CSteamGameServerAPIContext.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.TestIfAvailableGameServer(); return (HSteamUser)NativeMethods.ISteamClient_ConnectToGlobalUser(CSteamGameServerAPIContext.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.TestIfAvailableGameServer(); return (HSteamUser)NativeMethods.ISteamClient_CreateLocalUser(CSteamGameServerAPIContext.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.TestIfAvailableGameServer(); NativeMethods.ISteamClient_ReleaseUser(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe, hUser); } /// /// retrieves the ISteamUser interface associated with the handle /// public static IntPtr GetISteamUser(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamUser(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } /// /// retrieves the ISteamGameServer interface associated with the handle /// public static IntPtr GetISteamGameServer(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamGameServer(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } /// /// set the local IP and Port to bind to /// this must be set before CreateLocalUser() /// public static void SetLocalIPBinding(uint unIP, ushort usPort) { InteropHelp.TestIfAvailableGameServer(); NativeMethods.ISteamClient_SetLocalIPBinding(CSteamGameServerAPIContext.GetSteamClient(), unIP, usPort); } /// /// returns the ISteamFriends interface /// public static IntPtr GetISteamFriends(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamFriends(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } /// /// returns the ISteamUtils interface /// public static IntPtr GetISteamUtils(HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamUtils(CSteamGameServerAPIContext.GetSteamClient(), hSteamPipe, pchVersion2); } } /// /// returns the ISteamMatchmaking interface /// public static IntPtr GetISteamMatchmaking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamMatchmaking(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } /// /// returns the ISteamMatchmakingServers interface /// public static IntPtr GetISteamMatchmakingServers(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamMatchmakingServers(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } /// /// returns the a generic interface /// public static IntPtr GetISteamGenericInterface(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamGenericInterface(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } /// /// returns the ISteamUserStats interface /// public static IntPtr GetISteamUserStats(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamUserStats(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } /// /// returns the ISteamGameServerStats interface /// public static IntPtr GetISteamGameServerStats(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamGameServerStats(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } /// /// returns apps interface /// public static IntPtr GetISteamApps(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamApps(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } /// /// networking /// public static IntPtr GetISteamNetworking(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamNetworking(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } /// /// remote storage /// public static IntPtr GetISteamRemoteStorage(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamRemoteStorage(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } /// /// user screenshots /// public static IntPtr GetISteamScreenshots(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamScreenshots(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } /// /// game search /// public static IntPtr GetISteamGameSearch(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamGameSearch(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } /// /// 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.TestIfAvailableGameServer(); return NativeMethods.ISteamClient_GetIPCCallCount(CSteamGameServerAPIContext.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.TestIfAvailableGameServer(); NativeMethods.ISteamClient_SetWarningMessageHook(CSteamGameServerAPIContext.GetSteamClient(), pFunction); } /// /// Trigger global shutdown for the DLL /// public static bool BShutdownIfAllPipesClosed() { InteropHelp.TestIfAvailableGameServer(); return NativeMethods.ISteamClient_BShutdownIfAllPipesClosed(CSteamGameServerAPIContext.GetSteamClient()); } /// /// Expose HTTP interface /// public static IntPtr GetISteamHTTP(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamHTTP(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } /// /// Exposes the ISteamController interface - deprecated in favor of Steam Input /// public static IntPtr GetISteamController(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamController(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } /// /// Exposes the ISteamUGC interface /// public static IntPtr GetISteamUGC(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamUGC(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } /// /// returns app list interface, only available on specially registered apps /// public static IntPtr GetISteamAppList(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamAppList(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } /// /// Music Player /// public static IntPtr GetISteamMusic(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamMusic(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } /// /// Music Player Remote /// public static IntPtr GetISteamMusicRemote(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamMusicRemote(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } /// /// html page display /// public static IntPtr GetISteamHTMLSurface(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamHTMLSurface(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } /// /// inventory /// public static IntPtr GetISteamInventory(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamInventory(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } /// /// Video /// public static IntPtr GetISteamVideo(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamVideo(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } /// /// Parental controls /// public static IntPtr GetISteamParentalSettings(HSteamUser hSteamuser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamParentalSettings(CSteamGameServerAPIContext.GetSteamClient(), hSteamuser, hSteamPipe, pchVersion2); } } /// /// Exposes the Steam Input interface for controller support /// public static IntPtr GetISteamInput(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamInput(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } /// /// Steam Parties interface /// public static IntPtr GetISteamParties(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamParties(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } /// /// Steam Remote Play interface /// public static IntPtr GetISteamRemotePlay(HSteamUser hSteamUser, HSteamPipe hSteamPipe, string pchVersion) { InteropHelp.TestIfAvailableGameServer(); using (var pchVersion2 = new InteropHelp.UTF8StringHandle(pchVersion)) { return NativeMethods.ISteamClient_GetISteamRemotePlay(CSteamGameServerAPIContext.GetSteamClient(), hSteamUser, hSteamPipe, pchVersion2); } } } } #endif // !DISABLESTEAMWORKS