From 0e63c4a2c6dec8dfa260501fb7d73750261ea7b7 Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Sat, 25 Nov 2023 18:39:02 +0800 Subject: + init --- Assembly_Firstpass/Steamworks/SteamAppList.cs | 45 +++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Assembly_Firstpass/Steamworks/SteamAppList.cs (limited to 'Assembly_Firstpass/Steamworks/SteamAppList.cs') diff --git a/Assembly_Firstpass/Steamworks/SteamAppList.cs b/Assembly_Firstpass/Steamworks/SteamAppList.cs new file mode 100644 index 0000000..fcdfb7f --- /dev/null +++ b/Assembly_Firstpass/Steamworks/SteamAppList.cs @@ -0,0 +1,45 @@ +using System; +using System.Runtime.InteropServices; + +namespace Steamworks; + +public static class SteamAppList +{ + public static uint GetNumInstalledApps() + { + InteropHelp.TestIfAvailableClient(); + return NativeMethods.ISteamAppList_GetNumInstalledApps(CSteamAPIContext.GetSteamAppList()); + } + + public static uint GetInstalledApps(AppId_t[] pvecAppID, uint unMaxAppIDs) + { + InteropHelp.TestIfAvailableClient(); + return NativeMethods.ISteamAppList_GetInstalledApps(CSteamAPIContext.GetSteamAppList(), pvecAppID, unMaxAppIDs); + } + + public static int GetAppName(AppId_t nAppID, out string pchName, int cchNameMax) + { + InteropHelp.TestIfAvailableClient(); + IntPtr intPtr = Marshal.AllocHGlobal(cchNameMax); + int num = NativeMethods.ISteamAppList_GetAppName(CSteamAPIContext.GetSteamAppList(), nAppID, intPtr, cchNameMax); + pchName = ((num != -1) ? InteropHelp.PtrToStringUTF8(intPtr) : null); + Marshal.FreeHGlobal(intPtr); + return num; + } + + public static int GetAppInstallDir(AppId_t nAppID, out string pchDirectory, int cchNameMax) + { + InteropHelp.TestIfAvailableClient(); + IntPtr intPtr = Marshal.AllocHGlobal(cchNameMax); + int num = NativeMethods.ISteamAppList_GetAppInstallDir(CSteamAPIContext.GetSteamAppList(), nAppID, intPtr, cchNameMax); + pchDirectory = ((num != -1) ? InteropHelp.PtrToStringUTF8(intPtr) : null); + Marshal.FreeHGlobal(intPtr); + return num; + } + + public static int GetAppBuildId(AppId_t nAppID) + { + InteropHelp.TestIfAvailableClient(); + return NativeMethods.ISteamAppList_GetAppBuildId(CSteamAPIContext.GetSteamAppList(), nAppID); + } +} -- cgit v1.1-26-g67d0