Compare commits

...

4 Commits

6 changed files with 35 additions and 23 deletions

View File

@ -1,4 +1,6 @@
namespace EDPlayerJournal.BGS; using EDPlayerJournal.Entries;
namespace EDPlayerJournal.BGS;
public class IncompleteTransaction : Transaction { public class IncompleteTransaction : Transaction {
public Transaction? UnderlyingTransaction { get; set; } = null; public Transaction? UnderlyingTransaction { get; set; } = null;
@ -6,8 +8,9 @@ public class IncompleteTransaction : Transaction {
public IncompleteTransaction() { } public IncompleteTransaction() { }
public IncompleteTransaction(Transaction? underlying, string reason) { public IncompleteTransaction(Transaction? underlying, string reason, Entry entry) {
UnderlyingTransaction = underlying; UnderlyingTransaction = underlying;
Reason = reason; Reason = reason;
Entries.Add(entry);
} }
} }

View File

@ -123,7 +123,7 @@ internal class TransactionParserContext {
// Still unknown // Still unknown
grade = null; grade = null;
} else { } else {
transactions.AddIncomplete(new CombatZone(), "Failed to discern combat zone type"); transactions.AddIncomplete(new CombatZone(), "Failed to discern combat zone type", e);
return; return;
} }
@ -209,8 +209,8 @@ internal class TransactionParserContext {
} }
public class TransactionList : List<Transaction> { public class TransactionList : List<Transaction> {
public void AddIncomplete(Transaction underlying, string reason) { public void AddIncomplete(Transaction underlying, string reason, Entry entry) {
Add(new IncompleteTransaction(underlying, reason)); Add(new IncompleteTransaction(underlying, reason, entry));
} }
} }
@ -394,7 +394,7 @@ internal class CommitCrimeParser : TransactionParserPart {
if (entry.Faction == null) { if (entry.Faction == null) {
transactions.AddIncomplete( transactions.AddIncomplete(
new FoulMurder(), new FoulMurder(),
"On foot murder victim did not have a faction" "On foot murder victim did not have a faction", e
); );
return; return;
} }
@ -405,7 +405,7 @@ internal class CommitCrimeParser : TransactionParserPart {
if (!context.NPCFaction.ContainsKey(victim)) { if (!context.NPCFaction.ContainsKey(victim)) {
transactions.AddIncomplete( transactions.AddIncomplete(
new FoulMurder(), new FoulMurder(),
"Crime victim was not properly scanned." "Crime victim was not properly scanned.", e
); );
return; return;
} }
@ -429,7 +429,8 @@ internal class MissionAcceptedParser : TransactionParserPart {
if (context.CurrentSystem == null || context.CurrentSystemAddress == null) { if (context.CurrentSystem == null || context.CurrentSystemAddress == null) {
transactions.AddIncomplete(new MissionCompleted(), transactions.AddIncomplete(new MissionCompleted(),
"Could not determine current location on mission acceptance." "Could not determine current location on mission acceptance.",
e
); );
return; return;
} }
@ -438,7 +439,8 @@ internal class MissionAcceptedParser : TransactionParserPart {
context.MissionAccepted(entry); context.MissionAccepted(entry);
} catch (Exception exception) { } catch (Exception exception) {
transactions.AddIncomplete(new MissionCompleted(), transactions.AddIncomplete(new MissionCompleted(),
exception.Message exception.Message,
e
); );
} }
} }
@ -460,14 +462,14 @@ internal class MissionCompletedParser : TransactionParserPart {
if (!context.AcceptedMissions.TryGetValue(entry.Mission.MissionID, out accepted)) { if (!context.AcceptedMissions.TryGetValue(entry.Mission.MissionID, out accepted)) {
transactions.AddIncomplete(new MissionCompleted(), transactions.AddIncomplete(new MissionCompleted(),
String.Format("Mission acceptance for mission id {0} was not found", String.Format("Mission acceptance for mission id {0} was not found",
entry.Mission.MissionID)); entry.Mission.MissionID), e);
return; return;
} }
if (!context.AcceptedMissionLocation.TryGetValue(entry.Mission.MissionID, out accepted_location)) { if (!context.AcceptedMissionLocation.TryGetValue(entry.Mission.MissionID, out accepted_location)) {
transactions.AddIncomplete(new MissionCompleted(), transactions.AddIncomplete(new MissionCompleted(),
String.Format("Location for acceptance for mission id {0} was not found", String.Format("Location for acceptance for mission id {0} was not found",
entry.Mission.MissionID)); entry.Mission.MissionID), e);
return; return;
} }
@ -515,7 +517,8 @@ internal class MissionCompletedParser : TransactionParserPart {
if (!context.SystemsByID.TryGetValue(system_address, out system)) { if (!context.SystemsByID.TryGetValue(system_address, out system)) {
transactions.AddIncomplete(new MissionCompleted(), transactions.AddIncomplete(new MissionCompleted(),
string.Format("Unknown system {0}, unable to assign that mission a target", system_address) string.Format("Unknown system {0}, unable to assign that mission a target", system_address),
e
); );
continue; continue;
} }
@ -571,21 +574,21 @@ internal class MissionFailedParser : TransactionParserPart {
if (!context.AcceptedMissions.TryGetValue(entry.Mission.MissionID, out accepted)) { if (!context.AcceptedMissions.TryGetValue(entry.Mission.MissionID, out accepted)) {
transactions.AddIncomplete(new MissionFailed(), transactions.AddIncomplete(new MissionFailed(),
"Mission acceptance was not found" "Mission acceptance was not found", e
); );
return; return;
} }
if (!context.AcceptedMissionLocation.TryGetValue(entry.Mission.MissionID, out accepted_location)) { if (!context.AcceptedMissionLocation.TryGetValue(entry.Mission.MissionID, out accepted_location)) {
transactions.AddIncomplete(new MissionFailed(), transactions.AddIncomplete(new MissionFailed(),
"Unable to figure out where failed mission was accepted" "Unable to figure out where failed mission was accepted", e
); );
return; return;
} }
if (!context.SystemsByID.TryGetValue(accepted_location.SystemAddress, out accepted_system)) { if (!context.SystemsByID.TryGetValue(accepted_location.SystemAddress, out accepted_system)) {
transactions.AddIncomplete(new MissionFailed(), transactions.AddIncomplete(new MissionFailed(),
"Unable to figure out in which system failed mission was accepted" "Unable to figure out in which system failed mission was accepted", e
); );
return; return;
} }
@ -659,7 +662,7 @@ internal class RedeemVoucherParser : TransactionParserPart {
if (context.CurrentSystem == null) { if (context.CurrentSystem == null) {
transactions.AddIncomplete(new Vouchers(), transactions.AddIncomplete(new Vouchers(),
"Could not find out where the vouchers were redeemed" "Could not find out where the vouchers were redeemed", e
); );
return; return;
} }
@ -667,7 +670,7 @@ internal class RedeemVoucherParser : TransactionParserPart {
List<Faction>? current_factions = context.GetFactions(context.CurrentSystem); List<Faction>? current_factions = context.GetFactions(context.CurrentSystem);
if (current_factions == null) { if (current_factions == null) {
transactions.AddIncomplete(new Vouchers(), transactions.AddIncomplete(new Vouchers(),
"Current system factions are unknown, so vouchers were ineffective"); "Current system factions are unknown, so vouchers were ineffective", e);
} }
foreach (string faction in entry.Factions) { foreach (string faction in entry.Factions) {
@ -688,8 +691,8 @@ internal class RedeemVoucherParser : TransactionParserPart {
relevantBond = true; relevantBond = true;
} else { } else {
transactions.AddIncomplete(new Vouchers(), transactions.AddIncomplete(new Vouchers(),
string.Format("Vouchers for {0} had no effect in {1} since said " + string.Format("Vouchers for \"{0}\" had no effect in \"{1}\" since said " +
"faction is not present here", faction, context.CurrentSystem) "faction is not present there", faction, context.CurrentSystem), e
); );
} }
} }

View File

@ -18,6 +18,8 @@
<Copyright>Copyright 2019 by Florian Stinglmayr</Copyright> <Copyright>Copyright 2019 by Florian Stinglmayr</Copyright>
<RepositoryUrl>https://git.aror.org/florian/EDBGS</RepositoryUrl> <RepositoryUrl>https://git.aror.org/florian/EDBGS</RepositoryUrl>
<PackageTags>ED;Elite Dangerous;BGS</PackageTags> <PackageTags>ED;Elite Dangerous;BGS</PackageTags>
<PackageProjectUrl>https://bgs.n0la.org</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Resource Include="main-page.png"> <Resource Include="main-page.png">
@ -25,6 +27,8 @@
</Resource> </Resource>
<None Update="README.md"> <None Update="README.md">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None> </None>
<None Update="docs\CHANGELOG.md"> <None Update="docs\CHANGELOG.md">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>

View File

@ -10,7 +10,7 @@ public class NonaDiscordLog : DiscordLogGenerator {
private string FormatDate() { private string FormatDate() {
CultureInfo cultureInfo = CultureInfo.InvariantCulture; CultureInfo cultureInfo = CultureInfo.InvariantCulture;
StringBuilder date = new StringBuilder(); StringBuilder date = new StringBuilder();
DateTime today = DateTime.Now; DateTime today = DateTime.UtcNow;
string suffix; string suffix;
if (today.Day == 1 || today.Day == 21 || today.Day == 31) { if (today.Day == 1 || today.Day == 21 || today.Day == 31) {

View File

@ -1,11 +1,13 @@
# EliteBGS changelog # EliteBGS changelog
## 0.2.4 on ??.??.202? ## 0.2.4 on 18.12.2022
* Fixed bug with organic data. * Fixed bug with organic data.
* Fixed bug in mission format. * Fixed bug in mission format.
* You can now select also a time when filtering transactions. * You can now select also a time when filtering transactions.
* Added a button to toggle all children on and off at once. * Added a button to toggle all children on and off at once.
* Date in Nova Navy discord log is now UTC.
* Added a divider so you can rescale the objectives and the log to a preferred aspect ratio.
## 0.2.3 on 11.12.2022 ## 0.2.3 on 11.12.2022

View File

@ -20,9 +20,9 @@ command line:
winget install Microsoft.DotNet.DesktopRuntime.7 winget install Microsoft.DotNet.DesktopRuntime.7
``` ```
You can download the **latest** version **0.2.3** here: You can download the **latest** version **0.2.4** here:
* [https://bgs.n0la.org/elitebgs-0.2.3.zip](https://bgs.n0la.org/elitebgs-0.2.3.zip) * [https://bgs.n0la.org/elitebgs-0.2.4.zip](https://bgs.n0la.org/elitebgs-0.2.4.zip)
## Old Versions ## Old Versions