7 Commits
0.3.5 ... 0.3.6

Author SHA1 Message Date
d6e2280a00 update website 2023-10-25 11:39:39 +02:00
160f4f8370 bump version information 2023-10-25 11:38:56 +02:00
4400418d30 update changelog 2023-10-25 11:38:47 +02:00
43037b0a5b don't return null for unknown 2023-10-25 11:35:30 +02:00
afc831cf31 add the new banshee 2023-10-25 11:35:19 +02:00
4ab54ee576 show Errors found by journal parser 2023-10-25 11:30:44 +02:00
d6842115c5 no longer completely fail on one wrong entry
U17 might have caused some journal bugs so don't fail immediately on one wrong entry, instead keep them in an Errors collection for later processing
2023-10-25 11:30:34 +02:00
10 changed files with 56 additions and 13 deletions

View File

@@ -64,7 +64,15 @@ public class Entry {
public static Entry? Parse(string journalline) { public static Entry? Parse(string journalline) {
using (JsonReader reader = new JsonTextReader(new StringReader(journalline))) { using (JsonReader reader = new JsonTextReader(new StringReader(journalline))) {
reader.DateParseHandling = DateParseHandling.None; reader.DateParseHandling = DateParseHandling.None;
var json = JObject.Load(reader); JObject? json = null;
try {
json = JObject.Load(reader);
} catch (Exception e) {
throw new InvalidJournalEntryException(
"invalid JSON journal entry: " + journalline,
e
);
}
if (json == null) { if (json == null) {
return null; return null;
} }

View File

@@ -6,6 +6,7 @@
public class InvalidJournalEntryException : Exception { public class InvalidJournalEntryException : Exception {
public InvalidJournalEntryException() { } public InvalidJournalEntryException() { }
public InvalidJournalEntryException(string message) : base(message) { } public InvalidJournalEntryException(string message) : base(message) { }
public InvalidJournalEntryException(string message, Exception inner) : base(message, inner) { }
} }
/// <summary> /// <summary>

View File

@@ -17,6 +17,11 @@ public class JournalFile : IComparable<JournalFile>
private static Regex update11regex = new Regex("Journal\\.([^\\.]+)\\.(\\d+).log"); private static Regex update11regex = new Regex("Journal\\.([^\\.]+)\\.(\\d+).log");
private static string iso8601 = "yyyyMMddTHHmmss"; private static string iso8601 = "yyyyMMddTHHmmss";
/// <summary>
/// A public list of errors encountered while parsing the journal files
/// </summary>
public List<Exception> Errors { get; private set; } = new List<Exception>();
public static bool VerifyFile(string path) { public static bool VerifyFile(string path) {
string filename = Path.GetFileName(path); string filename = Path.GetFileName(path);
@@ -125,15 +130,20 @@ public class JournalFile : IComparable<JournalFile>
} }
entries.Clear(); entries.Clear();
foreach(var line in lines) { Errors.Clear();
foreach (var line in lines) {
// Skip empty lines // Skip empty lines
if (line.Trim().Length == 0) { if (line.Trim().Length == 0) {
continue; continue;
} }
try {
Entry? entry = Entry.Parse(line); Entry? entry = Entry.Parse(line);
if (entry != null) { if (entry != null) {
entries.Add(entry); entries.Add(entry);
} }
} catch (Exception ex) {
Errors.Add(ex);
}
} }
} }
} }

View File

@@ -22,6 +22,12 @@ public class PlayerJournal {
ScanFiles(); ScanFiles();
} }
public List<Exception> AllErrors {
get {
return Files.SelectMany(x => x.Errors).ToList();
}
}
public List<JournalFile> Files { public List<JournalFile> Files {
get { return journalfiles; } get { return journalfiles; }
} }

View File

@@ -14,6 +14,10 @@ public enum ThargoidVessel {
/// Thargoid drone /// Thargoid drone
/// </summary> /// </summary>
Revenant = 8, Revenant = 8,
/// <summary>
/// New thargoid drone in U17
/// </summary>
Banshee = 9,
} }
public class Thargoid { public class Thargoid {
@@ -24,6 +28,8 @@ public class Thargoid {
{ 25000, ThargoidVessel.Revenant }, { 25000, ThargoidVessel.Revenant },
{ 65000, ThargoidVessel.Scout }, { 65000, ThargoidVessel.Scout },
{ 75000, ThargoidVessel.Scout }, { 75000, ThargoidVessel.Scout },
// New in Update 17
{ 100000, ThargoidVessel.Banshee },
// New in Update 15 // New in Update 15
{ 4500000, ThargoidVessel.Hunter }, { 4500000, ThargoidVessel.Hunter },
{ 6500000, ThargoidVessel.Cyclops }, { 6500000, ThargoidVessel.Cyclops },
@@ -47,7 +53,7 @@ public class Thargoid {
}; };
public static Dictionary<ThargoidVessel, string?> VesselNames { get; } = new() { public static Dictionary<ThargoidVessel, string?> VesselNames { get; } = new() {
{ ThargoidVessel.Unknown, null }, { ThargoidVessel.Unknown, "(Unknown)" },
{ ThargoidVessel.Revenant, "Revenant" }, { ThargoidVessel.Revenant, "Revenant" },
{ ThargoidVessel.Scout, "Scout" }, { ThargoidVessel.Scout, "Scout" },
{ ThargoidVessel.Orthrus, "Orthrus" }, { ThargoidVessel.Orthrus, "Orthrus" },
@@ -56,6 +62,7 @@ public class Thargoid {
{ ThargoidVessel.Medusa, "Medusa" }, { ThargoidVessel.Medusa, "Medusa" },
{ ThargoidVessel.Hydra, "Hydra" }, { ThargoidVessel.Hydra, "Hydra" },
{ ThargoidVessel.Hunter, "Hunter" }, { ThargoidVessel.Hunter, "Hunter" },
{ ThargoidVessel.Banshee, "Banshee" },
}; };
public static ThargoidVessel GetVesselByPayout(ulong payout) { public static ThargoidVessel GetVesselByPayout(ulong payout) {

View File

@@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework> <TargetFramework>net7.0-windows</TargetFramework>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<Version>0.3.5</Version> <Version>0.3.6</Version>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF> <UseWPF>true</UseWPF>

View File

@@ -233,6 +233,12 @@ public partial class MainWindow : MetroWindow {
HandleEntries(entries, start, end); HandleEntries(entries, start, end);
GenerateLog(); GenerateLog();
var errors = journal.AllErrors;
foreach (var error in errors) {
Log("An error has occured in the Journal file, please send this to CMDR Hekateh:");
Log(error.ToString());
}
} catch (Exception exception) { } catch (Exception exception) {
Log("Something went terribly wrong while parsing the E:D player journal."); Log("Something went terribly wrong while parsing the E:D player journal.");
Log("Please send this to CMDR Hekateh:"); Log("Please send this to CMDR Hekateh:");

View File

@@ -1,6 +1,4 @@
using System.Reflection; using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Windows; using System.Windows;
@@ -51,5 +49,5 @@ using System.Windows;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.3.5.0")] [assembly: AssemblyVersion("0.3.6.0")]
[assembly: AssemblyFileVersion("0.3.5.0")] [assembly: AssemblyFileVersion("0.3.6.0")]

View File

@@ -1,5 +1,12 @@
# EliteBGS changelog # EliteBGS changelog
# 0.3.6 on 25.10.2023
* U17 introduced invalid JSON into the player journal. EliteBGS can now skip over
those and keep processing. This way players won't have to delete lines in their
journals anymore to keep using the tool.
* Banshee has been added.
## 0.3.5 on 11.09.2023 ## 0.3.5 on 11.09.2023
* Small bounty voucher formats are no longer suppressed. * Small bounty voucher formats are no longer suppressed.

View File

@@ -20,13 +20,13 @@ command line:
winget install Microsoft.DotNet.DesktopRuntime.7 winget install Microsoft.DotNet.DesktopRuntime.7
``` ```
You can download the **latest** version **0.3.5** at CodeBerg: You can download the **latest** version **0.3.6** at CodeBerg:
* [https://codeberg.org/nola/EDBGS/releases](https://codeberg.org/nola/EDBGS/releases) * [https://codeberg.org/nola/EDBGS/releases](https://codeberg.org/nola/EDBGS/releases)
Or alternatively from my server: Or alternatively from my server:
* [https://bgs.n0la.org/elitebgs-0.3.5.zip](https://bgs.n0la.org/elitebgs-0.3.5.zip) * [https://bgs.n0la.org/elitebgs-0.3.6.zip](https://bgs.n0la.org/elitebgs-0.3.6.zip)
## Old Versions ## Old Versions