Compare commits
8 Commits
1dd95aff82
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 84a26ad956 | |||
| f2778df092 | |||
| 1dd78d04b8 | |||
| 8f9e1b1429 | |||
| 3a5d4dd60f | |||
| 2bef2a6c81 | |||
| 9b31077a11 | |||
| 86bd9f76c1 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -7,3 +7,4 @@
|
|||||||
/bin/Release
|
/bin/Release
|
||||||
/bin/Debug
|
/bin/Debug
|
||||||
/packages/Newtonsoft.Json.13.0.1
|
/packages/Newtonsoft.Json.13.0.1
|
||||||
|
/.vs/edjournal/v17/.suo
|
||||||
|
|||||||
16
CommanderEntry.cs
Normal file
16
CommanderEntry.cs
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace EDJournal {
|
||||||
|
public class CommanderEntry : Entry {
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string FID { get; set; }
|
||||||
|
protected override void Initialise() {
|
||||||
|
Name = JSON.Value<string>("Name") ?? "";
|
||||||
|
FID = JSON.Value<string>("FID") ?? "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Entry.cs
2
Entry.cs
@@ -13,12 +13,14 @@ namespace EDJournal {
|
|||||||
public class Entry {
|
public class Entry {
|
||||||
private static readonly Dictionary<string, Type> classes = new Dictionary<string, Type> {
|
private static readonly Dictionary<string, Type> classes = new Dictionary<string, Type> {
|
||||||
{ Events.Bounty, typeof(BountyEntry) },
|
{ Events.Bounty, typeof(BountyEntry) },
|
||||||
|
{ Events.Commander, typeof(CommanderEntry) },
|
||||||
{ Events.CommitCrime, typeof(CommitCrimeEntry) },
|
{ Events.CommitCrime, typeof(CommitCrimeEntry) },
|
||||||
{ Events.Died, typeof(DiedEntry) },
|
{ Events.Died, typeof(DiedEntry) },
|
||||||
{ Events.Docked, typeof(DockedEntry) },
|
{ Events.Docked, typeof(DockedEntry) },
|
||||||
{ Events.FactionKillBond, typeof(FactionKillBondEntry) },
|
{ Events.FactionKillBond, typeof(FactionKillBondEntry) },
|
||||||
{ Events.FSDJump, typeof(FSDJumpEntry) },
|
{ Events.FSDJump, typeof(FSDJumpEntry) },
|
||||||
{ Events.HullDamage, typeof(HullDamageEntry) },
|
{ Events.HullDamage, typeof(HullDamageEntry) },
|
||||||
|
{ Events.LoadGame, typeof(LoadGameEntry) },
|
||||||
{ Events.Location, typeof(LocationEntry) },
|
{ Events.Location, typeof(LocationEntry) },
|
||||||
{ Events.MarketBuy, typeof(MarketBuyEntry) },
|
{ Events.MarketBuy, typeof(MarketBuyEntry) },
|
||||||
{ Events.MarketSell, typeof(MarketSellEntry) },
|
{ Events.MarketSell, typeof(MarketSellEntry) },
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
namespace EDJournal {
|
namespace EDJournal {
|
||||||
public class Events {
|
public class Events {
|
||||||
public static readonly string Bounty = "Bounty";
|
public static readonly string Bounty = "Bounty";
|
||||||
|
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";
|
||||||
public static readonly string Docked = "Docked";
|
public static readonly string Docked = "Docked";
|
||||||
@@ -8,6 +9,7 @@
|
|||||||
public static readonly string FighterDestroyed = "FighterDestroyed";
|
public static readonly string FighterDestroyed = "FighterDestroyed";
|
||||||
public static readonly string FSDJump = "FSDJump";
|
public static readonly string FSDJump = "FSDJump";
|
||||||
public static readonly string HullDamage = "HullDamage";
|
public static readonly string HullDamage = "HullDamage";
|
||||||
|
public static readonly string LoadGame = "LoadGame";
|
||||||
public static readonly string Location = "Location";
|
public static readonly string Location = "Location";
|
||||||
public static readonly string MarketBuy = "MarketBuy";
|
public static readonly string MarketBuy = "MarketBuy";
|
||||||
public static readonly string MarketSell = "MarketSell";
|
public static readonly string MarketSell = "MarketSell";
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ namespace EDJournal {
|
|||||||
protected override void Initialise() {
|
protected override void Initialise() {
|
||||||
SystemAddress = JSON.Value<ulong?>("SystemAddress") ?? 0;
|
SystemAddress = JSON.Value<ulong?>("SystemAddress") ?? 0;
|
||||||
StarSystem = JSON.Value<string>("StarSystem");
|
StarSystem = JSON.Value<string>("StarSystem");
|
||||||
|
StarPos = JSON.Value<JArray>("StarPos").ToObject<long[]>();
|
||||||
|
|
||||||
var faction = JSON.Value<JObject>("SystemFaction");
|
var faction = JSON.Value<JObject>("SystemFaction");
|
||||||
if (faction != null) {
|
if (faction != null) {
|
||||||
SystemFaction = faction.Value<string>("Name");
|
SystemFaction = faction.Value<string>("Name");
|
||||||
@@ -21,12 +23,10 @@ namespace EDJournal {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public long[] StarPos { get; set; }
|
||||||
public string StarSystem { get; set; }
|
public string StarSystem { get; set; }
|
||||||
|
|
||||||
public string SystemFaction { get; set; }
|
public string SystemFaction { get; set; }
|
||||||
|
|
||||||
public ulong SystemAddress { get; set; }
|
public ulong SystemAddress { get; set; }
|
||||||
|
|
||||||
public List<Faction> SystemFactions { get; set; } = new List<Faction>();
|
public List<Faction> SystemFactions { get; set; } = new List<Faction>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
52
LoadGameEntry.cs
Normal file
52
LoadGameEntry.cs
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace EDJournal {
|
||||||
|
public class LoadGameEntry : Entry {
|
||||||
|
public string Commander { get; set; }
|
||||||
|
public string FID { get; set; }
|
||||||
|
public bool Horizons { get; set; }
|
||||||
|
public bool Odyssey { get; set; }
|
||||||
|
public string Ship { get; set; }
|
||||||
|
public long ShipID { get; set; }
|
||||||
|
public bool StartLanded { get; set; }
|
||||||
|
public bool StartDead { get; set; }
|
||||||
|
public string GameMode { get; set; }
|
||||||
|
public string Group { get; set; }
|
||||||
|
public long Credits { get; set; }
|
||||||
|
public long Loan { get; set; }
|
||||||
|
public string ShipName { get; set; }
|
||||||
|
public string ShipIdent { get; set; }
|
||||||
|
public double FuelLevel { get; set; }
|
||||||
|
public double FuelCapacity { get; set; }
|
||||||
|
|
||||||
|
protected override void Initialise() {
|
||||||
|
Commander = JSON.Value<string>("Commander") ?? "";
|
||||||
|
FID = JSON.Value<string>("FID") ?? "";
|
||||||
|
// Game
|
||||||
|
Horizons = JSON.Value<bool?>("Horizons") ?? false;
|
||||||
|
Odyssey = JSON.Value<bool?>("Odyssey") ?? false;
|
||||||
|
// Ships
|
||||||
|
Ship = JSON.Value<string>("Ship") ?? "";
|
||||||
|
ShipID = JSON.Value<long?>("ShipID") ?? 0;
|
||||||
|
ShipName = JSON.Value<string>("ShipName") ?? "";
|
||||||
|
ShipIdent = JSON.Value<string>("ShipIdent") ?? "";
|
||||||
|
// Fuel
|
||||||
|
FuelLevel = JSON.Value<double?>("FuelLevel") ?? 0.0;
|
||||||
|
FuelCapacity = JSON.Value<double?>("FuelCapacity") ?? 0.0;
|
||||||
|
// Landed/Dead
|
||||||
|
StartLanded = JSON.Value<bool?>("StartLanded") ?? false;
|
||||||
|
StartDead = JSON.Value<bool?>("StartDead") ?? false;
|
||||||
|
// GameMode
|
||||||
|
GameMode = JSON.Value<string>("GameMode") ?? "";
|
||||||
|
// Group
|
||||||
|
Group = JSON.Value<string>("Group") ?? "";
|
||||||
|
// Wealth
|
||||||
|
Credits = JSON.Value<long?>("Credits") ?? 0;
|
||||||
|
Loan = JSON.Value<long?>("Loan") ?? 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,6 +13,7 @@ namespace EDJournal {
|
|||||||
public ulong SystemAddress { get; set; }
|
public ulong SystemAddress { get; set; }
|
||||||
public string Body { get; set; }
|
public string Body { get; set; }
|
||||||
public bool Docked { get; set; }
|
public bool Docked { get; set; }
|
||||||
|
public long[] StarPos { get; set; }
|
||||||
|
|
||||||
public List<Faction> SystemFactions { get; set; } = new List<Faction>();
|
public List<Faction> SystemFactions { get; set; } = new List<Faction>();
|
||||||
|
|
||||||
@@ -21,6 +22,7 @@ namespace EDJournal {
|
|||||||
SystemAddress = JSON.Value<ulong?>("SystemAddress") ?? 0;
|
SystemAddress = JSON.Value<ulong?>("SystemAddress") ?? 0;
|
||||||
Docked = JSON.Value<bool?>("Docked") ?? false;
|
Docked = JSON.Value<bool?>("Docked") ?? false;
|
||||||
StationName = JSON.Value<string>("StationName") ?? "";
|
StationName = JSON.Value<string>("StationName") ?? "";
|
||||||
|
StarPos = JSON.Value<JArray>("StarPos").ToObject<long[]>();
|
||||||
|
|
||||||
JObject systemfaction = JSON.Value<JObject>("SystemFaction");
|
JObject systemfaction = JSON.Value<JObject>("SystemFaction");
|
||||||
if (systemfaction != null) {
|
if (systemfaction != null) {
|
||||||
|
|||||||
@@ -7,16 +7,17 @@
|
|||||||
<Mission Name="Mission_AltruismCredits_Bust_name">Donate Credits (Bust)</Mission>
|
<Mission Name="Mission_AltruismCredits_Bust_name">Donate Credits (Bust)</Mission>
|
||||||
<Mission Name="Mission_AltruismCredits_Famine_name">Donate Credits (Famine)</Mission>
|
<Mission Name="Mission_AltruismCredits_Famine_name">Donate Credits (Famine)</Mission>
|
||||||
<Mission Name="Mission_AltruismCredits_name">Donate Credits</Mission>
|
<Mission Name="Mission_AltruismCredits_name">Donate Credits</Mission>
|
||||||
|
<Mission Name="Mission_Assassinate_Illegal_BLOPS_name">Assassination (Illegal)</Mission>
|
||||||
<Mission Name="Mission_Assassinate_Legal_Corporate_name">Corporate Assassination (Legal)</Mission>
|
<Mission Name="Mission_Assassinate_Legal_Corporate_name">Corporate Assassination (Legal)</Mission>
|
||||||
<Mission Name="Mission_Assassinate_name">Assassination</Mission>
|
<Mission Name="Mission_Assassinate_name">Assassination</Mission>
|
||||||
<Mission Name="Mission_Assassinate_Planetary_name">Assassination (Planetary Scan)</Mission>
|
<Mission Name="Mission_Assassinate_Planetary_name">Assassination (Planetary Scan)</Mission>
|
||||||
<Mission Name="Mission_Assassinate_Illegal_BLOPS_name">Assassination (Illegal)</Mission>
|
|
||||||
<Mission Name="Mission_Collect_Bust_name">Provide (Bust)</Mission>
|
<Mission Name="Mission_Collect_Bust_name">Provide (Bust)</Mission>
|
||||||
<Mission Name="Mission_Collect_CivilLiberty_name">Provide (Civil Liberty)</Mission>
|
<Mission Name="Mission_Collect_CivilLiberty_name">Provide (Civil Liberty)</Mission>
|
||||||
<Mission Name="Mission_Collect_CivilUnrest_name">Provide (Civil Unrest)</Mission>
|
<Mission Name="Mission_Collect_CivilUnrest_name">Provide (Civil Unrest)</Mission>
|
||||||
<Mission Name="Mission_Collect_Famine_name">Provide (Famine)</Mission>
|
<Mission Name="Mission_Collect_Famine_name">Provide (Famine)</Mission>
|
||||||
<Mission Name="Mission_Collect_Industrial_name">Provide (Industrial)</Mission>
|
<Mission Name="Mission_Collect_Industrial_name">Provide (Industrial)</Mission>
|
||||||
<Mission Name="Mission_Collect_name">Provide</Mission>
|
<Mission Name="Mission_Collect_name">Provide</Mission>
|
||||||
|
<Mission Name="Mission_Collect_RankEmp_name">Provide (Imperial Navy)</Mission>
|
||||||
<Mission Name="Mission_Collect_Retreat_name">Provide (Retreat)</Mission>
|
<Mission Name="Mission_Collect_Retreat_name">Provide (Retreat)</Mission>
|
||||||
<Mission Name="Mission_Courier_Democracy_name">Courier (Democracy)</Mission>
|
<Mission Name="Mission_Courier_Democracy_name">Courier (Democracy)</Mission>
|
||||||
<Mission Name="Mission_Courier_Elections_name">Courier (Elections)</Mission>
|
<Mission Name="Mission_Courier_Elections_name">Courier (Elections)</Mission>
|
||||||
@@ -24,14 +25,16 @@
|
|||||||
<Mission Name="Mission_Courier_Famine_name">Courier (Famine)</Mission>
|
<Mission Name="Mission_Courier_Famine_name">Courier (Famine)</Mission>
|
||||||
<Mission Name="Mission_Courier_Lockdown_name">Courier (Lockdown)</Mission>
|
<Mission Name="Mission_Courier_Lockdown_name">Courier (Lockdown)</Mission>
|
||||||
<Mission Name="Mission_Courier_name">Courier</Mission>
|
<Mission Name="Mission_Courier_name">Courier</Mission>
|
||||||
<Mission Name="Mission_Courier_RankEmp_name">Courier (Empire)</Mission>
|
<Mission Name="Mission_Courier_RankEmp_name">Courier (Imperial Navy)</Mission>
|
||||||
<Mission Name="Mission_Delivery_Agriculture_name">Delivery (Agriculture)</Mission>
|
<Mission Name="Mission_Delivery_Agriculture_name">Delivery (Agriculture)</Mission>
|
||||||
<Mission Name="Mission_Delivery_Boom_name">Delivery (Boom)</Mission>
|
<Mission Name="Mission_Delivery_Boom_name">Delivery (Boom)</Mission>
|
||||||
<Mission Name="Mission_Delivery_Democracy_name">Delivery (Democracy)</Mission>
|
<Mission Name="Mission_Delivery_Democracy_name">Delivery (Democracy)</Mission>
|
||||||
<Mission Name="Mission_Delivery_Investment_name">Delivery (Investment)</Mission>
|
<Mission Name="Mission_Delivery_Investment_name">Delivery (Investment)</Mission>
|
||||||
<Mission Name="Mission_Delivery_name">Delivery</Mission>
|
<Mission Name="Mission_Delivery_name">Delivery</Mission>
|
||||||
<Mission Name="Mission_Delivery_RankEmp_name">Delivery (Imperial Rank)</Mission>
|
<Mission Name="Mission_Delivery_RankEmp_name">Delivery (Imperial Navy)</Mission>
|
||||||
<Mission Name="Mission_Delivery_Retreat_name">Delivery (Retreat)</Mission>
|
<Mission Name="Mission_Delivery_Retreat_name">Delivery (Retreat)</Mission>
|
||||||
|
<Mission Name="Mission_DeliveryWing_name">Delivery (Wing)</Mission>
|
||||||
|
<Mission Name="Mission_DeliveryWing_War_name">Delivery (Wing) (War)</Mission>
|
||||||
<Mission Name="Mission_Hack_BLOPS_Boom_name">Hack Surface Installation (Boom)</Mission>
|
<Mission Name="Mission_Hack_BLOPS_Boom_name">Hack Surface Installation (Boom)</Mission>
|
||||||
<Mission Name="Mission_Hack_BLOPS_Elections_name">Hack Surface Installation (Elections)</Mission>
|
<Mission Name="Mission_Hack_BLOPS_Elections_name">Hack Surface Installation (Elections)</Mission>
|
||||||
<Mission Name="Mission_Hack_BLOPS_Expansion_name">Hack Surface Installation (Expansion)</Mission>
|
<Mission Name="Mission_Hack_BLOPS_Expansion_name">Hack Surface Installation (Expansion)</Mission>
|
||||||
@@ -49,9 +52,10 @@
|
|||||||
<Mission Name="Mission_OnFoot_Collect_Contact_MB_name">On Foot Collect</Mission>
|
<Mission Name="Mission_OnFoot_Collect_Contact_MB_name">On Foot Collect</Mission>
|
||||||
<Mission Name="Mission_OnFoot_Collect_MB_name">On Foot Collection</Mission>
|
<Mission Name="Mission_OnFoot_Collect_MB_name">On Foot Collection</Mission>
|
||||||
<Mission Name="Mission_OnFoot_Delivery_Contact_MB_name">On Foot Delivery (Contact)</Mission>
|
<Mission Name="Mission_OnFoot_Delivery_Contact_MB_name">On Foot Delivery (Contact)</Mission>
|
||||||
<Mission Name="Mission_OnFoot_Hack_Upload_MB_name">On Foot Hack (Upload)</Mission>
|
|
||||||
<Mission Name="Mission_OnFoot_Hack_Upload_Covert_MB_name">On Foot Hack (Covert Upload)</Mission>
|
<Mission Name="Mission_OnFoot_Hack_Upload_Covert_MB_name">On Foot Hack (Covert Upload)</Mission>
|
||||||
|
<Mission Name="Mission_OnFoot_Hack_Upload_MB_name">On Foot Hack (Upload)</Mission>
|
||||||
<Mission Name="Mission_OnFoot_Heist_POI_MB_name">On Foot Heist (POI)</Mission>
|
<Mission Name="Mission_OnFoot_Heist_POI_MB_name">On Foot Heist (POI)</Mission>
|
||||||
|
<Mission Name="Mission_OnFoot_Massacre_MB_name">On Foot Massacre</Mission>
|
||||||
<Mission Name="Mission_OnFoot_Onslaught_MB_name">On Foot Onslaught</Mission>
|
<Mission Name="Mission_OnFoot_Onslaught_MB_name">On Foot Onslaught</Mission>
|
||||||
<Mission Name="Mission_OnFoot_Onslaught_Offline_MB_name">On Foot Onslaught (Offline)</Mission>
|
<Mission Name="Mission_OnFoot_Onslaught_Offline_MB_name">On Foot Onslaught (Offline)</Mission>
|
||||||
<Mission Name="Mission_OnFoot_ProductionHeist_Covert_MB_name">On Foot Production Heist (Covert)</Mission>
|
<Mission Name="Mission_OnFoot_ProductionHeist_Covert_MB_name">On Foot Production Heist (Covert)</Mission>
|
||||||
|
|||||||
@@ -62,5 +62,28 @@ namespace EDJournal {
|
|||||||
|
|
||||||
journalfiles.Sort();
|
journalfiles.Sort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Entry FindMostRecent(string entry) {
|
||||||
|
var entries = journalfiles
|
||||||
|
.OrderByDescending(x => x.DateTime)
|
||||||
|
.ToArray()
|
||||||
|
;
|
||||||
|
|
||||||
|
if (entries == null || entries.Length == 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach(JournalFile file in entries) {
|
||||||
|
Entry found = file.Entries
|
||||||
|
.OrderByDescending(x => x.Timestamp)
|
||||||
|
.First(x => x.Event == entry)
|
||||||
|
;
|
||||||
|
if (found != null) {
|
||||||
|
return found;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ namespace EDJournal {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public long TotalValue => BioData.Sum(x => x.TotalValue);
|
public long TotalValue {
|
||||||
|
get { return BioData.Sum(x => x.TotalValue); }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="BountyEntry.cs" />
|
<Compile Include="BountyEntry.cs" />
|
||||||
|
<Compile Include="CommanderEntry.cs" />
|
||||||
<Compile Include="CommitCrimeEntry.cs" />
|
<Compile Include="CommitCrimeEntry.cs" />
|
||||||
<Compile Include="Credits.cs" />
|
<Compile Include="Credits.cs" />
|
||||||
<Compile Include="CrimeTypes.cs" />
|
<Compile Include="CrimeTypes.cs" />
|
||||||
@@ -58,6 +59,7 @@
|
|||||||
<Compile Include="JournalException.cs" />
|
<Compile Include="JournalException.cs" />
|
||||||
<Compile Include="JournalFile.cs" />
|
<Compile Include="JournalFile.cs" />
|
||||||
<Compile Include="JournalStream.cs" />
|
<Compile Include="JournalStream.cs" />
|
||||||
|
<Compile Include="LoadGameEntry.cs" />
|
||||||
<Compile Include="LocationEntry.cs" />
|
<Compile Include="LocationEntry.cs" />
|
||||||
<Compile Include="MarketBuyEntry.cs" />
|
<Compile Include="MarketBuyEntry.cs" />
|
||||||
<Compile Include="MarketSellEntry.cs" />
|
<Compile Include="MarketSellEntry.cs" />
|
||||||
|
|||||||
Reference in New Issue
Block a user