Crew monitor revisit (#22240)

This commit is contained in:
chromiumboy
2023-12-09 23:38:50 -06:00
committed by GitHub
parent ffb9112dc5
commit b70c0845d0
28 changed files with 1871 additions and 1302 deletions

View File

@@ -1,76 +1,75 @@
using Content.Shared.Medical.SuitSensor;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Server.Medical.SuitSensors
namespace Content.Server.Medical.SuitSensors;
/// <summary>
/// Tracking device, embedded in almost all uniforms and jumpsuits.
/// If enabled, will report to crew monitoring console owners position and status.
/// </summary>
[RegisterComponent]
[Access(typeof(SuitSensorSystem))]
public sealed partial class SuitSensorComponent : Component
{
/// <summary>
/// Tracking device, embedded in almost all uniforms and jumpsuits.
/// If enabled, will report to crew monitoring console owners position and status.
/// Choose a random sensor mode when item is spawned.
/// </summary>
[RegisterComponent]
[Access(typeof(SuitSensorSystem))]
public sealed partial class SuitSensorComponent : Component
{
/// <summary>
/// Choose a random sensor mode when item is spawned.
/// </summary>
[DataField("randomMode")]
public bool RandomMode = true;
[DataField("randomMode")]
public bool RandomMode = true;
/// <summary>
/// If true user can't change suit sensor mode
/// </summary>
[DataField("controlsLocked")]
public bool ControlsLocked = false;
/// <summary>
/// If true user can't change suit sensor mode
/// </summary>
[DataField("controlsLocked")]
public bool ControlsLocked = false;
/// <summary>
/// Current sensor mode. Can be switched by user verbs.
/// </summary>
[DataField("mode")]
public SuitSensorMode Mode = SuitSensorMode.SensorOff;
/// <summary>
/// Current sensor mode. Can be switched by user verbs.
/// </summary>
[DataField("mode")]
public SuitSensorMode Mode = SuitSensorMode.SensorOff;
/// <summary>
/// Activate sensor if user wear it in this slot.
/// </summary>
[DataField("activationSlot")]
public string ActivationSlot = "jumpsuit";
/// <summary>
/// Activate sensor if user wear it in this slot.
/// </summary>
[DataField("activationSlot")]
public string ActivationSlot = "jumpsuit";
/// <summary>
/// Activate sensor if user has this in a sensor-compatible container.
/// </summary>
[DataField("activationContainer")]
public string? ActivationContainer;
/// <summary>
/// Activate sensor if user has this in a sensor-compatible container.
/// </summary>
[DataField("activationContainer")]
public string? ActivationContainer;
/// <summary>
/// How often does sensor update its owners status (in seconds). Limited by the system update rate.
/// </summary>
[DataField("updateRate")]
public TimeSpan UpdateRate = TimeSpan.FromSeconds(2f);
/// <summary>
/// How often does sensor update its owners status (in seconds). Limited by the system update rate.
/// </summary>
[DataField("updateRate")]
public TimeSpan UpdateRate = TimeSpan.FromSeconds(2f);
/// <summary>
/// Current user that wears suit sensor. Null if nobody wearing it.
/// </summary>
[ViewVariables]
public EntityUid? User = null;
/// <summary>
/// Current user that wears suit sensor. Null if nobody wearing it.
/// </summary>
[ViewVariables]
public EntityUid? User = null;
/// <summary>
/// Next time when sensor updated owners status
/// </summary>
[DataField("nextUpdate", customTypeSerializer:typeof(TimeOffsetSerializer))]
public TimeSpan NextUpdate = TimeSpan.Zero;
/// <summary>
/// Next time when sensor updated owners status
/// </summary>
[DataField("nextUpdate", customTypeSerializer:typeof(TimeOffsetSerializer))]
public TimeSpan NextUpdate = TimeSpan.Zero;
/// <summary>
/// The station this suit sensor belongs to. If it's null the suit didn't spawn on a station and the sensor doesn't work.
/// </summary>
[DataField("station")]
public EntityUid? StationId = null;
/// <summary>
/// The station this suit sensor belongs to. If it's null the suit didn't spawn on a station and the sensor doesn't work.
/// </summary>
[DataField("station")]
public EntityUid? StationId = null;
/// <summary>
/// The server the suit sensor sends it state to.
/// The suit sensor will try connecting to a new server when no server is connected.
/// It does this by calling the servers entity system for performance reasons.
/// </summary>
[DataField("server")]
public string? ConnectedServer = null;
}
/// <summary>
/// The server the suit sensor sends it state to.
/// The suit sensor will try connecting to a new server when no server is connected.
/// It does this by calling the servers entity system for performance reasons.
/// </summary>
[DataField("server")]
public string? ConnectedServer = null;
}