1
0

InactivityRuleComponent.cs 793 B

123456789101112131415161718192021222324
  1. using System.Threading;
  2. namespace Content.Server.GameTicking.Rules.Components;
  3. /// <summary>
  4. /// Gamerule that ends the round after a period of inactivity.
  5. /// </summary>
  6. [RegisterComponent, Access(typeof(InactivityTimeRestartRuleSystem))]
  7. public sealed partial class InactivityRuleComponent : Component
  8. {
  9. /// <summary>
  10. /// How long the round must be inactive to restart
  11. /// </summary>
  12. [DataField("inactivityMaxTime", required: true)]
  13. public TimeSpan InactivityMaxTime = TimeSpan.FromMinutes(10);
  14. /// <summary>
  15. /// The delay between announcing round end and the lobby.
  16. /// </summary>
  17. [DataField("roundEndDelay", required: true)]
  18. public TimeSpan RoundEndDelay = TimeSpan.FromSeconds(10);
  19. public CancellationTokenSource TimerCancel = new();
  20. }