Files
tbd-station-14/Content.Server/GameTicking/Rules/Components/RespawnTrackerComponent.cs
2023-08-30 18:06:15 -07:00

31 lines
955 B
C#

using Robust.Shared.Network;
namespace Content.Server.GameTicking.Rules.Components;
/// <summary>
/// This is used for globally tracking players that need to be respawned.
/// Used on gamerule entities.
/// </summary>
[RegisterComponent, Access(typeof(RespawnRuleSystem))]
public sealed partial class RespawnTrackerComponent : Component
{
/// <summary>
/// A list of the people that should be respawned.
/// Used to make sure that we don't respawn aghosts or observers.
/// </summary>
[DataField("players")]
public HashSet<NetUserId> Players = new();
/// <summary>
/// The delay between dying and respawning.
/// </summary>
[DataField("respawnDelay")]
public TimeSpan RespawnDelay = TimeSpan.Zero;
/// <summary>
/// A dictionary of player netuserids and when they will respawn.
/// </summary>
[DataField("respawnQueue")]
public Dictionary<NetUserId, TimeSpan> RespawnQueue = new();
}