using System;
using System.Threading;
using Lidgren.Network;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Configuration;
using Robust.Shared.ContentPack;
using Robust.Shared.GameObjects;
using Robust.Shared.Log;
using Robust.Shared.Maths;
using Robust.Shared.Network;
using Robust.Shared.Physics;
namespace Robust.Shared
{
///
[CVarDefs]
public abstract class CVars
{
protected CVars()
{
throw new InvalidOperationException("This class must not be instantiated");
}
/*
* NET
*/
///
/// Hard max-cap of concurrent connections for the main game networking.
///
///
/// This cannot be bypassed in any way, since it is used by Lidgren internally.
///
public static readonly CVarDef NetMaxConnections =
CVarDef.Create("net.max_connections", 256, CVar.ARCHIVE | CVar.REPLICATED | CVar.SERVER);
///
/// UDP port to bind to for main game networking.
/// Each address specified in net.bindto is bound with this port.
///
public static readonly CVarDef NetPort =
CVarDef.Create("net.port", 1212, CVar.ARCHIVE);
///
/// Send buffer size on the UDP sockets used for main game networking.
///
public static readonly CVarDef NetSendBufferSize =
CVarDef.Create("net.sendbuffersize", 131071, CVar.ARCHIVE);
///
/// Receive buffer size on the UDP sockets used for main game networking.
///
public static readonly CVarDef NetReceiveBufferSize =
CVarDef.Create("net.receivebuffersize", 131071, CVar.ARCHIVE);
///
/// Size of the pool for Lidgren's array buffers to send messages.
/// Set to 0 to disable pooling; max is 8192.
///
///
/// Higher just means more potentially wasted space and slower pool retrieval.
///
public static readonly CVarDef NetPoolSize =
CVarDef.Create("net.pool_size", 512, CVar.CLIENT | CVar.SERVER);
///
/// Maximum UDP payload size to send by default, for IPv4.
///
///
///
public static readonly CVarDef NetMtu =
CVarDef.Create("net.mtu", 700, CVar.ARCHIVE);
///
/// Maximum UDP payload size to send by default, for IPv6.
///
///
///
public static readonly CVarDef NetMtuIpv6 =
CVarDef.Create("net.mtu_ipv6", NetPeerConfiguration.kDefaultMTUV6, CVar.ARCHIVE);
///
/// If set, automatically try to detect MTU above .
///
///
///
///
///
public static readonly CVarDef NetMtuExpand =
CVarDef.Create("net.mtu_expand", false, CVar.ARCHIVE);
///
/// Interval between MTU expansion attempts, in seconds.
///
///
/// This property is named incorrectly: it is actually an interval, not a frequency.
/// The name is chosen to match Lidgren's .
///
///
public static readonly CVarDef NetMtuExpandFrequency =
CVarDef.Create("net.mtu_expand_frequency", 2f, CVar.ARCHIVE);
///
/// How many times an MTU expansion attempt can fail before settling on a final MTU value.
///
///
public static readonly CVarDef NetMtuExpandFailAttempts =
CVarDef.Create("net.mtu_expand_fail_attempts", 5, CVar.ARCHIVE);
///
/// Whether to enable verbose debug logging in Lidgren.
///
///
public static readonly CVarDef NetVerbose =
CVarDef.Create("net.verbose", false);
///
/// Comma-separated list of IP addresses to bind to for the main game networking port.
/// The port bound is the value of net.port always.
///
public static readonly CVarDef NetBindTo =
CVarDef.Create("net.bindto", "0.0.0.0,::", CVar.ARCHIVE | CVar.SERVERONLY);
///
/// Whether to bind IPv6 sockets in dual-stack mode (for main game networking).
///
public static readonly CVarDef NetDualStack =
CVarDef.Create("net.dualstack", false, CVar.ARCHIVE | CVar.SERVERONLY);
///
/// Whether to interpolate between server game states for render frames on the client.
///
public static readonly CVarDef NetInterp =
CVarDef.Create("net.interp", true, CVar.ARCHIVE | CVar.CLIENT | CVar.REPLICATED);
///
/// The target number of game states to keep buffered up to smooth out network inconsistency.
///
public static readonly CVarDef NetBufferSize =
CVarDef.Create("net.buffer_size", 2, CVar.ARCHIVE | CVar.CLIENT | CVar.REPLICATED);
///
/// The maximum size of the game state buffer. If this is exceeded the client will request a full game state.
/// Values less than will be ignored.
///
public static readonly CVarDef NetMaxBufferSize =
CVarDef.Create("net.max_buffer_size", 512, CVar.ARCHIVE | CVar.CLIENTONLY);
///
/// Enable verbose game state/networking logging.
///
public static readonly CVarDef NetLogging =
CVarDef.Create("net.logging", false, CVar.ARCHIVE);
///
/// Whether prediction is enabled on the client.
///
///
/// If off, simulation input commands will not fire and most entity methods will not run update.
///
public static readonly CVarDef NetPredict =
CVarDef.Create("net.predict", true, CVar.CLIENTONLY | CVar.ARCHIVE);
///
/// Extra amount of ticks to run-ahead for prediction on the client.
///
public static readonly CVarDef NetPredictTickBias =
CVarDef.Create("net.predict_tick_bias", 1, CVar.CLIENTONLY | CVar.ARCHIVE);
// On Windows we default this to 16ms lag bias, to account for time period lag in the Lidgren thread.
// Basically due to how time periods work on Windows, messages are (at worst) time period-delayed when sending.
// BUT! Lidgren's latency calculation *never* measures this due to how it works.
// This broke some prediction calculations quite badly so we bias them to mask it.
// This is not necessary on Linux because Linux, for better or worse,
// just has the Lidgren thread go absolute brr polling.
///
/// Extra amount of seconds to run-ahead for prediction on the client.
///
public static readonly CVarDef NetPredictLagBias = CVarDef.Create(
"net.predict_lag_bias",
OperatingSystem.IsWindows() ? 0.016f : 0,
CVar.CLIENTONLY | CVar.ARCHIVE);
public static readonly CVarDef NetStateBufMergeThreshold =
CVarDef.Create("net.state_buf_merge_threshold", 5, CVar.CLIENTONLY | CVar.ARCHIVE);
///
/// Whether to cull entities sent to clients from the server.
/// If this is on, only entities immediately close to a client will be sent.
/// Otherwise, all entities will be sent to all clients.
///
public static readonly CVarDef NetPVS =
CVarDef.Create("net.pvs", true, CVar.ARCHIVE | CVar.REPLICATED | CVar.SERVER);
///
/// Size increments for the automatic growth of Pvs' entity data storage. 0 will increase it by factors of 2
///
public static readonly CVarDef NetPvsEntityGrowth =
CVarDef.Create("net.pvs_entity_growth", 1 << 16, CVar.ARCHIVE | CVar.SERVERONLY);
///
/// Initial size of PVS' entity data storage.
///
public static readonly CVarDef NetPvsEntityInitial =
CVarDef.Create("net.pvs_entity_initial", 1 << 16, CVar.ARCHIVE | CVar.SERVERONLY);
///
/// Maximum ever size of PVS' entity data storage.
///
///
///
/// Arbitrarily set to a default of 16 million entities.
/// Increasing this parameter does not increase real memory usage, only virtual.
///
///
public static readonly CVarDef NetPvsEntityMax =
CVarDef.Create("net.pvs_entity_max", 1 << 24, CVar.ARCHIVE | CVar.SERVERONLY);
///
/// If false, this will run more parts of PVS synchronously. This will generally slow it down, can be useful
/// for collecting tick timing metrics.
///
public static readonly CVarDef NetPvsAsync =
CVarDef.Create("net.pvs_async", true, CVar.ARCHIVE | CVar.SERVERONLY);
///
/// View size to take for PVS calculations, as the size of the sides of a square centered on the view points of
/// clients. See also .
///
public static readonly CVarDef NetMaxUpdateRange =
CVarDef.Create("net.pvs_range", 25f, CVar.ARCHIVE | CVar.REPLICATED | CVar.SERVER);
///
/// A variant of that is used to limit the view-distance of entities with the
/// flag set. This can be used to extend the range at which certain
/// entities become visible.
///
///
/// This is useful for entities like lights and occluders to try and prevent noticeable pop-in as players
/// move around. Note that this has no effect if it is less than , and that this
/// only works for entities that are directly parented to a grid or map.
///
public static readonly CVarDef NetPvsPriorityRange =
CVarDef.Create("net.pvs_priority_range", 32.5f, CVar.ARCHIVE | CVar.REPLICATED | CVar.SERVER);
///
/// Maximum allowed delay between the current tick and a client's last acknowledged tick before we send the
/// next game state reliably and simply force update the acked tick,
///
public static readonly CVarDef NetForceAckThreshold =
CVarDef.Create("net.force_ack_threshold", 60, CVar.ARCHIVE | CVar.SERVERONLY);
///
/// This limits the number of new entities that can be sent to a client in a single game state. This exists to
/// avoid stuttering on the client when it has to spawn a bunch of entities in a single tick. If ever entity
/// spawning isn't hot garbage, this can be increased.
///
public static readonly CVarDef NetPVSEntityBudget =
CVarDef.Create("net.pvs_budget", 50, CVar.ARCHIVE | CVar.REPLICATED | CVar.CLIENT);
///
/// This limits the number of entities that can re-enter a client's view in a single game state. This exists to
/// avoid stuttering on the client when it has to update the transform of a bunch (700+) of entities in a single
/// tick. Ideally this would just be handled client-side somehow.
///
public static readonly CVarDef NetPVSEntityEnterBudget =
CVarDef.Create("net.pvs_enter_budget", 200, CVar.ARCHIVE | CVar.REPLICATED | CVar.CLIENT);
///
/// The amount of pvs-exiting entities that a client will process in a single tick.
///
public static readonly CVarDef NetPVSEntityExitBudget =
CVarDef.Create("net.pvs_exit_budget", 75, CVar.ARCHIVE | CVar.CLIENTONLY);
///
/// ZSTD compression level to use when compressing game states. Used by both networking and replays.
///
public static readonly CVarDef NetPvsCompressLevel =
CVarDef.Create("net.pvs_compress_level", 3, CVar.ARCHIVE);
///
/// Log late input messages from clients.
///
public static readonly CVarDef NetLogLateMsg =
CVarDef.Create("net.log_late_msg", true);
///
/// Ticks per second on the server.
/// This influences both how frequently game code processes, and how frequently updates are sent to clients.
///
public static readonly CVarDef NetTickrate =
CVarDef.Create("net.tickrate", 30, CVar.ARCHIVE | CVar.REPLICATED | CVar.SERVER);
///
/// Offset CurTime at server start by this amount (in seconds).
///
public static readonly CVarDef NetTimeStartOffset =
CVarDef.Create("net.time_start_offset", 0, CVar.SERVERONLY);
///
/// How many seconds after the last message from the server before we consider it timed out.
///
public static readonly CVarDef ConnectionTimeout =
CVarDef.Create("net.connection_timeout", 25.0f, CVar.ARCHIVE | CVar.CLIENTONLY);
///
/// When doing the connection handshake, how long to wait before initial connection attempt packets.
///
public static readonly CVarDef ResendHandshakeInterval =
CVarDef.Create("net.handshake_interval", 3.0f, CVar.ARCHIVE | CVar.CLIENTONLY);
///
/// When doing the connection handshake, how many times to try sending initial connection attempt packets.
///
public static readonly CVarDef MaximumHandshakeAttempts =
CVarDef.Create("net.handshake_attempts", 5, CVar.ARCHIVE | CVar.CLIENTONLY);
///
/// If true, encrypt connections when possible.
///
///
/// Encryption is currently only possible when the client has authenticated with the auth server.
///
public static readonly CVarDef NetEncrypt =
CVarDef.Create("net.encrypt", true, CVar.CLIENTONLY);
///
/// If true, use UPnP to automatically forward ports on startup if possible.
///
public static readonly CVarDef NetUPnP =
CVarDef.Create("net.upnp", false, CVar.SERVERONLY);
///
/// App identifier used by Lidgren. This must match between client and server for them to be able to connect.
///
public static readonly CVarDef NetLidgrenAppIdentifier =
CVarDef.Create("net.lidgren_app_identifier", "RobustToolbox");
///
/// Add random fake network loss to all outgoing UDP network packets, as a ratio of how many packets to drop.
/// 0 = no packet loss, 1 = all packets dropped
///
public static readonly CVarDef NetFakeLoss = CVarDef.Create("net.fakeloss", 0f, CVar.CHEAT);
///
/// Add fake extra delay to all outgoing UDP network packets, in seconds.
///
///
public static readonly CVarDef NetFakeLagMin = CVarDef.Create("net.fakelagmin", 0f, CVar.CHEAT);
///
/// Add fake extra random delay to all outgoing UDP network packets, in seconds.
/// The actual delay added for each packet is random between 0 and the specified value.
///
///
public static readonly CVarDef NetFakeLagRand = CVarDef.Create("net.fakelagrand", 0f, CVar.CHEAT);
///
/// Add random fake duplicates to all outgoing UDP network packets, as a ratio of how many packets to duplicate.
/// 0 = no packets duplicated, 1 = all packets duplicated.
///
public static readonly CVarDef NetFakeDuplicates = CVarDef.Create("net.fakeduplicates", 0f, CVar.CHEAT);
///
/// When using Happy Eyeballs to try both IPv6 over IPv4, the delay that IPv4 gets to get less priority.
///
public static readonly CVarDef NetHappyEyeballsDelay =
CVarDef.Create("net.happy_eyeballs_delay", 0.025f, CVar.CLIENTONLY);
///
/// Controls whether the networking library will log warning messages.
///
///
/// Disabling this should make the networking layer more resilient against some DDoS attacks.
///
public static readonly CVarDef NetLidgrenLogWarning =
CVarDef.Create("net.lidgren_log_warning", true);
///
/// Controls whether the networking library will log error messages.
///
public static readonly CVarDef NetLidgrenLogError =
CVarDef.Create("net.lidgren_log_error", true);
///
/// If true, run network message encryption on another thread.
///
public static readonly CVarDef NetEncryptionThread =
CVarDef.Create("net.encryption_thread", true);
///
/// Outstanding buffer size used by .
///
public static readonly CVarDef NetEncryptionThreadChannelSize =
CVarDef.Create("net.encryption_thread_channel_size", 16);
///
/// Whether the server should request HWID system for client identification.
///
///
///
/// Note that modern HWIDs are only available if the connection is authenticated.
///
///
public static readonly CVarDef NetHWId =
CVarDef.Create("net.hwid", true, CVar.SERVERONLY);
/**
* TRANSFER
*/
///
/// If true, enable the WebSocket-based high bandwidth transfer channel.
///
///
///
/// If set, must be set to the API address of the server,
/// and you must ensure your reverse proxy (if you have one) is configured to allow WebSocket connections.
///
///
/// The transfer channel has no additional encryption layer. Unless your API is exposed behind HTTPS,
/// traffic over the channel will not be encrypted, and you are discouraged from enabling it.
///
///
public static readonly CVarDef TransferHttp =
CVarDef.Create("transfer.http", false, CVar.SERVERONLY);
///
/// The base HTTP URL of the game server, used for the high-bandwidth transfer channel.
///
public static readonly CVarDef TransferHttpEndpoint =
CVarDef.Create("transfer.http_endpoint", "http://localhost:1212/", CVar.SERVERONLY);
///
/// Amount of concurrent client->server transfer streams allowed.
///
///
/// Clients will be disconnected if they exceed this limit.
///
public static readonly CVarDef TransferStreamLimit =
CVarDef.Create("transfer.stream_limit", 10, CVar.SERVERONLY);
///
/// Artificially delay transfer operations to simulate slow network. Debug option.
///
internal static readonly CVarDef TransferArtificialDelay =
CVarDef.Create("transfer.artificial_delay", false);
/**
* SUS
*/
///
/// If not zero on Windows, the server will sent the tick period for its own process via TimeBeginPeriod.
/// This increases polling and sleep precision of the network and main thread,
/// but may negatively affect battery life or such.
///
public static readonly CVarDef SysWinTickPeriod =
CVarDef.Create("sys.win_tick_period", 3, CVar.SERVERONLY);
///
/// On non-FULL_RELEASE builds, use ProfileOptimization/tiered JIT to speed up game startup.
///
public static readonly CVarDef SysProfileOpt =
CVarDef.Create("sys.profile_opt", true);
///
/// Controls stack size of the game logic thread, in bytes.
///
public static readonly CVarDef SysGameThreadStackSize =
CVarDef.Create("sys.game_thread_stack_size", 8 * 1024 * 1024);
///
/// Controls thread priority of the game logic thread.
///
public static readonly CVarDef SysGameThreadPriority =
CVarDef.Create("sys.game_thread_priority", (int) ThreadPriority.AboveNormal);
///
/// Whether to run a operation after the engine is finished initializing.
///
public static readonly CVarDef SysGCCollectStart =
CVarDef.Create("sys.gc_collect_start", true);
///
/// Use precise sleeping methods in the game loop.
///
public static readonly CVarDef SysPreciseSleep =
CVarDef.Create("sys.precise_sleep", true);
/*
* METRICS
*/
///
/// Whether to enable a prometheus metrics server.
///
public static readonly CVarDef MetricsEnabled =
CVarDef.Create("metrics.enabled", false, CVar.SERVERONLY);
///
/// The IP address to host the metrics server on.
///
public static readonly CVarDef MetricsHost =
CVarDef.Create("metrics.host", "localhost", CVar.SERVERONLY);
///
/// The port to host the metrics server on.
///
public static readonly CVarDef MetricsPort =
CVarDef.Create("metrics.port", 44880, CVar.SERVERONLY);
///
/// Sets a fixed interval (seconds) for internal collection of certain metrics,
/// when not using the Prometheus metrics server.
///
///
///
/// Most metrics are internally implemented directly via the prometheus-net library.
/// These metrics can only be scraped by the Prometheus metrics server ().
/// However, newer metrics are implemented with the System.Diagnostics.Metrics library in the .NET runtime.
/// These metrics can be scraped through more means, such as dotnet counters.
///
///
/// While many metrics are simple counters that can "just" be reported,
/// some metrics require more advanced internal work and need some code to be ran internally
/// before their values are made current. When collecting metrics via a
/// method other than the Prometheus metrics server, these metrics pose a problem,
/// as there is no way for the game to update them before collection properly.
///
///
/// This CVar acts as a fallback: if set to a value other than 0 (disabled),
/// these metrics will be internally updated at the interval provided.
///
///
/// This does not need to be enabled if metrics are collected exclusively via the Prometheus metrics server.
///
///
public static readonly CVarDef MetricsUpdateInterval =
CVarDef.Create("metrics.update_interval", 0f, CVar.SERVERONLY);
///
/// Enable detailed runtime metrics. Empty to disable.
///
///
/// Runtime metrics are provided by https://github.com/djluck/prometheus-net.DotNetRuntime.
/// Granularity of metrics can be further configured with related CVars.
///
public static readonly CVarDef MetricsRuntime =
CVarDef.Create("metrics.runtime", true, CVar.SERVERONLY);
///
/// Mode for runtime GC metrics. Empty to disable.
///
///
/// See the documentation for prometheus-net.DotNetRuntime for values and their metrics:
/// https://github.com/djluck/prometheus-net.DotNetRuntime/blob/master/docs/metrics-exposed-5.0.md
///
public static readonly CVarDef MetricsRuntimeGc =
CVarDef.Create("metrics.runtime_gc", "Counters", CVar.SERVERONLY);
///
/// Histogram buckets for GC and pause times. Comma-separated list of floats, in milliseconds.
///
public static readonly CVarDef MetricsRuntimeGcHistogram =
CVarDef.Create("metrics.runtime_gc_histogram", "0.5,1.0,2.0,4.0,6.0,10.0,15.0,20.0", CVar.SERVERONLY);
///
/// Mode for runtime lock contention metrics. Empty to disable.
///
///
/// See the documentation for prometheus-net.DotNetRuntime for values and their metrics:
/// https://github.com/djluck/prometheus-net.DotNetRuntime/blob/master/docs/metrics-exposed-5.0.md
///
public static readonly CVarDef MetricsRuntimeContention =
CVarDef.Create("metrics.runtime_contention", "Counters", CVar.SERVERONLY);
///
/// Sample lock contention every N events. Higher numbers increase accuracy but also memory use.
///
public static readonly CVarDef MetricsRuntimeContentionSampleRate =
CVarDef.Create("metrics.runtime_contention_sample_rate", 50, CVar.SERVERONLY);
///
/// Mode for runtime thread pool metrics. Empty to disable.
///
///
/// See the documentation for prometheus-net.DotNetRuntime for values and their metrics:
/// https://github.com/djluck/prometheus-net.DotNetRuntime/blob/master/docs/metrics-exposed-5.0.md
///
public static readonly CVarDef MetricsRuntimeThreadPool =
CVarDef.Create("metrics.runtime_thread_pool", "Counters", CVar.SERVERONLY);
///
/// Histogram buckets for thread pool queue length.
///
public static readonly CVarDef MetricsRuntimeThreadPoolQueueHistogram =
CVarDef.Create("metrics.runtime_thread_pool_queue_histogram", "0,10,30,60,120,180", CVar.SERVERONLY);
///
/// Mode for runtime JIT metrics. Empty to disable.
///
///
/// See the documentation for prometheus-net.DotNetRuntime for values and their metrics:
/// https://github.com/djluck/prometheus-net.DotNetRuntime/blob/master/docs/metrics-exposed-5.0.md
///
public static readonly CVarDef MetricsRuntimeJit =
CVarDef.Create("metrics.runtime_jit", "Counters", CVar.SERVERONLY);
///
/// Sample JIT every N events. Higher numbers increase accuracy but also memory use.
///
public static readonly CVarDef MetricsRuntimeJitSampleRate =
CVarDef.Create("metrics.runtime_jit_sample_rate", 10, CVar.SERVERONLY);
///
/// Mode for runtime exception metrics. Empty to disable.
///
///
/// See the documentation for prometheus-net.DotNetRuntime for values and their metrics:
/// https://github.com/djluck/prometheus-net.DotNetRuntime/blob/master/docs/metrics-exposed-5.0.md
///
public static readonly CVarDef MetricsRuntimeException =
CVarDef.Create("metrics.runtime_exception", "Counters", CVar.SERVERONLY);
///
/// Mode for runtime TCP socket metrics. Empty to disable.
///
///
/// See the documentation for prometheus-net.DotNetRuntime for values and their metrics:
/// https://github.com/djluck/prometheus-net.DotNetRuntime/blob/master/docs/metrics-exposed-5.0.md
///
public static readonly CVarDef MetricsRuntimeSocket =
CVarDef.Create("metrics.runtime_socket", "Counters", CVar.SERVERONLY);
/*
* STATUS
*/
///
/// Whether to enable the HTTP status API server.
///
///
/// This is necessary for people to be able to connect via the launcher.
///
public static readonly CVarDef StatusEnabled =
CVarDef.Create("status.enabled", true, CVar.ARCHIVE | CVar.SERVERONLY);
///
/// Prefix address to bind the HTTP status API server to.
/// This is in the form of addr:port, with * serving as a wildcard "all".
/// If empty (the default), this is automatically generated to match the UDP ports.
///
public static readonly CVarDef StatusBind =
CVarDef.Create("status.bind", "", CVar.ARCHIVE | CVar.SERVERONLY);
///
/// Max amount of concurrent connections to the HTTP status server.
/// Note that this is for actively processing requests, not kept-alive/pooled connections.
///
public static readonly CVarDef StatusMaxConnections =
CVarDef.Create("status.max_connections", 5, CVar.SERVERONLY);
///
/// UDP address that should be advertised and the launcher will use to connect to.
/// If not set, the launcher will automatically infer this based on the address it already has.
///
public static readonly CVarDef StatusConnectAddress =
CVarDef.Create("status.connectaddress", "", CVar.ARCHIVE | CVar.SERVERONLY);
///
/// HTTP(S) link to a privacy policy that the user must accept to connect to the server.
///
///
/// This must be set along with and
/// for the user to be prompted about a privacy policy.
///
public static readonly CVarDef StatusPrivacyPolicyLink =
CVarDef.Create("status.privacy_policy_link", "https://example.com/privacy", CVar.SERVER | CVar.REPLICATED);
///
/// An identifier for privacy policy specified by .
/// This must be globally unique.
///
///
///
/// This value must be globally unique per server community. Servers that want to enforce a
/// privacy policy should set this to a value that is unique to their server and, preferably, recognizable.
///
///
/// This value is stored by the launcher to keep track of what privacy policies a player has accepted.
///
///
public static readonly CVarDef StatusPrivacyPolicyIdentifier =
CVarDef.Create("status.privacy_policy_identifier", "", CVar.SERVER | CVar.REPLICATED);
///
/// A "version" for the privacy policy specified by .
///
///
///
/// This parameter is stored by the launcher and should be modified whenever your server's privacy policy changes.
///
///
public static readonly CVarDef StatusPrivacyPolicyVersion =
CVarDef.Create("status.privacy_policy_version", "", CVar.SERVER | CVar.REPLICATED);
/*
* BUILD
*/
///
/// Engine version that launcher needs to connect to this server.
///
public static readonly CVarDef BuildEngineVersion =
CVarDef.Create("build.engine_version",
typeof(CVars).Assembly.GetName().Version?.ToString(3) ?? String.Empty);
///
/// Fork ID, as a hint to the launcher to manage local files.
/// This can be anything, it does not need a strict format.
///
public static readonly CVarDef BuildForkId =
CVarDef.Create("build.fork_id", "");
///
/// Version string, as a hint to the launcher to manage local files.
/// This can be anything, it does not need a strict format.
///
public static readonly CVarDef BuildVersion =
CVarDef.Create("build.version", "");
///
/// Content pack the launcher should download to connect to this server.
///
public static readonly CVarDef BuildDownloadUrl =
CVarDef.Create("build.download_url", string.Empty);
///
/// URL of the content manifest the launcher should download to connect to this server.
///
public static readonly CVarDef BuildManifestUrl =
CVarDef.Create("build.manifest_url", string.Empty);
///
/// URL at which the launcher can download the manifest game files.
///
public static readonly CVarDef BuildManifestDownloadUrl =
CVarDef.Create("build.manifest_download_url", string.Empty);
///
/// SHA-256 hash of the content pack hosted at build.download_url
///
public static readonly CVarDef BuildHash =
CVarDef.Create("build.hash", "");
///
/// SHA-256 hash of the manifest hosted at build.manifest_url
///
public static readonly CVarDef BuildManifestHash =
CVarDef.Create("build.manifest_hash", "");
///
/// Allows you to disable the display of all entities in the spawn menu that are not labeled with the ShowSpawnMenu category.
/// This is useful for forks that just want to disable the standard upstream content
///
public static readonly CVarDef EntitiesCategoryFilter =
CVarDef.Create("build.entities_category_filter", "");
/*
* WATCHDOG
*/
///
/// API token set by the watchdog to communicate to the server.
///
public static readonly CVarDef WatchdogToken =
CVarDef.Create("watchdog.token", "", CVar.SERVERONLY | CVar.CONFIDENTIAL);
///
/// Watchdog server identifier for this server.
///
public static readonly CVarDef WatchdogKey =
CVarDef.Create("watchdog.key", "", CVar.SERVERONLY);
///
/// Base URL of the watchdog on the local machine.
///
public static readonly CVarDef WatchdogBaseUrl =
CVarDef.Create("watchdog.baseUrl", "http://localhost:5000", CVar.SERVERONLY);
/*
* GAME
*/
///
/// Hard max-cap of concurrent connections for the main game networking.
///
///
/// This cannot be bypassed in any way, since it is used by Lidgren internally.
///
[Obsolete("Use net.max_connections instead")]
public static readonly CVarDef GameMaxPlayers =
CVarDef.Create("game.maxplayers", 0, CVar.ARCHIVE | CVar.REPLICATED | CVar.SERVER);
///
/// Name of the game server. This shows up in the launcher and potentially parts of the UI.
///
public static readonly CVarDef GameHostName =
CVarDef.Create("game.hostname", "MyServer", CVar.ARCHIVE | CVar.REPLICATED | CVar.SERVER);
///
/// Description of the game server in the launcher.
///
public static readonly CVarDef GameDesc =
CVarDef.Create("game.desc", "Just another server, don't mind me!", CVar.SERVERONLY);
///
/// If a grid is shrunk to include no more tiles should it be deleted.
///
public static readonly CVarDef GameDeleteEmptyGrids =
CVarDef.Create("game.delete_empty_grids", true, CVar.ARCHIVE | CVar.SERVER);
///
/// Automatically pause simulation if there are no players connected to the game server.
///
public static readonly CVarDef GameAutoPauseEmpty =
CVarDef.Create("game.auto_pause_empty", true, CVar.SERVERONLY);
///
/// Scales the game simulation time. Higher values make the game slower.
///
public static readonly CVarDef GameTimeScale =
CVarDef.Create("game.time_scale", 1f, CVar.REPLICATED | CVar.SERVER);
/*
* LOG
*/
///
/// Write server log to disk.
///
public static readonly CVarDef LogEnabled =
CVarDef.Create("log.enabled", true, CVar.ARCHIVE | CVar.SERVERONLY);
///
/// Path to put log files in if log writing is enabled.
///
public static readonly CVarDef LogPath =
CVarDef.Create("log.path", "logs", CVar.ARCHIVE | CVar.SERVERONLY);
///
/// Format for individual log files, based on current date and time replacement.
///
public static readonly CVarDef LogFormat =
CVarDef.Create("log.format", "log_%(date)s-T%(time)s.txt", CVar.ARCHIVE | CVar.SERVERONLY);
///
/// Minimum log level for all server logging.
///
public static readonly CVarDef LogLevel =
CVarDef.Create("log.level", Log.LogLevel.Info, CVar.ARCHIVE | CVar.SERVERONLY);
///
/// Log a separate exception log for all exceptions that occur.
///
public static readonly CVarDef LogRuntimeLog =
CVarDef.Create("log.runtimelog", true, CVar.ARCHIVE | CVar.SERVERONLY);
/*
* Light
*/
///
/// This is the maximum the viewport is enlarged to check for any intersecting render-trees for lights.
/// This should be set to your maximum light radius.
///
///
/// If this value is too small it just means there may be pop-in where a light is located on a render-tree
/// outside of our viewport.
///
public static readonly CVarDef MaxLightRadius =
CVarDef.Create("light.max_radius", 32.1f, CVar.CLIENTONLY | CVar.ARCHIVE);
///
/// Maximum number of lights that the client will draw.
///
public static readonly CVarDef MaxLightCount =
CVarDef.Create("light.max_light_count", 2048, CVar.CLIENTONLY | CVar.ARCHIVE);
///
/// Maximum number of occluders that the client will draw. Values below 1024 have no effect.
///
public static readonly CVarDef MaxOccluderCount =
CVarDef.Create("light.max_occluder_count", 2048, CVar.CLIENTONLY | CVar.ARCHIVE);
///
/// Scale used to modify the horizontal and vertical resolution of lighting framebuffers,
/// relative to the viewport framebuffer size.
///
public static readonly CVarDef LightResolutionScale =
CVarDef.Create("light.resolution_scale", 0.5f, CVar.CLIENTONLY | CVar.ARCHIVE);
///
/// Maximum amount of shadow-casting lights that can be rendered in a single viewport at once.
///
public static readonly CVarDef MaxShadowcastingLights =
CVarDef.Create("light.max_shadowcasting_lights", 128, CVar.CLIENTONLY | CVar.ARCHIVE);
///
/// Whether to give shadows a soft edge when rendering.
///
public static readonly CVarDef LightSoftShadows =
CVarDef.Create("light.soft_shadows", true, CVar.CLIENTONLY | CVar.ARCHIVE);
///
/// Apply a gaussian blur to the final lighting framebuffer to smoothen it out a little.
///
public static readonly CVarDef LightBlur=
CVarDef.Create("light.blur", true, CVar.CLIENTONLY | CVar.ARCHIVE);
///
/// Factor by which to blur the lighting framebuffer under light.blur.
///
public static readonly CVarDef LightBlurFactor =
CVarDef.Create("light.blur_factor", 0.001f, CVar.CLIENTONLY | CVar.ARCHIVE);
/*
* Lookup
*/
///
/// Like MaxLightRadius this is how far we enlarge lookups to find intersecting components.
/// This should be set to your maximum entity size.
///
public static readonly CVarDef LookupEnlargementRange =
CVarDef.Create("lookup.enlargement_range", 10.0f, CVar.ARCHIVE | CVar.REPLICATED | CVar.CHEAT);
/*
* LOKI
*/
///
/// Whether to send the server log to Grafana Loki.
///
public static readonly CVarDef LokiEnabled =
CVarDef.Create("loki.enabled", false, CVar.SERVERONLY);
///
/// The name of the current server, set as the value of the "Server" label in Loki.
///
public static readonly CVarDef LokiName =
CVarDef.Create("loki.name", "", CVar.SERVERONLY);
///
/// The address of the Loki server to send to.
///
public static readonly CVarDef LokiAddress =
CVarDef.Create("loki.address", "", CVar.SERVERONLY);
///
/// If set, a HTTP Basic auth username to use when talking to Loki.
///
public static readonly CVarDef LokiUsername =
CVarDef.Create("loki.username", "", CVar.SERVERONLY);
///
/// If set, a HTTP Basic auth password to use when talking to Loki.
///
public static readonly CVarDef LokiPassword =
CVarDef.Create("loki.password", "", CVar.SERVERONLY);
/*
* AUTH
*/
///
/// Mode with which to handle authentication on the server.
/// See the documentation of the enum for values.
///
public static readonly CVarDef AuthMode =
CVarDef.Create("auth.mode", (int) Network.AuthMode.Required, CVar.SERVERONLY);
///
/// Allow unauthenticated localhost connections, even if the auth mode is set to required.
/// These connections have a "localhost@" prefix as username.
///
public static readonly CVarDef AuthAllowLocal =
CVarDef.Create("auth.allowlocal", true, CVar.SERVERONLY);
// Only respected on server, client goes through IAuthManager for security.
///
/// Authentication server address.
///
public static readonly CVarDef AuthServer =
CVarDef.Create("auth.server", AuthManager.DefaultAuthServer, CVar.SERVERONLY);
/*
* RENDERING
*/
///
/// This biases the RSI-direction used to draw diagonally oriented 4-directional sprites to avoid flickering between directions. A positive
/// value biases towards facing N/S, while a negative value will bias towards E/W.
///
///
/// The bias needs to be large enough to prevent sprites on rotating grids from flickering, but should be
/// small enough that it is generally unnoticeable. Currently it is somewhat large to combat issues with
/// eye-lerping & grid rotations.
///
public static readonly CVarDef RenderSpriteDirectionBias =
CVarDef.Create("render.sprite_direction_bias", -0.05, CVar.ARCHIVE | CVar.CLIENTONLY);
public static readonly CVarDef RenderFOVColor =
CVarDef.Create("render.fov_color", Color.Black.ToHex(), CVar.REPLICATED | CVar.SERVER);
///
/// Whether to render tile edges, which is where some tiles can partially overlap other adjacent tiles on a grid.
/// E.g., snow tiles partly extending beyond their own tile to blend together with different adjacent tiles types.
///
public static readonly CVarDef RenderTileEdges =
CVarDef.Create("render.tile_edges", true, CVar.CLIENTONLY);
/*
* CONTROLS
*/
///
/// Milliseconds to wait to consider double-click delays.
///
public static readonly CVarDef DoubleClickDelay =
CVarDef.Create("controls.double_click_delay", 250, CVar.ARCHIVE | CVar.CLIENTONLY);
///
/// Range in pixels for double-clicks
///
public static readonly CVarDef DoubleClickRange =
CVarDef.Create("controls.double_click_range", 10, CVar.ARCHIVE | CVar.CLIENTONLY);
/*
* DISPLAY
*/
///
/// Enable VSync for rendering.
///
public static readonly CVarDef DisplayVSync =
CVarDef.Create("display.vsync", true, CVar.ARCHIVE | CVar.CLIENTONLY);
///
/// Maximum framerate the client should run at. Set to 0 to have no limit.
///
///
/// This is ignored if is enabled.
///
public static readonly CVarDef DisplayMaxFPS =
CVarDef.Create("display.max_fps", 0, CVar.ARCHIVE | CVar.CLIENTONLY);
///
/// Window mode for the main game window. 0 = windowed, 1 = fullscreen.
///
public static readonly CVarDef DisplayWindowMode =
CVarDef.Create("display.windowmode", 0, CVar.ARCHIVE | CVar.CLIENTONLY);
///
/// Initial width of the game window when running on windowed mode.
///
public static readonly CVarDef DisplayWidth =
CVarDef.Create("display.width", 1280, CVar.CLIENTONLY);
///
/// Initial height of the game window when running on windowed mode.
///
public static readonly CVarDef DisplayHeight =
CVarDef.Create("display.height", 720, CVar.CLIENTONLY);
///
/// UI scale for all UI controls. If zero, this value is automatically calculated from the OS.
///
public static readonly CVarDef DisplayUIScale =
CVarDef.Create("display.uiScale", 0f, CVar.ARCHIVE | CVar.CLIENTONLY);
// Clyde related enums are in Clyde.Constants.cs.
///
/// Which renderer to use to render the game.
///
public static readonly CVarDef DisplayRenderer =
CVarDef.Create("display.renderer", 0, CVar.CLIENTONLY);
///
/// Whether to use compatibility mode.
///
///
/// This can change certain behaviors like GL version selection to try to avoid driver crashes/bugs.
///
public static readonly CVarDef DisplayCompat =
CVarDef.Create("display.compat", false, CVar.CLIENTONLY);
///
/// Which OpenGL version to use for the OpenGL renderer.
/// Values correspond to the (private) RendererOpenGLVersion enum in Clyde.
///
public static readonly CVarDef DisplayOpenGLVersion =
CVarDef.Create("display.opengl_version", 0, CVar.CLIENTONLY);
///
/// On Windows, use ANGLE as OpenGL implementation.
///
public static readonly CVarDef DisplayAngle =
CVarDef.Create("display.angle", false, CVar.CLIENTONLY);
///
/// Use a custom DXGI swap chain when using ANGLE.
/// Should improve performance and fixes main window sRGB handling with ANGLE.
///
public static readonly CVarDef DisplayAngleCustomSwapChain =
CVarDef.Create("display.angle_custom_swap_chain", true, CVar.CLIENTONLY);
///
/// Force ANGLE to create a GLES2 context (not a compatible GLES3 context).
///
public static readonly CVarDef DisplayAngleForceEs2 =
CVarDef.Create("display.angle_force_es2", false, CVar.CLIENTONLY);
///
/// Force ANGLE to create a context from a D3D11 FL 10_0 device.
///
public static readonly CVarDef DisplayAngleForce10_0 =
CVarDef.Create("display.angle_force_10_0", false, CVar.CLIENTONLY);
///
/// Force usage of DXGI 1.1 when using custom swap chain setup.
///
public static readonly CVarDef DisplayAngleDxgi1 =
CVarDef.Create("display.angle_dxgi1", false, CVar.CLIENTONLY);
///
/// Try to use the display adapter with this name, if the current renderer supports selecting it.
///
public static readonly CVarDef DisplayAdapter =
CVarDef.Create("display.adapter", "", CVar.CLIENTONLY);
///
/// What type of GPU to prefer when creating a graphics context, for things such as hybrid GPU laptops.
///
///
/// This setting is not always respect depending on platform and rendering API used.
/// Values are:
/// 0 = unspecified (DXGI_GPU_PREFERENCE_UNSPECIFIED)
/// 1 = minimum power (DXGI_GPU_PREFERENCE_MINIMUM_POWER)
/// 2 = high performance (DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE)
///
public static readonly CVarDef DisplayGpuPreference =
CVarDef.Create("display.gpu_preference", 2, CVar.CLIENTONLY);
///
/// Use EGL to create GL context instead of GLFW, if possible.
///
///
/// This only tries to use EGL if on a platform like X11 or Windows (w/ ANGLE) where it is possible.
///
public static readonly CVarDef DisplayEgl =
CVarDef.Create("display.egl", false, CVar.CLIENTONLY);
///
/// Enable allowES3OnFL10_0 on ANGLE.
///
public static readonly CVarDef DisplayAngleEs3On10_0 =
CVarDef.Create("display.angle_es3_on_10_0", true, CVar.CLIENTONLY);
///
/// Base DPI to render fonts at. This can be further scaled based on display.uiScale.
///
public static readonly CVarDef DisplayFontDpi =
CVarDef.Create("display.fontdpi", 96, CVar.CLIENTONLY);
///
/// Override detected OpenGL version, for testing.
///
public static readonly CVarDef DisplayOGLOverrideVersion =
CVarDef.Create("display.ogl_override_version", string.Empty, CVar.CLIENTONLY);
///
/// Run glCheckError() after (almost) every GL call.
///
public static readonly CVarDef DisplayOGLCheckErrors =
CVarDef.Create("display.ogl_check_errors", false, CVar.CLIENTONLY);
///
/// Forces synchronization of multi-window rendering with glFinish when GL fence sync is unavailable.
///
///
/// If this is disabled multi-window rendering on GLES2 might run better, dunno.
/// It technically causes UB thanks to the OpenGL spec with cross-context sync. Hope that won't happen.
/// Let's be real the OpenGL specification is basically just a suggestion to drivers anyways so who cares.
///
public static readonly CVarDef DisplayForceSyncWindows =
CVarDef.Create("display.force_sync_windows", true, CVar.CLIENTONLY);
///
/// Use a separate thread for multi-window blitting.
///
public static readonly CVarDef DisplayThreadWindowBlit =
CVarDef.Create("display.thread_window_blit", true, CVar.CLIENTONLY);
///
/// Diagnostic flag for testing. When using a separate thread for multi-window blitting,
/// should the worker be unblocked before the SwapBuffers(). Setting to true may improve
/// performance but may cause crashes or rendering errors.
///
public static readonly CVarDef DisplayThreadUnlockBeforeSwap =
CVarDef.Create("display.thread_unlock_before_swap", false, CVar.CLIENTONLY);
///
/// Buffer size of input command channel from windowing thread to main game thread.
///
public static readonly CVarDef DisplayInputBufferSize =
CVarDef.Create("display.input_buffer_size", 32, CVar.CLIENTONLY);
///
/// Insert stupid performance hitches into the windowing thread, to test how the game thread handles it.
///
public static readonly CVarDef DisplayWin32Experience =
CVarDef.Create("display.win32_experience", false, CVar.CLIENTONLY);
///
/// The window icon set to use. Overriden by GameControllerOptions on startup.
///
///
/// Dynamically changing this does nothing.
///
public static readonly CVarDef DisplayWindowIconSet =
CVarDef.Create("display.window_icon_set", "", CVar.CLIENTONLY);
///
/// The splash logo to use. Overriden by GameControllerOptions on startup.
///
///
/// Dynamically changing this does nothing.
///
public static readonly CVarDef DisplaySplashLogo =
CVarDef.Create("display.splash_logo", "", CVar.CLIENTONLY);
///
/// Use US QWERTY hotkeys for reported key names.
///
public static readonly CVarDef DisplayUSQWERTYHotkeys =
CVarDef.Create("display.use_US_QWERTY_hotkeys", false, CVar.CLIENTONLY | CVar.ARCHIVE);
public static readonly CVarDef DisplayWindowingApi =
CVarDef.Create("display.windowing_api", "sdl3", CVar.CLIENTONLY);
///
/// If true and on Windows 11 Build 22000,
/// specify DWMWA_USE_IMMERSIVE_DARK_MODE to have dark mode window titles if the system is set to dark mode.
///
public static readonly CVarDef DisplayWin11ImmersiveDarkMode =
CVarDef.Create("display.win11_immersive_dark_mode", true, CVar.CLIENTONLY);
///
/// If true, run the windowing system in another thread from the game thread.
///
public static readonly CVarDef DisplayThreadWindowApi =
CVarDef.Create("display.thread_window_api", false, CVar.CLIENTONLY);
/*
* AUDIO
*/
///
/// Default limit for concurrently playing an audio file.
///
public static readonly CVarDef AudioDefaultConcurrent =
CVarDef.Create("audio.default_concurrent", 16, CVar.CLIENTONLY | CVar.ARCHIVE);
public static readonly CVarDef AudioAttenuation =
CVarDef.Create("audio.attenuation", (int) Attenuation.LinearDistanceClamped, CVar.REPLICATED | CVar.ARCHIVE);
///
/// Audio device to try to output audio to by default.
///
public static readonly CVarDef AudioDevice =
CVarDef.Create("audio.device", string.Empty, CVar.CLIENTONLY);
///
/// Master volume for audio output.
///
public static readonly CVarDef AudioMasterVolume =
CVarDef.Create("audio.mastervolume", 0.50f, CVar.ARCHIVE | CVar.CLIENTONLY);
///
/// Maximum raycast distance for audio occlusion.
///
public static readonly CVarDef AudioRaycastLength =
CVarDef.Create("audio.raycast_length", SharedAudioSystem.DefaultSoundRange, CVar.ARCHIVE | CVar.CLIENTONLY);
///
/// Maximum offset for audio to be played at from its full duration. If it's past this then the audio won't be played.
///
public static readonly CVarDef AudioEndBuffer =
CVarDef.Create("audio.end_buffer", 0.01f, CVar.REPLICATED);
///
/// Tickrate for audio calculations.
/// OpenAL recommends 30TPS. This is to avoid running raycasts every frame especially for high-refresh rate monitors.
///
public static readonly CVarDef AudioTickRate =
CVarDef.Create("audio.tick_rate", 30, CVar.CLIENTONLY);
public static readonly CVarDef AudioZOffset =
CVarDef.Create("audio.z_offset", -5f, CVar.REPLICATED);
/*
* PLAYER
*/
///
/// Player name to send from user, if not overriden by a myriad of factors.
///
public static readonly CVarDef PlayerName =
CVarDef.Create("player.name", "JoeGenero", CVar.ARCHIVE | CVar.CLIENTONLY);
/*
* PHYSICS
*/
///
/// The target minimum ticks per second on the server.
/// This is used for substepping and will help with clipping/physics issues and such.
/// Ideally 50-60 is the minimum.
///
public static readonly CVarDef TargetMinimumTickrate =
CVarDef.Create("physics.target_minimum_tickrate", 60, CVar.ARCHIVE | CVar.REPLICATED | CVar.SERVER);
// Grid fixtures
///
/// I'ma be real with you: the only reason this exists is to get tests working.
///
public static readonly CVarDef GenerateGridFixtures =
CVarDef.Create("physics.grid_fixtures", true, CVar.REPLICATED);
///
/// Can grids split if not connected by cardinals
///
public static readonly CVarDef GridSplitting =
CVarDef.Create("physics.grid_splitting", true, CVar.ARCHIVE);
///
/// How much to enlarge grids when determining their fixture bounds.
///
public static readonly CVarDef GridFixtureEnlargement =
CVarDef.Create("physics.grid_fixture_enlargement", -PhysicsConstants.PolygonRadius, CVar.ARCHIVE | CVar.REPLICATED);
// - Sleep
public static readonly CVarDef AngularSleepTolerance =
CVarDef.Create("physics.angsleeptol", 0.3f / 180.0f * MathF.PI);
public static readonly CVarDef LinearSleepTolerance =
CVarDef.Create("physics.linsleeptol", 0.01f);
public static readonly CVarDef SleepAllowed =
CVarDef.Create("physics.sleepallowed", true);
// Box2D default is 0.5f
public static readonly CVarDef TimeToSleep =
CVarDef.Create("physics.timetosleep", 0.2f);
// - Solver
// These are the minimum recommended by Box2D with the standard being 8 velocity 3 position iterations.
// Trade-off is obviously performance vs how long it takes to stabilise.
// PhysX opts for fewer velocity iterations and more position but they also have a different solver.
public static readonly CVarDef PositionIterations =
CVarDef.Create("physics.positer", 3);
public static readonly CVarDef VelocityIterations =
CVarDef.Create("physics.veliter", 8);
public static readonly CVarDef WarmStarting =
CVarDef.Create("physics.warmstart", true);
public static readonly CVarDef AutoClearForces =
CVarDef.Create("physics.autoclearforces", true);
///
/// A velocity threshold for elastic collisions. Any collision with a relative linear
/// velocity below this threshold will be treated as inelastic.
///
public static readonly CVarDef VelocityThreshold =
CVarDef.Create("physics.velocitythreshold", 0.5f);
// TODO: Copy Box2D's comments on baumgarte I think it's on the solver class.
///
/// How much overlap is resolved per tick.
///
public static readonly CVarDef Baumgarte =
CVarDef.Create("physics.baumgarte", 0.2f);
public static readonly CVarDef MaxLinearCorrection =
CVarDef.Create("physics.maxlinearcorrection", 0.2f);
public static readonly CVarDef MaxAngularCorrection =
CVarDef.Create("physics.maxangularcorrection", 8.0f / 180.0f * MathF.PI);
// - Maximums
///
/// Maximum linear velocity per second.
/// Make sure that MaxLinVelocity / is around 0.5 or higher so that moving objects don't go through walls.
/// MaxLinVelocity is compared to the dot product of linearVelocity * frameTime.
///
///
/// Default is 400 m/s in-line with Box2c. Box2d used 120m/s.
///
public static readonly CVarDef MaxLinVelocity =
CVarDef.Create("physics.maxlinvelocity", 400f, CVar.SERVER | CVar.REPLICATED);
///
/// Maximum angular velocity in full rotations per second.
/// MaxAngVelocity is compared to the squared rotation.
///
///
/// Default is 15 rotations per second. Approximately a quarter rotation per tick at 60 ticks per second.
///
public static readonly CVarDef MaxAngVelocity =
CVarDef.Create("physics.maxangvelocity", 15f);
/*
* User interface
*/
///
/// Change the UITheme
///
public static readonly CVarDef InterfaceTheme =
CVarDef.Create("interface.theme", "", CVar.CLIENTONLY | CVar.ARCHIVE);
///
/// Should UI have audio at all.
///
public static readonly CVarDef InterfaceAudio =
CVarDef.Create("interface.audio", true, CVar.REPLICATED);
///
///Minimum resolution to start clamping autoscale to 1
///
public static readonly CVarDef ResAutoScaleUpperX =
CVarDef.Create("interface.resolutionAutoScaleUpperCutoffX",1080 , CVar.CLIENTONLY);
///
///Minimum resolution to start clamping autoscale to 1
///
public static readonly CVarDef ResAutoScaleUpperY =
CVarDef.Create("interface.resolutionAutoScaleUpperCutoffY",720 , CVar.CLIENTONLY);
///
///Maximum resolution to start clamping autos scale to autoscale minimum
///
public static readonly CVarDef ResAutoScaleLowX =
CVarDef.Create("interface.resolutionAutoScaleLowerCutoffX",520 , CVar.CLIENTONLY);
///
///Maximum resolution to start clamping autos scale to autoscale minimum
///
public static readonly CVarDef ResAutoScaleLowY =
CVarDef.Create("interface.resolutionAutoScaleLowerCutoffY",520 , CVar.CLIENTONLY);
///
/// The minimum ui scale value that autoscale will scale to
///
public static readonly CVarDef ResAutoScaleMin =
CVarDef.Create("interface.resolutionAutoScaleMinimum",0.5f , CVar.CLIENTONLY);
///
///Enable the UI autoscale system on this control, this will scale down the UI for lower resolutions
///
public static readonly CVarDef ResAutoScaleEnabled =
CVarDef.Create("interface.resolutionAutoScaleEnabled",true , CVar.CLIENTONLY | CVar.ARCHIVE);
/*
* DISCORD
*/
///
/// Enable Discord rich presence integration.
///
public static readonly CVarDef DiscordEnabled =
CVarDef.Create("discord.enabled", true, CVar.CLIENTONLY | CVar.ARCHIVE);
public static readonly CVarDef DiscordRichPresenceMainIconId =
CVarDef.Create("discord.rich_main_icon_id", "devstation", CVar.SERVER | CVar.REPLICATED);
public static readonly CVarDef DiscordRichPresenceSecondIconId =
CVarDef.Create("discord.rich_second_icon_id", "logo", CVar.SERVER | CVar.REPLICATED);
/*
* RES
*/
///
/// Verify that resource path capitalization is correct, even on case-insensitive file systems such as Windows.
///
public static readonly CVarDef ResCheckPathCasing =
CVarDef.Create("res.checkpathcasing", false);
///
/// Preload all textures at client startup to avoid hitches at runtime.
///
public static readonly CVarDef ResTexturePreloadingEnabled =
CVarDef.Create("res.texturepreloadingenabled", true, CVar.CLIENTONLY);
///
/// Upper limit on the size of the RSI atlas texture. A lower limit might waste less vram, but start to defeat
/// the purpose of using an atlas if it gets too small.
///
public static readonly CVarDef ResRSIAtlasSize =
CVarDef.Create("res.rsi_atlas_size", 12288, CVar.CLIENTONLY);
// TODO: Currently unimplemented.
///
/// Cache texture preload data to speed things up even further.
///
public static readonly CVarDef ResTexturePreloadCache =
CVarDef.Create("res.texture_preload_cache", true, CVar.CLIENTONLY);
///
/// Override seekability of resource streams returned by ResourceManager.
/// See for int values.
///
///
/// This is intended to be a debugging tool primarily.
/// Non-default seek modes WILL result in worse performance.
///
public static readonly CVarDef ResStreamSeekMode =
CVarDef.Create("res.stream_seek_mode", (int)StreamSeekMode.None);
///
/// Whether to watch prototype files for prototype reload on the client. Only applies to development builds.
///
///
/// The client sends a reload signal to the server on refocus, if you're wondering why this is client-only.
///
public static readonly CVarDef ResPrototypeReloadWatch =
CVarDef.Create("res.prototype_reload_watch", true, CVar.CLIENTONLY);
///
/// If true, do a warning check at startup for probably-erroneous file extensions like .yaml in resources.
///
///
/// This check is always skipped on FULL_RELEASE.
///
public static readonly CVarDef ResCheckBadFileExtensions =
CVarDef.Create("res.check_bad_file_extensions", true);
/*
* DEBUG
*/
///
/// Target framerate for things like the frame graph.
///
public static readonly CVarDef DebugTargetFps =
CVarDef.Create("debug.target_fps", 60, CVar.CLIENTONLY | CVar.ARCHIVE);
/*
* MIDI
*/
public static readonly CVarDef MidiVolume =
CVarDef.Create("midi.volume", 0.50f, CVar.CLIENTONLY | CVar.ARCHIVE);
///
/// Controls amount of CPU cores and (by extension) polyphony for Fluidsynth.
///
///
/// You probably don't want to set this to be multithreaded, the way Fluidsynth's multithreading works is
/// probably worse-than-nothing for Robust's usage.
///
public static readonly CVarDef MidiParallelism =
CVarDef.Create("midi.parallelism", 1, CVar.CLIENTONLY | CVar.ARCHIVE);
/*
* HUB
* CVars related to public master server hub
*/
///
/// Whether to advertise this server to the public server hub.
///
public static readonly CVarDef HubAdvertise =
CVarDef.Create("hub.advertise", false, CVar.SERVERONLY);
///
/// Comma-separated list of tags to advertise via the status server (and therefore, to the hub).
///
public static readonly CVarDef HubTags =
CVarDef.Create("hub.tags", "", CVar.ARCHIVE | CVar.SERVERONLY);
///
/// Comma-separated list of URLs of hub servers to advertise to.
///
public static readonly CVarDef HubUrls =
CVarDef.Create("hub.hub_urls", "https://hub.spacestation14.com/", CVar.SERVERONLY);
///
/// URL of this server to advertise.
/// This is automatically inferred by the hub server based on IP address if left empty,
/// but if you want to specify a domain or use ss14:// you should specify this manually.
/// You also have to set this if you change status.bind.
///
public static readonly CVarDef HubServerUrl =
CVarDef.Create("hub.server_url", "", CVar.SERVERONLY);
///
/// URL to use to automatically try to detect IPv4 address.
/// This is only used if hub.server_url is unset.
///
public static readonly CVarDef HubIpifyUrl =
CVarDef.Create("hub.ipify_url", "https://api.ipify.org?format=json", CVar.SERVERONLY);
///
/// How long to wait between advertise pings to the hub server.
///
public static readonly CVarDef HubAdvertiseInterval =
CVarDef.Create("hub.advertise_interval", 120, CVar.SERVERONLY);
/*
* ACZ
*/
///
/// Whether to use stream compression instead of per-file compression when transmitting ACZ data.
/// Enabling stream compression significantly reduces bandwidth usage of downloads,
/// but increases server and launcher CPU load. It also makes final files stored on the client compressed less.
///
public static readonly CVarDef AczStreamCompress =
CVarDef.Create("acz.stream_compress", false, CVar.SERVERONLY);
///
/// ZSTD Compression level to use when doing ACZ stream compressed.
///
public static readonly CVarDef AczStreamCompressLevel =
CVarDef.Create("acz.stream_compress_level", 3, CVar.SERVERONLY);
///
/// Whether to do compression on individual files for ACZ downloads.
/// Automatically forced off if stream compression is enabled.
///
public static readonly CVarDef AczBlobCompress =
CVarDef.Create("acz.blob_compress", true, CVar.SERVERONLY);
///
/// ZSTD Compression level to use for individual file compression.
///
public static readonly CVarDef AczBlobCompressLevel =
CVarDef.Create("acz.blob_compress_level", 14, CVar.SERVERONLY);
// Could consider using a ratio for this?
///
/// Amount of bytes that need to be saved by compression for the compression to be "worth it".
///
public static readonly CVarDef AczBlobCompressSaveThreshold =
CVarDef.Create("acz.blob_compress_save_threshold", 14, CVar.SERVERONLY);
///
/// Whether to ZSTD compress the ACZ manifest.
/// If this is enabled (the default) then non-compressed manifest requests will be decompressed live.
///
public static readonly CVarDef AczManifestCompress =
CVarDef.Create("acz.manifest_compress", true, CVar.SERVERONLY);
///
/// Compression level for ACZ manifest compression.
///
public static readonly CVarDef AczManifestCompressLevel =
CVarDef.Create("acz.manifest_compress_level", 14, CVar.SERVERONLY);
/*
* CON
*/
///
/// Add artificial delay (in seconds) to console completion fetching, even for local commands.
///
///
/// Intended for debugging the console completion system.
///
public static readonly CVarDef ConCompletionDelay =
CVarDef.Create("con.completion_delay", 0f, CVar.CLIENTONLY);
///
/// The amount of completions to show in console completion drop downs.
///
public static readonly CVarDef ConCompletionCount =
CVarDef.Create("con.completion_count", 15, CVar.CLIENTONLY);
///
/// The minimum margin of options to keep on either side of the completion cursor, when scrolling through.
///
public static readonly CVarDef ConCompletionMargin =
CVarDef.Create("con.completion_margin", 3, CVar.CLIENTONLY);
///
/// Maximum amount of entries stored by the debug console.
///
public static readonly CVarDef ConMaxEntries =
CVarDef.Create("con.max_entries", 3_000, CVar.CLIENTONLY);
/*
* THREAD
*/
///
/// The nominal parallel processing count to use for parallelized operations.
/// The default of 0 automatically selects the system's processor count.
///
public static readonly CVarDef ThreadParallelCount =
CVarDef.Create("thread.parallel_count", 0);
/*
* PROF
*/
///
/// Enabled the profiling system.
///
public static readonly CVarDef ProfEnabled = CVarDef.Create("prof.enabled", false);
///
/// Event log buffer size for the profiling system.
///
public static readonly CVarDef ProfBufferSize = CVarDef.Create("prof.buffer_size", 8192);
///
/// Index log buffer size for the profiling system.
///
public static readonly CVarDef ProfIndexSize = CVarDef.Create("prof.index_size", 128);
/*
* Replays
*/
///
/// A relative path pointing to a folder within the server data directory where all replays will be stored.
///
public static readonly CVarDef ReplayDirectory = CVarDef.Create("replay.directory", "replays",
CVar.ARCHIVE);
///
/// Maximum compressed size of a replay recording (in kilobytes) before recording automatically stops.
///
public static readonly CVarDef ReplayMaxCompressedSize = CVarDef.Create("replay.max_compressed_size",
1024L * 512, CVar.ARCHIVE);
///
/// Maximum uncompressed size of a replay recording (in kilobytes) before recording automatically stops.
///
public static readonly CVarDef ReplayMaxUncompressedSize = CVarDef.Create("replay.max_uncompressed_size",
1024L * 1024, CVar.ARCHIVE);
///
/// Size of the replay (in kilobytes) at which point the replay is considered "large",
/// and replay clients should enable server GC (if possible) to improve performance.
///
///
/// Set to -1 to never make replays use server GC.
///
public static readonly CVarDef ReplayServerGCSizeThreshold =
CVarDef.Create("replay.server_gc_size_threshold", 50L * 1024);
///
/// Uncompressed size of individual files created by the replay (in kilobytes), where each file contains data
/// for one or more ticks. Actual files may be slightly larger, this is just a threshold for the file to get
/// written. After compressing, the files are generally ~30% of their uncompressed size.
///
public static readonly CVarDef ReplayTickBatchSize = CVarDef.Create("replay.replay_tick_batchSize",
1024, CVar.ARCHIVE);
///
/// The max amount of pending write commands while recording replays.
///
public static readonly CVarDef ReplayWriteChannelSize = CVarDef.Create("replay.write_channel_size", 5);
///
/// Whether or not server-side replay recording is enabled.
///
public static readonly CVarDef ReplayServerRecordingEnabled = CVarDef.Create(
"replay.server_recording_enabled",
true,
CVar.SERVERONLY | CVar.ARCHIVE);
///
/// Whether or not client-side replay recording is enabled.
///
public static readonly CVarDef ReplayClientRecordingEnabled = CVarDef.Create(
"replay.client_recording_enabled",
true,
CVar.SERVER | CVar.REPLICATED | CVar.ARCHIVE);
///
/// How many milliseconds we will spend moving forward from the nearest checkpoint or current position.
/// We will spend this time when scrubbing the timeline per game tick. This limits CPU usage / locking up and
/// improves responsiveness
///
public static readonly CVarDef ReplayMaxScrubTime = CVarDef.Create("replay.max_scrub_time", 10);
///
/// Determines the threshold before visual events (muzzle flashes, chat pop-ups, etc) are suppressed when
/// jumping forward in time. Jumps larger than this will simply skip directly to the target tick.
///
public static readonly CVarDef ReplaySkipThreshold = CVarDef.Create("replay.skip_threshold", 30);
///
/// Minimum number of ticks before a new checkpoint tick is generated (overrides SpawnThreshold and StateThreshold)
///
public static readonly CVarDef CheckpointMinInterval = CVarDef.Create("replay.checkpoint_min_interval", 60);
///
/// Maximum number of ticks before a new checkpoint tick is generated.
///
public static readonly CVarDef CheckpointInterval = CVarDef.Create("replay.checkpoint_interval", 500);
///
/// Maximum number of entities that can be spawned before a new checkpoint tick is generated.
///
public static readonly CVarDef CheckpointEntitySpawnThreshold = CVarDef.Create("replay.checkpoint_entity_spawn_threshold", 1000);
///
/// Maximum number of entity states that can be applied before a new checkpoint tick is generated.
///
public static readonly CVarDef CheckpointEntityStateThreshold = CVarDef.Create("replay.checkpoint_entity_state_threshold", 50 * 600);
///
/// Whether or not to constantly apply game states while using something like a slider to scrub through replays.
/// If false, this will only jump to a point in time when the scrubbing ends.
///
public static readonly CVarDef ReplayDynamicalScrubbing = CVarDef.Create("replay.dynamical_scrubbing", true);
///
/// When recording replays, should we attempt to make a valid content bundle that can be directly executed by
/// the launcher?
///
///
/// This requires the server's build information to be sufficiently filled out.
///
public static readonly CVarDef ReplayMakeContentBundle =
CVarDef.Create("replay.make_content_bundle", true);
///
/// If true, this will cause the replay client to ignore some errors while loading a replay file.
///
///
/// This might make otherwise broken replays playable, but ignoring these errors is also very likely to
/// cause unexpected and confusing errors elsewhere. By default this is disabled so that users report the
/// original exception rather than sending people on a wild-goose chase to find a non-existent bug.
///
public static readonly CVarDef ReplayIgnoreErrors =
CVarDef.Create("replay.ignore_errors", false, CVar.CLIENTONLY);
/*
* CFG
*/
///
/// If set, check for any unknown CVars once the game is initialized to try the spot any unknown ones.
///
///
/// CVars can be dynamically registered instead of just being statically known ahead of time,
/// so the engine is not capable of immediately telling if a CVar is a typo or such.
/// This check after game initialization assumes all CVars have been registered,
/// and will complain if anything unknown is found (probably indicating a typo of some kind).
///
public static readonly CVarDef CfgCheckUnused = CVarDef.Create("cfg.check_unused", true);
///
/// Storage for CVars that should be rolled back next client startup.
///
///
/// This CVar is utilized through 's rollback functionality.
///
internal static readonly CVarDef
CfgRollbackData = CVarDef.Create("cfg.rollback_data", "", CVar.ARCHIVE);
/*
* Network Resource Manager
*/
///
/// Controls whether new resources can be uploaded by admins.
/// Does not prevent already uploaded resources from being sent.
///
public static readonly CVarDef ResourceUploadingEnabled =
CVarDef.Create("netres.enabled", true, CVar.REPLICATED | CVar.SERVER);
///
/// Controls the data size limit in megabytes for uploaded resources. If they're too big, they will be dropped.
/// Set to zero or a negative value to disable limit.
///
public static readonly CVarDef ResourceUploadingLimitMb =
CVarDef.Create("netres.limit", 3f, CVar.REPLICATED | CVar.SERVER);
/*
* LAUNCH
* CVars relating to how the client is launched. Primarily set from the launcher.
*/
///
/// Game was launched from the launcher.
///
///
/// The game should not try to automatically connect to a server, there's other variables for that.
///
public static readonly CVarDef LaunchLauncher =
CVarDef.Create("launch.launcher", false, CVar.CLIENTONLY);
///
/// Game was launched from a content bundle.
///
public static readonly CVarDef LaunchContentBundle =
CVarDef.Create("launch.content_bundle", false, CVar.CLIENTONLY);
/*
* TOOLSHED
*/
///