Skip to content

Commit

Permalink
Post event update commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Somfic committed Dec 17, 2018
1 parent 5e67c39 commit aba270f
Show file tree
Hide file tree
Showing 8 changed files with 267 additions and 16 deletions.
2 changes: 1 addition & 1 deletion EliteAPI/Classes/Cargo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace EliteAPI
public class Cargo
{
public DateTime timestamp { get; set; }
public string _event { get; set; }

public string Vessel { get; set; }
public int Count { get; set; }
public Inventory[] Inventory { get; set; }
Expand Down
5 changes: 3 additions & 2 deletions EliteAPI/Classes/System.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;

namespace EliteAPI
{
Expand All @@ -16,7 +17,7 @@ public class System
public string Government_Localised { get; set; }
public string Security { get; set; }
public string Security_Localised { get; set; }
public int Population { get; set; }
public ulong Population { get; set; }
public string SystemFaction { get; set; }
public string FactionState { get; set; }
}
Expand Down
2 changes: 1 addition & 1 deletion EliteAPI/EDDB/System.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class EddbSystem
public double x { get; set; }
public double y { get; set; }
public double z { get; set; }
public UInt64 population { get; set; }
public ulong population { get; set; }
public bool is_populated { get; set; }
public int? government_id { get; set; }
public string government { get; set; }
Expand Down
35 changes: 35 additions & 0 deletions EliteAPI/EliteAPI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,15 @@
<Compile Include="Events\BuyDrones.cs" />
<Compile Include="Events\Cargo.cs" />
<Compile Include="Events\CargoDepot.cs" />
<Compile Include="Events\CodexEntry.cs" />
<Compile Include="Events\CollectCargo.cs" />
<Compile Include="Events\CommitCrime.cs" />
<Compile Include="Events\CommunityGoal.cs" />
<Compile Include="Events\CrewLaunchFighter.cs" />
<Compile Include="Events\CrewMemberJoins.cs" />
<Compile Include="Events\CrewMemberRoleChange.cs" />
<Compile Include="Events\CrimeVictim.cs" />
<Compile Include="Events\Died.cs" />
<Compile Include="Events\DiscoveryScan.cs" />
<Compile Include="Events\DockingDenied.cs" />
<Compile Include="Events\DockingGranted.cs" />
Expand All @@ -94,18 +102,26 @@
<Compile Include="Events\Commander.cs" />
<Compile Include="Events\Docked.cs" />
<Compile Include="Events\DockingTimeout.cs" />
<Compile Include="Events\DockSRV.cs" />
<Compile Include="Events\EjectCargo.cs" />
<Compile Include="Events\EndCrewSession.cs" />
<Compile Include="Events\EngineerCraft.cs" />
<Compile Include="Events\EngineerProgress.cs" />
<Compile Include="Events\EscapeInterdiction.cs" />
<Compile Include="Events\FetchRemoteModule.cs" />
<Compile Include="Events\Fileheader.cs" />
<Compile Include="Events\Friends.cs" />
<Compile Include="Events\FSDTarget.cs" />
<Compile Include="Events\FSSAllBodiesFound.cs" />
<Compile Include="Events\FSSDiscoveryScan.cs" />
<Compile Include="Events\FSSSignalDiscovered.cs" />
<Compile Include="Events\FuelScoop.cs" />
<Compile Include="Events\HeatDamage.cs" />
<Compile Include="Events\HeatWarning.cs" />
<Compile Include="Events\HullDamage.cs" />
<Compile Include="Events\LaunchDrone.cs" />
<Compile Include="Events\LaunchFighter.cs" />
<Compile Include="Events\LaunchSRV.cs" />
<Compile Include="Events\LeaveBody.cs" />
<Compile Include="Events\Liftoff.cs" />
<Compile Include="Events\LoadGame.cs" />
Expand All @@ -114,29 +130,47 @@
<Compile Include="Events\Market.cs" />
<Compile Include="Events\MarketBuy.cs" />
<Compile Include="Events\MarketSell.cs" />
<Compile Include="Events\MaterialCollected.cs" />
<Compile Include="Events\MaterialDiscovered.cs" />
<Compile Include="Events\Materials.cs" />
<Compile Include="Events\MiningRefined.cs" />
<Compile Include="Events\MissionAbandoned.cs" />
<Compile Include="Events\MissionAccepted.cs" />
<Compile Include="Events\MissionCompleted.cs" />
<Compile Include="Events\MissionRedirected.cs" />
<Compile Include="Events\Missions.cs" />
<Compile Include="Events\ModuleBuy.cs" />
<Compile Include="Events\ModuleInfo.cs" />
<Compile Include="Events\ModuleRetrieve.cs" />
<Compile Include="Events\ModuleSell.cs" />
<Compile Include="Events\ModuleSellRemote.cs" />
<Compile Include="Events\ModuleSwap.cs" />
<Compile Include="Events\MultiSellExplorationData.cs" />
<Compile Include="Events\NavBeaconScan.cs" />
<Compile Include="Events\NewCommander.cs" />
<Compile Include="Events\NpcCrewPaidWage.cs" />
<Compile Include="Events\Outfitting.cs" />
<Compile Include="Events\PayFine.cs" />
<Compile Include="Events\PayFines.cs" />
<Compile Include="Events\Powerplay.cs" />
<Compile Include="Events\PowerplaySalary.cs" />
<Compile Include="Events\Progress.cs" />
<Compile Include="Events\Rank.cs" />
<Compile Include="Events\RedeemVoucher.cs" />
<Compile Include="Events\RefuelAll.cs" />
<Compile Include="Events\RefuelPartial.cs" />
<Compile Include="Events\Repair.cs" />
<Compile Include="Events\RepairAll.cs" />
<Compile Include="Events\Reputation.cs" />
<Compile Include="Events\RestockVehicle.cs" />
<Compile Include="Events\Resurrect.cs" />
<Compile Include="Events\SAAScanComplete.cs" />
<Compile Include="Events\Scan.cs" />
<Compile Include="Events\SelfDestruct.cs" />
<Compile Include="Events\SellDrones.cs" />
<Compile Include="Events\SellExplorationData.cs" />
<Compile Include="Events\SendText.cs" />
<Compile Include="Events\SetUserShip.cs" />
<Compile Include="Events\SetUserShipName.cs" />
<Compile Include="Events\ShipTargeted.cs" />
<Compile Include="Events\Shipyard.cs" />
Expand All @@ -154,6 +188,7 @@
<Compile Include="Events\FSDJump.cs" />
<Compile Include="Events\Music.cs" />
<Compile Include="Events\Interdicted.cs" />
<Compile Include="Events\USSDrop.cs" />
<Compile Include="Events\WingAdd.cs" />
<Compile Include="Events\WingInvite.cs" />
<Compile Include="Events\WingJoin.cs" />
Expand Down
214 changes: 212 additions & 2 deletions EliteAPI/EliteDangerousAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ private void InitProcessLog()
/// Process the log file once.
/// </summary>
/// <param name="logFile">The log file to process.</param>
private void ProcessLog(FileInfo logFile, bool actuallyProcess)
public void ProcessLog(FileInfo logFile, bool actuallyProcess)
{
//Create a stream from the log file.
FileStream fileStream = logFile.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
Expand Down Expand Up @@ -184,7 +184,7 @@ private void Process(string json)
{
default:
OtherEvent?.Invoke(this, JsonConvert.DeserializeObject<dynamic>(json));
//File.AppendAllText(@"C:\ICT\EliteAPI\NotAddedEvents.txt", json + Environment.NewLine);
File.AppendAllText(@"C:\ICT\EliteAPI\NotAddedEvents.txt", json + Environment.NewLine);
break;

case "ClearSavedGame":
Expand Down Expand Up @@ -530,9 +530,219 @@ private void Process(string json)
case "FSSDiscoveryScan":
FSSDiscoveryScanEvent?.Invoke(this, JsonConvert.DeserializeObject<FSSDiscoveryScanInfo>(json));
break;

case "Powerplay":
PowerplayEvent?.Invoke(this, JsonConvert.DeserializeObject<PowerplayInfo>(json));
break;

case "CommunityGoal":
CommunityGoalEvent?.Invoke(this, JsonConvert.DeserializeObject<CommunityGoalInfo>(json));
break;

case "FSDTarget":
FSDTargetEvent?.Invoke(this, JsonConvert.DeserializeObject<FSDTargetInfo>(json));
break;

case "CodexEntry":
CodexEntryEvent?.Invoke(this, JsonConvert.DeserializeObject<CodexEntryInfo>(json));
break;

case "ModuleInfo":
ModuleInfoEvent?.Invoke(this, JsonConvert.DeserializeObject<ModuleInfoInfo>(json));
break;

case "RedeemVoucher":
RedeemVoucherEvent?.Invoke(this, JsonConvert.DeserializeObject<RedeemVoucherInfo>(json));
break;

case "PowerplaySalary":
PowerplaySalaryEvent?.Invoke(this, JsonConvert.DeserializeObject<PowerplaySalaryInfo>(json));
break;

case "SetUserShipName":
SetUserShipNameEvent?.Invoke(this, JsonConvert.DeserializeObject<SetUserShipNameInfo>(json));
break;

case "EngineerCraft":
EngineerCraftEvent?.Invoke(this, JsonConvert.DeserializeObject<EngineerCraftInfo>(json));
break;

case "ModuleRetrieve":
ModuleRetrieveEvent?.Invoke(this, JsonConvert.DeserializeObject<ModuleRetrieveInfo>(json));
break;

case "SellDrones":
SellDronesEvent?.Invoke(this, JsonConvert.DeserializeObject<SellDronesInfo>(json));
break;

case "MultiSellExplorationData":
MultiSellExplorationDataEvent?.Invoke(this, JsonConvert.DeserializeObject<MultiSellExplorationDataInfo>(json));
break;

case "ModuleSwap":
ModuleSwapEvent?.Invoke(this, JsonConvert.DeserializeObject<ModuleSwapInfo>(json));
break;

case "SAAScanComplete":
SAAScanCompleteEvent?.Invoke(this, JsonConvert.DeserializeObject<SAAScanCompleteInfo>(json));
break;

case "LaunchSRV":
LaunchSRVEvent?.Invoke(this, JsonConvert.DeserializeObject<LaunchSRVInfo>(json));
break;

case "MaterialCollected":
MaterialCollectedEvent?.Invoke(this, JsonConvert.DeserializeObject<MaterialCollectedInfo>(json));
break;

case "DockSRV":
DockSRVEvent?.Invoke(this, JsonConvert.DeserializeObject<DockSRVInfo>(json));
break;

case "MiningRefined":
MiningRefinedEvent?.Invoke(this, JsonConvert.DeserializeObject<MiningRefinedInfo>(json));
break;

case "FSSAllBodiesFound":
FSSAllBodiesFoundEvent?.Invoke(this, JsonConvert.DeserializeObject<FSSAllBodiesFoundInfo>(json));
break;

case "MaterialDiscovered":
MaterialDiscoveredEvent?.Invoke(this, JsonConvert.DeserializeObject<MaterialDiscoveredInfo>(json));
break;

case "USSDrop":
USSDropEvent?.Invoke(this, JsonConvert.DeserializeObject<USSDropInfo>(json));
break;

case "MissionRedirected":
MissionRedirectedEvent?.Invoke(this, JsonConvert.DeserializeObject<MissionRedirectedInfo>(json));
break;

case "SendText":
SendTextEvent?.Invoke(this, JsonConvert.DeserializeObject<SendTextInfo>(json));
break;

case "SelfDestruct":
SelfDestructEvent?.Invoke(this, JsonConvert.DeserializeObject<SelfDestructInfo>(json));
break;

case "HeatDamage":
HeatDamageEvent?.Invoke(this, JsonConvert.DeserializeObject<HeatDamageInfo>(json));
break;

case "Died":
DiedEvent?.Invoke(this, JsonConvert.DeserializeObject<DiedInfo>(json));
break;

case "Resurrect":
ResurrectEvent?.Invoke(this, JsonConvert.DeserializeObject<ResurrectInfo>(json));
break;

case "HullDamage":
HullDamageEvent?.Invoke(this, JsonConvert.DeserializeObject<HullDamageInfo>(json));
break;

case "CrewMemberJoins":
CrewMemberJoinsEvent?.Invoke(this, JsonConvert.DeserializeObject<CrewMemberJoinsInfo>(json));
break;

case "CrewMemberRoleChange":
CrewMemberRoleChangeEvent?.Invoke(this, JsonConvert.DeserializeObject<CrewMemberRoleChangeInfo>(json));
break;

case "CrewLaunchFighter":
CrewLaunchFighterEvent?.Invoke(this, JsonConvert.DeserializeObject<CrewLaunchFighterInfo>(json));
break;

case "CrimeVictim":
CrimeVictimEvent?.Invoke(this, JsonConvert.DeserializeObject<CrimeVictimInfo>(json));
break;

case "EndCrewSession":
EndCrewSessionEvent?.Invoke(this, JsonConvert.DeserializeObject<EndCrewSessionInfo>(json));
break;

case "RestockVehicle":
RestockVehicleEvent?.Invoke(this, JsonConvert.DeserializeObject<RestockVehicleInfo>(json));
break;

case "CollectCargo":
CollectCargoEvent?.Invoke(this, JsonConvert.DeserializeObject<CollectCargoInfo>(json));
break;
}
}

public EventHandler<PowerplayInfo> PowerplayEvent;

public EventHandler<CommunityGoalInfo> CommunityGoalEvent;

public EventHandler<FSDTargetInfo> FSDTargetEvent;

public EventHandler<CodexEntryInfo> CodexEntryEvent;

public EventHandler<ModuleInfoInfo> ModuleInfoEvent;

public EventHandler<RedeemVoucherInfo> RedeemVoucherEvent;

public EventHandler<PowerplaySalaryInfo> PowerplaySalaryEvent;

public EventHandler<SetUserShipNameInfo> SetUserShipNameEvent;

public EventHandler<EngineerCraftInfo> EngineerCraftEvent;

public EventHandler<ModuleRetrieveInfo> ModuleRetrieveEvent;

public EventHandler<SellDronesInfo> SellDronesEvent;

public EventHandler<MultiSellExplorationDataInfo> MultiSellExplorationDataEvent;

public EventHandler<ModuleSwapInfo> ModuleSwapEvent;

public EventHandler<SAAScanCompleteInfo> SAAScanCompleteEvent;

public EventHandler<LaunchSRVInfo> LaunchSRVEvent;

public EventHandler<MaterialCollectedInfo> MaterialCollectedEvent;

public EventHandler<DockSRVInfo> DockSRVEvent;

public EventHandler<MiningRefinedInfo> MiningRefinedEvent;

public EventHandler<FSSAllBodiesFoundInfo> FSSAllBodiesFoundEvent;

public EventHandler<MaterialDiscoveredInfo> MaterialDiscoveredEvent;

public EventHandler<USSDropInfo> USSDropEvent;

public EventHandler<MissionRedirectedInfo> MissionRedirectedEvent;

public EventHandler<SendTextInfo> SendTextEvent;

public EventHandler<SelfDestructInfo> SelfDestructEvent;

public EventHandler<HeatDamageInfo> HeatDamageEvent;

public EventHandler<DiedInfo> DiedEvent;

public EventHandler<ResurrectInfo> ResurrectEvent;

public EventHandler<HullDamageInfo> HullDamageEvent;

public EventHandler<CrewMemberJoinsInfo> CrewMemberJoinsEvent;

public EventHandler<CrewMemberRoleChangeInfo> CrewMemberRoleChangeEvent;

public EventHandler<CrewLaunchFighterInfo> CrewLaunchFighterEvent;

public EventHandler<CrimeVictimInfo> CrimeVictimEvent;

public EventHandler<EndCrewSessionInfo> EndCrewSessionEvent;

public EventHandler<RestockVehicleInfo> RestockVehicleEvent;

public EventHandler<CollectCargoInfo> CollectCargoEvent;

/// <summary>
/// Triggered whenever a discovery scan has been completed.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion EliteAPI/Events/FSDJump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class FSDJumpInfo
public string SystemGovernment_Localised { get; set; }
public string SystemSecurity { get; set; }
public string SystemSecurity_Localised { get; set; }
public int Population { get; set; }
public ulong Population { get; set; }
public double JumpDist { get; set; }
public double FuelUsed { get; set; }
public double FuelLevel { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion EliteAPI/Events/Location.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class FactionInfo
public string SystemGovernment_Localised { get; set; }
public string SystemSecurity { get; set; }
public string SystemSecurity_Localised { get; set; }
public int Population { get; set; }
public ulong Population { get; set; }
public string Body { get; set; }
public int BodyID { get; set; }
public string BodyType { get; set; }
Expand Down
Loading

0 comments on commit aba270f

Please sign in to comment.