Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5ea288ee86 | |||
| f3fc99a3f3 | |||
| 2bee03dbc2 | |||
| 16b579688d | |||
| 9994a45d06 | |||
| d6e2280a00 | |||
| 160f4f8370 | |||
| 4400418d30 | |||
| 43037b0a5b | |||
| afc831cf31 | |||
| 4ab54ee576 | |||
| d6842115c5 |
30
EDPlayerJournal/BGS/Parsers/CarrierJumpParser.cs
Normal file
30
EDPlayerJournal/BGS/Parsers/CarrierJumpParser.cs
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
using EDPlayerJournal.Entries;
|
||||||
|
|
||||||
|
namespace EDPlayerJournal.BGS.Parsers;
|
||||||
|
|
||||||
|
internal class CarrierJumpParser : ITransactionParserPart {
|
||||||
|
public void Parse(Entry entry, TransactionParserContext context, TransactionParserOptions options, TransactionList transactions) {
|
||||||
|
CarrierJump? jump = entry as CarrierJump;
|
||||||
|
|
||||||
|
if (jump == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!jump.Docked) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
context.CurrentSystem = jump.StarSystem;
|
||||||
|
context.CurrentSystemAddress = jump.SystemAddress;
|
||||||
|
|
||||||
|
context.SystemsByID.TryAdd(jump.SystemAddress, jump.StarSystem);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(jump.SystemFaction)) {
|
||||||
|
context.ControllingFaction = jump.SystemFaction;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (jump.SystemFactions != null && jump.SystemFactions.Count > 0) {
|
||||||
|
context.SystemFactions[jump.StarSystem] = jump.SystemFactions;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
17
EDPlayerJournal/BGS/Parsers/MusicParser.cs
Normal file
17
EDPlayerJournal/BGS/Parsers/MusicParser.cs
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
using EDPlayerJournal.Entries;
|
||||||
|
|
||||||
|
namespace EDPlayerJournal.BGS.Parsers;
|
||||||
|
|
||||||
|
internal class MusicParser : ITransactionParserPart {
|
||||||
|
public void Parse(Entry entry, TransactionParserContext context, TransactionParserOptions options, TransactionList transactions) {
|
||||||
|
MusicEntry? entryMusic = (MusicEntry)entry;
|
||||||
|
|
||||||
|
if (entryMusic == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.Compare(entryMusic.MusicTrack, "Combat_CapitalShip") == 0) {
|
||||||
|
context.HaveSeenCapShip = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -665,6 +665,7 @@ public class TransactionParser {
|
|||||||
{
|
{
|
||||||
{ Events.ApproachSettlement, new ApproachSettlementParser() },
|
{ Events.ApproachSettlement, new ApproachSettlementParser() },
|
||||||
{ Events.CapShipBond, new CapShipBondParser() },
|
{ Events.CapShipBond, new CapShipBondParser() },
|
||||||
|
{ Events.CarrierJump, new CarrierJumpParser() },
|
||||||
{ Events.Commander, new CommanderParser() },
|
{ Events.Commander, new CommanderParser() },
|
||||||
{ Events.CommitCrime, new CommitCrimeParser() },
|
{ Events.CommitCrime, new CommitCrimeParser() },
|
||||||
{ Events.Died, new DiedParser() },
|
{ Events.Died, new DiedParser() },
|
||||||
@@ -683,6 +684,7 @@ public class TransactionParser {
|
|||||||
{ Events.MissionFailed, new MissionFailedParser() },
|
{ Events.MissionFailed, new MissionFailedParser() },
|
||||||
{ Events.Missions, new MissionsParser() },
|
{ Events.Missions, new MissionsParser() },
|
||||||
{ Events.MultiSellExplorationData, new MultiSellExplorationDataParser() },
|
{ Events.MultiSellExplorationData, new MultiSellExplorationDataParser() },
|
||||||
|
{ Events.Music, new MusicParser() },
|
||||||
{ Events.ReceiveText, new ReceiveTextParser() },
|
{ Events.ReceiveText, new ReceiveTextParser() },
|
||||||
{ Events.RedeemVoucher, new RedeemVoucherParser() },
|
{ Events.RedeemVoucher, new RedeemVoucherParser() },
|
||||||
{ Events.SearchAndRescue, new SearchAndRescueParser() },
|
{ Events.SearchAndRescue, new SearchAndRescueParser() },
|
||||||
|
|||||||
44
EDPlayerJournal/Entries/CarrierJump.cs
Normal file
44
EDPlayerJournal/Entries/CarrierJump.cs
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
|
namespace EDPlayerJournal.Entries;
|
||||||
|
|
||||||
|
public class CarrierJump : Entry {
|
||||||
|
public bool Docked { get; set; } = false;
|
||||||
|
|
||||||
|
public string? StationName { get; set; } = null;
|
||||||
|
|
||||||
|
public string? StationType { get; set; } = null;
|
||||||
|
|
||||||
|
public string? StarSystem { get; set; } = null;
|
||||||
|
|
||||||
|
public ulong SystemAddress { get; set; } = 0;
|
||||||
|
|
||||||
|
public string? SystemFaction { get; set; } = null;
|
||||||
|
|
||||||
|
public List<Faction> SystemFactions { get; set; } = new List<Faction>();
|
||||||
|
|
||||||
|
protected override void Initialise() {
|
||||||
|
Docked = JSON.Value<bool?>("Docked") ?? false;
|
||||||
|
|
||||||
|
StarSystem = JSON.Value<string>("StarSystem");
|
||||||
|
SystemAddress = JSON.Value<ulong?>("SystemAddress") ?? 0;
|
||||||
|
|
||||||
|
StationName = JSON.Value<string?>("StationName");
|
||||||
|
StationType = JSON.Value<string?>("StationType");
|
||||||
|
|
||||||
|
var faction = JSON.Value<JObject>("SystemFaction");
|
||||||
|
if (faction != null) {
|
||||||
|
SystemFaction = faction.Value<string>("Name");
|
||||||
|
}
|
||||||
|
|
||||||
|
var factions = JSON.Value<JArray>("Factions");
|
||||||
|
if (factions != null) {
|
||||||
|
foreach (JObject system_faction in factions) {
|
||||||
|
Faction? f = Faction.FromJSON(system_faction);
|
||||||
|
if (f != null) {
|
||||||
|
SystemFactions.Add(f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,6 +15,7 @@ public class Entry {
|
|||||||
{ Events.ApproachSettlement, typeof(ApproachSettlementEntry) },
|
{ Events.ApproachSettlement, typeof(ApproachSettlementEntry) },
|
||||||
{ Events.Bounty, typeof(BountyEntry) },
|
{ Events.Bounty, typeof(BountyEntry) },
|
||||||
{ Events.CapShipBond, typeof(CapShipBondEntry) },
|
{ Events.CapShipBond, typeof(CapShipBondEntry) },
|
||||||
|
{ Events.CarrierJump, typeof(CarrierJump) },
|
||||||
{ Events.Commander, typeof(CommanderEntry) },
|
{ Events.Commander, typeof(CommanderEntry) },
|
||||||
{ Events.CommitCrime, typeof(CommitCrimeEntry) },
|
{ Events.CommitCrime, typeof(CommitCrimeEntry) },
|
||||||
{ Events.Died, typeof(DiedEntry) },
|
{ Events.Died, typeof(DiedEntry) },
|
||||||
@@ -37,6 +38,7 @@ public class Entry {
|
|||||||
{ Events.MissionRedirected, typeof(MissionRedirectedEntry) },
|
{ Events.MissionRedirected, typeof(MissionRedirectedEntry) },
|
||||||
{ Events.Missions, typeof(MissionsEntry) },
|
{ Events.Missions, typeof(MissionsEntry) },
|
||||||
{ Events.MultiSellExplorationData, typeof(MultiSellExplorationDataEntry) },
|
{ Events.MultiSellExplorationData, typeof(MultiSellExplorationDataEntry) },
|
||||||
|
{ Events.Music, typeof(MusicEntry) },
|
||||||
{ Events.ReceiveText, typeof(ReceiveTextEntry) },
|
{ Events.ReceiveText, typeof(ReceiveTextEntry) },
|
||||||
{ Events.RedeemVoucher, typeof(RedeemVoucherEntry) },
|
{ Events.RedeemVoucher, typeof(RedeemVoucherEntry) },
|
||||||
{ Events.SearchAndRescue, typeof(SearchAndRescueEntry) },
|
{ Events.SearchAndRescue, typeof(SearchAndRescueEntry) },
|
||||||
@@ -64,7 +66,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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ public class Events {
|
|||||||
public static readonly string ApproachSettlement = "ApproachSettlement";
|
public static readonly string ApproachSettlement = "ApproachSettlement";
|
||||||
public static readonly string Bounty = "Bounty";
|
public static readonly string Bounty = "Bounty";
|
||||||
public static readonly string CapShipBond = "CapShipBond";
|
public static readonly string CapShipBond = "CapShipBond";
|
||||||
|
public static readonly string CarrierJump = "CarrierJump";
|
||||||
public static readonly string Commander = "Commander";
|
public static readonly string Commander = "Commander";
|
||||||
public static readonly string CommitCrime = "CommitCrime";
|
public static readonly string CommitCrime = "CommitCrime";
|
||||||
public static readonly string Died = "Died";
|
public static readonly string Died = "Died";
|
||||||
@@ -27,6 +28,7 @@ public class Events {
|
|||||||
public static readonly string MissionRedirected = "MissionRedirected";
|
public static readonly string MissionRedirected = "MissionRedirected";
|
||||||
public static readonly string Missions = "Missions";
|
public static readonly string Missions = "Missions";
|
||||||
public static readonly string MultiSellExplorationData = "MultiSellExplorationData";
|
public static readonly string MultiSellExplorationData = "MultiSellExplorationData";
|
||||||
|
public static readonly string Music = "Music";
|
||||||
public static readonly string ReceiveText = "ReceiveText";
|
public static readonly string ReceiveText = "ReceiveText";
|
||||||
public static readonly string RedeemVoucher = "RedeemVoucher";
|
public static readonly string RedeemVoucher = "RedeemVoucher";
|
||||||
public static readonly string SearchAndRescue = "SearchAndRescue";
|
public static readonly string SearchAndRescue = "SearchAndRescue";
|
||||||
|
|||||||
9
EDPlayerJournal/Entries/MusicEntry.cs
Normal file
9
EDPlayerJournal/Entries/MusicEntry.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
namespace EDPlayerJournal.Entries;
|
||||||
|
|
||||||
|
public class MusicEntry : Entry {
|
||||||
|
public string? MusicTrack { get; set; } = null;
|
||||||
|
|
||||||
|
protected override void Initialise() {
|
||||||
|
MusicTrack = JSON.Value<string?>("MusicTrack");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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>
|
||||||
|
|||||||
@@ -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,14 +130,19 @@ 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;
|
||||||
}
|
}
|
||||||
Entry? entry = Entry.Parse(line);
|
try {
|
||||||
if (entry != null) {
|
Entry? entry = Entry.Parse(line);
|
||||||
entries.Add(entry);
|
if (entry != null) {
|
||||||
|
entries.Add(entry);
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Errors.Add(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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.7</Version>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
<UseWindowsForms>true</UseWindowsForms>
|
<UseWindowsForms>true</UseWindowsForms>
|
||||||
<UseWPF>true</UseWPF>
|
<UseWPF>true</UseWPF>
|
||||||
|
|||||||
@@ -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:");
|
||||||
|
|||||||
@@ -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.7.0")]
|
||||||
[assembly: AssemblyFileVersion("0.3.5.0")]
|
[assembly: AssemblyFileVersion("0.3.7.0")]
|
||||||
|
|||||||
@@ -1,5 +1,18 @@
|
|||||||
# EliteBGS changelog
|
# EliteBGS changelog
|
||||||
|
|
||||||
|
# 0.3.7 on 29.01.2024
|
||||||
|
|
||||||
|
* Fix wrong locations of BGS action if you remain on your carrier while its
|
||||||
|
jumping to a new system.
|
||||||
|
* Identify a capital ship in a high CZ by its music.
|
||||||
|
|
||||||
|
# 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.
|
||||||
|
|||||||
@@ -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.7** 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.7.zip)
|
||||||
|
|
||||||
## Old Versions
|
## Old Versions
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user