CCVars.Admin.cs 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. using Robust.Shared.Configuration;
  2. namespace Content.Shared.CCVar;
  3. public sealed partial class CCVars
  4. {
  5. public static readonly CVarDef<bool> AdminAnnounceLogin =
  6. CVarDef.Create("admin.announce_login", true, CVar.SERVERONLY);
  7. public static readonly CVarDef<bool> AdminAnnounceLogout =
  8. CVarDef.Create("admin.announce_logout", true, CVar.SERVERONLY);
  9. /// <summary>
  10. /// The token used to authenticate with the admin API. Leave empty to disable the admin API. This is a secret! Do not share!
  11. /// </summary>
  12. public static readonly CVarDef<string> AdminApiToken =
  13. CVarDef.Create("admin.api_token", string.Empty, CVar.SERVERONLY | CVar.CONFIDENTIAL);
  14. /// <summary>
  15. /// Should users be able to see their own notes? Admins will be able to see and set notes regardless
  16. /// </summary>
  17. public static readonly CVarDef<bool> SeeOwnNotes =
  18. CVarDef.Create("admin.see_own_notes", false, CVar.ARCHIVE | CVar.REPLICATED | CVar.SERVER);
  19. /// <summary>
  20. /// Should the server play a quick sound to the active admins whenever a new player joins?
  21. /// </summary>
  22. public static readonly CVarDef<bool> AdminNewPlayerJoinSound =
  23. CVarDef.Create("admin.new_player_join_sound", false, CVar.SERVERONLY);
  24. /// <summary>
  25. /// The amount of days before the note starts fading. It will slowly lose opacity until it reaches stale. Set to 0 to disable.
  26. /// </summary>
  27. public static readonly CVarDef<double> NoteFreshDays =
  28. CVarDef.Create("admin.note_fresh_days", 91.31055, CVar.ARCHIVE | CVar.REPLICATED | CVar.SERVER);
  29. /// <summary>
  30. /// The amount of days before the note completely fades, and can only be seen by admins if they press "see more notes". Set to 0
  31. /// if you want the note to immediately disappear without fading.
  32. /// </summary>
  33. public static readonly CVarDef<double> NoteStaleDays =
  34. CVarDef.Create("admin.note_stale_days", 365.2422, CVar.ARCHIVE | CVar.REPLICATED | CVar.SERVER);
  35. /// <summary>
  36. /// How much time does the user have to wait in seconds before confirming that they saw an admin message?
  37. /// </summary>
  38. public static readonly CVarDef<float> MessageWaitTime =
  39. CVarDef.Create("admin.message_wait_time", 3f, CVar.ARCHIVE | CVar.REPLICATED | CVar.SERVER);
  40. /// <summary>
  41. /// Default severity for role bans
  42. /// </summary>
  43. public static readonly CVarDef<string> RoleBanDefaultSeverity =
  44. CVarDef.Create("admin.role_ban_default_severity", "medium", CVar.ARCHIVE | CVar.SERVER | CVar.REPLICATED);
  45. /// <summary>
  46. /// Default severity for department bans
  47. /// </summary>
  48. public static readonly CVarDef<string> DepartmentBanDefaultSeverity =
  49. CVarDef.Create("admin.department_ban_default_severity", "medium", CVar.ARCHIVE | CVar.SERVER | CVar.REPLICATED);
  50. /// <summary>
  51. /// Default severity for server bans
  52. /// </summary>
  53. public static readonly CVarDef<string> ServerBanDefaultSeverity =
  54. CVarDef.Create("admin.server_ban_default_severity", "High", CVar.ARCHIVE | CVar.SERVER | CVar.REPLICATED);
  55. /// <summary>
  56. /// Whether a server ban will ban the player's ip by default.
  57. /// </summary>
  58. public static readonly CVarDef<bool> ServerBanIpBanDefault =
  59. CVarDef.Create("admin.server_ban_ip_ban_default", true, CVar.ARCHIVE | CVar.SERVER | CVar.REPLICATED);
  60. /// <summary>
  61. /// Whether a server ban will ban the player's hardware id by default.
  62. /// </summary>
  63. public static readonly CVarDef<bool> ServerBanHwidBanDefault =
  64. CVarDef.Create("admin.server_ban_hwid_ban_default", true, CVar.ARCHIVE | CVar.SERVER | CVar.REPLICATED);
  65. /// <summary>
  66. /// Whether to use details from last connection for ip/hwid in the BanPanel.
  67. /// </summary>
  68. public static readonly CVarDef<bool> ServerBanUseLastDetails =
  69. CVarDef.Create("admin.server_ban_use_last_details", true, CVar.ARCHIVE | CVar.SERVER | CVar.REPLICATED);
  70. /// <summary>
  71. /// Whether to erase a player's chat messages and their entity from the game when banned.
  72. /// </summary>
  73. public static readonly CVarDef<bool> ServerBanErasePlayer =
  74. CVarDef.Create("admin.server_ban_erase_player", false, CVar.ARCHIVE | CVar.SERVER | CVar.REPLICATED);
  75. /// <summary>
  76. /// If true, will reset the last time the player has read the rules. This will mean on their next login they will be shown the rules again.
  77. /// </summary>
  78. public static readonly CVarDef<bool> ServerBanResetLastReadRules =
  79. CVarDef.Create("admin.server_ban_reset_last_read_rules", true, CVar.ARCHIVE | CVar.SERVER);
  80. /// <summary>
  81. /// Minimum players sharing a connection required to create an alert. -1 to disable the alert.
  82. /// </summary>
  83. /// <remarks>
  84. /// If you set this to 0 or 1 then it will alert on every connection, so probably don't do that.
  85. /// </remarks>
  86. public static readonly CVarDef<int> AdminAlertMinPlayersSharingConnection =
  87. CVarDef.Create("admin.alert.min_players_sharing_connection", -1, CVar.SERVERONLY);
  88. /// <summary>
  89. /// Minimum explosion intensity to create an admin alert message. -1 to disable the alert.
  90. /// </summary>
  91. public static readonly CVarDef<int> AdminAlertExplosionMinIntensity =
  92. CVarDef.Create("admin.alert.explosion_min_intensity", 60, CVar.SERVERONLY);
  93. /// <summary>
  94. /// Minimum particle accelerator strength to create an admin alert message.
  95. /// </summary>
  96. public static readonly CVarDef<int> AdminAlertParticleAcceleratorMinPowerState =
  97. CVarDef.Create("admin.alert.particle_accelerator_min_power_state", 5, CVar.SERVERONLY); // strength 4
  98. /// <summary>
  99. /// Should the ban details in admin channel include PII? (IP, HWID, etc)
  100. /// </summary>
  101. public static readonly CVarDef<bool> AdminShowPIIOnBan =
  102. CVarDef.Create("admin.show_pii_onban", false, CVar.SERVERONLY);
  103. /// <summary>
  104. /// If an admin joins a round by reading up or using the late join button, automatically
  105. /// de-admin them.
  106. /// </summary>
  107. public static readonly CVarDef<bool> AdminDeadminOnJoin =
  108. CVarDef.Create("admin.deadmin_on_join", false, CVar.SERVERONLY);
  109. /// <summary>
  110. /// Overrides the name the client sees in ahelps. Set empty to disable.
  111. /// </summary>
  112. public static readonly CVarDef<string> AdminAhelpOverrideClientName =
  113. CVarDef.Create("admin.override_adminname_in_client_ahelp", string.Empty, CVar.SERVERONLY);
  114. /// <summary>
  115. /// The threshold of minutes to appear as a "new player" in the ahelp menu
  116. /// If 0, appearing as a new player is disabled.
  117. /// </summary>
  118. public static readonly CVarDef<int> NewPlayerThreshold =
  119. CVarDef.Create("admin.new_player_threshold", 0, CVar.ARCHIVE | CVar.REPLICATED | CVar.SERVER);
  120. /// <summary>
  121. /// How long an admin client can go without any input before being considered AFK.
  122. /// </summary>
  123. public static readonly CVarDef<float> AdminAfkTime =
  124. CVarDef.Create("admin.afk_time", 600f, CVar.SERVERONLY);
  125. /// <summary>
  126. /// If true, admins are able to connect even if
  127. /// <see cref="SoftMaxPlayers"/> would otherwise block regular players.
  128. /// </summary>
  129. public static readonly CVarDef<bool> AdminBypassMaxPlayers =
  130. CVarDef.Create("admin.bypass_max_players", true, CVar.SERVERONLY);
  131. /// <summary>
  132. /// Determines whether admins count towards the total playercount when determining whether the server is over <see cref="SoftMaxPlayers"/>
  133. /// Ideally this should be used in conjuction with <see cref="AdminBypassPlayers"/>.
  134. /// This also applies to playercount limits in whitelist conditions
  135. /// If false, then admins will not be considered when checking whether the playercount is already above the soft player cap
  136. /// </summary>
  137. public static readonly CVarDef<bool> AdminsCountForMaxPlayers =
  138. CVarDef.Create("admin.admins_count_for_max_players", false, CVar.SERVERONLY);
  139. /// <summary>
  140. /// Should admins be hidden from the player count reported to the launcher/via api?
  141. /// This is hub advert safe, in case that's a worry.
  142. /// </summary>
  143. public static readonly CVarDef<bool> AdminsCountInReportedPlayerCount =
  144. CVarDef.Create("admin.admins_count_in_playercount", false, CVar.SERVERONLY);
  145. /// <summary>
  146. /// Determine if custom rank names are used.
  147. /// If it is false, it'd use the actual rank name regardless of the individual's title.
  148. /// </summary>
  149. /// <seealso cref="AhelpAdminPrefix"/>
  150. /// <seealso cref="AhelpAdminPrefixWebhook"/>
  151. public static readonly CVarDef<bool> AdminUseCustomNamesAdminRank =
  152. CVarDef.Create("admin.use_custom_names_admin_rank", true, CVar.SERVERONLY);
  153. public static readonly CVarDef<bool> BanHardwareIds =
  154. CVarDef.Create("ban.hardware_ids", true, CVar.SERVERONLY);
  155. /// <summary>
  156. /// Determines if we'll reject connections from clients who don't have a modern hwid.
  157. /// </summary>
  158. public static readonly CVarDef<bool> RequireModernHardwareId =
  159. CVarDef.Create("admin.require_modern_hwid", true, CVar.SERVERONLY);
  160. /// <summary>
  161. /// If true, players are allowed to connect to multiple game servers at once.
  162. /// If false, they will be kicked from the first when connecting to another.
  163. /// </summary>
  164. public static readonly CVarDef<bool> AdminAllowMultiServerPlay =
  165. CVarDef.Create("admin.allow_multi_server_play", true, CVar.SERVERONLY);
  166. }