From a6b16fd5b80c0bde7021747ddf50e2cc126b600a Mon Sep 17 00:00:00 2001 From: Florian Stinglmayr Date: Sun, 11 Dec 2022 12:29:32 +0100 Subject: [PATCH] commander entry happens when you relog Use it to discern combat zone relogs. --- EDPlayerJournal/BGS/TransactionParser.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/EDPlayerJournal/BGS/TransactionParser.cs b/EDPlayerJournal/BGS/TransactionParser.cs index de70728..81aa956 100644 --- a/EDPlayerJournal/BGS/TransactionParser.cs +++ b/EDPlayerJournal/BGS/TransactionParser.cs @@ -902,10 +902,20 @@ internal class DropshipDeployParser : TransactionParserPart { } } +internal class CommanderParser : TransactionParserPart { + public void Parse(Entry entry, TransactionParserContext context, TransactionList transactions) { + // A commander entry happens when you log out, and log back in again + // for example when switching from Open, to Solo or PG. + context.DiscernCombatZone(transactions, entry); + context.ResetCombatZone(); + } +} + public class TransactionParser { private static Dictionary ParserParts { get; } = new() { { Events.CapShipBond, new CapShipBondParser() }, + { Events.Commander, new CommanderParser() }, { Events.CommitCrime, new CommitCrimeParser() }, { Events.Died, new DiedParser() }, { Events.Disembark, new EmbarkDisembarkParser() },