-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathDoomEternal.cs
47 lines (40 loc) · 2.09 KB
/
DoomEternal.cs
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using System.Reflection.Emit;
using Org.BouncyCastle.Cms;
using Org.BouncyCastle.Crypto.Engines;
namespace DOOMSaveManager
{
public class DoomEternal
{
public const string GameName = "Doom Eternal";
public const int SteamGameID = 782330;
public static string SteamSavePath = "";
public static string BnetSavePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Saved Games", "id Software", "DOOMEternal", "base", "savegame");
public static DoomEternalSavePathCollection Saves;
public static void EnumerateSaves() {
Saves = new DoomEternalSavePathCollection();
if (Directory.Exists(BnetSavePath)) {
Saves.Add(new DoomEternalSavePath("savegame.unencrypted", DoomEternalSavePlatform.BethesdaNet, false));
foreach (var single in Directory.GetDirectories(BnetSavePath, "*.*", SearchOption.TopDirectoryOnly)) {
if (Utilities.CheckUUID(Path.GetFileNameWithoutExtension(single)))
Saves.Add(new DoomEternalSavePath(Path.GetFileNameWithoutExtension(single), DoomEternalSavePlatform.BethesdaNet));
}
}
string steamPath = Utilities.GetSteamPath();
if (!string.IsNullOrEmpty(steamPath)) {
SteamSavePath = Path.Combine(steamPath, "userdata");
if (Directory.Exists(SteamSavePath)) {
foreach (var steamId3 in Directory.GetDirectories(SteamSavePath, "*.*", SearchOption.TopDirectoryOnly)) {
foreach (var single in Directory.GetDirectories(steamId3, "*.*", SearchOption.TopDirectoryOnly)) {
if (Path.GetFileNameWithoutExtension(single) == SteamGameID.ToString())
Saves.Add(new DoomEternalSavePath(Utilities.Id3ToId64(Path.GetFileNameWithoutExtension(steamId3)), DoomEternalSavePlatform.Steam));
}
}
}
}
}
}
}