1
0

MaxTimeRestartRuleComponent.cs 763 B

123456789101112131415161718192021222324
  1. using System.Threading;
  2. namespace Content.Server.GameTicking.Rules.Components;
  3. /// <summary>
  4. /// Configures the <see cref="InactivityTimeRestartRuleSystem"/> game rule.
  5. /// </summary>
  6. [RegisterComponent]
  7. public sealed partial class MaxTimeRestartRuleComponent : Component
  8. {
  9. /// <summary>
  10. /// The max amount of time the round can last
  11. /// </summary>
  12. [DataField("roundMaxTime", required: true)]
  13. public TimeSpan RoundMaxTime = TimeSpan.FromMinutes(5);
  14. /// <summary>
  15. /// The amount of time between the round completing and the lobby appearing.
  16. /// </summary>
  17. [DataField("roundEndDelay", required: true)]
  18. public TimeSpan RoundEndDelay = TimeSpan.FromSeconds(10);
  19. public CancellationTokenSource TimerCancel = new();
  20. }