mirror of
https://github.com/EpicMorg/SteamPathsLib.git
synced 2025-03-04 09:25:23 +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");
|
var files = new DirectoryInfo(path).GetFiles("appmanifest_*.acf");
|
||||||
|
|
||||||
foreach (var file in files) {
|
foreach (var file in files) {
|
||||||
var appData = new SteamAppManifestData();
|
try {
|
||||||
dynamic appManifestObject = VdfConvert.Deserialize(File.ReadAllText(file.FullName)).Value;
|
var appData = new SteamAppManifestData();
|
||||||
|
dynamic appManifestObject = VdfConvert.Deserialize(File.ReadAllText(file.FullName)).Value;
|
||||||
|
|
||||||
appData.AppId = Convert.ToInt32(appManifestObject.appid.Value);
|
appData.AppId = Convert.ToInt32(appManifestObject.appid.Value);
|
||||||
appData.Name = appManifestObject.name.Value;
|
appData.Name = appManifestObject.name.Value;
|
||||||
appData.InstallDir = appManifestObject.installdir.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);
|
result.Add(libraryData);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
} catch (Exception) {
|
} catch (Exception e) {
|
||||||
|
Console.WriteLine(e);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user