mirror of
https://github.com/sp-tarkov/launcher.git
synced 2025-02-13 08:50:43 -05:00
Fix: Copying Logs (!65)
only try to copy logs that exist Co-authored-by: Dev <dev@dev.sp-tarkov.com> Co-authored-by: CWX <cwxdev@outlook.com> Reviewed-on: SPT/Launcher#65 Co-authored-by: waffle.lord <waffle.lord@hotmail.com> Co-committed-by: waffle.lord <waffle.lord@hotmail.com>
This commit is contained in:
parent
6172c800fc
commit
3321146d7b
@ -19,7 +19,7 @@ git config --local user.email "USERNAME@SOMETHING.com"
|
|||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- Escape From Tarkov 30626
|
- Escape From Tarkov 31124
|
||||||
- .NET 8 SDK
|
- .NET 8 SDK
|
||||||
- Visual Studio Code
|
- Visual Studio Code
|
||||||
- [PowerShell v7](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows)
|
- [PowerShell v7](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows)
|
||||||
|
@ -223,7 +223,7 @@ namespace SPT.Launcher
|
|||||||
LogManager.Instance.Info($"[LaunchGame] spt-core.dll version: {dllVersion}");
|
LogManager.Instance.Info($"[LaunchGame] spt-core.dll version: {dllVersion}");
|
||||||
|
|
||||||
// Edge case, running on locally built modules dlls, ignore check and return ok
|
// Edge case, running on locally built modules dlls, ignore check and return ok
|
||||||
if (dllVersion.Major == 0) return false;
|
if (dllVersion.Major == 1) return false;
|
||||||
|
|
||||||
// check 'X'.x.x
|
// check 'X'.x.x
|
||||||
if (serverVersion.Major != dllVersion.Major) return true;
|
if (serverVersion.Major != dllVersion.Major) return true;
|
||||||
|
Binary file not shown.
@ -2,9 +2,7 @@
|
|||||||
using SPT.Launcher.Helpers;
|
using SPT.Launcher.Helpers;
|
||||||
using SPT.Launcher.Models;
|
using SPT.Launcher.Models;
|
||||||
using SPT.Launcher.Models.Launcher;
|
using SPT.Launcher.Models.Launcher;
|
||||||
using SPT.Launcher.ViewModels.Dialogs;
|
|
||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Controls;
|
|
||||||
using ReactiveUI;
|
using ReactiveUI;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@ -50,18 +48,41 @@ namespace SPT.Launcher.ViewModels
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var traceLogs = Directory.GetFiles(Path.Join(LauncherSettingsProvider.Instance.GamePath, "Logs"), $"{DateTime.Now:yyyy.MM.dd}_* traces.log", SearchOption.AllDirectories);
|
var filesToCopy = new List<string> { LogManager.Instance.LogFile };
|
||||||
|
|
||||||
var traceLog = traceLogs.Length > 0 ? traceLogs[0] : "";
|
var serverLog = Path.Join(LauncherSettingsProvider.Instance.GamePath, @"\user\logs",
|
||||||
|
$"server-{DateTime.Now:yyyy-MM-dd}.log");
|
||||||
|
var bepinexLog = Path.Join(LauncherSettingsProvider.Instance.GamePath, @"BepInEx\LogOutput.log");
|
||||||
|
|
||||||
var filesToCopy = new string[]
|
if (AccountManager.SelectedAccount?.id != null)
|
||||||
{
|
{
|
||||||
Path.Join(LauncherSettingsProvider.Instance.GamePath, @"\user\logs", $"server-{DateTime.Now:yyyy-MM-dd}.log"),
|
filesToCopy.Add(Path.Join(LauncherSettingsProvider.Instance.GamePath, @"\user\profiles",
|
||||||
traceLog,
|
$"{AccountManager.SelectedAccount.id}.json"));
|
||||||
Path.Join(LauncherSettingsProvider.Instance.GamePath, @"BepInEx\LogOutput.log"),
|
}
|
||||||
Path.Join(LauncherSettingsProvider.Instance.GamePath, @"\user\profiles", $"{AccountManager.SelectedAccount.id}.json"),
|
|
||||||
LogManager.Instance.LogFile,
|
if (File.Exists(serverLog))
|
||||||
};
|
{
|
||||||
|
filesToCopy.Add(serverLog);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (File.Exists(bepinexLog))
|
||||||
|
{
|
||||||
|
filesToCopy.Add(bepinexLog);
|
||||||
|
}
|
||||||
|
|
||||||
|
var logsPath = Path.Join(LauncherSettingsProvider.Instance.GamePath, "Logs");
|
||||||
|
if (Directory.Exists(logsPath))
|
||||||
|
{
|
||||||
|
var traceLogs = Directory.GetFiles(logsPath, $"{DateTime.Now:yyyy.MM.dd}_* traces.log",
|
||||||
|
SearchOption.AllDirectories);
|
||||||
|
|
||||||
|
var log = traceLogs.Length > 0 ? traceLogs[0] : "";
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(log))
|
||||||
|
{
|
||||||
|
filesToCopy.Add(log);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
List<IStorageFile> files = new List<IStorageFile>();
|
List<IStorageFile> files = new List<IStorageFile>();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user