Skip to main content

ed_journals/modules/logs/content/
log_event_content.rs

1use crate::civilization::LocationInfo;
2use kinded::Kinded;
3use serde::{Deserialize, Serialize};
4
5#[cfg(feature = "allow-unknown")]
6use serde_json::Value;
7
8use afmu_repairs_event::AFMURepairsEvent;
9use applied_to_squadron_event::AppliedToSquadronEvent;
10use approach_body_event::ApproachBodyEvent;
11use approach_settlement_event::ApproachSettlementEvent;
12use asteroid_cracked_event::AsteroidCrackedEvent;
13use backpack_change_event::BackpackChangeEvent;
14use backpack_event::BackpackEvent;
15use book_dropship_event::BookDropshipEvent;
16use book_taxi_event::BookTaxiEvent;
17use bounty_event::BountyEvent;
18use buy_ammo_event::BuyAmmoEvent;
19use buy_drones_event::BuyDronesEvent;
20use buy_exploration_data_event::BuyExplorationDataEvent;
21use buy_micro_resource_event::BuyMicroResourceEvent;
22use buy_suit_event::BuySuitEvent;
23use buy_trade_data_event::BuyTradeDateEvent;
24use buy_weapon_event::BuyWeaponEvent;
25use cancel_dropship_event::CancelDropshipEvent;
26use cancel_taxi_event::CancelTaxiEvent;
27use cap_ship_bond_event::CapShipBondEvent;
28use cargo_depot_event::CargoDepotEvent;
29use cargo_event::CargoEvent;
30use cargo_transfer_event::CargoTransferEvent;
31use carrier_bank_transfer_event::CarrierBankTransferEvent;
32use carrier_buy_event::CarrierBuyEvent;
33use carrier_cancel_decommission_event::CarrierCancelDecommissionEvent;
34use carrier_crew_services_event::CarrierCrewServicesEvent;
35use carrier_decommision_event::CarrierDecommissionEvent;
36use carrier_deposit_fuel_event::CarrierDepositFuelEvent;
37use carrier_docking_permission_event::CarrierDockingPermissionEvent;
38use carrier_finance_event::CarrierFinanceEvent;
39use carrier_jump_cancelled_event::CarrierJumpCancelled;
40use carrier_jump_event::CarrierJumpEvent;
41use carrier_jump_request_event::CarrierJumpRequestEvent;
42use carrier_location_event::CarrierLocationEvent;
43use carrier_module_pack_event::CarrierModulePackEvent;
44use carrier_name_changed_event::CarrierNameChangeEvent;
45use carrier_ship_pack_event::CarrierShipPackEvent;
46use carrier_stats_event::CarrierStatsEvent;
47use carrier_trade_order_event::CarrierTradeOrderEvent;
48use change_crew_role_event::ChangeCrewRoleEvent;
49use clear_impound_event::ClearImpoundEvent;
50use clear_saved_game_event::ClearSavedGameEvent;
51use codex_entry_event::CodexEntryEvent;
52use collect_cargo_event::CollectCargoEvent;
53use collect_items_event::CollectItemsEvent;
54use colonisation_construction_depot_event::ColonisationConstructionDepotEvent;
55use colonisation_contribution_event::ColonisationContributionEvent;
56use commander_event::CommanderEvent;
57use commit_crime_event::CommitCrimeEvent;
58use community_goal_discard_event::CommunityGoalDiscardEvent;
59use community_goal_join_event::CommunityGoalJoinEvent;
60use community_goal_reward_event::CommunityGoalRewardEvent;
61use continued_event::ContinuedEvent;
62use create_suit_loadout_event::CreateSuitLoadoutEvent;
63use crew_assign_event::CrewAssignEvent;
64use crew_fire_event::CrewFireEvent;
65use crew_hire_event::CrewHireEvent;
66use crew_launch_fighter_event::CrewLaunchFighterEvent;
67use crew_member_joins_event::CrewMemberJoinsEvent;
68use crew_member_quits_event::CrewMemberQuitsEvent;
69use crew_member_role_change_event::CrewMemberRoleChangeEvent;
70use crime_victim_event::CrimeVictimEvent;
71use data_scanned_event::DataScannedEvent;
72use datalink_scan_event::DatalinkScanEvent;
73use datalink_voucher_event::DatalinkVoucherEvent;
74use delete_suit_loadout_event::DeleteSuitLoadoutEvent;
75use died_event::DiedEvent;
76use disbanded_squadron_event::DisbandedSquadronEvent;
77use discovery_scan_event::DiscoveryScanEvent;
78use disembark_event::DisembarkEvent;
79use dock_fighter_event::DockFighterEvent;
80use dock_srv_event::DockSRVEvent;
81use docked_event::DockedEvent;
82use docking_cancelled_event::DockingCancelled;
83use docking_denied_event::DockingDeniedEvent;
84use docking_granted_event::DockingGrantedEvent;
85use docking_requested_event::DockingRequestedEvent;
86use docking_timeout_event::DockingTimeoutEvent;
87use drop_items_event::DropItemsEvent;
88use drop_ship_deploy_event::DropshipDeployEvent;
89use eject_cargo_event::EjectCargoEvent;
90use embark_event::EmbarkEvent;
91use end_crew_session_event::EndCrewSessionEvent;
92use engineer_contribution_event::EngineerContributionEvent;
93use engineer_craft_event::EngineerCraftEvent;
94use engineer_progress_event::EngineerProgressEvent;
95use escape_interdiction_event::EscapeInterdictionEvent;
96use faction_kill_bond_event::FactionKillBondEvent;
97use fc_embark_event::FCEmbarkEvent;
98use fetch_remote_module_event::FetchRemoteModuleEvent;
99use fighter_destroyed_event::FighterDestroyedEvent;
100use fighter_rebuilt_event::FighterRebuiltEvent;
101use file_header_event::FileHeaderEvent;
102use friends_event::FriendsEvent;
103use fsd_jump_event::FSDJumpEvent;
104use fsd_target_event::FSDTargetEvent;
105use fss_all_bodies_found_event::FSSAllBodiesFoundEvent;
106use fss_body_signals_event::FSSBodySignalsEvent;
107use fss_discovery_scan_event::FSSDiscoveryScan;
108use fss_signal_discovered_event::FSSSignalDiscoveredEvent;
109use fuel_scoop_event::FuelScoopEvent;
110use hull_damage_event::HullDamageEvent;
111use interdicted_event::InterdictedEvent;
112use interdiction_event::InterdictionEvent;
113use invited_to_squadron_event::InvitedToSquadronEvent;
114use jet_cone_boost_event::JetConeBoostEvent;
115use jet_cone_damage_event::JetConeDamageEvent;
116use join_a_crew_event::JoinACrewEvent;
117use joined_squadron_event::JoinedSquadronEvent;
118use kick_crew_member_event::KickCrewMemberEvent;
119use kicked_from_squadron_event::KickedFromSquadronEvent;
120use launch_drone_event::LaunchDroneEvent;
121use launch_fighter_event::LaunchFighterEvent;
122use launch_srv_event::LaunchSRVEvent;
123use leave_body_event::LeaveBodyEvent;
124use left_squadron_event::LeftSquadronEvent;
125use liftoff_event::LiftoffEvent;
126use load_game_event::LoadGameEvent;
127use loadout_equip_module_event::LoadoutEquipModuleEvent;
128use loadout_event::LoadoutEvent;
129use loadout_remove_module_event::LoadoutRemoveModuleEvent;
130use location_event::LocationEvent;
131use market_buy_event::MarketBuyEvent;
132use market_event::MarketEvent;
133use market_sell_event::MarketSellEvent;
134use mass_module_store_event::MassModuleStoreEvent;
135use material_collected_event::MaterialCollectedEvent;
136use material_discarded_event::MaterialDiscarded;
137use material_discovered_event::MaterialDiscoveredEvent;
138use material_trade_event::MaterialTradeEvent;
139use materials_event::MaterialsEvent;
140use mining_refined::MiningRefinedEvent;
141use mission_abandoned_event::MissionAbandonedEvent;
142use mission_accepted_event::MissionAcceptedEvent;
143use mission_completed_event::MissionCompletedEvent;
144use mission_failed_event::MissionFailedEvent;
145use mission_redirected_event::MissionRedirectedEvent;
146use missions_event::MissionsEvent;
147use module_buy_and_store_event::ModuleBuyAndStoreEvent;
148use module_buy_event::ModuleBuyEvent;
149use module_retrieve_event::ModuleRetrieveEvent;
150use module_sell_event::ModuleSellEvent;
151use module_sell_remote_event::ModuleSellRemoteEvent;
152use module_store_event::ModuleStoreEvent;
153use module_swap_event::ModuleSwapEvent;
154use multi_sell_exploration_data_event::MultiSellExplorationDataEvent;
155use music_event::MusicEvent;
156use nav_beacon_scan_event::NavBeaconScanEvent;
157use new_commander_event::NewCommanderEvent;
158use npc_crew_rank_event::NPCCrewRankEvent;
159use npc_crew_wage_paid_event::NPCCrewWagePaidEvent;
160use outfitting_event::OutfittingEvent;
161use passengers_event::PassengersEvent;
162use pay_bounties_event::PayBountiesEvent;
163use pay_fines_event::PayFinesEvent;
164use powerplay_collect_event::PowerplayCollectEvent;
165use powerplay_defect_event::PowerplayDefectEvent;
166use powerplay_deliver_event::PowerplayDeliverEvent;
167use powerplay_event::PowerplayEvent;
168use powerplay_fast_track_event::PowerplayFastTrackEvent;
169use powerplay_join_event::PowerplayJoinEvent;
170use powerplay_leave_event::PowerplayLeaveEvent;
171use powerplay_merits_event::PowerplayMeritsEvent;
172use powerplay_rank_event::PowerplayRankEvent;
173use powerplay_salary_event::PowerplaySalaryEvent;
174use powerplay_vote_event::PowerplayVoteEvent;
175use progress_event::ProgressEvent;
176use promotion_event::PromotionEvent;
177use prospected_asteroid_event::ProspectedAsteroidEvent;
178use pvp_kill_event::PVPKillEvent;
179use quit_a_crew_event::QuitACrewEvent;
180use rank_event::RankEvent;
181use reboot_repair_event::RebootRepairEvent;
182use receive_text_event::ReceiveTextEvent;
183use redeem_voucher_event::RedeemVoucherEvent;
184use refuel_all_event::RefuelAllEvent;
185use refuel_partial_event::RefuelPartialEvent;
186use rename_suit_loadout_event::RenameSuitLoadoutEvent;
187use repair_all_event::RepairAllEvent;
188use repair_drone_event::RepairDroneEvent;
189use repair_event::RepairEvent;
190use reputation_event::ReputationEvent;
191use request_power_micro_resources::RequestPowerMicroResourcesEvent;
192use reservoir_replenished_event::ReservoirReplenishedEvent;
193use restock_vehicle_event::RestockVehicleEvent;
194use resurrect_event::ResurrectEvent;
195use saa_scan_complete_event::SAAScanCompleteEvent;
196use saa_signals_found_event::SAASignalsFoundEvent;
197use scan_bary_centre_event::ScanBaryCentreEvent;
198use scan_event::ScanEvent;
199use scan_organic_event::ScanOrganicEvent;
200use scanned_event::ScannedEvent;
201use scientific_research_event::ScientificResearchEvent;
202use screenshot_event::ScreenshotEvent;
203use search_and_rescue_event::SearchAndRescueEvent;
204use sell_drones_event::SellDronesEvent;
205use sell_exploration_date_event::SellExplorationDataEvent;
206use sell_micro_resources_event::SellMicroResourcesEvent;
207use sell_organic_data::SellOrganicDataEvent;
208use sell_ship_on_rebuy_event::SellShipOnRebuyEvent;
209use sell_suit_event::SellSuitEvent;
210use sell_weapon_event::SellWeaponEvent;
211use send_text_event::SendTextEvent;
212use set_user_ship_name_event::SetUserShipNameEvent;
213use shared_bookmark_to_squadron_event::ShardedBookmarkToSquadronEvent;
214use shield_state_event::ShieldStateEvent;
215use ship_locker_event::ShipLockerEvent;
216use ship_targeted_event::ShipTargetedEvent;
217use shipyard_buy_event::ShipyardBuyEvent;
218use shipyard_event::ShipyardEvent;
219use shipyard_new_event::ShipyardNewEvent;
220use shipyard_sell_event::ShipyardSellEvent;
221use shipyard_swap_event::ShipyardSwapEvent;
222use shipyard_transfer_event::ShipyardTransferEvent;
223use squadron_created_event::SquadronCreatedEvent;
224use squadron_demotion_event::SquadronDemotionEvent;
225use squadron_promotion_event::SquadronPromotionEvent;
226use squadron_startup_event::SquadronStartupEvent;
227use srv_destroyed_event::SRVDestroyedEvent;
228use start_jump_event::StartJumpEvent;
229use statistics_event::StatisticsEvent;
230use stored_modules_event::StoredModulesEvent;
231use stored_ships_event::StoredShipsEvent;
232use suit_loadout_event::SuitLoadoutEvent;
233use supercruise_destination_drop_event::SupercruiseDestinationDropEvent;
234use supercruise_entry_event::SupercruiseEntryEvent;
235use supercruise_exit_event::SupercruiseExitEvent;
236use switch_suit_loadout_event::SwitchSuitLoadoutEvent;
237use synthasis_event::SynthesisEvent;
238use technology_broker_event::TechnologyBrokerEvent;
239use touchdown_event::TouchdownEvent;
240use trade_micro_resources_event::TradeMicroResourcesEvent;
241use transfer_micro_resources_event::TransferMicroResourcesEvent;
242use under_attack_event::UnderAttackEvent;
243use undocked_event::UndockedEvent;
244use upgrade_suit_event::UpgradeSuitEvent;
245use upgrade_weapon_event::UpgradeWeaponEvent;
246use use_consumable_event::UseConsumableEvent;
247use uss_drop_event::USSDropEvent;
248use vehicle_switch_event::VehicleSwitchEvent;
249use wing_add_event::WingAddEvent;
250use wing_invite_event::WingInviteEvent;
251use wing_join_event::WingJoinEvent;
252use won_a_trophy_for_squadron_event::WonATrophyForSquadronEvent;
253
254use crate::logs::content::log_event_content::community_goal_event::CommunityGoalEvent;
255use crate::logs::content::log_event_content::ship_redeemed::ShipRedeemed;
256use crate::logs::content::log_event_content::shipyard_redeem::ShipyardRedeem;
257use crate::logs::content::log_event_content::start_jump_event::StartJumpType;
258use crate::modules::partials::PartialSystemInfo;
259
260#[cfg(feature = "legacy")]
261use legacy_liftoff_event::LegacyLiftoffEvent;
262
263#[cfg(feature = "legacy")]
264use legacy_touchdown_event::LegacyTouchdownEvent;
265
266pub mod afmu_repairs_event;
267pub mod applied_to_squadron_event;
268pub mod approach_body_event;
269pub mod approach_settlement_event;
270pub mod asteroid_cracked_event;
271pub mod backpack_change_event;
272pub mod backpack_event;
273pub mod book_dropship_event;
274pub mod book_taxi_event;
275pub mod bounty_event;
276pub mod buy_ammo_event;
277pub mod buy_drones_event;
278pub mod buy_exploration_data_event;
279pub mod buy_micro_resource_event;
280pub mod buy_suit_event;
281pub mod buy_trade_data_event;
282pub mod buy_weapon_event;
283pub mod cancel_dropship_event;
284pub mod cancel_taxi_event;
285pub mod cap_ship_bond_event;
286pub mod cargo_depot_event;
287pub mod cargo_event;
288pub mod cargo_transfer_event;
289pub mod carrier_bank_transfer_event;
290pub mod carrier_buy_event;
291pub mod carrier_cancel_decommission_event;
292pub mod carrier_crew_services_event;
293pub mod carrier_decommision_event;
294pub mod carrier_deposit_fuel_event;
295pub mod carrier_docking_permission_event;
296pub mod carrier_finance_event;
297pub mod carrier_jump_cancelled_event;
298pub mod carrier_jump_event;
299pub mod carrier_jump_request_event;
300pub mod carrier_location_event;
301pub mod carrier_module_pack_event;
302pub mod carrier_name_changed_event;
303pub mod carrier_ship_pack_event;
304pub mod carrier_stats_event;
305pub mod carrier_trade_order_event;
306pub mod change_crew_role_event;
307pub mod clear_impound_event;
308pub mod clear_saved_game_event;
309pub mod codex_entry_event;
310pub mod collect_cargo_event;
311pub mod collect_items_event;
312pub mod colonisation_construction_depot_event;
313pub mod colonisation_contribution_event;
314pub mod commander_event;
315pub mod commit_crime_event;
316pub mod community_goal_discard_event;
317pub mod community_goal_event;
318pub mod community_goal_join_event;
319pub mod community_goal_reward_event;
320pub mod continued_event;
321pub mod create_suit_loadout_event;
322pub mod crew_assign_event;
323pub mod crew_fire_event;
324pub mod crew_hire_event;
325pub mod crew_launch_fighter_event;
326pub mod crew_member_joins_event;
327pub mod crew_member_quits_event;
328pub mod crew_member_role_change_event;
329pub mod crime_victim_event;
330pub mod data_scanned_event;
331pub mod datalink_scan_event;
332pub mod datalink_voucher_event;
333pub mod delete_suit_loadout_event;
334pub mod died_event;
335pub mod disbanded_squadron_event;
336pub mod discovery_scan_event;
337pub mod disembark_event;
338pub mod dock_fighter_event;
339pub mod dock_srv_event;
340pub mod docked_event;
341pub mod docking_cancelled_event;
342pub mod docking_denied_event;
343pub mod docking_granted_event;
344pub mod docking_requested_event;
345pub mod docking_timeout_event;
346pub mod drop_items_event;
347pub mod drop_ship_deploy_event;
348pub mod eject_cargo_event;
349pub mod embark_event;
350pub mod end_crew_session_event;
351pub mod engineer_contribution_event;
352pub mod engineer_craft_event;
353pub mod engineer_progress_event;
354pub mod escape_interdiction_event;
355pub mod faction_kill_bond_event;
356pub mod fc_embark_event;
357pub mod fetch_remote_module_event;
358pub mod fighter_destroyed_event;
359pub mod fighter_rebuilt_event;
360pub mod file_header_event;
361pub mod friends_event;
362pub mod fsd_jump_event;
363pub mod fsd_target_event;
364pub mod fss_all_bodies_found_event;
365pub mod fss_body_signals_event;
366pub mod fss_discovery_scan_event;
367pub mod fss_signal_discovered_event;
368pub mod fuel_scoop_event;
369pub mod hull_damage_event;
370pub mod interdicted_event;
371pub mod interdiction_event;
372pub mod invited_to_squadron_event;
373pub mod jet_cone_boost_event;
374pub mod jet_cone_damage_event;
375pub mod join_a_crew_event;
376pub mod joined_squadron_event;
377pub mod kick_crew_member_event;
378pub mod kicked_from_squadron_event;
379pub mod launch_drone_event;
380pub mod launch_fighter_event;
381pub mod launch_srv_event;
382pub mod leave_body_event;
383pub mod left_squadron_event;
384pub mod liftoff_event;
385pub mod load_game_event;
386pub mod loadout_equip_module_event;
387pub mod loadout_event;
388pub mod loadout_remove_module_event;
389pub mod location_event;
390pub mod market_buy_event;
391pub mod market_event;
392pub mod market_sell_event;
393pub mod mass_module_store_event;
394pub mod material_collected_event;
395pub mod material_discarded_event;
396pub mod material_discovered_event;
397pub mod material_trade_event;
398pub mod materials_event;
399pub mod mining_refined;
400pub mod mission_abandoned_event;
401pub mod mission_accepted_event;
402pub mod mission_completed_event;
403pub mod mission_failed_event;
404pub mod mission_redirected_event;
405pub mod missions_event;
406pub mod module_buy_and_store_event;
407pub mod module_buy_event;
408pub mod module_retrieve_event;
409pub mod module_sell_event;
410pub mod module_sell_remote_event;
411pub mod module_store_event;
412pub mod module_swap_event;
413pub mod multi_sell_exploration_data_event;
414pub mod music_event;
415pub mod nav_beacon_scan_event;
416pub mod new_commander_event;
417pub mod npc_crew_rank_event;
418pub mod npc_crew_wage_paid_event;
419pub mod outfitting_event;
420pub mod passengers_event;
421pub mod pay_bounties_event;
422pub mod pay_fines_event;
423pub mod powerplay_collect_event;
424pub mod powerplay_defect_event;
425pub mod powerplay_deliver_event;
426pub mod powerplay_event;
427pub mod powerplay_fast_track_event;
428pub mod powerplay_join_event;
429pub mod powerplay_leave_event;
430pub mod powerplay_merits_event;
431pub mod powerplay_rank_event;
432pub mod powerplay_salary_event;
433pub mod powerplay_vote_event;
434pub mod progress_event;
435pub mod promotion_event;
436pub mod prospected_asteroid_event;
437pub mod pvp_kill_event;
438pub mod quit_a_crew_event;
439pub mod rank_event;
440pub mod reboot_repair_event;
441pub mod receive_text_event;
442pub mod redeem_voucher_event;
443pub mod refuel_all_event;
444pub mod refuel_partial_event;
445pub mod rename_suit_loadout_event;
446pub mod repair_all_event;
447pub mod repair_drone_event;
448pub mod repair_event;
449pub mod reputation_event;
450pub mod request_power_micro_resources;
451pub mod reservoir_replenished_event;
452pub mod restock_vehicle_event;
453pub mod resurrect_event;
454pub mod saa_scan_complete_event;
455pub mod saa_signals_found_event;
456pub mod scan_bary_centre_event;
457pub mod scan_event;
458pub mod scan_organic_event;
459pub mod scanned_event;
460pub mod scientific_research_event;
461pub mod screenshot_event;
462pub mod search_and_rescue_event;
463pub mod sell_drones_event;
464pub mod sell_exploration_date_event;
465pub mod sell_micro_resources_event;
466pub mod sell_organic_data;
467pub mod sell_ship_on_rebuy_event;
468pub mod sell_suit_event;
469pub mod sell_weapon_event;
470pub mod send_text_event;
471pub mod set_user_ship_name_event;
472pub mod shared_bookmark_to_squadron_event;
473pub mod shield_state_event;
474pub mod ship_locker_event;
475pub mod ship_redeemed;
476pub mod ship_targeted_event;
477pub mod shipyard_buy_event;
478pub mod shipyard_event;
479pub mod shipyard_new_event;
480pub mod shipyard_redeem;
481pub mod shipyard_sell_event;
482pub mod shipyard_swap_event;
483pub mod shipyard_transfer_event;
484pub mod squadron_created_event;
485pub mod squadron_demotion_event;
486pub mod squadron_promotion_event;
487pub mod squadron_startup_event;
488pub mod srv_destroyed_event;
489pub mod start_jump_event;
490pub mod statistics_event;
491pub mod stored_modules_event;
492pub mod stored_ships_event;
493pub mod suit_loadout_event;
494pub mod supercruise_destination_drop_event;
495pub mod supercruise_entry_event;
496pub mod supercruise_exit_event;
497pub mod switch_suit_loadout_event;
498pub mod synthasis_event;
499pub mod technology_broker_event;
500pub mod touchdown_event;
501pub mod trade_micro_resources_event;
502pub mod transfer_micro_resources_event;
503pub mod under_attack_event;
504pub mod undocked_event;
505pub mod upgrade_suit_event;
506pub mod upgrade_weapon_event;
507pub mod use_consumable_event;
508pub mod uss_drop_event;
509pub mod vehicle_switch_event;
510pub mod wing_add_event;
511pub mod wing_invite_event;
512pub mod wing_join_event;
513pub mod won_a_trophy_for_squadron_event;
514
515#[cfg(feature = "legacy")]
516#[cfg_attr(docsrs, doc(cfg(feature = "legacy")))]
517pub mod legacy_liftoff_event;
518
519#[cfg(feature = "legacy")]
520#[cfg_attr(docsrs, doc(cfg(feature = "legacy")))]
521pub mod legacy_touchdown_event;
522
523/// Enum containing all the possible events that can be found in a [JournalFile].
524///
525/// > **Note** not all events might already be parsed or be parsed correctly. If you feel that
526/// > an existing entry is not parsed correctly or if there is a missing entry, please open an issue
527/// > on [GitHub](https://github.com/rster2002/ed-journals/issues/new).
528#[derive(Debug, Serialize, Deserialize, Kinded, Clone, PartialEq)]
529#[serde(tag = "event")]
530#[cfg_attr(not(feature = "allow-unknown"), non_exhaustive)]
531pub enum LogEventContent {
532    // Startup
533    Cargo(CargoEvent),
534    ClearSavedGame(ClearSavedGameEvent),
535    Commander(CommanderEvent),
536
537    #[serde(rename = "Fileheader")]
538    FileHeader(FileHeaderEvent),
539    LoadGame(LoadGameEvent),
540    Loadout(LoadoutEvent),
541    Materials(MaterialsEvent),
542    Missions(MissionsEvent),
543    NewCommander(NewCommanderEvent),
544    Passengers(PassengersEvent),
545    Powerplay(PowerplayEvent),
546    Progress(ProgressEvent),
547    Rank(RankEvent),
548    Reputation(ReputationEvent),
549    Statistics(StatisticsEvent),
550
551    // Travel
552    ApproachBody(ApproachBodyEvent),
553    CarrierLocation(CarrierLocationEvent),
554    Docked(DockedEvent),
555    DockingCancelled(DockingCancelled),
556    DockingDenied(DockingDeniedEvent),
557    DockingGranted(DockingGrantedEvent),
558    DockingRequested(DockingRequestedEvent),
559    DockingTimeout(DockingTimeoutEvent),
560    FSDJump(FSDJumpEvent),
561    FSDTarget(FSDTargetEvent),
562    LeaveBody(LeaveBodyEvent),
563    Liftoff(LiftoffEvent),
564    Location(LocationEvent),
565    StartJump(StartJumpEvent),
566    SupercruiseEntry(SupercruiseEntryEvent),
567    SupercruiseExit(SupercruiseExitEvent),
568    Touchdown(TouchdownEvent),
569    Undocked(UndockedEvent),
570
571    /// This event is fired when something changes in the `NavRoute.json` file and does not contain
572    /// the route in the event.
573    NavRoute,
574    NavRouteClear,
575
576    // Combat
577    Bounty(BountyEvent),
578    CapShipBond(CapShipBondEvent),
579    Died(DiedEvent),
580    EscapeInterdiction(EscapeInterdictionEvent),
581    FactionKillBond(FactionKillBondEvent),
582    FighterDestroyed(FighterDestroyedEvent),
583    HeatDamage,
584    HeatWarning,
585    HullDamage(HullDamageEvent),
586    Interdicted(InterdictedEvent),
587    Interdiction(InterdictionEvent),
588    PVPKill(PVPKillEvent),
589    SRVDestroyed(SRVDestroyedEvent),
590    ShieldState(ShieldStateEvent),
591    ShipTargeted(ShipTargetedEvent),
592    UnderAttack(UnderAttackEvent),
593
594    // Exploration
595    BuyExplorationData(BuyExplorationDataEvent),
596    CodexEntry(CodexEntryEvent),
597    DiscoveryScan(DiscoveryScanEvent),
598    FSSAllBodiesFound(FSSAllBodiesFoundEvent),
599    FSSBodySignals(FSSBodySignalsEvent),
600    FSSDiscoveryScan(FSSDiscoveryScan),
601    FSSSignalDiscovered(FSSSignalDiscoveredEvent),
602    MaterialCollected(MaterialCollectedEvent),
603    MaterialDiscarded(MaterialDiscarded),
604    MaterialDiscovered(MaterialDiscoveredEvent),
605    MultiSellExplorationData(MultiSellExplorationDataEvent),
606    NavBeaconScan(NavBeaconScanEvent),
607    SAAScanComplete(SAAScanCompleteEvent),
608    SAASignalsFound(SAASignalsFoundEvent),
609    Scan(ScanEvent),
610    ScanBaryCentre(ScanBaryCentreEvent),
611    SellExplorationData(SellExplorationDataEvent),
612    Screenshot(ScreenshotEvent),
613
614    // Trade
615    AsteroidCracked(AsteroidCrackedEvent),
616    BuyTradeData(BuyTradeDateEvent),
617    CollectCargo(CollectCargoEvent),
618    EjectCargo(EjectCargoEvent),
619    MarketBuy(MarketBuyEvent),
620    MarketSell(MarketSellEvent),
621    MiningRefined(MiningRefinedEvent),
622
623    // Station services
624    BuyAmmo(BuyAmmoEvent),
625    BuyDrones(BuyDronesEvent),
626    CargoDepot(CargoDepotEvent),
627    CommunityGoal(CommunityGoalEvent),
628    CommunityGoalDiscard(CommunityGoalDiscardEvent),
629    CommunityGoalJoin(CommunityGoalJoinEvent),
630    CommunityGoalReward(CommunityGoalRewardEvent),
631    CrewAssign(CrewAssignEvent),
632    CrewFire(CrewFireEvent),
633    CrewHire(CrewHireEvent),
634    EngineerContribution(EngineerContributionEvent),
635    EngineerCraft(EngineerCraftEvent),
636    EngineerProgress(EngineerProgressEvent),
637    FetchRemoteModule(FetchRemoteModuleEvent),
638    Market(MarketEvent),
639    MassModuleStore(MassModuleStoreEvent),
640    MaterialTrade(MaterialTradeEvent),
641    MissionAbandoned(MissionAbandonedEvent),
642    MissionAccepted(MissionAcceptedEvent),
643    MissionCompleted(MissionCompletedEvent),
644    MissionFailed(MissionFailedEvent),
645    MissionRedirected(MissionRedirectedEvent),
646    ModuleBuy(ModuleBuyEvent),
647    ModuleBuyAndStore(ModuleBuyAndStoreEvent),
648    ModuleRetrieve(ModuleRetrieveEvent),
649    ModuleSell(ModuleSellEvent),
650    ModuleSellRemote(ModuleSellRemoteEvent),
651    ModuleStore(ModuleStoreEvent),
652    ModuleSwap(ModuleSwapEvent),
653    Outfitting(OutfittingEvent),
654    PayBounties(PayBountiesEvent),
655    PayFines(PayFinesEvent),
656    RedeemVoucher(RedeemVoucherEvent),
657    RefuelAll(RefuelAllEvent),
658    RefuelPartial(RefuelPartialEvent),
659    Repair(RepairEvent),
660    RepairAll(RepairAllEvent),
661    RestockVehicle(RestockVehicleEvent),
662    ScientificResearch(ScientificResearchEvent),
663    SearchAndRescue(SearchAndRescueEvent),
664    SellDrones(SellDronesEvent),
665    SellShipOnRebuy(SellShipOnRebuyEvent),
666    SetUserShipName(SetUserShipNameEvent),
667    Shipyard(ShipyardEvent),
668    ShipyardBuy(ShipyardBuyEvent),
669    ShipyardNew(ShipyardNewEvent),
670    ShipyardSell(ShipyardSellEvent),
671    ShipyardSwap(ShipyardSwapEvent),
672    ShipyardTransfer(ShipyardTransferEvent),
673    ShipyardRedeem(ShipyardRedeem),
674    ShipRedeemed(ShipRedeemed),
675    StoredModules(StoredModulesEvent),
676    StoredShips(StoredShipsEvent),
677    TechnologyBroker(TechnologyBrokerEvent),
678    ClearImpound(ClearImpoundEvent),
679
680    // Powerplay
681    PowerplayCollect(PowerplayCollectEvent),
682    PowerplayDefect(PowerplayDefectEvent),
683    PowerplayDeliver(PowerplayDeliverEvent),
684    PowerplayFastTrack(PowerplayFastTrackEvent),
685    PowerplayJoin(PowerplayJoinEvent),
686    PowerplayLeave(PowerplayLeaveEvent),
687    PowerplayMerits(PowerplayMeritsEvent),
688    PowerplayRank(PowerplayRankEvent),
689    PowerplaySalary(PowerplaySalaryEvent),
690    PowerplayVote(PowerplayVoteEvent),
691    RequestPowerMicroResources(RequestPowerMicroResourcesEvent),
692
693    // Squadrons
694    AppliedToSquadron(AppliedToSquadronEvent),
695    DisbandedSquadron(DisbandedSquadronEvent),
696    InvitedToSquadron(InvitedToSquadronEvent),
697    JoinedSquadron(JoinedSquadronEvent),
698    KickedFromSquadron(KickedFromSquadronEvent),
699    LeftSquadron(LeftSquadronEvent),
700    SharedBookmarkToSquadron(ShardedBookmarkToSquadronEvent),
701    SquadronCreated(SquadronCreatedEvent),
702    SquadronDemotion(SquadronDemotionEvent),
703    SquadronPromotion(SquadronPromotionEvent),
704    SquadronStartup(SquadronStartupEvent),
705    WonATrophyForSquadron(WonATrophyForSquadronEvent),
706
707    // Fleet carriers
708    CarrierJump(CarrierJumpEvent),
709    CarrierBuy(CarrierBuyEvent),
710    CarrierStats(CarrierStatsEvent),
711    CarrierJumpRequest(CarrierJumpRequestEvent),
712    CarrierDecommission(CarrierDecommissionEvent),
713    CarrierCancelDecommission(CarrierCancelDecommissionEvent),
714    CarrierBankTransfer(CarrierBankTransferEvent),
715    CarrierDepositFuel(CarrierDepositFuelEvent),
716    CarrierCrewServices(CarrierCrewServicesEvent),
717    CarrierFinance(CarrierFinanceEvent),
718    CarrierShipPack(CarrierShipPackEvent),
719    CarrierModulePack(CarrierModulePackEvent),
720    CarrierTradeOrder(CarrierTradeOrderEvent),
721    CarrierDockingPermission(CarrierDockingPermissionEvent),
722    CarrierNameChange(CarrierNameChangeEvent),
723    CarrierJumpCancelled(CarrierJumpCancelled),
724
725    // Odyssey
726    Backpack(BackpackEvent),
727    BackpackChange(BackpackChangeEvent),
728    BookDropship(BookDropshipEvent),
729    BookTaxi(BookTaxiEvent),
730    BuyMicroResources(BuyMicroResourceEvent),
731    BuySuit(BuySuitEvent),
732    BuyWeapon(BuyWeaponEvent),
733    CancelDropship(CancelDropshipEvent),
734    CancelTaxi(CancelTaxiEvent),
735    CollectItems(CollectItemsEvent),
736    CreateSuitLoadout(CreateSuitLoadoutEvent),
737    DeleteSuitLoadout(DeleteSuitLoadoutEvent),
738    Disembark(DisembarkEvent),
739    DropItems(DropItemsEvent),
740    DropshipDeploy(DropshipDeployEvent),
741    Embark(EmbarkEvent),
742    FCMaterials(FCEmbarkEvent),
743    LoadoutEquipModule(LoadoutEquipModuleEvent),
744    LoadoutRemoveModule(LoadoutRemoveModuleEvent),
745    RenameSuitLoadout(RenameSuitLoadoutEvent),
746    Resupply,
747    ScanOrganic(ScanOrganicEvent),
748    SellMicroResources(SellMicroResourcesEvent),
749    SellOrganicData(SellOrganicDataEvent),
750    SellSuit(SellSuitEvent),
751    SellWeapon(SellWeaponEvent),
752    ShipLocker(ShipLockerEvent),
753    SwitchSuitLoadout(SwitchSuitLoadoutEvent),
754    SuitLoadout(SuitLoadoutEvent),
755    TransferMicroResources(TransferMicroResourcesEvent),
756    TradeMicroResources(TradeMicroResourcesEvent),
757    UpgradeSuit(UpgradeSuitEvent),
758    UpgradeWeapon(UpgradeWeaponEvent),
759    UseConsumable(UseConsumableEvent),
760
761    // Colonisation
762    ColonisationConstructionDepot(ColonisationConstructionDepotEvent),
763    ColonisationContribution(ColonisationContributionEvent),
764
765    // Other
766    #[serde(rename = "AfmuRepairs")]
767    AFMURepairs(AFMURepairsEvent),
768    ApproachSettlement(ApproachSettlementEvent),
769    CargoTransfer(CargoTransferEvent),
770    ChangeCrewRole(ChangeCrewRoleEvent),
771    CockpitBreached,
772    CommitCrime(CommitCrimeEvent),
773    Continued(ContinuedEvent),
774    CrewLaunchFighter(CrewLaunchFighterEvent),
775    CrewMemberJoins(CrewMemberJoinsEvent),
776    CrewMemberQuits(CrewMemberQuitsEvent),
777    CrewMemberRoleChange(CrewMemberRoleChangeEvent),
778    CrimeVictim(CrimeVictimEvent),
779    DataScanned(DataScannedEvent),
780    DatalinkVoucher(DatalinkVoucherEvent),
781    DatalinkScan(DatalinkScanEvent),
782    DockFighter(DockFighterEvent),
783    DockSRV(DockSRVEvent),
784    EndCrewSession(EndCrewSessionEvent),
785    FighterRebuilt(FighterRebuiltEvent),
786    Friends(FriendsEvent),
787    FuelScoop(FuelScoopEvent),
788    JetConeBoost(JetConeBoostEvent),
789    JetConeDamage(JetConeDamageEvent),
790    JoinACrew(JoinACrewEvent),
791    KickCrewMember(KickCrewMemberEvent),
792    LaunchDrone(LaunchDroneEvent),
793    LaunchFighter(LaunchFighterEvent),
794    LaunchSRV(LaunchSRVEvent),
795
796    /// This event is fired when something changes in the `ModulesInfo.json` file and does not
797    /// contain any data itself.
798    ModuleInfo,
799    Music(MusicEvent),
800
801    #[serde(rename = "NpcCrewPaidWage")]
802    NPCCrewPaidWage(NPCCrewWagePaidEvent),
803
804    #[serde(rename = "NpcCrewRank")]
805    NPCCrewRank(NPCCrewRankEvent),
806    Promotion(PromotionEvent),
807    ProspectedAsteroid(ProspectedAsteroidEvent),
808    QuitACrew(QuitACrewEvent),
809    RebootRepair(RebootRepairEvent),
810    ReceiveText(ReceiveTextEvent),
811    RepairDrone(RepairDroneEvent),
812    ReservoirReplenished(ReservoirReplenishedEvent),
813    Resurrect(ResurrectEvent),
814    Scanned(ScannedEvent),
815    SelfDestruct,
816    SendText(SendTextEvent),
817    Shutdown,
818    SupercruiseDestinationDrop(SupercruiseDestinationDropEvent),
819    Synthesis(SynthesisEvent),
820    SystemsShutdown,
821    USSDrop(USSDropEvent),
822    VehicleSwitch(VehicleSwitchEvent),
823    WingAdd(WingAddEvent),
824    WingInvite(WingInviteEvent),
825    WingJoin(WingJoinEvent),
826    WingLeave,
827
828    // Legacy
829    #[cfg(feature = "legacy")]
830    #[cfg_attr(docsrs, doc(cfg(feature = "legacy")))]
831    #[serde(untagged)]
832    LegacyLiftoffEvent(LegacyLiftoffEvent),
833
834    #[cfg(feature = "legacy")]
835    #[cfg_attr(docsrs, doc(cfg(feature = "legacy")))]
836    #[serde(untagged)]
837    LegacyTouchdownEvent(LegacyTouchdownEvent),
838
839    #[cfg(feature = "allow-unknown")]
840    #[cfg_attr(docsrs, doc(cfg(feature = "allow-unknown")))]
841    #[serde(untagged)]
842    Unknown(Value),
843}
844
845impl LogEventContent {
846    pub fn system_address(&self) -> Option<u64> {
847        Some(match self {
848            LogEventContent::Location(event) => event.location_info.system_address,
849            LogEventContent::FSDJump(event) => event.system_info.system_address,
850            LogEventContent::CarrierJump(event) => event.system_info.system_address,
851            LogEventContent::ApproachSettlement(event) => event.system_address,
852            LogEventContent::ApproachBody(event) => event.system_address,
853            LogEventContent::LeaveBody(event) => event.system_address,
854            LogEventContent::CarrierBuy(event) => event.system_address,
855            LogEventContent::CarrierJumpRequest(event) => event.system_address,
856            LogEventContent::CodexEntry(event) => event.system_address,
857            LogEventContent::DiscoveryScan(event) => event.system_address,
858            LogEventContent::Disembark(event) => event.system_address,
859            LogEventContent::Docked(event) => event.system_address,
860            LogEventContent::DropshipDeploy(event) => event.system_address,
861            LogEventContent::Embark(event) => event.system_address,
862            LogEventContent::FSSAllBodiesFound(event) => event.system_address,
863            LogEventContent::FSSBodySignals(event) => event.system_address,
864            LogEventContent::FSSDiscoveryScan(event) => event.system_address,
865            LogEventContent::FSSSignalDiscovered(event) => event.system_address,
866            LogEventContent::Liftoff(event) => event.system_address,
867            LogEventContent::NavBeaconScan(event) => event.system_address,
868            LogEventContent::SAAScanComplete(event) => event.system_address,
869            LogEventContent::SAASignalsFound(event) => event.system_address,
870            LogEventContent::Scan(event) => event.system_address,
871            LogEventContent::ScanBaryCentre(event) => event.system_address,
872            LogEventContent::ScanOrganic(event) => event.system_address,
873            LogEventContent::StartJump(event) => match event.jump {
874                StartJumpType::Hyperspace { system_address, .. } => system_address,
875                StartJumpType::Supercruise => return None,
876            },
877            LogEventContent::SupercruiseEntry(event) => event.system_address,
878            LogEventContent::SupercruiseExit(event) => event.system_address,
879            LogEventContent::Touchdown(event) => event.system_address,
880
881            #[cfg(feature = "legacy")]
882            LogEventContent::LegacyLiftoffEvent(event) => event.system_address?,
883
884            #[cfg(feature = "legacy")]
885            LogEventContent::LegacyTouchdownEvent(event) => event.system_address?,
886            _ => return None,
887        })
888    }
889
890    pub fn star_name(&self) -> Option<&str> {
891        Some(match self {
892            LogEventContent::Location(event) => &event.location_info.star_system,
893            LogEventContent::FSDJump(event) => &event.system_info.star_system,
894            LogEventContent::CarrierJump(event) => &event.system_info.star_system,
895            LogEventContent::CarrierBuy(event) => &event.location,
896            LogEventContent::CarrierJumpRequest(event) => &event.system_name,
897            LogEventContent::CodexEntry(event) => &event.system,
898            LogEventContent::Disembark(event) => &event.star_system,
899            LogEventContent::Docked(event) => &event.star_system,
900            LogEventContent::DropshipDeploy(event) => &event.star_system,
901            LogEventContent::Embark(event) => &event.star_system,
902            LogEventContent::FSSAllBodiesFound(event) => &event.system_name,
903            LogEventContent::FSSDiscoveryScan(event) => &event.system_name,
904            LogEventContent::LeaveBody(event) => &event.star_system,
905            LogEventContent::Liftoff(event) => &event.star_system,
906            LogEventContent::Scan(event) => &event.star_system,
907            LogEventContent::ScanBaryCentre(event) => &event.star_system,
908            LogEventContent::StartJump(event) => match &event.jump {
909                StartJumpType::Hyperspace { star_system, .. } => star_system,
910                StartJumpType::Supercruise => return None,
911            },
912            LogEventContent::SupercruiseEntry(event) => &event.star_system,
913            LogEventContent::SupercruiseExit(event) => &event.star_system,
914            LogEventContent::Touchdown(event) => &event.star_system,
915
916            #[cfg(feature = "legacy")]
917            LogEventContent::LegacyLiftoffEvent(event) => event.star_system.as_ref()?,
918
919            #[cfg(feature = "legacy")]
920            LogEventContent::LegacyTouchdownEvent(event) => event.star_system.as_ref()?,
921            _ => return None,
922        })
923    }
924
925    pub fn partial_system_info(&self) -> Option<PartialSystemInfo> {
926        let system_address = self.system_address()?;
927        let star_name = self.star_name()?;
928
929        Some(PartialSystemInfo {
930            system_address,
931            star_name: star_name.to_string(),
932        })
933    }
934
935    pub fn body_id(&self) -> Option<u8> {
936        Some(match self {
937            LogEventContent::Location(event) => event.location_info.body_id,
938            LogEventContent::FSDJump(event) => event.system_info.body_id,
939            LogEventContent::CarrierJump(event) => event.system_info.body_id,
940            LogEventContent::ApproachSettlement(event) => event.body_id,
941            LogEventContent::ApproachBody(event) => event.body_id,
942            LogEventContent::LeaveBody(event) => event.body_id,
943            LogEventContent::CarrierJumpRequest(event) => event.body_id,
944            LogEventContent::CodexEntry(event) => event.body_id?,
945            LogEventContent::DropshipDeploy(event) => event.body_id,
946            LogEventContent::FSSBodySignals(event) => event.body_id,
947            LogEventContent::SAAScanComplete(event) => event.body_id,
948            LogEventContent::SAASignalsFound(event) => event.body_id,
949            LogEventContent::ScanBaryCentre(event) => event.body_id,
950            LogEventContent::Scan(event) => event.body_id,
951            LogEventContent::Touchdown(event) => event.body_id,
952            LogEventContent::ScanOrganic(event) => event.body,
953            LogEventContent::Liftoff(event) => event.body_id,
954
955            #[cfg(feature = "legacy")]
956            LogEventContent::LegacyLiftoffEvent(event) => event.body_id?,
957
958            #[cfg(feature = "legacy")]
959            LogEventContent::LegacyTouchdownEvent(event) => event.body_id?,
960            _ => return None,
961        })
962    }
963
964    pub fn body_name(&self) -> Option<&str> {
965        Some(match self {
966            LogEventContent::Location(event) => &event.location_info.body,
967            LogEventContent::FSDJump(event) => &event.system_info.body,
968            LogEventContent::CarrierJump(event) => &event.system_info.body,
969            LogEventContent::ApproachSettlement(event) => &event.body_name,
970            LogEventContent::CarrierJumpRequest(event) => match &event.body {
971                Some(name) => name,
972                None => return None,
973            },
974            LogEventContent::DropshipDeploy(event) => &event.body,
975            LogEventContent::FSSBodySignals(event) => &event.body_name,
976            LogEventContent::LeaveBody(event) => &event.body,
977            LogEventContent::SAAScanComplete(event) => &event.body_name,
978            LogEventContent::Scan(event) => &event.body_name,
979            LogEventContent::Touchdown(event) => &event.body,
980            LogEventContent::Liftoff(event) => &event.body,
981
982            #[cfg(feature = "legacy")]
983            LogEventContent::LegacyLiftoffEvent(event) => event.body.as_ref()?,
984
985            #[cfg(feature = "legacy")]
986            LogEventContent::LegacyTouchdownEvent(event) => event.body.as_ref()?,
987
988            _ => return None,
989        })
990    }
991
992    pub fn location_info(&self) -> Option<&LocationInfo> {
993        Some(match self {
994            LogEventContent::Location(event) => &event.location_info,
995            LogEventContent::FSDJump(event) => &event.system_info,
996            LogEventContent::CarrierJump(event) => &event.system_info,
997
998            _ => return None,
999        })
1000    }
1001}