Skip to content

Commit

Permalink
Added multiple new events
Browse files Browse the repository at this point in the history
BuyAmmo
CargoDepot
CommitCrime
EscapeInterdiction
FetchRemoteModule
HeatWarning
Market
ModuleSellRemote
NavBeaconScan
PayFine
PayFines
SellExplorationData
SetUserShipName
WingAdd
WingInvite
WingJoin
WingLeave
  • Loading branch information
Somfic committed Oct 24, 2018
1 parent 7cf3d6c commit 1d89a64
Show file tree
Hide file tree
Showing 21 changed files with 363 additions and 6 deletions.
16 changes: 16 additions & 0 deletions EliteAPI/EliteAPI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@
<Compile Include="Events\ApproachBody.cs" />
<Compile Include="Events\ApproachSettlement.cs" />
<Compile Include="Events\Bounty.cs" />
<Compile Include="Events\BuyAmmo.cs" />
<Compile Include="Events\Cargo.cs" />
<Compile Include="Events\CargoDepot.cs" />
<Compile Include="Events\CommitCrime.cs" />
<Compile Include="Events\DiscoveryScan.cs" />
<Compile Include="Events\DockingDenied.cs" />
<Compile Include="Events\DockingGranted.cs" />
Expand All @@ -91,9 +94,12 @@
<Compile Include="Events\Docked.cs" />
<Compile Include="Events\DockingTimeout.cs" />
<Compile Include="Events\EjectCargo.cs" />
<Compile Include="Events\EscapeInterdiction.cs" />
<Compile Include="Events\FetchRemoteModule.cs" />
<Compile Include="Events\Fileheader.cs" />
<Compile Include="Events\Friends.cs" />
<Compile Include="Events\FuelScoop.cs" />
<Compile Include="Events\HeatWarning.cs" />
<Compile Include="Events\LaunchFighter.cs" />
<Compile Include="Events\LeaveBody.cs" />
<Compile Include="Events\Liftoff.cs" />
Expand All @@ -110,9 +116,13 @@
<Compile Include="Events\Missions.cs" />
<Compile Include="Events\ModuleBuy.cs" />
<Compile Include="Events\ModuleSell.cs" />
<Compile Include="Events\ModuleSellRemote.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\Progress.cs" />
<Compile Include="Events\Rank.cs" />
<Compile Include="Events\RefuelAll.cs" />
Expand All @@ -121,6 +131,8 @@
<Compile Include="Events\RepairAll.cs" />
<Compile Include="Events\Reputation.cs" />
<Compile Include="Events\Scan.cs" />
<Compile Include="Events\SellExplorationData.cs" />
<Compile Include="Events\SetUserShipName.cs" />
<Compile Include="Events\ShipTargeted.cs" />
<Compile Include="Events\Shipyard.cs" />
<Compile Include="Events\ShipyardBuy.cs" />
Expand All @@ -136,6 +148,10 @@
<Compile Include="Events\FSDJump.cs" />
<Compile Include="Events\Music.cs" />
<Compile Include="Events\Interdicted.cs" />
<Compile Include="Events\WingAdd.cs" />
<Compile Include="Events\WingInvite.cs" />
<Compile Include="Events\WingJoin.cs" />
<Compile Include="Events\WingLeave.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Events\StartJump.cs" />
<Compile Include="Events\SupercruiseEntry.cs" />
Expand Down
137 changes: 136 additions & 1 deletion EliteAPI/EliteDangerousAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private void Process(string json)
{
default:
OtherEvent?.Invoke(this, JsonConvert.DeserializeObject<dynamic>(json));
//File.AppendAllText(@"D:\NotAddedEvents.txt", json + Environment.NewLine);
File.AppendAllText(@"D:\NotAddedEvents.txt", json + Environment.NewLine);
break;

case "ClearSavedGame":
Expand Down Expand Up @@ -419,9 +419,144 @@ private void Process(string json)
case "LaunchFighter":
LaunchFighterEvent?.Invoke(this, JsonConvert.DeserializeObject<LaunchFighterInfo>(json));
break;

case "BuyAmmo":
BuyAmmoEvent?.Invoke(this, JsonConvert.DeserializeObject<BuyAmmoInfo>(json));
break;

case "CommitCrime":
CommitCrimeEvent?.Invoke(this, JsonConvert.DeserializeObject<CommitCrimeInfo>(json));
break;

case "PayFine":
PayFineEvent?.Invoke(this, JsonConvert.DeserializeObject<PayFineInfo>(json));
break;

case "HeatWarning":
HeatWarningEvent?.Invoke(this, JsonConvert.DeserializeObject<HeatWarningInfo>(json));
break;

case "WingInvite":
WingInviteEvent?.Invoke(this, JsonConvert.DeserializeObject<WingInviteInfo>(json));
break;

case "WingJoin":
WingJoinEvent?.Invoke(this, JsonConvert.DeserializeObject<WingJoinInfo>(json));
break;

case "WingAdd":
WingAddEvent?.Invoke(this, JsonConvert.DeserializeObject<WingAddInfo>(json));
break;

case "WingLeave":
WingLeaveEvent?.Invoke(this, JsonConvert.DeserializeObject<WingLeaveInfo>(json));
break;

case "NavBeaconScan":
NavBeaconScanEvent?.Invoke(this, JsonConvert.DeserializeObject<NavBeaconScanInfo>(json));
break;

case "CargoDepot":
CargoDepotEvent?.Invoke(this, JsonConvert.DeserializeObject<CargoDepotInfo>(json));
break;

case "PayFines":
PayFinesEvent?.Invoke(this, JsonConvert.DeserializeObject<PayFinesInfo>(json));
break;

case "SellExplorationData":
SellExplorationDataEvent?.Invoke(this, JsonConvert.DeserializeObject<SellExplorationDataInfo>(json));
break;

case "FetchRemoteModule":
FetchRemoteModuleEvent?.Invoke(this, JsonConvert.DeserializeObject<FetchRemoteModuleInfo>(json));
break;

case "ModuleSellRemote":
ModuleSellRemoteEvent?.Invoke(this, JsonConvert.DeserializeObject<ModuleSellRemoteInfo>(json));
break;

case "EscapeInterdiction":
EscapeInterdictionEvent?.Invoke(this, JsonConvert.DeserializeObject<EscapeInterdictionInfo>(json));
break;
}
}

/// <summary>
/// Triggered whenever a player sells a module remotely.
/// </summary>
public event EventHandler<EscapeInterdictionInfo> EscapeInterdictionEvent;

/// <summary>
/// Triggered whenever a player sells a module remotely.
/// </summary>
public event EventHandler<ModuleSellRemoteInfo> ModuleSellRemoteEvent;

/// <summary>
/// Triggered whenever a player requests a remote module.
/// </summary>
public event EventHandler<FetchRemoteModuleInfo> FetchRemoteModuleEvent;

/// <summary>
/// Triggered whenever a player mass-pays their fines.
/// </summary>
public event EventHandler<SellExplorationDataInfo> SellExplorationDataEvent;

/// <summary>
/// Triggered whenever a player mass-pays their fines.
/// </summary>
public event EventHandler<PayFinesInfo> PayFinesEvent;

/// <summary>
/// Triggered whenever a cargo delivery mission gets updated.
/// </summary>
public event EventHandler<CargoDepotInfo> CargoDepotEvent;

/// <summary>
/// Triggered whenever a player leaves the wing.
/// </summary>
public event EventHandler<NavBeaconScanInfo> NavBeaconScanEvent;

/// <summary>
/// Triggered whenever a player leaves the wing.
/// </summary>
public event EventHandler<WingLeaveInfo> WingLeaveEvent;

/// <summary>
/// Triggered whenever another commander gets added to the wing.
/// </summary>
public event EventHandler<WingAddInfo> WingAddEvent;

/// <summary>
/// Triggered whenever a player joins a wing.
/// </summary>
public event EventHandler<WingJoinInfo> WingJoinEvent;

/// <summary>
/// Triggered whenever a player gets invited for a wing.
/// </summary>
public event EventHandler<WingInviteInfo> WingInviteEvent;

/// <summary>
/// Triggered whenever the ships becomes too hot.
/// </summary>
public event EventHandler<HeatWarningInfo> HeatWarningEvent;

/// <summary>
/// Triggered whenever a player pays their fines.
/// </summary>
public event EventHandler<PayFineInfo> PayFineEvent;

/// <summary>
/// Triggered whenever a player commits a crime.
/// </summary>
public event EventHandler<CommitCrimeInfo> CommitCrimeEvent;

/// <summary>
/// Triggered when a player buys ammunition from a station.
/// </summary>
public event EventHandler<BuyAmmoInfo> BuyAmmoEvent;

/// <summary>
/// Triggered for every event that hasn't been included yet.
/// </summary>
Expand Down
10 changes: 10 additions & 0 deletions EliteAPI/Events/BuyAmmo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;

namespace EliteAPI
{
public class BuyAmmoInfo
{
public DateTime timestamp { get; set; }
public int Cost { get; set; }
}
}
20 changes: 20 additions & 0 deletions EliteAPI/Events/CargoDepot.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;

namespace EliteAPI
{
public class CargoDepotInfo
{
public DateTime timestamp { get; set; }
public int MissionID { get; set; }
public string UpdateType { get; set; }
public string CargoType { get; set; }
public string CargoType_Localised { get; set; }
public int Count { get; set; }
public long StartMarketID { get; set; }
public long EndMarketID { get; set; }
public int ItemsCollected { get; set; }
public int ItemsDelivered { get; set; }
public int TotalItemsToDeliver { get; set; }
public double Progress { get; set; }
}
}
12 changes: 12 additions & 0 deletions EliteAPI/Events/CommitCrime.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;

namespace EliteAPI
{
public class CommitCrimeInfo
{
public DateTime timestamp { get; set; }
public string CrimeType { get; set; }
public string Faction { get; set; }
public int Fine { get; set; }
}
}
11 changes: 11 additions & 0 deletions EliteAPI/Events/EscapeInterdiction.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System;

namespace EliteAPI
{
public class EscapeInterdictionInfo
{
public DateTime timestamp { get; set; }
public string Interdictor { get; set; }
public bool IsPlayer { get; set; }
}
}
17 changes: 17 additions & 0 deletions EliteAPI/Events/FetchRemoteModule.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;

namespace EliteAPI
{
public class FetchRemoteModuleInfo
{
public DateTime timestamp { get; set; }
public int StorageSlot { get; set; }
public string StoredItem { get; set; }
public string StoredItem_Localised { get; set; }
public int ServerId { get; set; }
public int TransferCost { get; set; }
public int TransferTime { get; set; }
public string Ship { get; set; }
public int ShipID { get; set; }
}
}
9 changes: 9 additions & 0 deletions EliteAPI/Events/HeatWarning.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using System;

namespace EliteAPI
{
public class HeatWarningInfo
{
public DateTime timestamp { get; set; }
}
}
2 changes: 1 addition & 1 deletion EliteAPI/Events/Market.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace EliteAPI
public class MarketInfo
{
public DateTime timestamp { get; set; }
public string @event { get; set; }

public long MarketID { get; set; }
public string StationName { get; set; }
public string StarSystem { get; set; }
Expand Down
16 changes: 16 additions & 0 deletions EliteAPI/Events/ModuleSellRemote.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;

namespace EliteAPI
{
public class ModuleSellRemoteInfo
{
public DateTime timestamp { get; set; }
public int StorageSlot { get; set; }
public string SellItem { get; set; }
public string SellItem_Localised { get; set; }
public int ServerId { get; set; }
public int SellPrice { get; set; }
public string Ship { get; set; }
public int ShipID { get; set; }
}
}
11 changes: 11 additions & 0 deletions EliteAPI/Events/NavBeaconScan.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System;

namespace EliteAPI
{
public class NavBeaconScanInfo
{
public DateTime timestamp { get; set; }
public long SystemAddress { get; set; }
public int NumBodies { get; set; }
}
}
12 changes: 12 additions & 0 deletions EliteAPI/Events/PayFine.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;

namespace EliteAPI
{
public class PayFineInfo
{
public DateTime timestamp { get; set; }
public int Amount { get; set; }
public bool AllFines { get; set; }
public int ShipID { get; set; }
}
}
12 changes: 12 additions & 0 deletions EliteAPI/Events/PayFines.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;

namespace EliteAPI
{
public class PayFinesInfo
{
public DateTime timestamp { get; set; }
public int Amount { get; set; }
public bool AllFines { get; set; }
public int ShipID { get; set; }
}
}
15 changes: 15 additions & 0 deletions EliteAPI/Events/SellExplorationData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;

namespace EliteAPI
{
public class SellExplorationDataInfo
{
public DateTime timestamp { get; set; }
public List<string> Systems { get; set; }
public List<string> Discovered { get; set; }
public int BaseValue { get; set; }
public int Bonus { get; set; }
public int TotalEarnings { get; set; }
}
}
14 changes: 14 additions & 0 deletions EliteAPI/Events/SetUserShipName.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;

namespace EliteAPI
{
public class SetUserShipNameInfo
{
public DateTime timestamp { get; set; }

public string Ship { get; set; }
public int ShipID { get; set; }
public string UserShipName { get; set; }
public string UserShipId { get; set; }
}
}
Loading

0 comments on commit 1d89a64

Please sign in to comment.