2
0
mirror of https://github.com/9ParsonsB/Pulsar.git synced 2025-04-05 17:39:39 -04:00
Ben Parsons 256ebb179e Rework Journal File Reading
Remove Explorer
Remove Plugin Architecture
2024-04-14 21:52:11 +10:00

289 lines
12 KiB
C#

using System.Text.Json.Serialization;
using Observatory.Framework.Files.Journal.Combat;
using Observatory.Framework.Files.Journal.Exploration;
using Observatory.Framework.Files.Journal.FleetCarrier;
using Observatory.Framework.Files.Journal.Odyssey;
using Observatory.Framework.Files.Journal.Other;
using Observatory.Framework.Files.Journal.Powerplay;
using Observatory.Framework.Files.Journal.Squadron;
using Observatory.Framework.Files.Journal.Startup;
using Observatory.Framework.Files.Journal.StationServices;
using Observatory.Framework.Files.Journal.Trade;
using Observatory.Framework.Files.Journal.Travel;
namespace Observatory.Framework.Files.Journal;
[JsonDerivedType(typeof(BackpackFile))]
[JsonDerivedType(typeof(CargoFile))]
[JsonDerivedType(typeof(FCMaterialsFile))]
[JsonDerivedType(typeof(Bounty))]
[JsonDerivedType(typeof(CapShipBound))]
[JsonDerivedType(typeof(Died))]
[JsonDerivedType(typeof(EscapeInterdiction))]
[JsonDerivedType(typeof(FactionKillBond))]
[JsonDerivedType(typeof(FighterDestroyed))]
[JsonDerivedType(typeof(HeatDamage))]
[JsonDerivedType(typeof(HeatWarning))]
[JsonDerivedType(typeof(HullDamage))]
[JsonDerivedType(typeof(Interdicted))]
[JsonDerivedType(typeof(Interdiction))]
[JsonDerivedType(typeof(PVPKill))]
[JsonDerivedType(typeof(SRVDestroyed))]
[JsonDerivedType(typeof(ShieldState))]
[JsonDerivedType(typeof(ShipTargeted))]
[JsonDerivedType(typeof(UnderAttack))]
[JsonDerivedType(typeof(BuyExplorationData))]
[JsonDerivedType(typeof(CodexEntry))]
[JsonDerivedType(typeof(DiscoveryScan))]
[JsonDerivedType(typeof(FSSAllBodiesFound))]
[JsonDerivedType(typeof(FSSBodySignals))]
[JsonDerivedType(typeof(FSSDiscoveryScan))]
[JsonDerivedType(typeof(FSSSignalDiscovered))]
[JsonDerivedType(typeof(MaterialCollected))]
[JsonDerivedType(typeof(MaterialDiscarded))]
[JsonDerivedType(typeof(MaterialDiscovered))]
[JsonDerivedType(typeof(MultiSellExplorationData))]
[JsonDerivedType(typeof(NavBeaconScan))]
[JsonDerivedType(typeof(SAAScanComplete))]
[JsonDerivedType(typeof(SAASignalsFound))]
[JsonDerivedType(typeof(Scan))]
[JsonDerivedType(typeof(ScanBaryCentre))]
[JsonDerivedType(typeof(Screenshot))]
[JsonDerivedType(typeof(SellExplorationData))]
[JsonDerivedType(typeof(CarrierBankTransfer))]
[JsonDerivedType(typeof(CarrierBuy))]
[JsonDerivedType(typeof(CarrierCancelDecommission))]
[JsonDerivedType(typeof(CarrierCrewServices))]
[JsonDerivedType(typeof(CarrierDecommission))]
[JsonDerivedType(typeof(CarrierDepositFuel))]
[JsonDerivedType(typeof(CarrierDockingPermission))]
[JsonDerivedType(typeof(CarrierFinance))]
[JsonDerivedType(typeof(CarrierJump))]
[JsonDerivedType(typeof(CarrierJumpCancelled))]
[JsonDerivedType(typeof(CarrierJumpRequest))]
[JsonDerivedType(typeof(CarrierModulePack))]
[JsonDerivedType(typeof(CarrierShipPack))]
[JsonDerivedType(typeof(CarrierStats))]
[JsonDerivedType(typeof(CarrierTradeOrder))]
[JsonDerivedType(typeof(FCMaterlas))]
[JsonDerivedType(typeof(InvalidJson))]
[JsonDerivedType(typeof(BackPack))]
[JsonDerivedType(typeof(BackpackChange))]
[JsonDerivedType(typeof(BackpackMaterials))]
[JsonDerivedType(typeof(BookDropship))]
[JsonDerivedType(typeof(BookTaxi))]
[JsonDerivedType(typeof(BuyMicroResources))]
[JsonDerivedType(typeof(BuySuit))]
[JsonDerivedType(typeof(BuyWeapon))]
[JsonDerivedType(typeof(CancelDropship))]
[JsonDerivedType(typeof(CancelTaxi))]
[JsonDerivedType(typeof(CollectItems))]
[JsonDerivedType(typeof(CreateSuitLoadout))]
[JsonDerivedType(typeof(DeleteSuitLoadout))]
[JsonDerivedType(typeof(Disembark))]
[JsonDerivedType(typeof(DropItems))]
[JsonDerivedType(typeof(DropShipDeploy))]
[JsonDerivedType(typeof(Embark))]
[JsonDerivedType(typeof(FCMaterials))]
[JsonDerivedType(typeof(LoadoutEquipModule))]
[JsonDerivedType(typeof(LoadoutRemoveModule))]
[JsonDerivedType(typeof(RenameSuitLoadout))]
[JsonDerivedType(typeof(ScanOrganic))]
[JsonDerivedType(typeof(SellMicroResources))]
[JsonDerivedType(typeof(SellOrganicData))]
[JsonDerivedType(typeof(SellSuit))]
[JsonDerivedType(typeof(SellWeapon))]
[JsonDerivedType(typeof(ShipLockerMaterials))]
[JsonDerivedType(typeof(SuitLoadout))]
[JsonDerivedType(typeof(SwitchSuitLoadout))]
[JsonDerivedType(typeof(TradeMicroResources))]
[JsonDerivedType(typeof(TransferMicroResources))]
[JsonDerivedType(typeof(UpgradeSuit))]
[JsonDerivedType(typeof(UpgradeWeapon))]
[JsonDerivedType(typeof(UseConsumable))]
[JsonDerivedType(typeof(AfmuRepairs))]
[JsonDerivedType(typeof(ApproachSettlement))]
[JsonDerivedType(typeof(CargoTransfer))]
[JsonDerivedType(typeof(ChangeCrewRole))]
[JsonDerivedType(typeof(CockpitBreached))]
[JsonDerivedType(typeof(CommitCrime))]
[JsonDerivedType(typeof(Continued))]
[JsonDerivedType(typeof(CrewLaunchFighter))]
[JsonDerivedType(typeof(CrewMemberJoins))]
[JsonDerivedType(typeof(CrewMemberQuits))]
[JsonDerivedType(typeof(CrewMemberRoleChange))]
[JsonDerivedType(typeof(CrimeVictim))]
[JsonDerivedType(typeof(DataScanned))]
[JsonDerivedType(typeof(DatalinkScan))]
[JsonDerivedType(typeof(DatalinkVoucher))]
[JsonDerivedType(typeof(DockFighter))]
[JsonDerivedType(typeof(DockSRV))]
[JsonDerivedType(typeof(EndCrewSession))]
[JsonDerivedType(typeof(FighterRebuilt))]
[JsonDerivedType(typeof(Friends))]
[JsonDerivedType(typeof(FuelScoop))]
[JsonDerivedType(typeof(JetConeBoost))]
[JsonDerivedType(typeof(JetConeDamage))]
[JsonDerivedType(typeof(JoinACrew))]
[JsonDerivedType(typeof(KickCrewMember))]
[JsonDerivedType(typeof(LaunchDrone))]
[JsonDerivedType(typeof(LaunchFighter))]
[JsonDerivedType(typeof(LaunchSRV))]
[JsonDerivedType(typeof(ModuleInfo))]
[JsonDerivedType(typeof(Music))]
[JsonDerivedType(typeof(NpcCrewPaidWage))]
[JsonDerivedType(typeof(NpcCrewRank))]
[JsonDerivedType(typeof(Promotion))]
[JsonDerivedType(typeof(ProspectedAsteroid))]
[JsonDerivedType(typeof(QuitACrew))]
[JsonDerivedType(typeof(RebootRepair))]
[JsonDerivedType(typeof(ReceiveText))]
[JsonDerivedType(typeof(RepairDrone))]
[JsonDerivedType(typeof(ReservoirReplenished))]
[JsonDerivedType(typeof(Resurrect))]
[JsonDerivedType(typeof(Scanned))]
[JsonDerivedType(typeof(SelfDestruct))]
[JsonDerivedType(typeof(SendText))]
[JsonDerivedType(typeof(Shutdown))]
[JsonDerivedType(typeof(Synthesis))]
[JsonDerivedType(typeof(SystemsShutdown))]
[JsonDerivedType(typeof(USSDrop))]
[JsonDerivedType(typeof(VehicleSwitch))]
[JsonDerivedType(typeof(WingAdd))]
[JsonDerivedType(typeof(WingInvite))]
[JsonDerivedType(typeof(WingJoin))]
[JsonDerivedType(typeof(WingLeave))]
[JsonDerivedType(typeof(PowerplayCollect))]
[JsonDerivedType(typeof(PowerplayDefect))]
[JsonDerivedType(typeof(PowerplayDeliver))]
[JsonDerivedType(typeof(PowerplayFastTrack))]
[JsonDerivedType(typeof(PowerplayJoin))]
[JsonDerivedType(typeof(PowerplayLeave))]
[JsonDerivedType(typeof(PowerplaySalary))]
[JsonDerivedType(typeof(PowerplayVote))]
[JsonDerivedType(typeof(PowerplayVoucher))]
[JsonDerivedType(typeof(AppliedToSquadron))]
[JsonDerivedType(typeof(DisbandedSquadron))]
[JsonDerivedType(typeof(InvitedToSquadron))]
[JsonDerivedType(typeof(JoinedSquadron))]
[JsonDerivedType(typeof(KickedFromSquadron))]
[JsonDerivedType(typeof(LeftSquadron))]
[JsonDerivedType(typeof(SharedBookmarkToSquadron))]
[JsonDerivedType(typeof(SquadronCreated))]
[JsonDerivedType(typeof(SquadronDemotion))]
[JsonDerivedType(typeof(SquadronPromotion))]
[JsonDerivedType(typeof(SquadronStartup))]
[JsonDerivedType(typeof(WonATrophyForSquadron))]
[JsonDerivedType(typeof(Cargo))]
[JsonDerivedType(typeof(ClearSavedGame))]
[JsonDerivedType(typeof(Commander))]
[JsonDerivedType(typeof(FileHeader))]
[JsonDerivedType(typeof(LoadGame))]
[JsonDerivedType(typeof(Loadout))]
[JsonDerivedType(typeof(Materials))]
[JsonDerivedType(typeof(Missions))]
[JsonDerivedType(typeof(NewCommander))]
[JsonDerivedType(typeof(Passengers))]
[JsonDerivedType(typeof(Startup.Powerplay))]
[JsonDerivedType(typeof(Progress))]
[JsonDerivedType(typeof(Rank))]
[JsonDerivedType(typeof(Reputation))]
[JsonDerivedType(typeof(Statistics))]
[JsonDerivedType(typeof(BuyAmmo))]
[JsonDerivedType(typeof(BuyDrones))]
[JsonDerivedType(typeof(CargoDepot))]
[JsonDerivedType(typeof(ClearImpound))]
[JsonDerivedType(typeof(CommunityGoal))]
[JsonDerivedType(typeof(CommunityGoalDiscard))]
[JsonDerivedType(typeof(CommunityGoalJoin))]
[JsonDerivedType(typeof(CommunityGoalReward))]
[JsonDerivedType(typeof(CrewAssign))]
[JsonDerivedType(typeof(CrewFire))]
[JsonDerivedType(typeof(CrewHire))]
[JsonDerivedType(typeof(EngineerApply))]
[JsonDerivedType(typeof(EngineerContribution))]
[JsonDerivedType(typeof(EngineerCraft))]
[JsonDerivedType(typeof(EngineerLegacyConvert))]
[JsonDerivedType(typeof(EngineerProgress))]
[JsonDerivedType(typeof(FetchRemoteModule))]
[JsonDerivedType(typeof(Market))]
[JsonDerivedType(typeof(MassModuleStore))]
[JsonDerivedType(typeof(MaterialTrade))]
[JsonDerivedType(typeof(MissionAbandoned))]
[JsonDerivedType(typeof(MissionAccepted))]
[JsonDerivedType(typeof(MissionCompleted))]
[JsonDerivedType(typeof(MissionFailed))]
[JsonDerivedType(typeof(MissionRedirected))]
[JsonDerivedType(typeof(ModuleBuy))]
[JsonDerivedType(typeof(ModuleRetrieve))]
[JsonDerivedType(typeof(ModuleSell))]
[JsonDerivedType(typeof(ModuleSellRemote))]
[JsonDerivedType(typeof(ModuleStore))]
[JsonDerivedType(typeof(ModuleSwap))]
[JsonDerivedType(typeof(Outfitting))]
[JsonDerivedType(typeof(PayBounties))]
[JsonDerivedType(typeof(PayFines))]
[JsonDerivedType(typeof(PayLegacyFines))]
[JsonDerivedType(typeof(RedeemVoucher))]
[JsonDerivedType(typeof(RefuelAll))]
[JsonDerivedType(typeof(RefuelPartial))]
[JsonDerivedType(typeof(Repair))]
[JsonDerivedType(typeof(RepairAll))]
[JsonDerivedType(typeof(RestockVehicle))]
[JsonDerivedType(typeof(ScientificResearch))]
[JsonDerivedType(typeof(SearchAndRescue))]
[JsonDerivedType(typeof(SellDrones))]
[JsonDerivedType(typeof(SellShipOnRebuy))]
[JsonDerivedType(typeof(SetUserShipName))]
[JsonDerivedType(typeof(Shipyard))]
[JsonDerivedType(typeof(ShipyardBuy))]
[JsonDerivedType(typeof(ShipyardNew))]
[JsonDerivedType(typeof(ShipyardSell))]
[JsonDerivedType(typeof(ShipyardSwap))]
[JsonDerivedType(typeof(ShipyardTransfer))]
[JsonDerivedType(typeof(StoredModules))]
[JsonDerivedType(typeof(StoredShips))]
[JsonDerivedType(typeof(TechnologyBroker))]
[JsonDerivedType(typeof(AsteroidCracked))]
[JsonDerivedType(typeof(BuyTradeData))]
[JsonDerivedType(typeof(CollectCargo))]
[JsonDerivedType(typeof(EjectCargo))]
[JsonDerivedType(typeof(MarketBuy))]
[JsonDerivedType(typeof(MarketSell))]
[JsonDerivedType(typeof(MiningRefined))]
[JsonDerivedType(typeof(ApproachBody))]
[JsonDerivedType(typeof(Docked))]
[JsonDerivedType(typeof(DockingCancelled))]
[JsonDerivedType(typeof(DockingDenied))]
[JsonDerivedType(typeof(DockingGranted))]
[JsonDerivedType(typeof(DockingRequested))]
[JsonDerivedType(typeof(DockingTimeout))]
[JsonDerivedType(typeof(FSDJump))]
[JsonDerivedType(typeof(FSDTarget))]
[JsonDerivedType(typeof(LeaveBody))]
[JsonDerivedType(typeof(Liftoff))]
[JsonDerivedType(typeof(Location))]
[JsonDerivedType(typeof(NavRoute))]
[JsonDerivedType(typeof(NavRouteClear))]
[JsonDerivedType(typeof(StartJump))]
[JsonDerivedType(typeof(SupercruiseDestinationDrop))]
[JsonDerivedType(typeof(SupercruiseEntry))]
[JsonDerivedType(typeof(SupercruiseExit))]
[JsonDerivedType(typeof(Touchdown))]
[JsonDerivedType(typeof(Undocked))]
[JsonDerivedType(typeof(MarketFile))]
[JsonDerivedType(typeof(ModuleInfoFile))]
[JsonDerivedType(typeof(NavRouteFile))]
[JsonDerivedType(typeof(OutfittingFile))]
[JsonDerivedType(typeof(ShipyardFile))]
[JsonDerivedType(typeof(Status))]
public class JournalBase
{
[JsonPropertyName("timestamp")]
public DateTimeOffset Timestamp { get; init; }
[JsonPropertyName("event")]
public string Event { get; init; }
[JsonExtensionData]
public Dictionary<string, object> AdditionalProperties { get; init; }
}