CCVars.Game.cs 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  1. using Content.Shared.Roles;
  2. using Robust.Shared.Configuration;
  3. namespace Content.Shared.CCVar;
  4. public sealed partial class CCVars
  5. {
  6. /// <summary>
  7. /// Disables most functionality in the GameTicker.
  8. /// </summary>
  9. public static readonly CVarDef<bool>
  10. GameDummyTicker = CVarDef.Create("game.dummyticker", false, CVar.ARCHIVE | CVar.SERVERONLY);
  11. /// <summary>
  12. /// Controls if the lobby is enabled. If it is not, and there are no available jobs, you may get stuck on a black screen.
  13. /// </summary>
  14. public static readonly CVarDef<bool>
  15. GameLobbyEnabled = CVarDef.Create("game.lobbyenabled", true, CVar.ARCHIVE);
  16. /// <summary>
  17. /// Controls the duration of the lobby timer in seconds. Defaults to 2 minutes and 30 seconds.
  18. /// </summary>
  19. public static readonly CVarDef<int>
  20. GameLobbyDuration = CVarDef.Create("game.lobbyduration", 150, CVar.ARCHIVE);
  21. /// <summary>
  22. /// Controls if players can latejoin at all.
  23. /// </summary>
  24. public static readonly CVarDef<bool>
  25. GameDisallowLateJoins = CVarDef.Create("game.disallowlatejoins", false, CVar.ARCHIVE | CVar.SERVERONLY);
  26. /// <summary>
  27. /// Controls the default game preset.
  28. /// </summary>
  29. public static readonly CVarDef<string>
  30. GameLobbyDefaultPreset = CVarDef.Create("game.defaultpreset", "nomads", CVar.ARCHIVE);
  31. /// <summary>
  32. /// Controls if the game can force a different preset if the current preset's criteria are not met.
  33. /// </summary>
  34. public static readonly CVarDef<bool>
  35. GameLobbyFallbackEnabled = CVarDef.Create("game.fallbackenabled", true, CVar.ARCHIVE);
  36. /// <summary>
  37. /// The preset for the game to fall back to if the selected preset could not be used, and fallback is enabled.
  38. /// </summary>
  39. public static readonly CVarDef<string>
  40. GameLobbyFallbackPreset = CVarDef.Create("game.fallbackpreset", "Nomads", CVar.ARCHIVE);
  41. /// <summary>
  42. /// Controls if people can win the game in Suspicion or Deathmatch.
  43. /// </summary>
  44. public static readonly CVarDef<bool>
  45. GameLobbyEnableWin = CVarDef.Create("game.enablewin", true, CVar.ARCHIVE);
  46. /// <summary>
  47. /// Controls if round-end window shows whether the objective was completed or not.
  48. /// </summary>
  49. public static readonly CVarDef<bool>
  50. GameShowGreentext = CVarDef.Create("game.showgreentext", true, CVar.ARCHIVE | CVar.SERVERONLY);
  51. /// <summary>
  52. /// Controls the maximum number of character slots a player is allowed to have.
  53. /// </summary>
  54. public static readonly CVarDef<int>
  55. GameMaxCharacterSlots = CVarDef.Create("game.maxcharacterslots", 30, CVar.ARCHIVE | CVar.SERVERONLY);
  56. /// <summary>
  57. /// Controls the game map prototype to load. SS14 stores these prototypes in Prototypes/Maps.
  58. /// </summary>
  59. public static readonly CVarDef<string>
  60. GameMap = CVarDef.Create("game.map", string.Empty, CVar.SERVERONLY);
  61. /// <summary>
  62. /// Controls whether to use world persistence or not.
  63. /// </summary>
  64. public static readonly CVarDef<bool>
  65. UsePersistence = CVarDef.Create("game.usepersistence", false, CVar.ARCHIVE);
  66. /// <summary>
  67. /// If world persistence is used, what map prototype should be initially loaded.
  68. /// If the save file exists, it replaces MapPath but everything else stays the same (station name and such).
  69. /// </summary>
  70. public static readonly CVarDef<string>
  71. PersistenceMap = CVarDef.Create("game.persistencemap", "Nomads", CVar.ARCHIVE);
  72. /// <summary>
  73. /// Prototype to use for map pool.
  74. /// </summary>
  75. public static readonly CVarDef<string>
  76. GameMapPool = CVarDef.Create("game.map_pool", "DefaultMapPool", CVar.SERVERONLY);
  77. /// <summary>
  78. /// The depth of the queue used to calculate which map is next in rotation.
  79. /// This is how long the game "remembers" that some map was put in play. Default is 16 rounds.
  80. /// </summary>
  81. public static readonly CVarDef<int>
  82. GameMapMemoryDepth = CVarDef.Create("game.map_memory_depth", 16, CVar.SERVERONLY);
  83. /// <summary>
  84. /// Is map rotation enabled?
  85. /// </summary>
  86. public static readonly CVarDef<bool>
  87. GameMapRotation = CVarDef.Create("game.map_rotation", true, CVar.SERVERONLY);
  88. /// <summary>
  89. /// If roles should be restricted based on time.
  90. /// </summary>
  91. public static readonly CVarDef<bool>
  92. GameRoleTimers = CVarDef.Create("game.role_timers", true, CVar.SERVER | CVar.REPLICATED);
  93. /// <summary>
  94. /// Override default role requirements using a <see cref="JobRequirementOverridePrototype"/>
  95. /// </summary>
  96. public static readonly CVarDef<string>
  97. GameRoleTimerOverride = CVarDef.Create("game.role_timer_override", "", CVar.SERVER | CVar.REPLICATED);
  98. /// <summary>
  99. /// If roles should be restricted based on whether or not they are whitelisted.
  100. /// </summary>
  101. public static readonly CVarDef<bool>
  102. GameRoleWhitelist = CVarDef.Create("game.role_whitelist", true, CVar.SERVER | CVar.REPLICATED);
  103. /// <summary>
  104. /// Whether or not disconnecting inside of a cryopod should remove the character or just store them until they reconnect.
  105. /// </summary>
  106. public static readonly CVarDef<bool>
  107. GameCryoSleepRejoining = CVarDef.Create("game.cryo_sleep_rejoining", false, CVar.SERVER | CVar.REPLICATED);
  108. /// <summary>
  109. /// When enabled, guests will be assigned permanent UIDs and will have their preferences stored.
  110. /// </summary>
  111. public static readonly CVarDef<bool> GamePersistGuests =
  112. CVarDef.Create("game.persistguests", true, CVar.ARCHIVE | CVar.SERVERONLY);
  113. public static readonly CVarDef<bool> GameDiagonalMovement =
  114. CVarDef.Create("game.diagonalmovement", true, CVar.ARCHIVE);
  115. public static readonly CVarDef<int> SoftMaxPlayers =
  116. CVarDef.Create("game.soft_max_players", 30, CVar.SERVERONLY | CVar.ARCHIVE);
  117. /// <summary>
  118. /// If a player gets denied connection to the server,
  119. /// how long they are forced to wait before attempting to reconnect.
  120. /// </summary>
  121. public static readonly CVarDef<int> GameServerFullReconnectDelay =
  122. CVarDef.Create("game.server_full_reconnect_delay", 30, CVar.SERVERONLY);
  123. /// <summary>
  124. /// Whether or not panic bunker is currently enabled.
  125. /// </summary>
  126. public static readonly CVarDef<bool> PanicBunkerEnabled =
  127. CVarDef.Create("game.panic_bunker.enabled", false, CVar.NOTIFY | CVar.REPLICATED | CVar.SERVER);
  128. /// <summary>
  129. /// Whether or not the panic bunker will disable when an admin comes online.
  130. /// </summary>
  131. public static readonly CVarDef<bool> PanicBunkerDisableWithAdmins =
  132. CVarDef.Create("game.panic_bunker.disable_with_admins", false, CVar.SERVERONLY);
  133. /// <summary>
  134. /// Whether or not the panic bunker will enable when no admins are online.
  135. /// This counts everyone with the 'Admin' AdminFlag.
  136. /// </summary>
  137. public static readonly CVarDef<bool> PanicBunkerEnableWithoutAdmins =
  138. CVarDef.Create("game.panic_bunker.enable_without_admins", false, CVar.SERVERONLY);
  139. /// <summary>
  140. /// Whether or not the panic bunker will count deadminned admins for
  141. /// <see cref="PanicBunkerDisableWithAdmins"/> and
  142. /// <see cref="PanicBunkerEnableWithoutAdmins"/>
  143. /// </summary>
  144. public static readonly CVarDef<bool> PanicBunkerCountDeadminnedAdmins =
  145. CVarDef.Create("game.panic_bunker.count_deadminned_admins", false, CVar.SERVERONLY);
  146. /// <summary>
  147. /// Show reason of disconnect for user or not.
  148. /// </summary>
  149. public static readonly CVarDef<bool> PanicBunkerShowReason =
  150. CVarDef.Create("game.panic_bunker.show_reason", false, CVar.SERVERONLY);
  151. /// <summary>
  152. /// Minimum age of the account (from server's PoV, so from first-seen date) in minutes.
  153. /// </summary>
  154. public static readonly CVarDef<int> PanicBunkerMinAccountAge =
  155. CVarDef.Create("game.panic_bunker.min_account_age", 1440, CVar.SERVERONLY);
  156. /// <summary>
  157. /// Minimal overall played time.
  158. /// </summary>
  159. public static readonly CVarDef<int> PanicBunkerMinOverallMinutes =
  160. CVarDef.Create("game.panic_bunker.min_overall_minutes", 600, CVar.SERVERONLY);
  161. /// <summary>
  162. /// A custom message that will be used for connections denied to the panic bunker
  163. /// If not empty, then will overwrite <see cref="PanicBunkerShowReason"/>
  164. /// </summary>
  165. public static readonly CVarDef<string> PanicBunkerCustomReason =
  166. CVarDef.Create("game.panic_bunker.custom_reason", string.Empty, CVar.SERVERONLY);
  167. /// <summary>
  168. /// Allow bypassing the panic bunker if the user is whitelisted.
  169. /// </summary>
  170. public static readonly CVarDef<bool> BypassBunkerWhitelist =
  171. CVarDef.Create("game.panic_bunker.whitelisted_can_bypass", true, CVar.SERVERONLY);
  172. /// <summary>
  173. /// Enable IPIntel for blocking VPN connections from new players.
  174. /// </summary>
  175. public static readonly CVarDef<bool> GameIPIntelEnabled =
  176. CVarDef.Create("game.ipintel_enabled", false, CVar.SERVERONLY);
  177. /// <summary>
  178. /// Whether clients which are flagged as a VPN will be denied
  179. /// </summary>
  180. public static readonly CVarDef<bool> GameIPIntelRejectBad =
  181. CVarDef.Create("game.ipintel_reject_bad", true, CVar.SERVERONLY);
  182. /// <summary>
  183. /// Whether clients which cannot be checked due to a rate limit will be denied
  184. /// </summary>
  185. public static readonly CVarDef<bool> GameIPIntelRejectRateLimited =
  186. CVarDef.Create("game.ipintel_reject_ratelimited", false, CVar.SERVERONLY);
  187. /// <summary>
  188. /// Whether clients which cannot be checked due to an error of some form will be denied
  189. /// </summary>
  190. public static readonly CVarDef<bool> GameIPIntelRejectUnknown =
  191. CVarDef.Create("game.ipintel_reject_unknown", false, CVar.SERVERONLY);
  192. /// <summary>
  193. /// Should an admin message be made if the connection got rejected cause of ipintel?
  194. /// </summary>
  195. public static readonly CVarDef<bool> GameIPIntelAlertAdminReject =
  196. CVarDef.Create("game.ipintel_alert_admin_rejected", false, CVar.SERVERONLY);
  197. /// <summary>
  198. /// A contact email to be sent along with the request. Required by IPIntel
  199. /// </summary>
  200. public static readonly CVarDef<string> GameIPIntelEmail =
  201. CVarDef.Create("game.ipintel_contact_email", string.Empty, CVar.SERVERONLY | CVar.CONFIDENTIAL);
  202. /// <summary>
  203. /// The URL to IPIntel to make requests to. If you pay for more queries this is what you want to change.
  204. /// </summary>
  205. public static readonly CVarDef<string> GameIPIntelBase =
  206. CVarDef.Create("game.ipintel_baseurl", "https://check.getipintel.net", CVar.SERVERONLY);
  207. /// <summary>
  208. /// The flags to use in the request to IPIntel, please look here for more info. https://getipintel.net/free-proxy-vpn-tor-detection-api/#optional_settings
  209. /// Note: Some flags may increase the chances of false positives and request time. The default should be fine for most servers.
  210. /// </summary>
  211. public static readonly CVarDef<string> GameIPIntelFlags =
  212. CVarDef.Create("game.ipintel_flags", "b", CVar.SERVERONLY);
  213. /// <summary>
  214. /// Maximum amount of requests per Minute. For free you get 15.
  215. /// </summary>
  216. public static readonly CVarDef<int> GameIPIntelMaxMinute =
  217. CVarDef.Create("game.ipintel_request_limit_minute", 15, CVar.SERVERONLY);
  218. /// <summary>
  219. /// Maximum amount of requests per Day. For free you get 500.
  220. /// </summary>
  221. public static readonly CVarDef<int> GameIPIntelMaxDay =
  222. CVarDef.Create("game.ipintel_request_limit_daily", 500, CVar.SERVERONLY);
  223. /// <summary>
  224. /// Amount of seconds to add to the exponential backoff with every failed request.
  225. /// </summary>
  226. public static readonly CVarDef<int> GameIPIntelBackOffSeconds =
  227. CVarDef.Create("game.ipintel_request_backoff_seconds", 30, CVar.SERVERONLY);
  228. /// <summary>
  229. /// How much time should pass before we attempt to cleanup the IPIntel table for old ip addresses?
  230. /// </summary>
  231. public static readonly CVarDef<int> GameIPIntelCleanupMins =
  232. CVarDef.Create("game.ipintel_database_cleanup_mins", 15, CVar.SERVERONLY);
  233. /// <summary>
  234. /// How long to store results in the cache before they must be retrieved again in days.
  235. /// </summary>
  236. public static readonly CVarDef<TimeSpan> GameIPIntelCacheLength =
  237. CVarDef.Create("game.ipintel_cache_length", TimeSpan.FromDays(7), CVar.SERVERONLY);
  238. /// <summary>
  239. /// Amount of playtime in minutes to be exempt from an IP check. 0 to search everyone. 5 hours by default.
  240. /// <remarks>
  241. /// Trust me you want one.
  242. /// </remarks>>
  243. /// </summary>
  244. public static readonly CVarDef<TimeSpan> GameIPIntelExemptPlaytime =
  245. CVarDef.Create("game.ipintel_exempt_playtime", TimeSpan.FromMinutes(300), CVar.SERVERONLY);
  246. /// <summary>
  247. /// Rating to reject at. Anything equal to or higher than this will reject the connection.
  248. /// </summary>
  249. public static readonly CVarDef<float> GameIPIntelBadRating =
  250. CVarDef.Create("game.ipintel_bad_rating", 0.95f, CVar.SERVERONLY);
  251. /// <summary>
  252. /// Rating to send an admin warning over, but not reject the connection. Set to 0 to disable
  253. /// </summary>
  254. public static readonly CVarDef<float> GameIPIntelAlertAdminWarnRating =
  255. CVarDef.Create("game.ipintel_alert_admin_warn_rating", 0f, CVar.SERVERONLY);
  256. /// <summary>
  257. /// Make people bonk when trying to climb certain objects like tables.
  258. /// </summary>
  259. public static readonly CVarDef<bool> GameTableBonk =
  260. CVarDef.Create("game.table_bonk", false, CVar.REPLICATED);
  261. /// <summary>
  262. /// Whether or not status icons are rendered for everyone.
  263. /// </summary>
  264. public static readonly CVarDef<bool> GlobalStatusIconsEnabled =
  265. CVarDef.Create("game.global_status_icons_enabled", true, CVar.SERVER | CVar.REPLICATED);
  266. /// <summary>
  267. /// Whether or not status icons are rendered on this specific client.
  268. /// </summary>
  269. public static readonly CVarDef<bool> LocalStatusIconsEnabled =
  270. CVarDef.Create("game.local_status_icons_enabled", true, CVar.CLIENTONLY);
  271. /// <summary>
  272. /// Whether or not coordinates on the Debug overlay should only be available to admins.
  273. /// </summary>
  274. public static readonly CVarDef<bool> DebugCoordinatesAdminOnly =
  275. CVarDef.Create("game.debug_coordinates_admin_only", true, CVar.SERVER | CVar.REPLICATED);
  276. #if EXCEPTION_TOLERANCE
  277. /// <summary>
  278. /// Amount of times round start must fail before the server is shut down.
  279. /// Set to 0 or a negative number to disable.
  280. /// </summary>
  281. public static readonly CVarDef<int> RoundStartFailShutdownCount =
  282. CVarDef.Create("game.round_start_fail_shutdown_count", 5, CVar.SERVERONLY | CVar.SERVER);
  283. #endif
  284. /// <summary>
  285. /// Delay between station alert level changes.
  286. /// </summary>
  287. public static readonly CVarDef<int> GameAlertLevelChangeDelay =
  288. CVarDef.Create("game.alert_level_change_delay", 30, CVar.SERVERONLY);
  289. /// <summary>
  290. /// The time in seconds that the server should wait before restarting the round.
  291. /// Defaults to 2 minutes.
  292. /// </summary>
  293. public static readonly CVarDef<float> RoundRestartTime =
  294. CVarDef.Create("game.round_restart_time", 120f, CVar.SERVERONLY);
  295. /// <summary>
  296. /// The prototype to use for secret weights.
  297. /// </summary>
  298. public static readonly CVarDef<string> SecretWeightPrototype =
  299. CVarDef.Create("game.secret_weight_prototype", "Secret", CVar.SERVERONLY);
  300. /// <summary>
  301. /// The id of the sound collection to randomly choose a sound from and play when the round ends.
  302. /// </summary>
  303. public static readonly CVarDef<string> RoundEndSoundCollection =
  304. CVarDef.Create("game.round_end_sound_collection", "RoundEnd", CVar.SERVERONLY);
  305. /// <summary>
  306. /// Whether or not to add every player as a global override to PVS at round end.
  307. /// This will allow all players to see their clothing in the round screen player list screen,
  308. /// but may cause lag during round end with very high player counts.
  309. /// </summary>
  310. public static readonly CVarDef<bool> RoundEndPVSOverrides =
  311. CVarDef.Create("game.round_end_pvs_overrides", true, CVar.SERVERONLY);
  312. /// <summary>
  313. /// If true, players can place objects onto tabletop games like chess boards.
  314. /// </summary>
  315. /// <remarks>
  316. /// This feature is currently highly abusable and can easily be used to crash the server,
  317. /// so it's off by default.
  318. /// </remarks>
  319. public static readonly CVarDef<bool> GameTabletopPlace =
  320. CVarDef.Create("game.tabletop_place", false, CVar.SERVERONLY);
  321. /// <summary>
  322. /// If true, contraband severity can be viewed in the examine menu
  323. /// </summary>
  324. public static readonly CVarDef<bool> ContrabandExamine =
  325. CVarDef.Create("game.contraband_examine", true, CVar.SERVER | CVar.REPLICATED);
  326. /// <summary>
  327. /// Size of the lookup area for adding entities to the context menu
  328. /// </summary>
  329. public static readonly CVarDef<float> GameEntityMenuLookup =
  330. CVarDef.Create("game.entity_menu_lookup", 0.25f, CVar.CLIENTONLY | CVar.ARCHIVE);
  331. /// <summary>
  332. /// Should the clients window show the server hostname in the title?
  333. /// </summary>
  334. public static readonly CVarDef<bool> GameHostnameInTitlebar =
  335. CVarDef.Create("game.hostname_in_titlebar", true, CVar.SERVER | CVar.REPLICATED);
  336. }