1
0

RespawnTrackerComponent.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using Robust.Shared.Network;
  2. namespace Content.Server.GameTicking.Rules.Components;
  3. /// <summary>
  4. /// This is used for globally tracking players that need to be respawned.
  5. /// Used on gamerule entities.
  6. /// </summary>
  7. [RegisterComponent, Access(typeof(RespawnRuleSystem))]
  8. public sealed partial class RespawnTrackerComponent : Component
  9. {
  10. /// <summary>
  11. /// A list of the people that should be respawned.
  12. /// Used to make sure that we don't respawn aghosts or observers.
  13. /// </summary>
  14. [DataField]
  15. public HashSet<NetUserId> Players = new();
  16. /// <summary>
  17. /// The delay between dying and respawning.
  18. /// </summary>
  19. [DataField]
  20. public TimeSpan RespawnDelay = TimeSpan.Zero;
  21. /// <summary>
  22. /// A dictionary of player netuserids and when they will respawn.
  23. /// </summary>
  24. [DataField]
  25. public Dictionary<NetUserId, TimeSpan> RespawnQueue = new();
  26. /// <summary>
  27. /// Whether or not to delete the original body when respawning
  28. /// </summary>
  29. [DataField]
  30. public bool DeleteBody = true;
  31. /// <summary>
  32. /// Is the spawn timer running at a set time for everyone, or X amount of time since death?
  33. /// </summary>
  34. [DataField]
  35. public bool Fixed = false;
  36. /// <summary>
  37. /// Only used if fixed is true
  38. /// </summary>
  39. [DataField]
  40. public TimeSpan GlobalTimer = TimeSpan.Zero;
  41. }