CCVars.Interactions.cs 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. using Robust.Shared.Configuration;
  2. namespace Content.Shared.CCVar;
  3. public sealed partial class CCVars
  4. {
  5. /// <summary>
  6. /// Deadzone for drag-drop interactions.
  7. /// </summary>
  8. public static readonly CVarDef<float> DragDropDeadZone =
  9. CVarDef.Create("control.drag_dead_zone", 12f, CVar.CLIENTONLY | CVar.ARCHIVE);
  10. /// <summary>
  11. /// Toggles whether the walking key is a toggle or a held key.
  12. /// </summary>
  13. public static readonly CVarDef<bool> ToggleWalk =
  14. CVarDef.Create("control.toggle_walk", false, CVar.CLIENTONLY | CVar.ARCHIVE);
  15. // The rationale behind the default limit is simply that I can easily get to 7 interactions per second by just
  16. // trying to spam toggle a light switch or lever (though the UseDelay component limits the actual effect of the
  17. // interaction). I don't want to accidentally spam admins with alerts just because somebody is spamming a
  18. // key manually, nor do we want to alert them just because the player is having network issues and the server
  19. // receives multiple interactions at once. But we also want to try catch people with modified clients that spam
  20. // many interactions on the same tick. Hence, a very short period, with a relatively high count.
  21. /// <summary>
  22. /// Maximum number of interactions that a player can perform within <see cref="InteractionRateLimitCount"/> seconds
  23. /// </summary>
  24. public static readonly CVarDef<int> InteractionRateLimitCount =
  25. CVarDef.Create("interaction.rate_limit_count", 5, CVar.SERVER | CVar.REPLICATED);
  26. /// <seealso cref="InteractionRateLimitCount"/>
  27. public static readonly CVarDef<float> InteractionRateLimitPeriod =
  28. CVarDef.Create("interaction.rate_limit_period", 0.5f, CVar.SERVER | CVar.REPLICATED);
  29. /// <summary>
  30. /// Minimum delay (in seconds) between notifying admins about interaction rate limit violations. A negative
  31. /// value disables admin announcements.
  32. /// </summary>
  33. public static readonly CVarDef<int> InteractionRateLimitAnnounceAdminsDelay =
  34. CVarDef.Create("interaction.rate_limit_announce_admins_delay", 120, CVar.SERVERONLY);
  35. /// <summary>
  36. /// Whether or not the storage UI is static and bound to the hotbar, or unbound and allowed to be dragged anywhere.
  37. /// </summary>
  38. public static readonly CVarDef<bool> StaticStorageUI =
  39. CVarDef.Create("control.static_storage_ui", true, CVar.CLIENTONLY | CVar.ARCHIVE);
  40. /// <summary>
  41. /// Whether or not the storage window uses a transparent or opaque sprite.
  42. /// </summary>
  43. public static readonly CVarDef<bool> OpaqueStorageWindow =
  44. CVarDef.Create("control.opaque_storage_background", false, CVar.CLIENTONLY | CVar.ARCHIVE);
  45. /// <summary>
  46. /// Whether or not the storage window has a title of the entity name.
  47. /// </summary>
  48. public static readonly CVarDef<bool> StorageWindowTitle =
  49. CVarDef.Create("control.storage_window_title", false, CVar.CLIENTONLY | CVar.ARCHIVE);
  50. /// <summary>
  51. /// How many storage windows are allowed to be open at once.
  52. /// Recommended that you utilise this in conjunction with <see cref="StaticStorageUI"/>
  53. /// </summary>
  54. public static readonly CVarDef<int> StorageLimit =
  55. CVarDef.Create("control.storage_limit", 1, CVar.REPLICATED | CVar.SERVER);
  56. /// <summary>
  57. /// Whether or not storage can be opened recursively.
  58. /// </summary>
  59. public static readonly CVarDef<bool> NestedStorage =
  60. CVarDef.Create("control.nested_storage", true, CVar.REPLICATED | CVar.SERVER);
  61. }