1
0

CCVars.Chat.cs 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using Robust.Shared.Configuration;
  2. namespace Content.Shared.CCVar;
  3. public sealed partial class CCVars
  4. {
  5. /// <summary>
  6. /// Chat rate limit values are accounted in periods of this size (seconds).
  7. /// After the period has passed, the count resets.
  8. /// </summary>
  9. /// <seealso cref="ChatRateLimitCount"/>
  10. public static readonly CVarDef<float> ChatRateLimitPeriod =
  11. CVarDef.Create("chat.rate_limit_period", 2f, CVar.SERVERONLY);
  12. /// <summary>
  13. /// How many chat messages are allowed in a single rate limit period.
  14. /// </summary>
  15. /// <remarks>
  16. /// The total rate limit throughput per second is effectively
  17. /// <see cref="ChatRateLimitCount"/> divided by <see cref="ChatRateLimitCount"/>.
  18. /// </remarks>
  19. /// <seealso cref="ChatRateLimitPeriod"/>
  20. public static readonly CVarDef<int> ChatRateLimitCount =
  21. CVarDef.Create("chat.rate_limit_count", 10, CVar.SERVERONLY);
  22. /// <summary>
  23. /// Minimum delay (in seconds) between notifying admins about chat message rate limit violations.
  24. /// A negative value disables admin announcements.
  25. /// </summary>
  26. public static readonly CVarDef<int> ChatRateLimitAnnounceAdminsDelay =
  27. CVarDef.Create("chat.rate_limit_announce_admins_delay", 15, CVar.SERVERONLY);
  28. public static readonly CVarDef<int> ChatMaxMessageLength =
  29. CVarDef.Create("chat.max_message_length", 1000, CVar.SERVER | CVar.REPLICATED);
  30. public static readonly CVarDef<int> ChatMaxAnnouncementLength =
  31. CVarDef.Create("chat.max_announcement_length", 256, CVar.SERVER | CVar.REPLICATED);
  32. public static readonly CVarDef<bool> ChatSanitizerEnabled =
  33. CVarDef.Create("chat.chat_sanitizer_enabled", true, CVar.SERVERONLY);
  34. public static readonly CVarDef<bool> ChatShowTypingIndicator =
  35. CVarDef.Create("chat.show_typing_indicator", true, CVar.ARCHIVE | CVar.REPLICATED | CVar.SERVER);
  36. public static readonly CVarDef<bool> ChatEnableFancyBubbles =
  37. CVarDef.Create("chat.enable_fancy_bubbles",
  38. true,
  39. CVar.CLIENTONLY | CVar.ARCHIVE,
  40. "Toggles displaying fancy speech bubbles, which display the speaking character's name.");
  41. public static readonly CVarDef<bool> ChatFancyNameBackground =
  42. CVarDef.Create("chat.fancy_name_background",
  43. false,
  44. CVar.CLIENTONLY | CVar.ARCHIVE,
  45. "Toggles displaying a background under the speaking character's name.");
  46. /// <summary>
  47. /// A message broadcast to each player that joins the lobby.
  48. /// May be changed by admins ingame through use of the "set-motd" command.
  49. /// In this case the new value, if not empty, is broadcast to all connected players and saved between rounds.
  50. /// May be requested by any player through use of the "get-motd" command.
  51. /// </summary>
  52. public static readonly CVarDef<string> MOTD =
  53. CVarDef.Create("chat.motd",
  54. "",
  55. CVar.SERVER | CVar.SERVERONLY | CVar.ARCHIVE,
  56. "A message broadcast to each player that joins the lobby.");
  57. }