isteamapplist.cs (2490B)
1 // This file is provided under The MIT License as part of Steamworks.NET. 2 // Copyright (c) 2013-2019 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_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH 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 /// <summary> 30 /// <para> returns -1 if no name was found</para> 31 /// </summary> 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 /// <summary> 42 /// <para> returns -1 if no dir was found</para> 43 /// </summary> 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 /// <summary> 54 /// <para> return the buildid of this app, may change at any time based on backend updates to the game</para> 55 /// </summary> 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