mirror of
https://github.com/HolographicHat/Yae.git
synced 2025-12-18 20:33:19 +08:00
Merge branch 'master' into master
This commit is contained in:
@@ -29,33 +29,31 @@ new EventLog("AppInit") {
|
|||||||
{ "SystemVersion", DeviceHelper.GetSystemVersion() }
|
{ "SystemVersion", DeviceHelper.GetSystemVersion() }
|
||||||
}
|
}
|
||||||
}.Enqueue();
|
}.Enqueue();
|
||||||
var usePreviousData = false;
|
|
||||||
var historyCache = new CacheFile("ExportData");
|
var historyCache = new CacheFile("ExportData");
|
||||||
if (historyCache.LastWriteTime.AddMinutes(60) > DateTime.UtcNow) {
|
|
||||||
|
AchievementAllDataNotify? data = null;
|
||||||
|
try {
|
||||||
|
data = AchievementAllDataNotify.Parser.ParseFrom(historyCache.Read().Content);
|
||||||
|
} catch (Exception) { /* ignored */ }
|
||||||
|
|
||||||
|
if (historyCache.LastWriteTime.AddMinutes(60) > DateTime.UtcNow && data != null) {
|
||||||
Console.WriteLine(App.UsePreviousData);
|
Console.WriteLine(App.UsePreviousData);
|
||||||
var text = Console.ReadLine();
|
var text = Console.ReadLine();
|
||||||
if (text != null) {
|
if (text != null) {
|
||||||
text = text.ToUpper();
|
text = text.ToUpper();
|
||||||
usePreviousData = (text == "Y" || text == "YES");
|
if (text == "Y" || text == "YES") {
|
||||||
|
Export.Choose(data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Export:
|
|
||||||
if(usePreviousData) {
|
StartAndWaitResult(AppConfig.GamePath, str => {
|
||||||
AchievementAllDataNotify data;
|
GlobalVars.UnexpectedExit = false;
|
||||||
try {
|
var bytes = Convert.FromBase64String(str);
|
||||||
data = AchievementAllDataNotify.Parser.ParseFrom(historyCache.Read().Content);
|
var list = AchievementAllDataNotify.Parser.ParseFrom(bytes);
|
||||||
} catch (Exception) {
|
historyCache.Write(bytes);
|
||||||
usePreviousData = false;
|
Export.Choose(list);
|
||||||
goto Export;
|
return true;
|
||||||
}
|
});
|
||||||
Export.Choose(data);
|
|
||||||
} else {
|
|
||||||
StartAndWaitResult(AppConfig.GamePath, str => {
|
|
||||||
GlobalVars.UnexpectedExit = false;
|
|
||||||
var data = Convert.FromBase64String(str);
|
|
||||||
var list = AchievementAllDataNotify.Parser.ParseFrom(data);
|
|
||||||
historyCache.Write(data);
|
|
||||||
Export.Choose(list);
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user