mirror of
https://github.com/HolographicHat/Yae.git
synced 2025-12-06 14:42:52 +08:00
fix #2471
This commit is contained in:
@@ -30,7 +30,11 @@ internal static class Program {
|
||||
#endif
|
||||
options.TracesSampleRate = 1.0;
|
||||
options.AutoSessionTracking = true;
|
||||
options.SetBeforeSend(e => {
|
||||
options.SetBeforeSend(static e => {
|
||||
e.Release = GlobalVars.AppVersionName;
|
||||
return e;
|
||||
});
|
||||
options.SetBeforeSendTransaction(static e => {
|
||||
e.Release = GlobalVars.AppVersionName;
|
||||
return e;
|
||||
});
|
||||
|
||||
@@ -160,7 +160,11 @@ public static class Utils {
|
||||
internal static void CheckGenshinIsRunning() {
|
||||
// QueryProcessEvent?
|
||||
var appdata = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
|
||||
foreach (var path in Directory.EnumerateDirectories($"{appdata}/../LocalLow/miHoYo").Where(p => File.Exists($"{p}/info.txt"))) {
|
||||
var dataPath = $"{appdata}/../LocalLow/miHoYo";
|
||||
if (!Directory.Exists(dataPath)) {
|
||||
return;
|
||||
}
|
||||
foreach (var path in Directory.EnumerateDirectories(dataPath).Where(p => File.Exists($"{p}/info.txt"))) {
|
||||
try {
|
||||
using var handle = File.OpenHandle($"{path}/output_log.txt", share: FileShare.None, mode: FileMode.OpenOrCreate);
|
||||
} catch (IOException) {
|
||||
|
||||
Reference in New Issue
Block a user