mirror of
https://github.com/EpicMorg/SteamPathsLib.git
synced 2025-03-04 01:15:22 +03:00
fix load appmanifest data if invalid acf
fix load appmanifest data if invalid acf
This commit is contained in:
parent
16878cbb32
commit
e9dc3f0c72
@ -137,23 +137,29 @@ namespace EpicMorg.SteamPathsLib {
|
||||
var files = new DirectoryInfo(path).GetFiles("appmanifest_*.acf");
|
||||
|
||||
foreach (var file in files) {
|
||||
var appData = new SteamAppManifestData();
|
||||
dynamic appManifestObject = VdfConvert.Deserialize(File.ReadAllText(file.FullName)).Value;
|
||||
try {
|
||||
var appData = new SteamAppManifestData();
|
||||
dynamic appManifestObject = VdfConvert.Deserialize(File.ReadAllText(file.FullName)).Value;
|
||||
|
||||
appData.AppId = Convert.ToInt32(appManifestObject.appid.Value);
|
||||
appData.Name = appManifestObject.name.Value;
|
||||
appData.InstallDir = appManifestObject.installdir.Value;
|
||||
appData.AppId = Convert.ToInt32(appManifestObject.appid.Value);
|
||||
appData.Name = appManifestObject.name.Value;
|
||||
appData.InstallDir = appManifestObject.installdir.Value;
|
||||
|
||||
appData.Path = Path.Combine(path, "common", appData.InstallDir);
|
||||
appData.Path = Path.Combine(path, "common", appData.InstallDir);
|
||||
|
||||
libraryData.AppManifestDataList.Add(appData);
|
||||
libraryData.AppManifestDataList.Add(appData);
|
||||
} catch (Exception e) {
|
||||
Console.WriteLine(e);
|
||||
}
|
||||
}
|
||||
|
||||
result.Add(libraryData);
|
||||
}
|
||||
|
||||
return result;
|
||||
} catch (Exception) {
|
||||
} catch (Exception e) {
|
||||
Console.WriteLine(e);
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user