mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 10:17:22 +01:00
Fix some stuff, add versions.
This commit is contained in:
parent
c1a9c798ae
commit
7cb50030f9
6 changed files with 45 additions and 20 deletions
|
|
@ -24,6 +24,12 @@ public class CrashData
|
|||
/// <summary> The time this crash data was generated. </summary>
|
||||
public DateTimeOffset CrashTime { get; set; } = DateTimeOffset.UnixEpoch;
|
||||
|
||||
/// <summary> Penumbra's Version when this crash data was created. </summary>
|
||||
public string Version { get; set; } = string.Empty;
|
||||
|
||||
/// <summary> The Game's Version when this crash data was created. </summary>
|
||||
public string GameVersion { get; set; } = string.Empty;
|
||||
|
||||
/// <summary> The FFXIV process ID when this data was generated. </summary>
|
||||
public int ProcessId { get; set; } = 0;
|
||||
|
||||
|
|
@ -52,11 +58,11 @@ public class CrashData
|
|||
=> LastVfxFuncsInvoked.Count == 0 ? default : LastVfxFuncsInvoked[0];
|
||||
|
||||
/// <summary> A collection of the last few characters loaded before this crash data was generated. </summary>
|
||||
public List<CharacterLoadedEntry> LastCharactersLoaded { get; } = [];
|
||||
public List<CharacterLoadedEntry> LastCharactersLoaded { get; set; } = [];
|
||||
|
||||
/// <summary> A collection of the last few modded files loaded before this crash data was generated. </summary>
|
||||
public List<ModdedFileLoadedEntry> LastModdedFilesLoaded { get; } = [];
|
||||
public List<ModdedFileLoadedEntry> LastModdedFilesLoaded { get; set; } = [];
|
||||
|
||||
/// <summary> A collection of the last few vfx functions invoked before this crash data was generated. </summary>
|
||||
public List<VfxFuncInvokedEntry> LastVfxFuncsInvoked { get; } = [];
|
||||
public List<VfxFuncInvokedEntry> LastVfxFuncsInvoked { get; set; } = [];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,15 +25,17 @@ public sealed class GameEventLogReader : IDisposable
|
|||
}
|
||||
|
||||
|
||||
public JsonObject Dump(string mode, int processId, int exitCode)
|
||||
public JsonObject Dump(string mode, int processId, int exitCode, string version, string gameVersion)
|
||||
{
|
||||
var crashTime = DateTimeOffset.UtcNow;
|
||||
var obj = new JsonObject
|
||||
{
|
||||
[nameof(CrashData.Mode)] = mode,
|
||||
[nameof(CrashData.CrashTime)] = DateTimeOffset.UtcNow,
|
||||
[nameof(CrashData.ProcessId)] = processId,
|
||||
[nameof(CrashData.ExitCode)] = exitCode,
|
||||
[nameof(CrashData.Mode)] = mode,
|
||||
[nameof(CrashData.CrashTime)] = DateTimeOffset.UtcNow,
|
||||
[nameof(CrashData.ProcessId)] = processId,
|
||||
[nameof(CrashData.ExitCode)] = exitCode,
|
||||
[nameof(CrashData.Version)] = version,
|
||||
[nameof(CrashData.GameVersion)] = gameVersion,
|
||||
};
|
||||
|
||||
foreach (var (reader, singular, _) in Readers)
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ public class CrashHandler
|
|||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
if (args.Length < 2 || !int.TryParse(args[1], out var pid))
|
||||
if (args.Length < 4 || !int.TryParse(args[1], out var pid))
|
||||
return;
|
||||
|
||||
try
|
||||
|
|
@ -17,7 +17,7 @@ public class CrashHandler
|
|||
|
||||
parent.WaitForExit();
|
||||
var exitCode = parent.ExitCode;
|
||||
var obj = reader.Dump("Crash", pid, exitCode);
|
||||
var obj = reader.Dump("Crash", pid, exitCode, args[2], args[3]);
|
||||
using var fs = File.Open(args[0], FileMode.Create);
|
||||
using var w = new Utf8JsonWriter(fs, new JsonWriterOptions { Indented = true });
|
||||
obj.WriteTo(w, new JsonSerializerOptions() { WriteIndented = true });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue