diff --git a/Content.Server/Shipyard/Systems/ShipyardSystem.Consoles.cs b/Content.Server/Shipyard/Systems/ShipyardSystem.Consoles.cs index 80b1aada631..edc10b3c587 100644 --- a/Content.Server/Shipyard/Systems/ShipyardSystem.Consoles.cs +++ b/Content.Server/Shipyard/Systems/ShipyardSystem.Consoles.cs @@ -36,12 +36,14 @@ using Content.Server.Shuttles.Components; using Content.Server.Station.Components; using System.Text.RegularExpressions; +using Content.Server._NF.ShuttleRecords; using Content.Shared.UserInterface; using Robust.Shared.Audio; using Robust.Shared.Audio.Systems; using Content.Shared.Access; using Content.Shared.Tiles; using Content.Server._NF.Smuggling.Components; +using Content.Shared._NF.ShuttleRecords; namespace Content.Server.Shipyard.Systems; @@ -64,21 +66,22 @@ public sealed partial class ShipyardSystem : SharedShipyardSystem [Dependency] private readonly MindSystem _mind = default!; [Dependency] private readonly UserInterfaceSystem _userInterface = default!; [Dependency] private readonly EntityManager _entityManager = default!; + [Dependency] private readonly ShuttleRecordsSystem _shuttleRecordsSystem = default!; public void InitializeConsole() { } - private void OnPurchaseMessage(EntityUid uid, ShipyardConsoleComponent component, ShipyardConsolePurchaseMessage args) + private void OnPurchaseMessage(EntityUid shipyardConsoleUid, ShipyardConsoleComponent component, ShipyardConsolePurchaseMessage args) { if (args.Actor is not { Valid: true } player) return; if (component.TargetIdSlot.ContainerSlot?.ContainedEntity is not { Valid: true } targetId) { - ConsolePopup(args.Actor, Loc.GetString("shipyard-console-no-idcard")); - PlayDenySound(args.Actor, uid, component); + ConsolePopup(player, Loc.GetString("shipyard-console-no-idcard")); + PlayDenySound(player, shipyardConsoleUid, component); return; } @@ -86,35 +89,35 @@ private void OnPurchaseMessage(EntityUid uid, ShipyardConsoleComponent component TryComp(targetId, out var voucher); if (idCard is null && voucher is null) { - ConsolePopup(args.Actor, Loc.GetString("shipyard-console-no-idcard")); - PlayDenySound(args.Actor, uid, component); + ConsolePopup(player, Loc.GetString("shipyard-console-no-idcard")); + PlayDenySound(player, shipyardConsoleUid, component); return; } if (HasComp(targetId)) { - ConsolePopup(args.Actor, Loc.GetString("shipyard-console-already-deeded")); - PlayDenySound(args.Actor, uid, component); + ConsolePopup(player, Loc.GetString("shipyard-console-already-deeded")); + PlayDenySound(player, shipyardConsoleUid, component); return; } - if (TryComp(uid, out var accessReaderComponent) && !_access.IsAllowed(player, uid, accessReaderComponent)) + if (TryComp(shipyardConsoleUid, out var accessReaderComponent) && !_access.IsAllowed(player, shipyardConsoleUid, accessReaderComponent)) { - ConsolePopup(args.Actor, Loc.GetString("comms-console-permission-denied")); - PlayDenySound(args.Actor, uid, component); + ConsolePopup(player, Loc.GetString("comms-console-permission-denied")); + PlayDenySound(player, shipyardConsoleUid, component); return; } if (!_prototypeManager.TryIndex(args.Vessel, out var vessel)) { - ConsolePopup(args.Actor, Loc.GetString("shipyard-console-invalid-vessel", ("vessel", args.Vessel))); - PlayDenySound(args.Actor, uid, component); + ConsolePopup(player, Loc.GetString("shipyard-console-invalid-vessel", ("vessel", args.Vessel))); + PlayDenySound(player, shipyardConsoleUid, component); return; } - if (!GetAvailableShuttles(uid, targetId: targetId).available.Contains(vessel.ID)) + if (!GetAvailableShuttles(shipyardConsoleUid, targetId: targetId).available.Contains(vessel.ID)) { - PlayDenySound(args.Actor, uid, component); + PlayDenySound(player, shipyardConsoleUid, component); _adminLogger.Add(LogType.Action, LogImpact.Medium, $"{ToPrettyString(player):player} tried to purchase a vessel that was never available."); return; } @@ -123,17 +126,17 @@ private void OnPurchaseMessage(EntityUid uid, ShipyardConsoleComponent component if (vessel.Price <= 0) return; - if (_station.GetOwningStation(uid) is not { Valid: true } station) + if (_station.GetOwningStation(shipyardConsoleUid) is not { Valid: true } station) { - ConsolePopup(args.Actor, Loc.GetString("shipyard-console-invalid-station")); - PlayDenySound(args.Actor, uid, component); + ConsolePopup(player, Loc.GetString("shipyard-console-invalid-station")); + PlayDenySound(player, shipyardConsoleUid, component); return; } if (!TryComp(player, out var bank)) { - ConsolePopup(args.Actor, Loc.GetString("shipyard-console-no-bank")); - PlayDenySound(args.Actor, uid, component); + ConsolePopup(player, Loc.GetString("shipyard-console-no-bank")); + PlayDenySound(player, shipyardConsoleUid, component); return; } @@ -144,14 +147,14 @@ private void OnPurchaseMessage(EntityUid uid, ShipyardConsoleComponent component { if (voucher!.RedemptionsLeft <= 0) { - ConsolePopup(args.Actor, Loc.GetString("shipyard-console-no-voucher-redemptions")); - PlayDenySound(args.Actor, uid, component); + ConsolePopup(player, Loc.GetString("shipyard-console-no-voucher-redemptions")); + PlayDenySound(player, shipyardConsoleUid, component); return; } else if (voucher!.ConsoleType != (ShipyardConsoleUiKey)args.UiKey) { - ConsolePopup(args.Actor, Loc.GetString("shipyard-console-invalid-voucher-type")); - PlayDenySound(args.Actor, uid, component); + ConsolePopup(player, Loc.GetString("shipyard-console-invalid-voucher-type")); + PlayDenySound(player, shipyardConsoleUid, component); return; } voucher.RedemptionsLeft--; @@ -161,23 +164,29 @@ private void OnPurchaseMessage(EntityUid uid, ShipyardConsoleComponent component { if (bank.Balance <= vessel.Price) { - ConsolePopup(args.Actor, Loc.GetString("cargo-console-insufficient-funds", ("cost", vessel.Price))); - PlayDenySound(args.Actor, uid, component); + ConsolePopup(player, Loc.GetString("cargo-console-insufficient-funds", ("cost", vessel.Price))); + PlayDenySound(player, shipyardConsoleUid, component); return; } if (!_bank.TryBankWithdraw(player, vessel.Price)) { - ConsolePopup(args.Actor, Loc.GetString("cargo-console-insufficient-funds", ("cost", vessel.Price))); - PlayDenySound(args.Actor, uid, component); + ConsolePopup(player, Loc.GetString("cargo-console-insufficient-funds", ("cost", vessel.Price))); + PlayDenySound(player, shipyardConsoleUid, component); return; } } - if (!TryPurchaseShuttle((EntityUid) station, vessel.ShuttlePath.ToString(), out var shuttle)) + if (!TryPurchaseShuttle((EntityUid) station, vessel.ShuttlePath.ToString(), out var shuttleUidOut)) { - PlayDenySound(args.Actor, uid, component); + PlayDenySound(player, shipyardConsoleUid, component); + return; + } + var shuttleUid = shuttleUidOut.Value; + if (!_entityManager.TryGetComponent(shuttleUid, out var shuttle)) + { + PlayDenySound(player, shipyardConsoleUid, component); return; } EntityUid? shuttleStation = null; @@ -186,19 +195,19 @@ private void OnPurchaseMessage(EntityUid uid, ShipyardConsoleComponent component { List gridUids = new() { - shuttle.Owner + shuttleUid }; shuttleStation = _station.InitializeNewStation(stationProto.Stations[vessel.ID], gridUids); var metaData = MetaData((EntityUid) shuttleStation); name = metaData.EntityName; - _shuttle.SetIFFColor(shuttle.Owner, new Color + _shuttle.SetIFFColor(shuttleUid, new Color { R = 10, G = 50, B = 100, A = 100 }); - _shuttle.AddIFFFlag(shuttle.Owner, IFFFlags.IsPlayerShuttle); + _shuttle.AddIFFFlag(shuttleUid, IFFFlags.IsPlayerShuttle); } if (TryComp(targetId, out var newCap)) @@ -210,11 +219,11 @@ private void OnPurchaseMessage(EntityUid uid, ShipyardConsoleComponent component var deedID = EnsureComp(targetId); - var shuttleOwner = Name(args.Actor).Trim(); - AssignShuttleDeedProperties(deedID, shuttle.Owner, name, shuttleOwner); + var shuttleOwner = Name(player).Trim(); + AssignShuttleDeedProperties(deedID, shuttleUid, name, shuttleOwner); - var deedShuttle = EnsureComp(shuttle.Owner); - AssignShuttleDeedProperties(deedShuttle, shuttle.Owner, name, shuttleOwner); + var deedShuttle = EnsureComp(shuttleUid); + AssignShuttleDeedProperties(deedShuttle, shuttleUid, name, shuttleOwner); if (!voucherUsed) { @@ -247,7 +256,7 @@ private void OnPurchaseMessage(EntityUid uid, ShipyardConsoleComponent component } if (!recSuccess && - _mind.TryGetMind(args.Actor, out var mindUid, out var mindComp) + _mind.TryGetMind(player, out var mindUid, out var mindComp) && _prefManager.GetPreferences(_mind.GetSession(mindComp)!.UserId).SelectedCharacter is HumanoidCharacterProfile profile) { TryComp(player, out var fingerprintComponent); @@ -262,7 +271,7 @@ private void OnPurchaseMessage(EntityUid uid, ShipyardConsoleComponent component // Shuttle setup: add protected grid status if needed. if (vessel.GridProtection != GridProtectionFlags.None) { - var prot = EnsureComp(shuttle.Owner); + var prot = EnsureComp(shuttleUid); if (vessel.GridProtection.HasFlag(GridProtectionFlags.FloorRemoval)) prot.PreventFloorRemoval = true; if (vessel.GridProtection.HasFlag(GridProtectionFlags.FloorPlacement)) @@ -286,17 +295,25 @@ private void OnPurchaseMessage(EntityUid uid, ShipyardConsoleComponent component sellValue -= CalculateSalesTax(component, sellValue); } - SendPurchaseMessage(uid, player, name, component.ShipyardChannel, secret: false); + SendPurchaseMessage(shipyardConsoleUid, player, name, component.ShipyardChannel, secret: false); if (component.SecretShipyardChannel is { } secretChannel) - SendPurchaseMessage(uid, player, name, secretChannel, secret: true); + SendPurchaseMessage(shipyardConsoleUid, player, name, secretChannel, secret: true); - PlayConfirmSound(args.Actor, uid, component); + PlayConfirmSound(player, shipyardConsoleUid, component); if (voucherUsed) - _adminLogger.Add(LogType.ShipYardUsage, LogImpact.Low, $"{ToPrettyString(player):actor} purchased shuttle {ToPrettyString(shuttle.Owner)} with a voucher via {ToPrettyString(component.Owner)}"); + _adminLogger.Add(LogType.ShipYardUsage, LogImpact.Low, $"{ToPrettyString(player):actor} purchased shuttle {ToPrettyString(shuttleUid)} with a voucher via {ToPrettyString(component.Owner)}"); else - _adminLogger.Add(LogType.ShipYardUsage, LogImpact.Low, $"{ToPrettyString(player):actor} purchased shuttle {ToPrettyString(shuttle.Owner)} for {vessel.Price} credits via {ToPrettyString(component.Owner)}"); - - RefreshState(uid, bank.Balance, true, name, sellValue, targetId, (ShipyardConsoleUiKey) args.UiKey, voucherUsed); + _adminLogger.Add(LogType.ShipYardUsage, LogImpact.Low, $"{ToPrettyString(player):actor} purchased shuttle {ToPrettyString(shuttleUid)} for {vessel.Price} credits via {ToPrettyString(component.Owner)}"); + + _shuttleRecordsSystem.AddRecord( + new ShuttleRecord( + name: deedShuttle.ShuttleName ?? "", + suffix: deedShuttle.ShuttleNameSuffix ?? "", + ownerName: shuttleOwner, + entityUid: _entityManager.GetNetEntity(shuttleUid) + ) + ); + RefreshState(shipyardConsoleUid, bank.Balance, true, name, sellValue, targetId, (ShipyardConsoleUiKey) args.UiKey, voucherUsed); } private void TryParseShuttleName(ShuttleDeedComponent deed, string name) @@ -318,8 +335,8 @@ public void OnSellMessage(EntityUid uid, ShipyardConsoleComponent component, Shi if (component.TargetIdSlot.ContainerSlot?.ContainedEntity is not { Valid: true } targetId) { - ConsolePopup(args.Actor, Loc.GetString("shipyard-console-no-idcard")); - PlayDenySound(args.Actor, uid, component); + ConsolePopup(player, Loc.GetString("shipyard-console-no-idcard")); + PlayDenySound(player, uid, component); return; } @@ -327,8 +344,8 @@ public void OnSellMessage(EntityUid uid, ShipyardConsoleComponent component, Shi TryComp(targetId, out var voucher); if (idCard is null && voucher is null) { - ConsolePopup(args.Actor, Loc.GetString("shipyard-console-no-idcard")); - PlayDenySound(args.Actor, uid, component); + ConsolePopup(player, Loc.GetString("shipyard-console-no-idcard")); + PlayDenySound(player, uid, component); return; } @@ -336,22 +353,22 @@ public void OnSellMessage(EntityUid uid, ShipyardConsoleComponent component, Shi if (!TryComp(targetId, out var deed) || deed.ShuttleUid is not { Valid: true } shuttleUid) { - ConsolePopup(args.Actor, Loc.GetString("shipyard-console-no-deed")); - PlayDenySound(args.Actor, uid, component); + ConsolePopup(player, Loc.GetString("shipyard-console-no-deed")); + PlayDenySound(player, uid, component); return; } if (!TryComp(player, out var bank)) { - ConsolePopup(args.Actor, Loc.GetString("shipyard-console-no-bank")); - PlayDenySound(args.Actor, uid, component); + ConsolePopup(player, Loc.GetString("shipyard-console-no-bank")); + PlayDenySound(player, uid, component); return; } if (_station.GetOwningStation(uid) is not { Valid: true } stationUid) { - ConsolePopup(args.Actor, Loc.GetString("shipyard-console-invalid-station")); - PlayDenySound(args.Actor, uid, component); + ConsolePopup(player, Loc.GetString("shipyard-console-invalid-station")); + PlayDenySound(player, uid, component); return; } @@ -374,8 +391,8 @@ public void OnSellMessage(EntityUid uid, ShipyardConsoleComponent component, Shi var disableSaleMsg = FindDisableShipyardSaleObjects(shuttleUid, (ShipyardConsoleUiKey)args.UiKey, disableSaleQuery, xformQuery); if (disableSaleMsg != null) { - ConsolePopup(args.Actor, Loc.GetString(disableSaleMsg)); - PlayDenySound(args.Actor, uid, component); + ConsolePopup(player, Loc.GetString(disableSaleMsg)); + PlayDenySound(player, uid, component); return; } @@ -385,19 +402,19 @@ public void OnSellMessage(EntityUid uid, ShipyardConsoleComponent component, Shi switch (saleResult.Error) { case ShipyardSaleError.Undocked: - ConsolePopup(args.Actor, Loc.GetString("shipyard-console-sale-not-docked")); + ConsolePopup(player, Loc.GetString("shipyard-console-sale-not-docked")); break; case ShipyardSaleError.OrganicsAboard: - ConsolePopup(args.Actor, Loc.GetString("shipyard-console-sale-organic-aboard", ("name", saleResult.OrganicName ?? "Somebody"))); + ConsolePopup(player, Loc.GetString("shipyard-console-sale-organic-aboard", ("name", saleResult.OrganicName ?? "Somebody"))); break; case ShipyardSaleError.InvalidShip: - ConsolePopup(args.Actor, Loc.GetString("shipyard-console-sale-invalid-ship")); + ConsolePopup(player, Loc.GetString("shipyard-console-sale-invalid-ship")); break; default: - ConsolePopup(args.Actor, Loc.GetString("shipyard-console-sale-unknown-reason", ("reason", saleResult.Error.ToString()))); + ConsolePopup(player, Loc.GetString("shipyard-console-sale-unknown-reason", ("reason", saleResult.Error.ToString()))); break; } - PlayDenySound(args.Actor, uid, component); + PlayDenySound(player, uid, component); return; } @@ -419,7 +436,7 @@ public void OnSellMessage(EntityUid uid, ShipyardConsoleComponent component, Shi } _bank.TryBankDeposit(player, bill); - PlayConfirmSound(args.Actor, uid, component); + PlayConfirmSound(player, uid, component); } var name = GetFullName(deed); diff --git a/Content.Server/Shipyard/Systems/ShipyardSystem.cs b/Content.Server/Shipyard/Systems/ShipyardSystem.cs index 1c86a899540..4d514045086 100644 --- a/Content.Server/Shipyard/Systems/ShipyardSystem.cs +++ b/Content.Server/Shipyard/Systems/ShipyardSystem.cs @@ -113,11 +113,12 @@ private void SetShipyardEnabled(bool value) /// /// The ID of the station to dock the shuttle to /// The path to the shuttle file to load. Must be a grid file! - public bool TryPurchaseShuttle(EntityUid stationUid, string shuttlePath, [NotNullWhen(true)] out ShuttleComponent? shuttle) + /// The EntityUid of the shuttle that was purchased + public bool TryPurchaseShuttle(EntityUid stationUid, string shuttlePath, [NotNullWhen(true)] out EntityUid? shuttleEntityUid) { - if (!TryComp(stationUid, out var stationData) || !TryAddShuttle(shuttlePath, out var shuttleGrid) || !TryComp(shuttleGrid, out shuttle)) + if (!TryComp(stationUid, out var stationData) || !TryAddShuttle(shuttlePath, out var shuttleGrid) || !TryComp(shuttleGrid, out var shuttleComponent)) { - shuttle = null; + shuttleEntityUid = null; return false; } @@ -128,14 +129,14 @@ public bool TryPurchaseShuttle(EntityUid stationUid, string shuttlePath, [NotNul if (targetGrid == null) //how are we even here with no station grid { _mapManager.DeleteGrid((EntityUid) shuttleGrid); - shuttle = null; + shuttleEntityUid = null; return false; } - _sawmill.Info($"Shuttle {shuttlePath} was purchased at {ToPrettyString((EntityUid) stationUid)} for {price:f2}"); + _sawmill.Info($"Shuttle {shuttlePath} was purchased at {ToPrettyString(stationUid)} for {price:f2}"); //can do TryFTLDock later instead if we need to keep the shipyard map paused - _shuttle.TryFTLDock(shuttleGrid.Value, shuttle, targetGrid.Value); - + _shuttle.TryFTLDock(shuttleGrid.Value, shuttleComponent, targetGrid.Value); + shuttleEntityUid = shuttleGrid; return true; } diff --git a/Content.Server/_NF/Market/Systems/MarketSystem.cs b/Content.Server/_NF/Market/Systems/MarketSystem.cs index e0062ccd2a2..5e287b147f8 100644 --- a/Content.Server/_NF/Market/Systems/MarketSystem.cs +++ b/Content.Server/_NF/Market/Systems/MarketSystem.cs @@ -28,7 +28,6 @@ public sealed partial class MarketSystem: SharedMarketSystem [Dependency] private readonly PricingSystem _pricingSystem = default!; [Dependency] private readonly StackSystem _stackSystem = default!; [Dependency] private readonly SharedPopupSystem _popup = default!; - [Dependency] private readonly SectorServiceSystem _sectorService = default!; [Dependency] private readonly EntProtoIdWhitelistSystem _protoIdWhitelist = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly StationSystem _station = default!; diff --git a/Content.Server/_NF/ShuttleRecords/Components/SectorShuttleRecordsComponent.cs b/Content.Server/_NF/ShuttleRecords/Components/SectorShuttleRecordsComponent.cs new file mode 100644 index 00000000000..6585c119337 --- /dev/null +++ b/Content.Server/_NF/ShuttleRecords/Components/SectorShuttleRecordsComponent.cs @@ -0,0 +1,15 @@ +using Content.Shared._NF.ShuttleRecords; + +namespace Content.Server._NF.ShuttleRecords.Components; + +/// +/// A component that stores records for all shuttle purchases in the sector. +/// Note: all purchases are currently added, will need to be filtered appropriately by viewing clients. +/// +[RegisterComponent] +[Access(typeof(ShuttleRecordsSystem))] +public sealed partial class SectorShuttleRecordsComponent : Component +{ + [DataField] + public List ShuttleRecordsList = []; +} diff --git a/Content.Server/_NF/ShuttleRecords/ShuttleRecordsSystem.cs b/Content.Server/_NF/ShuttleRecords/ShuttleRecordsSystem.cs new file mode 100644 index 00000000000..d5af8bc422c --- /dev/null +++ b/Content.Server/_NF/ShuttleRecords/ShuttleRecordsSystem.cs @@ -0,0 +1,39 @@ +using System.Diagnostics.CodeAnalysis; +using Content.Server._NF.SectorServices; +using Content.Server._NF.ShuttleRecords.Components; +using Content.Shared._NF.ShuttleRecords; + +namespace Content.Server._NF.ShuttleRecords; + +public sealed partial class ShuttleRecordsSystem : SharedShuttleRecordsSystem +{ + [Dependency] private readonly IEntityManager _entityManager = default!; + [Dependency] private readonly SectorServiceSystem _sectorService = default!; + + + /** + * Adds a record to the shuttle records list. + * The record to add. + */ + public void AddRecord(ShuttleRecord record) + { + if (!TryGetShuttleRecordsDataComponent(out var component)) + return; + + component.ShuttleRecordsList.Add(record); + } + + private bool TryGetShuttleRecordsDataComponent([NotNullWhen(true)] out SectorShuttleRecordsComponent? component) + { + if (_entityManager.EnsureComponent( + uid: _sectorService.GetServiceEntity(), + out var shuttleRecordsComponent)) + { + component = shuttleRecordsComponent; + return true; + } + + component = null; + return false; + } +} diff --git a/Content.Shared/Shipyard/Components/ShuttleDeedComponent.cs b/Content.Shared/Shipyard/Components/ShuttleDeedComponent.cs index c314992e8be..fbc96bc17e7 100644 --- a/Content.Shared/Shipyard/Components/ShuttleDeedComponent.cs +++ b/Content.Shared/Shipyard/Components/ShuttleDeedComponent.cs @@ -1,3 +1,4 @@ +using Content.Shared._NF.ShuttleRecords; using Robust.Shared.GameStates; namespace Content.Shared.Shipyard.Components; @@ -5,7 +6,7 @@ namespace Content.Shared.Shipyard.Components; /// /// Tied to an ID card when a ship is purchased. 1 ship per captain. /// -[RegisterComponent, NetworkedComponent, Access(typeof(SharedShipyardSystem))] +[RegisterComponent, NetworkedComponent, Access(typeof(SharedShipyardSystem), typeof(SharedShuttleRecordsSystem))] public sealed partial class ShuttleDeedComponent : Component { public const int MaxNameLength = 30; diff --git a/Content.Shared/_NF/ShuttleRecords/SharedShuttleRecordsSystem.cs b/Content.Shared/_NF/ShuttleRecords/SharedShuttleRecordsSystem.cs new file mode 100644 index 00000000000..a95ea57ec7f --- /dev/null +++ b/Content.Shared/_NF/ShuttleRecords/SharedShuttleRecordsSystem.cs @@ -0,0 +1,11 @@ +using Content.Shared.Containers.ItemSlots; +using Robust.Shared.Audio.Systems; + +namespace Content.Shared._NF.ShuttleRecords; + +public abstract class SharedShuttleRecordsSystem : EntitySystem +{ + // These dependencies are eventually needed for the consoles that are made for this system. + [Dependency] protected readonly ItemSlotsSystem _itemSlotsSystem = default!; + [Dependency] protected readonly SharedAudioSystem _audioSystem = default!; +} diff --git a/Content.Shared/_NF/ShuttleRecords/ShuttleRecord.cs b/Content.Shared/_NF/ShuttleRecords/ShuttleRecord.cs new file mode 100644 index 00000000000..a88bb2341c4 --- /dev/null +++ b/Content.Shared/_NF/ShuttleRecords/ShuttleRecord.cs @@ -0,0 +1,32 @@ +using Robust.Shared.Serialization; + +namespace Content.Shared._NF.ShuttleRecords; + +/** + * A record of a shuttle that had been purchased. + * This class is NOT a indication that the shuttle is still in the game, merely a transaction record of it. + */ +[Virtual, NetSerializable, Serializable] +public class ShuttleRecord( + string name, + string suffix, + string ownerName, + NetEntity entityUid +) +{ + [ViewVariables] + public string Name { get; set; } = name; + + [ViewVariables] + public string? Suffix { get; set; } = suffix; + + [ViewVariables] + public string OwnerName { get; set; } = ownerName; + + /** + * Entity is deleted when the ship gets sold. + * Use EntityManager.EntityExists(EntityUid) to check if the entity still exists. + */ + [ViewVariables] + public NetEntity EntityUid { get; set; } = entityUid; +} diff --git a/Resources/Prototypes/_NF/SectorServices/services.yml b/Resources/Prototypes/_NF/SectorServices/services.yml index 39c36baeb64..51c150d25ea 100644 --- a/Resources/Prototypes/_NF/SectorServices/services.yml +++ b/Resources/Prototypes/_NF/SectorServices/services.yml @@ -7,3 +7,8 @@ id: MailMetrics components: - type: SectorLogisticStats + +- type: sectorService + id: ShuttleRecords + components: + - type: SectorShuttleRecords