From 337a9d5ea0e51773d00cb23374189fee403a0fdf Mon Sep 17 00:00:00 2001 From: Ben Parsons <9parsonsb@gmail.com> Date: Fri, 17 May 2024 23:40:36 +1000 Subject: [PATCH] Update Status Fuel Display Start working on Explorer Panel Backend now uses polymorphic de/serialization (net9) --- Botanist/Botanist.csproj | 2 +- .../Files/Journal/JournalBase.cs | 529 +++++++++--------- .../ObservatoryFramework.csproj | 2 +- Pulsar/Features/Journal/JournalService.cs | 43 +- Pulsar/Features/Status/StatusService.cs | 2 +- Pulsar/Pulsar.csproj | 2 +- Pulsar/Utils/JournalJsonConverter.cs | 252 ++++----- Pulsar/WebApp/package-lock.json | 203 +++---- Pulsar/WebApp/package.json | 8 +- Pulsar/WebApp/src/lib/Status.svelte | 14 +- .../src/routes/explorer/Explorer.svelte | 90 ++- .../WebApp/src/types/api/FSSDiscoveryScan.ts | 11 + Pulsar/WebApp/src/types/api/JournalBase.ts | 2 +- Pulsar/WebApp/src/types/api/Scan.ts | 62 ++ 14 files changed, 684 insertions(+), 538 deletions(-) create mode 100644 Pulsar/WebApp/src/types/api/FSSDiscoveryScan.ts create mode 100644 Pulsar/WebApp/src/types/api/Scan.ts diff --git a/Botanist/Botanist.csproj b/Botanist/Botanist.csproj index c1812fb..c70b1e3 100644 --- a/Botanist/Botanist.csproj +++ b/Botanist/Botanist.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 enable false Debug;Release;Portable diff --git a/ObservatoryFramework/Files/Journal/JournalBase.cs b/ObservatoryFramework/Files/Journal/JournalBase.cs index fbaf8c8..1e821d2 100644 --- a/ObservatoryFramework/Files/Journal/JournalBase.cs +++ b/ObservatoryFramework/Files/Journal/JournalBase.cs @@ -13,279 +13,268 @@ using StationServices; using Trade; using Travel; -[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))] -[JsonDerivedType(typeof(JournalBase))] -public class JournalBase +[JsonPolymorphic(TypeDiscriminatorPropertyName = "event", UnknownDerivedTypeHandling = JsonUnknownDerivedTypeHandling.FailSerialization)] +[JsonDerivedType(typeof(Bounty), "Bounty")] +[JsonDerivedType(typeof(CapShipBound), "CapShipBound")] +[JsonDerivedType(typeof(Died), "Died")] +[JsonDerivedType(typeof(EscapeInterdiction), "EscapeInterdiction")] +[JsonDerivedType(typeof(FactionKillBond), "FactionKillBond")] +[JsonDerivedType(typeof(FighterDestroyed), "FighterDestroyed")] +[JsonDerivedType(typeof(HeatDamage), "HeatDamage")] +[JsonDerivedType(typeof(HeatWarning), "HeatWarning")] +[JsonDerivedType(typeof(HullDamage), "HullDamage")] +[JsonDerivedType(typeof(Interdicted), "Interdicted")] +[JsonDerivedType(typeof(Interdiction), "Interdiction")] +[JsonDerivedType(typeof(PVPKill), "PVPKill")] +[JsonDerivedType(typeof(SRVDestroyed), "SRVDestroyed")] +[JsonDerivedType(typeof(ShieldState), "ShieldState")] +[JsonDerivedType(typeof(ShipTargeted), "ShipTargeted")] +[JsonDerivedType(typeof(UnderAttack), "UnderAttack")] +[JsonDerivedType(typeof(BuyExplorationData), "BuyExplorationData")] +[JsonDerivedType(typeof(CodexEntry), "CodexEntry")] +[JsonDerivedType(typeof(DiscoveryScan), "DiscoveryScan")] +[JsonDerivedType(typeof(FSSAllBodiesFound), "FSSAllBodiesFound")] +[JsonDerivedType(typeof(FSSBodySignals), "FSSBodySignals")] +[JsonDerivedType(typeof(FSSDiscoveryScan), "FSSDiscoveryScan")] +[JsonDerivedType(typeof(FSSSignalDiscovered), "FSSSignalDiscovered")] +[JsonDerivedType(typeof(MaterialCollected), "MaterialCollected")] +[JsonDerivedType(typeof(MaterialDiscarded), "MaterialDiscarded")] +[JsonDerivedType(typeof(MaterialDiscovered), "MaterialDiscovered")] +[JsonDerivedType(typeof(MultiSellExplorationData), "MultiSellExplorationData")] +[JsonDerivedType(typeof(NavBeaconScan), "NavBeaconScan")] +[JsonDerivedType(typeof(SAAScanComplete), "SAAScanComplete")] +[JsonDerivedType(typeof(SAASignalsFound), "SAASignalsFound")] +[JsonDerivedType(typeof(Scan), "Scan")] +[JsonDerivedType(typeof(ScanBaryCentre), "ScanBaryCentre")] +[JsonDerivedType(typeof(Screenshot), "Screenshot")] +[JsonDerivedType(typeof(SellExplorationData), "SellExplorationData")] +[JsonDerivedType(typeof(CarrierBankTransfer), "CarrierBankTransfer")] +[JsonDerivedType(typeof(CarrierBuy), "CarrierBuy")] +[JsonDerivedType(typeof(CarrierCancelDecommission), "CarrierCancelDecommission")] +[JsonDerivedType(typeof(CarrierCrewServices), "CarrierCrewServices")] +[JsonDerivedType(typeof(CarrierDecommission), "CarrierDecommission")] +[JsonDerivedType(typeof(CarrierDepositFuel), "CarrierDepositFuel")] +[JsonDerivedType(typeof(CarrierDockingPermission), "CarrierDockingPermission")] +[JsonDerivedType(typeof(CarrierFinance), "CarrierFinance")] +[JsonDerivedType(typeof(CarrierJump), "CarrierJump")] +[JsonDerivedType(typeof(CarrierJumpCancelled), "CarrierJumpCancelled")] +[JsonDerivedType(typeof(CarrierJumpRequest), "CarrierJumpRequest")] +[JsonDerivedType(typeof(CarrierModulePack), "CarrierModulePack")] +[JsonDerivedType(typeof(CarrierShipPack), "CarrierShipPack")] +[JsonDerivedType(typeof(CarrierStats), "CarrierStats")] +[JsonDerivedType(typeof(CarrierTradeOrder), "CarrierTradeOrder")] +[JsonDerivedType(typeof(FCMaterlas), "FCMaterlas")] +[JsonDerivedType(typeof(InvalidJson), "InvalidJson")] +[JsonDerivedType(typeof(BackpackChange), "BackpackChange")] +[JsonDerivedType(typeof(BackpackMaterials), "Backpack")] +[JsonDerivedType(typeof(BookDropship), "BookDropship")] +[JsonDerivedType(typeof(BookTaxi), "BookTaxi")] +[JsonDerivedType(typeof(BuyMicroResources), "BuyMicroResources")] +[JsonDerivedType(typeof(BuySuit), "BuySuit")] +[JsonDerivedType(typeof(BuyWeapon), "BuyWeapon")] +[JsonDerivedType(typeof(CancelDropship), "CancelDropship")] +[JsonDerivedType(typeof(CancelTaxi), "CancelTaxi")] +[JsonDerivedType(typeof(CollectItems), "CollectItems")] +[JsonDerivedType(typeof(CreateSuitLoadout), "CreateSuitLoadout")] +[JsonDerivedType(typeof(DeleteSuitLoadout), "DeleteSuitLoadout")] +[JsonDerivedType(typeof(Disembark), "Disembark")] +[JsonDerivedType(typeof(DropItems), "DropItems")] +[JsonDerivedType(typeof(DropShipDeploy), "DropShipDeploy")] +[JsonDerivedType(typeof(Embark), "Embark")] +[JsonDerivedType(typeof(FCMaterials), "FCMaterials")] +[JsonDerivedType(typeof(LoadoutEquipModule), "LoadoutEquipModule")] +[JsonDerivedType(typeof(LoadoutRemoveModule), "LoadoutRemoveModule")] +[JsonDerivedType(typeof(RenameSuitLoadout), "RenameSuitLoadout")] +[JsonDerivedType(typeof(ScanOrganic), "ScanOrganic")] +[JsonDerivedType(typeof(SellMicroResources), "SellMicroResources")] +[JsonDerivedType(typeof(SellOrganicData), "SellOrganicData")] +[JsonDerivedType(typeof(SellSuit), "SellSuit")] +[JsonDerivedType(typeof(SellWeapon), "SellWeapon")] +[JsonDerivedType(typeof(ShipLockerMaterials), "ShipLocker")] +[JsonDerivedType(typeof(SuitLoadout), "SuitLoadout")] +[JsonDerivedType(typeof(SwitchSuitLoadout) , "SwitchSuitLoadout")] +[JsonDerivedType(typeof(TradeMicroResources), "TradeMicroResources")] +[JsonDerivedType(typeof(TransferMicroResources), "TransferMicroResources")] +[JsonDerivedType(typeof(UpgradeSuit), "UpgradeSuit")] +[JsonDerivedType(typeof(UpgradeWeapon), "UpgradeWeapon")] +[JsonDerivedType(typeof(UseConsumable), "UseConsumable")] +[JsonDerivedType(typeof(AfmuRepairs), "AfmuRepairs")] +[JsonDerivedType(typeof(ApproachSettlement), "ApproachSettlement")] +[JsonDerivedType(typeof(CargoTransfer), "CargoTransfer")] +[JsonDerivedType(typeof(ChangeCrewRole), "ChangeCrewRole")] +[JsonDerivedType(typeof(CockpitBreached), "CockpitBreached")] +[JsonDerivedType(typeof(CommitCrime), "CommitCrime")] +[JsonDerivedType(typeof(Continued), "Continued")] +[JsonDerivedType(typeof(CrewLaunchFighter), "CrewLaunchFighter")] +[JsonDerivedType(typeof(CrewMemberJoins), "CrewMemberJoins")] +[JsonDerivedType(typeof(CrewMemberQuits), "CrewMemberQuits")] +[JsonDerivedType(typeof(CrewMemberRoleChange), "CrewMemberRoleChange")] +[JsonDerivedType(typeof(CrimeVictim), "CrimeVictim")] +[JsonDerivedType(typeof(DataScanned), "DataScanned")] +[JsonDerivedType(typeof(DatalinkScan), "DatalinkScan")] +[JsonDerivedType(typeof(DatalinkVoucher), "DatalinkVoucher")] +[JsonDerivedType(typeof(DockFighter), "DockFighter")] +[JsonDerivedType(typeof(DockSRV), "DockSRV")] +[JsonDerivedType(typeof(EndCrewSession), "EndCrewSession")] +[JsonDerivedType(typeof(FighterRebuilt), "FighterRebuilt")] +[JsonDerivedType(typeof(Friends), "Friends")] +[JsonDerivedType(typeof(FuelScoop), "FuelScoop")] +[JsonDerivedType(typeof(JetConeBoost), "JetConeBoost")] +[JsonDerivedType(typeof(JetConeDamage), "JetConeDamage")] +[JsonDerivedType(typeof(JoinACrew), "JoinACrew")] +[JsonDerivedType(typeof(KickCrewMember), "KickCrewMember")] +[JsonDerivedType(typeof(LaunchDrone), "LaunchDrone")] +[JsonDerivedType(typeof(LaunchFighter), "LaunchFighter")] +[JsonDerivedType(typeof(LaunchSRV), "LaunchSRV")] +[JsonDerivedType(typeof(ModuleInfo), "ModuleInfo")] +[JsonDerivedType(typeof(Music), "Music")] +[JsonDerivedType(typeof(NpcCrewPaidWage), "NpcCrewPaidWage")] +[JsonDerivedType(typeof(NpcCrewRank), "NpcCrewRank")] +[JsonDerivedType(typeof(Promotion), "Promotion")] +[JsonDerivedType(typeof(ProspectedAsteroid), "ProspectedAsteroid")] +[JsonDerivedType(typeof(QuitACrew), "QuitACrew")] +[JsonDerivedType(typeof(RebootRepair), "RebootRepair")] +[JsonDerivedType(typeof(ReceiveText), "ReceiveText")] +[JsonDerivedType(typeof(RepairDrone), "RepairDrone")] +[JsonDerivedType(typeof(ReservoirReplenished), "ReservoirReplenished")] +[JsonDerivedType(typeof(Resurrect), "Resurrect")] +[JsonDerivedType(typeof(Scanned), "Scanned")] +[JsonDerivedType(typeof(SelfDestruct), "SelfDestruct")] +[JsonDerivedType(typeof(SendText), "SendText")] +[JsonDerivedType(typeof(Shutdown), "Shutdown")] +[JsonDerivedType(typeof(Synthesis), "Synthesis")] +[JsonDerivedType(typeof(SystemsShutdown), "SystemsShutdown")] +[JsonDerivedType(typeof(USSDrop), "USSDrop")] +[JsonDerivedType(typeof(VehicleSwitch), "VehicleSwitch")] +[JsonDerivedType(typeof(WingAdd), "WingAdd")] +[JsonDerivedType(typeof(WingInvite), "WingInvite")] +[JsonDerivedType(typeof(WingJoin), "WingJoin")] +[JsonDerivedType(typeof(WingLeave), "WingLeave")] +[JsonDerivedType(typeof(PowerplayCollect), "PowerplayCollect")] +[JsonDerivedType(typeof(PowerplayDefect), "PowerplayDefect")] +[JsonDerivedType(typeof(PowerplayDeliver), "PowerplayDeliver")] +[JsonDerivedType(typeof(PowerplayFastTrack), "PowerplayFastTrack")] +[JsonDerivedType(typeof(PowerplayJoin), "PowerplayJoin")] +[JsonDerivedType(typeof(PowerplayLeave), "PowerplayLeave")] +[JsonDerivedType(typeof(PowerplaySalary), "PowerplaySalary")] +[JsonDerivedType(typeof(PowerplayVote), "PowerplayVote")] +[JsonDerivedType(typeof(PowerplayVoucher), "PowerplayVoucher")] +[JsonDerivedType(typeof(AppliedToSquadron), "AppliedToSquadron")] +[JsonDerivedType(typeof(DisbandedSquadron), "DisbandedSquadron")] +[JsonDerivedType(typeof(InvitedToSquadron), "InvitedToSquadron")] +[JsonDerivedType(typeof(JoinedSquadron), "JoinedSquadron")] +[JsonDerivedType(typeof(KickedFromSquadron), "KickedFromSquadron")] +[JsonDerivedType(typeof(LeftSquadron), "LeftSquadron")] +[JsonDerivedType(typeof(SharedBookmarkToSquadron), "SharedBookmarkToSquadron")] +[JsonDerivedType(typeof(SquadronCreated), "SquadronCreated")] +[JsonDerivedType(typeof(SquadronDemotion), "SquadronDemotion")] +[JsonDerivedType(typeof(SquadronPromotion), "SquadronPromotion")] +[JsonDerivedType(typeof(SquadronStartup), "SquadronStartup")] +[JsonDerivedType(typeof(WonATrophyForSquadron), "WonATrophyForSquadron")] +[JsonDerivedType(typeof(Cargo), "Cargo")] +[JsonDerivedType(typeof(ClearSavedGame), "ClearSavedGame")] +[JsonDerivedType(typeof(Commander), "Commander")] +[JsonDerivedType(typeof(FileHeader), "Fileheader")] +[JsonDerivedType(typeof(LoadGame), "LoadGame")] +[JsonDerivedType(typeof(Loadout), "Loadout")] +[JsonDerivedType(typeof(Materials), "Materials")] +[JsonDerivedType(typeof(Missions), "Missions")] +[JsonDerivedType(typeof(NewCommander), "NewCommander")] +[JsonDerivedType(typeof(Passengers), "Passengers")] +[JsonDerivedType(typeof(Startup.Powerplay), "Powerplay")] +[JsonDerivedType(typeof(Progress), "Progress")] +[JsonDerivedType(typeof(Rank), "Rank")] +[JsonDerivedType(typeof(Reputation), "Reputation")] +[JsonDerivedType(typeof(Statistics), "Statistics")] +[JsonDerivedType(typeof(BuyAmmo), "BuyAmmo")] +[JsonDerivedType(typeof(BuyDrones), "BuyDrones")] +[JsonDerivedType(typeof(CargoDepot), "CargoDepot")] +[JsonDerivedType(typeof(ClearImpound), "ClearImpound")] +[JsonDerivedType(typeof(CommunityGoal), "CommunityGoal")] +[JsonDerivedType(typeof(CommunityGoalDiscard), "CommunityGoalDiscard")] +[JsonDerivedType(typeof(CommunityGoalJoin), "CommunityGoalJoin")] +[JsonDerivedType(typeof(CommunityGoalReward), "CommunityGoalReward")] +[JsonDerivedType(typeof(CrewAssign), "CrewAssign")] +[JsonDerivedType(typeof(CrewFire), "CrewFire")] +[JsonDerivedType(typeof(CrewHire), "CrewHire")] +[JsonDerivedType(typeof(EngineerApply), "EngineerApply")] +[JsonDerivedType(typeof(EngineerContribution), "EngineerContribution")] +[JsonDerivedType(typeof(EngineerCraft), "EngineerCraft")] +[JsonDerivedType(typeof(EngineerLegacyConvert), "EngineerLegacyConvert")] +[JsonDerivedType(typeof(EngineerProgress), "EngineerProgress")] +[JsonDerivedType(typeof(FetchRemoteModule), "FetchRemoteModule")] +[JsonDerivedType(typeof(Market), "Market")] +[JsonDerivedType(typeof(MassModuleStore), "MassModuleStore")] +[JsonDerivedType(typeof(MaterialTrade), "MaterialTrade")] +[JsonDerivedType(typeof(MissionAbandoned), "MissionAbandoned")] +[JsonDerivedType(typeof(MissionAccepted), "MissionAccepted")] +[JsonDerivedType(typeof(MissionCompleted), "MissionCompleted")] +[JsonDerivedType(typeof(MissionFailed), "MissionFailed")] +[JsonDerivedType(typeof(MissionRedirected), "MissionRedirected")] +[JsonDerivedType(typeof(ModuleBuy), "ModuleBuy")] +[JsonDerivedType(typeof(ModuleRetrieve), "ModuleRetrieve")] +[JsonDerivedType(typeof(ModuleSell), "ModuleSell")] +[JsonDerivedType(typeof(ModuleSellRemote), "ModuleSellRemote")] +[JsonDerivedType(typeof(ModuleStore), "ModuleStore")] +[JsonDerivedType(typeof(ModuleSwap), "ModuleSwap")] +[JsonDerivedType(typeof(Outfitting), "Outfitting")] +[JsonDerivedType(typeof(PayBounties), "PayBounties")] +[JsonDerivedType(typeof(PayFines), "PayFines")] +[JsonDerivedType(typeof(PayLegacyFines), "PayLegacyFines")] +[JsonDerivedType(typeof(RedeemVoucher), "RedeemVoucher")] +[JsonDerivedType(typeof(RefuelAll), "RefuelAll")] +[JsonDerivedType(typeof(RefuelPartial), "RefuelPartial")] +[JsonDerivedType(typeof(Repair), "Repair")] +[JsonDerivedType(typeof(RepairAll), "RepairAll")] +[JsonDerivedType(typeof(RestockVehicle), "RestockVehicle")] +[JsonDerivedType(typeof(ScientificResearch), "ScientificResearch")] +[JsonDerivedType(typeof(SearchAndRescue), "SearchAndRescue")] +[JsonDerivedType(typeof(SellDrones), "SellDrones")] +[JsonDerivedType(typeof(SellShipOnRebuy), "SellShipOnRebuy")] +[JsonDerivedType(typeof(SetUserShipName), "SetUserShipName")] +[JsonDerivedType(typeof(Shipyard), "Shipyard")] +[JsonDerivedType(typeof(ShipyardBuy), "ShipyardBuy")] +[JsonDerivedType(typeof(ShipyardNew), "ShipyardNew")] +[JsonDerivedType(typeof(ShipyardSell), "ShipyardSell")] +[JsonDerivedType(typeof(ShipyardSwap), "ShipyardSwap")] +[JsonDerivedType(typeof(ShipyardTransfer), "ShipyardTransfer")] +[JsonDerivedType(typeof(StoredModules), "StoredModules")] +[JsonDerivedType(typeof(StoredShips), "StoredShips")] +[JsonDerivedType(typeof(TechnologyBroker), "TechnologyBroker")] +[JsonDerivedType(typeof(AsteroidCracked), "AsteroidCracked")] +[JsonDerivedType(typeof(BuyTradeData), "BuyTradeData")] +[JsonDerivedType(typeof(CollectCargo), "CollectCargo")] +[JsonDerivedType(typeof(EjectCargo), "EjectCargo")] +[JsonDerivedType(typeof(MarketBuy), "MarketBuy")] +[JsonDerivedType(typeof(MarketSell), "MarketSell")] +[JsonDerivedType(typeof(MiningRefined), "MiningRefined")] +[JsonDerivedType(typeof(ApproachBody), "ApproachBody")] +[JsonDerivedType(typeof(Docked), "Docked")] +[JsonDerivedType(typeof(DockingCancelled), "DockingCancelled")] +[JsonDerivedType(typeof(DockingDenied), "DockingDenied")] +[JsonDerivedType(typeof(DockingGranted), "DockingGranted")] +[JsonDerivedType(typeof(DockingRequested), "DockingRequested")] +[JsonDerivedType(typeof(DockingTimeout), "DockingTimeout")] +[JsonDerivedType(typeof(FSDJump), "FSDJump")] +[JsonDerivedType(typeof(FSDTarget), "FSDTarget")] +[JsonDerivedType(typeof(LeaveBody), "LeaveBody")] +[JsonDerivedType(typeof(Liftoff), "Liftoff")] +[JsonDerivedType(typeof(Location), "Location")] +[JsonDerivedType(typeof(NavRoute), "NavRoute")] +[JsonDerivedType(typeof(NavRouteClear), "NavRouteClear")] +[JsonDerivedType(typeof(StartJump), "StartJump")] +[JsonDerivedType(typeof(SupercruiseDestinationDrop), "SupercruiseDestinationDrop")] +[JsonDerivedType(typeof(SupercruiseEntry), "SupercruiseEntry")] +[JsonDerivedType(typeof(SupercruiseExit), "SupercruiseExit")] +[JsonDerivedType(typeof(Touchdown), "Touchdown")] +[JsonDerivedType(typeof(Undocked), "Undocked")] +[JsonDerivedType(typeof(Status), "Status")] +public abstract class JournalBase { [JsonPropertyName("timestamp")] public DateTimeOffset Timestamp { get; init; } - - [JsonPropertyName("event")] - public string Event { get; init; } - + [JsonExtensionData] public Dictionary AdditionalProperties { get; init; } } + \ No newline at end of file diff --git a/ObservatoryFramework/ObservatoryFramework.csproj b/ObservatoryFramework/ObservatoryFramework.csproj index 26178c4..7c94243 100644 --- a/ObservatoryFramework/ObservatoryFramework.csproj +++ b/ObservatoryFramework/ObservatoryFramework.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 enable Observatory.Framework Debug;Release;Portable diff --git a/Pulsar/Features/Journal/JournalService.cs b/Pulsar/Features/Journal/JournalService.cs index 9e8ad76..e619ded 100644 --- a/Pulsar/Features/Journal/JournalService.cs +++ b/Pulsar/Features/Journal/JournalService.cs @@ -19,6 +19,13 @@ public class JournalService( static ConcurrentBag _journals = new(); static DateTimeOffset notBefore = DateTimeOffset.UtcNow.AddHours(-1); + + readonly JsonSerializerOptions options = new() + { + PropertyNameCaseInsensitive = true, + AllowOutOfOrderMetadataProperties = true, + // Converters = { ActivatorUtilities.CreateInstance(serviceProvider) } + }; public async Task HandleFile(string filePath) { @@ -29,28 +36,35 @@ public class JournalService( var file = await File.ReadAllLinesAsync(filePath, Encoding.UTF8); var newJournals = new List(); - var select = file.AsParallel().Select(line => JsonSerializer.Deserialize(line, - new JsonSerializerOptions - { - PropertyNameCaseInsensitive = true, - Converters = { ActivatorUtilities.CreateInstance(serviceProvider) } - })); - - foreach (var journal in select) + await Parallel.ForEachAsync(file, (line, _) => { - if (_journals.Any(j => j.Timestamp == journal.Timestamp && j.Event == journal.Event)) + if (string.IsNullOrWhiteSpace(line)) { - continue; + return ValueTask.CompletedTask; } + + var journal = JsonSerializer.Deserialize(line, options); + if (journal == null) + { + return ValueTask.CompletedTask; + } + + if (_journals.Any(j => j.Timestamp == journal.Timestamp && j.GetType() == journal.GetType())) + { + return ValueTask.CompletedTask; + } + + _journals.Add(journal); if (journal.Timestamp < notBefore) { - continue; + return ValueTask.CompletedTask; } - _journals.Add(journal); newJournals.Add(journal); - } + return ValueTask.CompletedTask; + }); + if (newJournals.Any()) { @@ -60,7 +74,6 @@ public class JournalService( public async Task> Get() { - await hub.Clients.All.JournalUpdated(_journals.ToList()); - return _journals.ToList(); + return []; } } \ No newline at end of file diff --git a/Pulsar/Features/Status/StatusService.cs b/Pulsar/Features/Status/StatusService.cs index b9b7ec0..807fce1 100644 --- a/Pulsar/Features/Status/StatusService.cs +++ b/Pulsar/Features/Status/StatusService.cs @@ -41,7 +41,7 @@ public class StatusService public async Task Get() { - var statusFile = Path.Combine(options.Value.JournalDirectory, FileName); + var statusFile = Path.Join(options.Value.JournalDirectory, FileName); if (!FileHelper.ValidateFile(statusFile)) { diff --git a/Pulsar/Pulsar.csproj b/Pulsar/Pulsar.csproj index 3f591e8..eaaf115 100644 --- a/Pulsar/Pulsar.csproj +++ b/Pulsar/Pulsar.csproj @@ -2,7 +2,7 @@ exe - net8.0 + net9.0 enable enable Pulsar diff --git a/Pulsar/Utils/JournalJsonConverter.cs b/Pulsar/Utils/JournalJsonConverter.cs index e683516..64cf58f 100644 --- a/Pulsar/Utils/JournalJsonConverter.cs +++ b/Pulsar/Utils/JournalJsonConverter.cs @@ -42,7 +42,7 @@ public enum JournalReaderState /// all Journals can be deserialized into a JournalBase object for identification /// and then deserialized into their respective types. /// -public class JournalConverter(ILogger logger) : JsonConverter +public class JournalJsonConverter(ILogger logger) : JsonConverter { private JournalReaderState state = JournalReaderState.Start; @@ -58,18 +58,12 @@ public class JournalConverter(ILogger logger) : JsonConverter< depth++; switch (clone.TokenType) { - case JsonTokenType.None: - break; case JsonTokenType.StartObject: state = JournalReaderState.Start; break; case JsonTokenType.EndObject: state = JournalReaderState.End; break; - case JsonTokenType.StartArray: - break; - case JsonTokenType.EndArray: - break; case JsonTokenType.PropertyName: var propertyName = clone.GetString(); // if we have not started reading the body, and we have not read the (timestamp or event name) @@ -99,23 +93,23 @@ public class JournalConverter(ILogger logger) : JsonConverter< break; case JsonTokenType.Comment: continue; + case JsonTokenType.None: + case JsonTokenType.StartArray: + case JsonTokenType.EndArray: case JsonTokenType.String: - break; case JsonTokenType.Number: - break; case JsonTokenType.True: - break; case JsonTokenType.False: - break; case JsonTokenType.Null: + logger.LogWarning("Unexpected token type {TokenType} at depth {Depth}", clone.TokenType, depth); break; default: throw new ArgumentOutOfRangeException(); } } while (clone.Read()); - return new() { Timestamp = timestamp!.Value, Event = eventName! }; - + logger.LogWarning("Failed to deserialize journal entry at depth: {Depth}. Event?: {EventName}, Timestamp?: {Timestamp}", depth, eventName, timestamp); + return null; // TODO: handle inf (invalid data) in the journal files // else if (typeof(TJournal) == typeof(Scan) && json.Contains("\"RotationPeriod\":inf")) // { @@ -125,237 +119,237 @@ public class JournalConverter(ILogger logger) : JsonConverter< private JournalBase GetDestinationType(ref Utf8JsonReader reader, string eventName) { - switch (eventName.ToLower()) + switch (eventName) { - case "fileheader": + case "Fileheader": return JsonSerializer.Deserialize(ref reader)!; - case "commander": + case "Commander": return JsonSerializer.Deserialize(ref reader)!; - case "materials": + case "Materials": return JsonSerializer.Deserialize(ref reader)!; - case "rank": + case "Rank": return JsonSerializer.Deserialize(ref reader)!; - case "music": + case "Music": return JsonSerializer.Deserialize(ref reader)!; - case "cargo": + case "Cargo": return JsonSerializer.Deserialize(ref reader)!; - case "loadout": + case "Loadout": return JsonSerializer.Deserialize(ref reader)!; - case "missions": + case "Missions": return JsonSerializer.Deserialize(ref reader)!; - case "fsssignaldiscovered": + case "FSSSignalDiscovered": return JsonSerializer.Deserialize(ref reader)!; - case "reputation": + case "Reputation": return JsonSerializer.Deserialize(ref reader)!; - case "loadgame": + case "LoadGame": return JsonSerializer.Deserialize(ref reader)!; - case "receivetext": + case "ReceiveText": return JsonSerializer.Deserialize(ref reader)!; - case "shiplocker": + case "ShipLocker": return JsonSerializer.Deserialize(ref reader)!; - case "location": + case "Location": return JsonSerializer.Deserialize(ref reader)!; - case "powerplay": + case "Powerplay": return JsonSerializer.Deserialize(ref reader)!; - case "reservoirreplenished": + case "ReservoirReplenished": return JsonSerializer.Deserialize(ref reader)!; - case "statistics": + case "Statistics": return JsonSerializer.Deserialize(ref reader)!; - case "scan": + case "Scan": return JsonSerializer.Deserialize(ref reader)!; - case "shipyard": + case "Shipyard": return JsonSerializer.Deserialize(ref reader)!; - case "docked": + case "Docked": return JsonSerializer.Deserialize(ref reader)!; - case "leavebody": + case "LeaveBody": return JsonSerializer.Deserialize(ref reader)!; - case "progress": + case "Progress": return JsonSerializer.Deserialize(ref reader)!; - case "supercruiseexit": + case "SupercruiseExit": return JsonSerializer.Deserialize(ref reader)!; - case "engineerprogress": + case "EngineerProgress": return JsonSerializer.Deserialize(ref reader)!; - case "dockingrequested": + case "DockingRequested": return JsonSerializer.Deserialize(ref reader)!; - case "npccrewpaidwage": + case "NpcCrewPaidWage": return JsonSerializer.Deserialize(ref reader)!; - case "supercruiseentry": + case "SupercruiseEntry": return JsonSerializer.Deserialize(ref reader)!; - case "dockinggranted": + case "DockingGranted": return JsonSerializer.Deserialize(ref reader)!; - case "startjump": + case "StartJump": return JsonSerializer.Deserialize(ref reader)!; - case "fssallbodiesfound": + case "FSSAllBodiesFound": return JsonSerializer.Deserialize(ref reader)!; - case "fssbodysignals": + case "FSSBodySignals": return JsonSerializer.Deserialize(ref reader)!; - case "liftoff": + case "Liftoff": return JsonSerializer.Deserialize(ref reader)!; - case "supercruisedestinationdrop": + case "SupercruiseDestinationDrop": return JsonSerializer.Deserialize(ref reader)!; - case "fsdtarget": + case "FSDTarget": return JsonSerializer.Deserialize(ref reader)!; - case "fsdjump": + case "FSDJump": return JsonSerializer.Deserialize(ref reader)!; - case "codexentry": + case "CodexEntry": return JsonSerializer.Deserialize(ref reader)!; - case "hulldamage": + case "HullDamage": return JsonSerializer.Deserialize(ref reader)!; - case "materialcollected": + case "MaterialCollected": return JsonSerializer.Deserialize(ref reader)!; - case "navroute": + case "NavRoute": return JsonSerializer.Deserialize(ref reader)!; - case "navrouteclear": + case "NavRouteClear": return JsonSerializer.Deserialize(ref reader)!; - case "scanbarycentre": + case "ScanBaryCentre": return JsonSerializer.Deserialize(ref reader)!; - case "jetconeboost": + case "JetConeBoost": return JsonSerializer.Deserialize(ref reader)!; - case "shutdown": + case "Shutdown": return JsonSerializer.Deserialize(ref reader)!; - case "fuelscoop": + case "FuelScoop": return JsonSerializer.Deserialize(ref reader)!; - case "fssdiscoveryscan": + case "FSSDiscoveryScan": return JsonSerializer.Deserialize(ref reader)!; - case "moduleinfo": + case "ModuleInfo": return JsonSerializer.Deserialize(ref reader)!; - case "shiptargeted": + case "ShipTargeted": return JsonSerializer.Deserialize(ref reader)!; - case "afmurepairs": + case "AfmuRepairs": return JsonSerializer.Deserialize(ref reader)!; - case "heatwarning": + case "HeatWarning": return JsonSerializer.Deserialize(ref reader)!; - case "modulebuy": + case "ModuleBuy": return JsonSerializer.Deserialize(ref reader)!; - case "buydrones": + case "BuyDrones": return JsonSerializer.Deserialize(ref reader)!; - case "shieldstate": + case "ShieldState": return JsonSerializer.Deserialize(ref reader)!; - case "buyammo": + case "BuyAmmo": return JsonSerializer.Deserialize(ref reader)!; - case "ejectcargo": + case "EjectCargo": return JsonSerializer.Deserialize(ref reader)!; - case "approachbody": + case "ApproachBody": return JsonSerializer.Deserialize(ref reader)!; - case "docksrv": + case "DockSRV": return JsonSerializer.Deserialize(ref reader)!; - case "touchdown": + case "Touchdown": return JsonSerializer.Deserialize(ref reader)!; - case "saasignalsfound": + case "SAASignalsFound": return JsonSerializer.Deserialize(ref reader)!; - case "engineercraft": + case "EngineerCraft": return JsonSerializer.Deserialize(ref reader)!; - case "materialtrade": + case "MaterialTrade": return JsonSerializer.Deserialize(ref reader)!; - case "repair": + case "Repair": return JsonSerializer.Deserialize(ref reader)!; - case "refuelall": + case "RefuelAll": return JsonSerializer.Deserialize(ref reader)!; - case "storedmodules": + case "StoredModules": return JsonSerializer.Deserialize(ref reader)!; - case "synthesis": + case "Synthesis": return JsonSerializer.Deserialize(ref reader)!; - case "scanned": + case "Scanned": return JsonSerializer.Deserialize(ref reader)!; - case "sendtext": + case "SendText": return JsonSerializer.Deserialize(ref reader)!; - case "embark": + case "Embark": return JsonSerializer.Deserialize(ref reader)!; - case "multisellexplorationdata": + case "MultiSellExplorationData": return JsonSerializer.Deserialize(ref reader)!; - case "backpack": + case "Backpack": return JsonSerializer.Deserialize(ref reader)!; - case "modulesell": + case "ModuleSell": return JsonSerializer.Deserialize(ref reader)!; - case "undocked": + case "Undocked": return JsonSerializer.Deserialize(ref reader)!; - case "repairall": + case "RepairAll": return JsonSerializer.Deserialize(ref reader)!; - case "outfitting": + case "Outfitting": return JsonSerializer.Deserialize(ref reader)!; - case "powerplaysalary": + case "PowerplaySalary": return JsonSerializer.Deserialize(ref reader)!; - case "redeemvoucher": + case "RedeemVoucher": return JsonSerializer.Deserialize(ref reader)!; - case "saascancomplete": + case "SAAScanComplete": return JsonSerializer.Deserialize(ref reader)!; - case "friends": + case "Friends": return JsonSerializer.Deserialize(ref reader)!; - case "launchsrv": + case "LaunchSRV": return JsonSerializer.Deserialize(ref reader)!; - case "suitloadout": + case "SuitLoadout": return JsonSerializer.Deserialize(ref reader)!; - case "disembark": + case "Disembark": return JsonSerializer.Deserialize(ref reader)!; - case "materialdiscovered": + case "MaterialDiscovered": return JsonSerializer.Deserialize(ref reader)!; - case "storedships": + case "StoredShips": return JsonSerializer.Deserialize(ref reader)!; - case "scanorganic": + case "ScanOrganic": return JsonSerializer.Deserialize(ref reader)!; - case "market": + case "Market": return JsonSerializer.Deserialize(ref reader)!; - case "missioncompleted": + case "MissionCompleted": return JsonSerializer.Deserialize(ref reader)!; - case "sellshiponrebuy": + case "SellShipOnRebuy": return JsonSerializer.Deserialize(ref reader)!; - case "missionaccepted": + case "MissionAccepted": return JsonSerializer.Deserialize(ref reader)!; - case "approachsettlement": + case "ApproachSettlement": return JsonSerializer.Deserialize(ref reader)!; - case "screenshot": + case "Screenshot": return JsonSerializer.Deserialize(ref reader)!; - case "moduleswap": + case "ModuleSwap": return JsonSerializer.Deserialize(ref reader)!; - case "underattack": + case "UnderAttack": return JsonSerializer.Deserialize(ref reader)!; - case "datascanned": + case "DataScanned": return JsonSerializer.Deserialize(ref reader)!; - case "dockingdenied": + case "DockingDenied": return JsonSerializer.Deserialize(ref reader)!; - case "fetchremotemodule": + case "FetchRemoteModule": return JsonSerializer.Deserialize(ref reader)!; - case "engineercontribution": + case "EngineerContribution": return JsonSerializer.Deserialize(ref reader)!; - case "collectcargo": + case "CollectCargo": return JsonSerializer.Deserialize(ref reader)!; - case "moduleretrieve": + case "ModuleRetrieve": return JsonSerializer.Deserialize(ref reader)!; - case "marketbuy": + case "MarketBuy": return JsonSerializer.Deserialize(ref reader)!; - case "selldrones": + case "SellDrones": return JsonSerializer.Deserialize(ref reader)!; - case "interdicted": + case "Interdicted": return JsonSerializer.Deserialize(ref reader)!; - case "sellorganicdata": + case "SellOrganicData": return JsonSerializer.Deserialize(ref reader)!; - case "wingadd": + case "WingAdd": return JsonSerializer.Deserialize(ref reader)!; - case "winginvite": + case "WingInvite": return JsonSerializer.Deserialize(ref reader)!; - case "wingjoin": + case "WingJoin": return JsonSerializer.Deserialize(ref reader)!; - case "wingleave": + case "WingLeave": return JsonSerializer.Deserialize(ref reader)!; - case "bounty": + case "Bounty": return JsonSerializer.Deserialize(ref reader)!; - case "commitcrime": + case "CommitCrime": return JsonSerializer.Deserialize(ref reader)!; - case "modulestore": + case "ModuleStore": return JsonSerializer.Deserialize(ref reader)!; - case "factionkillbond": + case "FactionKillBond": return JsonSerializer.Deserialize(ref reader)!; - case "rebootrepair": + case "RebootRepair": return JsonSerializer.Deserialize(ref reader)!; - case "launchdrone": + case "LaunchDrone": return JsonSerializer.Deserialize(ref reader)!; - case "sellmicroresources": + case "SellMicroResources": return JsonSerializer.Deserialize(ref reader)!; - case "navbeaconscan": + case "NavBeaconScan": return JsonSerializer.Deserialize(ref reader)!; - case "searchandrescue": + case "SearchAndRescue": return JsonSerializer.Deserialize(ref reader)!; - case "marketsell": + case "MarketSell": return JsonSerializer.Deserialize(ref reader)!; default: logger.LogWarning("Unknown Journal event type {EventName}", eventName); diff --git a/Pulsar/WebApp/package-lock.json b/Pulsar/WebApp/package-lock.json index 01fac8b..9108bc0 100644 --- a/Pulsar/WebApp/package-lock.json +++ b/Pulsar/WebApp/package-lock.json @@ -12,13 +12,13 @@ "@microsoft/signalr": "^8.0.0", "@playwright/test": "^1.44.0", "@sveltejs/adapter-static": "^3.0.1", - "@sveltejs/kit": "^2.5.7", - "@sveltejs/vite-plugin-svelte": "next", + "@sveltejs/kit": "^2.5.8", + "@sveltejs/vite-plugin-svelte": "^3.1.0", "@sveltestack/svelte-query": "^1.6.0", "eslint-plugin-svelte": "^2.39.0", "globals": "^15.2.0", - "sass": "^1.77.0", - "svelte": "^5.0.0-next.126", + "sass": "^1.77.2", + "svelte": "^5.0.0-next.136", "svelte-check": "^3.7.1", "tslib": "^2.6.2", "typescript": "^5.4.5", @@ -800,9 +800,9 @@ "dev": true }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.14.2.tgz", - "integrity": "sha512-ahxSgCkAEk+P/AVO0vYr7DxOD3CwAQrT0Go9BJyGQ9Ef0QxVOfjDZMiF4Y2s3mLyPrjonchIMH/tbWHucJMykQ==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.17.2.tgz", + "integrity": "sha512-NM0jFxY8bB8QLkoKxIQeObCaDlJKewVlIEkuyYKm5An1tdVZ966w2+MPQ2l8LBZLjR+SgyV+nRkTIunzOYBMLQ==", "cpu": [ "arm" ], @@ -813,9 +813,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.14.2.tgz", - "integrity": "sha512-lAarIdxZWbFSHFSDao9+I/F5jDaKyCqAPMq5HqnfpBw8dKDiCaaqM0lq5h1pQTLeIqueeay4PieGR5jGZMWprw==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.17.2.tgz", + "integrity": "sha512-yeX/Usk7daNIVwkq2uGoq2BYJKZY1JfyLTaHO/jaiSwi/lsf8fTFoQW/n6IdAsx5tx+iotu2zCJwz8MxI6D/Bw==", "cpu": [ "arm64" ], @@ -826,9 +826,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.14.2.tgz", - "integrity": "sha512-SWsr8zEUk82KSqquIMgZEg2GE5mCSfr9sE/thDROkX6pb3QQWPp8Vw8zOq2GyxZ2t0XoSIUlvHDkrf5Gmf7x3Q==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.17.2.tgz", + "integrity": "sha512-kcMLpE6uCwls023+kknm71ug7MZOrtXo+y5p/tsg6jltpDtgQY1Eq5sGfHcQfb+lfuKwhBmEURDga9N0ol4YPw==", "cpu": [ "arm64" ], @@ -839,9 +839,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.14.2.tgz", - "integrity": "sha512-o/HAIrQq0jIxJAhgtIvV5FWviYK4WB0WwV91SLUnsliw1lSAoLsmgEEgRWzDguAFeUEUUoIWXiJrPqU7vGiVkA==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.17.2.tgz", + "integrity": "sha512-AtKwD0VEx0zWkL0ZjixEkp5tbNLzX+FCqGG1SvOu993HnSz4qDI6S4kGzubrEJAljpVkhRSlg5bzpV//E6ysTQ==", "cpu": [ "x64" ], @@ -852,9 +852,22 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.14.2.tgz", - "integrity": "sha512-nwlJ65UY9eGq91cBi6VyDfArUJSKOYt5dJQBq8xyLhvS23qO+4Nr/RreibFHjP6t+5ap2ohZrUJcHv5zk5ju/g==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.17.2.tgz", + "integrity": "sha512-3reX2fUHqN7sffBNqmEyMQVj/CKhIHZd4y631duy0hZqI8Qoqf6lTtmAKvJFYa6bhU95B1D0WgzHkmTg33In0A==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.17.2.tgz", + "integrity": "sha512-uSqpsp91mheRgw96xtyAGP9FW5ChctTFEoXP0r5FAzj/3ZRv3Uxjtc7taRQSaQM/q85KEKjKsZuiZM3GyUivRg==", "cpu": [ "arm" ], @@ -865,9 +878,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.14.2.tgz", - "integrity": "sha512-Pg5TxxO2IVlMj79+c/9G0LREC9SY3HM+pfAwX7zj5/cAuwrbfj2Wv9JbMHIdPCfQpYsI4g9mE+2Bw/3aeSs2rQ==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.17.2.tgz", + "integrity": "sha512-EMMPHkiCRtE8Wdk3Qhtciq6BndLtstqZIroHiiGzB3C5LDJmIZcSzVtLRbwuXuUft1Cnv+9fxuDtDxz3k3EW2A==", "cpu": [ "arm64" ], @@ -878,9 +891,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.14.2.tgz", - "integrity": "sha512-cAOTjGNm84gc6tS02D1EXtG7tDRsVSDTBVXOLbj31DkwfZwgTPYZ6aafSU7rD/4R2a34JOwlF9fQayuTSkoclA==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.17.2.tgz", + "integrity": "sha512-NMPylUUZ1i0z/xJUIx6VUhISZDRT+uTWpBcjdv0/zkp7b/bQDF+NfnfdzuTiB1G6HTodgoFa93hp0O1xl+/UbA==", "cpu": [ "arm64" ], @@ -891,9 +904,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.14.2.tgz", - "integrity": "sha512-4RyT6v1kXb7C0fn6zV33rvaX05P0zHoNzaXI/5oFHklfKm602j+N4mn2YvoezQViRLPnxP8M1NaY4s/5kXO5cw==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.17.2.tgz", + "integrity": "sha512-T19My13y8uYXPw/L/k0JYaX1fJKFT/PWdXiHr8mTbXWxjVF1t+8Xl31DgBBvEKclw+1b00Chg0hxE2O7bTG7GQ==", "cpu": [ "ppc64" ], @@ -904,9 +917,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.14.2.tgz", - "integrity": "sha512-KNUH6jC/vRGAKSorySTyc/yRYlCwN/5pnMjXylfBniwtJx5O7X17KG/0efj8XM3TZU7raYRXJFFReOzNmL1n1w==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.17.2.tgz", + "integrity": "sha512-BOaNfthf3X3fOWAB+IJ9kxTgPmMqPPH5f5k2DcCsRrBIbWnaJCgX2ll77dV1TdSy9SaXTR5iDXRL8n7AnoP5cg==", "cpu": [ "riscv64" ], @@ -917,9 +930,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.14.2.tgz", - "integrity": "sha512-xPV4y73IBEXToNPa3h5lbgXOi/v0NcvKxU0xejiFw6DtIYQqOTMhZ2DN18/HrrP0PmiL3rGtRG9gz1QE8vFKXQ==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.17.2.tgz", + "integrity": "sha512-W0UP/x7bnn3xN2eYMql2T/+wpASLE5SjObXILTMPUBDB/Fg/FxC+gX4nvCfPBCbNhz51C+HcqQp2qQ4u25ok6g==", "cpu": [ "s390x" ], @@ -930,9 +943,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.14.2.tgz", - "integrity": "sha512-QBhtr07iFGmF9egrPOWyO5wciwgtzKkYPNLVCFZTmr4TWmY0oY2Dm/bmhHjKRwZoGiaKdNcKhFtUMBKvlchH+Q==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.17.2.tgz", + "integrity": "sha512-Hy7pLwByUOuyaFC6mAr7m+oMC+V7qyifzs/nW2OJfC8H4hbCzOX07Ov0VFk/zP3kBsELWNFi7rJtgbKYsav9QQ==", "cpu": [ "x64" ], @@ -943,9 +956,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.14.2.tgz", - "integrity": "sha512-8zfsQRQGH23O6qazZSFY5jP5gt4cFvRuKTpuBsC1ZnSWxV8ZKQpPqOZIUtdfMOugCcBvFGRa1pDC/tkf19EgBw==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.17.2.tgz", + "integrity": "sha512-h1+yTWeYbRdAyJ/jMiVw0l6fOOm/0D1vNLui9iPuqgRGnXA0u21gAqOyB5iHjlM9MMfNOm9RHCQ7zLIzT0x11Q==", "cpu": [ "x64" ], @@ -956,9 +969,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.14.2.tgz", - "integrity": "sha512-H4s8UjgkPnlChl6JF5empNvFHp77Jx+Wfy2EtmYPe9G22XV+PMuCinZVHurNe8ggtwoaohxARJZbaH/3xjB/FA==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.17.2.tgz", + "integrity": "sha512-tmdtXMfKAjy5+IQsVtDiCfqbynAQE/TQRpWdVataHmhMb9DCoJxp9vLcCBjEQWMiUYxO1QprH/HbY9ragCEFLA==", "cpu": [ "arm64" ], @@ -969,9 +982,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.14.2.tgz", - "integrity": "sha512-djqpAjm/i8erWYF0K6UY4kRO3X5+T4TypIqw60Q8MTqSBaQNpNXDhxdjpZ3ikgb+wn99svA7jxcXpiyg9MUsdw==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.17.2.tgz", + "integrity": "sha512-7II/QCSTAHuE5vdZaQEwJq2ZACkBpQDOmQsE6D6XUbnBHW8IAhm4eTufL6msLJorzrHDFv3CF8oCA/hSIRuZeQ==", "cpu": [ "ia32" ], @@ -982,9 +995,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.14.2.tgz", - "integrity": "sha512-teAqzLT0yTYZa8ZP7zhFKEx4cotS8Tkk5XiqNMJhD4CpaWB1BHARE4Qy+RzwnXvSAYv+Q3jAqCVBS+PS+Yee8Q==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.17.2.tgz", + "integrity": "sha512-TGGO7v7qOq4CYmSBVEYpI1Y5xDuCEnbVC5Vth8mOsW0gDSzxNrVERPc790IGHsrT2dQSimgMr9Ub3Y1Jci5/8w==", "cpu": [ "x64" ], @@ -1004,9 +1017,9 @@ } }, "node_modules/@sveltejs/kit": { - "version": "2.5.7", - "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-2.5.7.tgz", - "integrity": "sha512-6uedTzrb7nQrw6HALxnPrPaXdIN2jJJTzTIl96Z3P5NiG+OAfpdPbrWrvkJ3GN4CfWqrmU4dJqwMMRMTD/C7ow==", + "version": "2.5.8", + "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-2.5.8.tgz", + "integrity": "sha512-ZQXYaVHd1p0kDGwOi4l82i5kAiUQtrhMthDKtJi0zVzmNupKJ0ZlBVAoceuarCuIntPNctyQchW29h5DkFxd1Q==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -1086,6 +1099,20 @@ "svelte": "^3.19.0 || ^4.0.0" } }, + "node_modules/@sveltejs/vite-plugin-svelte/node_modules/vitefu": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-0.2.5.tgz", + "integrity": "sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==", + "dev": true, + "peerDependencies": { + "vite": "^3.0.0 || ^4.0.0 || ^5.0.0" + }, + "peerDependenciesMeta": { + "vite": { + "optional": true + } + } + }, "node_modules/@sveltestack/svelte-query": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@sveltestack/svelte-query/-/svelte-query-1.6.0.tgz", @@ -2284,15 +2311,12 @@ } }, "node_modules/magic-string": { - "version": "0.30.9", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.9.tgz", - "integrity": "sha512-S1+hd+dIrC8EZqKyT9DstTH/0Z+f76kmmvZnkfQVmOpDEF9iVgdYif3Q/pIWHmCoo59bQVGW0kVL3e2nl+9+Sw==", + "version": "0.30.10", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", + "integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==", "dev": true, "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" - }, - "engines": { - "node": ">=12" } }, "node_modules/merge2": { @@ -2802,9 +2826,9 @@ } }, "node_modules/rollup": { - "version": "4.14.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.14.2.tgz", - "integrity": "sha512-WkeoTWvuBoFjFAhsEOHKRoZ3r9GfTyhh7Vff1zwebEFLEFjT1lG3784xEgKiTa7E+e70vsC81roVL2MP4tgEEQ==", + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.17.2.tgz", + "integrity": "sha512-/9ClTJPByC0U4zNLowV1tMBe8yMEAxewtR3cUNX5BoEpGH3dQEWpJLr6CLp0fPdYRF/fzVOgvDb1zXuakwF5kQ==", "dev": true, "dependencies": { "@types/estree": "1.0.5" @@ -2817,21 +2841,22 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.14.2", - "@rollup/rollup-android-arm64": "4.14.2", - "@rollup/rollup-darwin-arm64": "4.14.2", - "@rollup/rollup-darwin-x64": "4.14.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.14.2", - "@rollup/rollup-linux-arm64-gnu": "4.14.2", - "@rollup/rollup-linux-arm64-musl": "4.14.2", - "@rollup/rollup-linux-powerpc64le-gnu": "4.14.2", - "@rollup/rollup-linux-riscv64-gnu": "4.14.2", - "@rollup/rollup-linux-s390x-gnu": "4.14.2", - "@rollup/rollup-linux-x64-gnu": "4.14.2", - "@rollup/rollup-linux-x64-musl": "4.14.2", - "@rollup/rollup-win32-arm64-msvc": "4.14.2", - "@rollup/rollup-win32-ia32-msvc": "4.14.2", - "@rollup/rollup-win32-x64-msvc": "4.14.2", + "@rollup/rollup-android-arm-eabi": "4.17.2", + "@rollup/rollup-android-arm64": "4.17.2", + "@rollup/rollup-darwin-arm64": "4.17.2", + "@rollup/rollup-darwin-x64": "4.17.2", + "@rollup/rollup-linux-arm-gnueabihf": "4.17.2", + "@rollup/rollup-linux-arm-musleabihf": "4.17.2", + "@rollup/rollup-linux-arm64-gnu": "4.17.2", + "@rollup/rollup-linux-arm64-musl": "4.17.2", + "@rollup/rollup-linux-powerpc64le-gnu": "4.17.2", + "@rollup/rollup-linux-riscv64-gnu": "4.17.2", + "@rollup/rollup-linux-s390x-gnu": "4.17.2", + "@rollup/rollup-linux-x64-gnu": "4.17.2", + "@rollup/rollup-linux-x64-musl": "4.17.2", + "@rollup/rollup-win32-arm64-msvc": "4.17.2", + "@rollup/rollup-win32-ia32-msvc": "4.17.2", + "@rollup/rollup-win32-x64-msvc": "4.17.2", "fsevents": "~2.3.2" } }, @@ -2895,9 +2920,9 @@ } }, "node_modules/sass": { - "version": "1.77.0", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.77.0.tgz", - "integrity": "sha512-eGj4HNfXqBWtSnvItNkn7B6icqH14i3CiCGbzMKs3BAPTq62pp9NBYsBgyN4cA+qssqo9r26lW4JSvlaUUWbgw==", + "version": "1.77.2", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.77.2.tgz", + "integrity": "sha512-eb4GZt1C3avsX3heBNlrc7I09nyT00IUuo4eFhAbeXWU2fvA7oXI53SxODVAA+zgZCk9aunAZgO+losjR3fAwA==", "dev": true, "dependencies": { "chokidar": ">=3.0.0 <4.0.0", @@ -3045,9 +3070,9 @@ } }, "node_modules/svelte": { - "version": "5.0.0-next.126", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.0.0-next.126.tgz", - "integrity": "sha512-Qnxhf+LG/qxhXpYm6I5+o8msSFBba2QOfnybrOqWbbtQbgbfy4gDVr3p2IExCT4yPOSUcqZWJiiSPsMbCuVwtA==", + "version": "5.0.0-next.136", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.0.0-next.136.tgz", + "integrity": "sha512-M3jHAIfWZ7K+hjZdvu2p53ZtWE843yubxJfjxeQw9XiwMYG5z6quCA5u8r23GrxAp20JBl36B6ucbZvLUf0Z/g==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.1", @@ -3388,20 +3413,6 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/vitefu": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-0.2.5.tgz", - "integrity": "sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==", - "dev": true, - "peerDependencies": { - "vite": "^3.0.0 || ^4.0.0 || ^5.0.0" - }, - "peerDependenciesMeta": { - "vite": { - "optional": true - } - } - }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", diff --git a/Pulsar/WebApp/package.json b/Pulsar/WebApp/package.json index 8438d77..507cbd0 100644 --- a/Pulsar/WebApp/package.json +++ b/Pulsar/WebApp/package.json @@ -17,12 +17,12 @@ "@playwright/test": "^1.44.0", "@sveltejs/adapter-static": "^3.0.1", "@sveltestack/svelte-query": "^1.6.0", - "@sveltejs/kit": "^2.5.7", - "@sveltejs/vite-plugin-svelte": "next", + "@sveltejs/kit": "^2.5.8", + "@sveltejs/vite-plugin-svelte": "^3.1.0", "eslint-plugin-svelte": "^2.39.0", "globals": "^15.2.0", - "sass": "^1.77.0", - "svelte": "^5.0.0-next.126", + "sass": "^1.77.2", + "svelte": "^5.0.0-next.136", "svelte-check": "^3.7.1", "tslib": "^2.6.2", "typescript": "^5.4.5", diff --git a/Pulsar/WebApp/src/lib/Status.svelte b/Pulsar/WebApp/src/lib/Status.svelte index b69615d..2732783 100644 --- a/Pulsar/WebApp/src/lib/Status.svelte +++ b/Pulsar/WebApp/src/lib/Status.svelte @@ -17,6 +17,7 @@ let loading = $state(true); let alert: JournalBase[] = $state([]); + let fuelDown = $state(false); onMount(async () => { @@ -39,17 +40,19 @@ last.push(message.fuel?.fuelMain ?? 0); const change = []; - for (let i = last.length - 1; i === 0; i--) { + for (let i = last.length - 1; i > 0; i--) { change.push(last[i] - last[i - 1]); } const avg = change.length ? change.reduce((a, b) => a + b, 0) / change.length : 0; const max = 32; - if ($statusStore.fuel?.fuelMain && avg) { - timeToMax = (max - $statusStore.fuel?.fuelMain) / avg; + const currentEmpty = (max - message.fuel?.fuelMain); + if (message.fuel?.fuelMain && !Number.isNaN(avg) && avg) { + fuelDown = avg < 0; + timeToMax = fuelDown ? (message.fuel?.fuelMain / -avg) : currentEmpty / avg ; } - console.log($statusStore); + console.log(message); }); $connection.on("JournalUpdated", (message) => { @@ -97,7 +100,7 @@
{#if $statusStore} Fuel%: {(($statusStore.fuel?.fuelMain ?? 0) / 32) * 100}% est: {timeToMax}sFuel%: {((($statusStore.fuel?.fuelMain ?? 0) / 32) * 100).toFixed(2)}% est{fuelDown ? ' REMAINING' : ' to fill'}: {timeToMax.toFixed(2 )}s
@@ -148,6 +151,7 @@ height: 100%; flex-direction: column-reverse; align-items: center; + min-width: 2vw; div.pip { min-width: 2vw; min-height: 1vh; diff --git a/Pulsar/WebApp/src/routes/explorer/Explorer.svelte b/Pulsar/WebApp/src/routes/explorer/Explorer.svelte index c4e067a..00e1a5b 100644 --- a/Pulsar/WebApp/src/routes/explorer/Explorer.svelte +++ b/Pulsar/WebApp/src/routes/explorer/Explorer.svelte @@ -1,29 +1,91 @@

Explorer

+ Current System: {currentSystem}

Bodies

- Scan: {scanned}/{totalBodies} + Scan: {scans.length}/{totalBodies}
High Value (>500kcr)
    - {#each bodies.filter((b) => b.value > 500000) as body} -
  1. [HMC/WW/ELT/ELN] $body.name - {body.value}cr
  2. +
  3. example
  4. + {#each scans as body} +
  5. + [HMC/WW/ELT/ELN] {toShortPlanetClass(body.planetClass)} + {body.bodyName} - 0cr +
  6. {/each}

@@ -78,7 +140,7 @@