-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSteamLibraryFolder.cs
More file actions
26 lines (22 loc) · 920 Bytes
/
Copy pathSteamLibraryFolder.cs
File metadata and controls
26 lines (22 loc) · 920 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System.Collections.Generic;
using System.IO;
using Gameloop.Vdf;
namespace UnityModStudio.Steam;
public class SteamLibraryFolder(string path)
{
public string Path { get; set; } = path;
public HashSet<uint> InstalledAppIds { get; } = [];
public SteamAppInfo? FindApplication(uint appId)
{
var acfFilePath = System.IO.Path.Combine(Path, $@"steamapps\appmanifest_{appId}.acf");
if (!File.Exists(acfFilePath))
return null;
using var reader = new StreamReader(acfFilePath);
var vdf = VdfConvert.Deserialize(reader);
var name = vdf.Value.Value<string>("name");
var installDir = vdf.Value.Value<string>("installdir");
return new SteamAppInfo(appId, name,
System.IO.Path.Combine(Path, @"steamapps\common", installDir),
System.IO.Path.Combine(Path, @"steamapps\workshop\content", appId.ToString()));
}
}