1
0

SurveillanceCameraComponent.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using Content.Shared.DeviceNetwork;
  2. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
  3. namespace Content.Server.SurveillanceCamera;
  4. [RegisterComponent]
  5. [Access(typeof(SurveillanceCameraSystem))]
  6. public sealed partial class SurveillanceCameraComponent : Component
  7. {
  8. // List of active viewers. This is for bookkeeping purposes,
  9. // so that when a camera shuts down, any entity viewing it
  10. // will immediately have their subscription revoked.
  11. [ViewVariables]
  12. public HashSet<EntityUid> ActiveViewers { get; } = new();
  13. // Monitors != Viewers, as viewers are entities that are tied
  14. // to a player session that's viewing from this camera
  15. //
  16. // Monitors are grouped sets of viewers, and may be
  17. // completely different monitor types (e.g., monitor console,
  18. // AI, etc.)
  19. [ViewVariables]
  20. public HashSet<EntityUid> ActiveMonitors { get; } = new();
  21. // If this camera is active or not. Deactivating a camera
  22. // will not allow it to obtain any new viewers.
  23. [ViewVariables]
  24. public bool Active { get; set; } = true;
  25. // This one isn't easy to deal with. Will require a UI
  26. // to change/set this so mapping these in isn't
  27. // the most terrible thing possible.
  28. [ViewVariables(VVAccess.ReadWrite)]
  29. [DataField("id")]
  30. public string CameraId { get; set; } = "camera";
  31. [ViewVariables(VVAccess.ReadWrite)]
  32. [DataField("nameSet")]
  33. public bool NameSet { get; set; }
  34. [ViewVariables(VVAccess.ReadWrite)]
  35. [DataField("networkSet")]
  36. public bool NetworkSet { get; set; }
  37. // This has to be device network frequency prototypes.
  38. [DataField("setupAvailableNetworks", customTypeSerializer:typeof(PrototypeIdListSerializer<DeviceFrequencyPrototype>))]
  39. public List<string> AvailableNetworks { get; private set; } = new();
  40. }