Jump to content

Grimwar/Dedicated servers: Difference between revisions

From Vellocet Developer Community
Initialize Vellocet Developer Community
 
Publish SDK documentation
 
Line 1: Line 1:
{{GameNav}}
{{GameNav}}
{{Draft}}
Community dedicated servers use an isolated writable data directory for configuration, addons, state, cache, replays, and secrets. Game installation files remain read-only and replaceable.


Community dedicated servers use file-based configuration, isolated mutable data directories, deterministic map rotation, and the same addon validation rules as the client.
== Create the server data directory ==


== Operator checklist ==
Assign a different absolute data directory to each server process:


# Install the current dedicated-server build.
<syntaxhighlight lang="text">
# Complete the first-run preflight to create configuration and secret directories.
GrimwarServer --data-dir /srv/grimwar/community-1 --server-preflight-only
# Set identity, networking, ruleset, and rotation configuration.
</syntaxhighlight>
# Configure direct Workshop items, collections, or manually staged release packages.
# Keep secrets outside ordinary configuration files and restrict filesystem permissions.
# Review server, Workshop, content-delivery, and networking diagnostics before opening the server publicly.


== Documentation areas ==
The preflight checks the server runtime and creates missing operator files, then exits. A normal first launch creates the same layout. Existing operator files are not overwritten.


* Data directories and configuration precedence
Use <code>--instance-id &lt;id&gt;</code> instead when the default per-user server location is appropriate. <code>GRIMWAR_DATA_DIR</code> and <code>GRIMWAR_INSTANCE_ID</code> provide the corresponding environment settings. Do not point two running servers at one data directory.
* Map rotation and game modes
 
* Addon acquisition and updates
Run <code>cmdlhelp</code> in server console for the command-line contract and <code>cfg_paths</code> for the resolved install, data, config, secret, addon, replay, state, and cache paths.
* Administration and permissions
 
* Logs and diagnostics
== Operator files ==
* Backup and upgrade procedures
 
The generated layout includes:
 
{| class="wikitable"
! Path !! Purpose
|-
| <code>config/server.cfg</code> || Base non-secret server settings.
|-
| <code>config/server.d/</code> || Split non-secret configuration files.
|-
| <code>config/rulesets/</code> || Operator-defined rulesets.
|-
| <code>config/modes/</code> || Per-mode overrides.
|-
| <code>config/maps/</code> || Per-map overrides.
|-
| <code>config/autoexec.cfg</code> || Final non-secret overrides.
|-
| <code>config/rotation.json</code> || Startup map and rotation selection.
|-
| <code>config/server-addons.json</code> || Workshop items, manual bindings, and collections.
|-
| <code>config/mods/</code> || VMod Admin groups, users, and operator-owned mod configuration.
|-
| <code>secrets/server.secrets.cfg</code> || Sensitive settings such as the RCON password.
|-
| <code>secrets/server.secrets.d/</code> || Split sensitive configuration files.
|}
 
The server applies <code>server.cfg</code> and <code>server.d</code>, the selected ruleset, mode and map overrides, <code>autoexec.cfg</code>, command-line overrides, secret files, then deployment overrides. Run authenticated <code>cfg_reload</code> to reapply the stack.
 
Keep passwords and tokens out of <code>server.cfg</code>. Sensitive commands found in an ordinary config layer are ignored.
 
== Basic configuration ==
 
Uncomment only the settings you need in <code>config/server.cfg</code>. For example:
 
<syntaxhighlight lang="text">
sv_ruleset casual
bot_quota 0
mp_timelimit 0
mp_roundtime 0
mp_winlimit 0
mp_maxrounds 0
</syntaxhighlight>
 
Community and listen servers default to the bundled <code>casual</code> ruleset. A custom ruleset goes in <code>config/rulesets/&lt;name&gt;.cfg</code> and may inherit another ruleset:
 
<syntaxhighlight lang="text">
// config/rulesets/community_plus.cfg
exec rulesets/casual.cfg
mp_allowspectators 0
</syntaxhighlight>
 
Select it with <code>sv_ruleset community_plus</code>. During a live or overtime round, a change applies at the next round boundary unless <code>now</code> is supplied.
 
== Configure RCON ==
 
Put RCON settings in <code>secrets/server.secrets.cfg</code>:
 
<syntaxhighlight lang="text">
rcon_enable 1
rcon_password "use-a-long-unique-password"
rcon_port 27015
rcon_maxclients 3
rcon_timeout 30
rcon_failures 3
rcon_ban_time 300
rcon_log 1
</syntaxhighlight>
 
Restrict access to the secret directory at the operating-system level. Expose the RCON TCP port only to administrator addresses or a private network. Do not reuse the server password or a Steam credential as the RCON password.
 
== Configure map rotation ==
 
The default <code>whitelist</code> mode uses entries in file order:
 
<syntaxhighlight lang="json">
{
  "listMode": "whitelist",
  "entries": [
    "as_compound",
    "community_castle"
  ]
}
</syntaxhighlight>
 
Use internal map IDs from the package manifests. The server skips unavailable entries after addon synchronization and selects the first loadable entry. Startup fails when no entry can be loaded.
 
Set <code>listMode</code> to <code>blacklist</code> to rotate every registered map except the named entries:
 
<syntaxhighlight lang="json">
{
  "listMode": "blacklist",
  "entries": [
    "as_compound",
    "community_ruins"
  ]
}
</syntaxhighlight>
 
Blacklist expansion occurs after Workshop synchronization, so installed addon maps participate. Excluding every registered map is a startup error. Use <code>changelevel &lt;map&gt; [mode]</code> from authenticated console or RCON for an immediate manual change.
 
== Install Workshop maps ==
 
Configure direct items and collections in <code>config/server-addons.json</code>. Store all Steam IDs as JSON strings:
 
<syntaxhighlight lang="json">
{
  "schemaVersion": 1,
  "workshop": {
    "depotId": "",
    "items": [
      "1234567890"
    ],
    "manualItems": [],
    "collections": [
      "3456789012"
    ]
  }
}
</syntaxhighlight>
 
<code>items</code> contains Workshop published-file IDs acquired by Steam. <code>collections</code> contains collection IDs; the server expands and installs their child items. Clients subscribe only to the addon required by the current map, not the whole collection.
 
Leave <code>depotId</code> empty unless Vellocet support directs you to override it. Grimwar supplies the fixed dedicated-server depot value.
 
=== Manually staged Workshop package ===
 
An operator can place an exact Workshop Release package below <code>&lt;data&gt;/addons</code> and bind it to the published item:
 
<syntaxhighlight lang="json">
{
  "schemaVersion": 1,
  "workshop": {
    "depotId": "",
    "items": [],
    "manualItems": [
      {
        "publishedFileId": "1234567890",
        "addonId": "community_castle"
      }
    ],
    "collections": []
  }
}
</syntaxhighlight>
 
Put an identity in exactly one acquisition list. The staged package must match the exact build currently uploaded to the Workshop item. Replace it after every Workshop update. Clients still download the Steam item; they never receive files from the server's staged folder.
 
== Install VMods ==
 
# Run <code>vmod_runtime_paths</code> and use the printed addon directory.
# Copy the complete VMod addon folder below <code>&lt;data&gt;/addons</code>.
# Restart, or run <code>vmod_runtime_reload</code> while no scripted mode is active.
# Confirm the package with <code>vmod_runtime_list</code>.
 
VMod-only packages are server-only and are not currently acquired through Workshop. Admin users and groups live below <code>&lt;data&gt;/config/mods</code>. See [[Grimwar/VMod|VMod scripting and administration]].
 
== Startup and diagnostics ==
 
Before opening the server publicly:
 
# Run preflight with the production data directory and deployment port mapping.
# Start the server and confirm it reaches its ready/listening state.
# Run <code>status -v</code> and verify role, build, protocol, transport, map, mode, ruleset, data path, and player limit.
# Run <code>cfg_paths</code> and confirm the expected data and secret roots.
# Check that every rotation map is registered after Workshop synchronization.
# Join with a separate Steam account and test authentication, map delivery, round transition, and map change.
# Test RCON from an allowed administrator address.
 
Useful log prefixes are <code>[ServerWorkshop]</code> for server acquisition and activation, <code>[WorkshopDL]</code> for exact client/server addon matching, <code>[SteamWorkshop]</code> for Steam installation, <code>[ContentDL]</code> for provider selection, and <code>[Net]</code> for pre-login requirements. Set <code>net_log 2</code> when per-addon network identities are needed.
 
Back up the data directory before game or addon updates. It contains operator configuration, VMod state, source selections, bans, and other mutable server data. The game install directory is not a substitute for that backup.


[[Category:Grimwar]] [[Category:Dedicated servers]]
[[Category:Grimwar]] [[Category:Dedicated servers]]

Latest revision as of 01:13, 25 August 2026

Community dedicated servers use an isolated writable data directory for configuration, addons, state, cache, replays, and secrets. Game installation files remain read-only and replaceable.

Create the server data directory

Assign a different absolute data directory to each server process:

GrimwarServer --data-dir /srv/grimwar/community-1 --server-preflight-only

The preflight checks the server runtime and creates missing operator files, then exits. A normal first launch creates the same layout. Existing operator files are not overwritten.

Use --instance-id <id> instead when the default per-user server location is appropriate. GRIMWAR_DATA_DIR and GRIMWAR_INSTANCE_ID provide the corresponding environment settings. Do not point two running servers at one data directory.

Run cmdlhelp in server console for the command-line contract and cfg_paths for the resolved install, data, config, secret, addon, replay, state, and cache paths.

Operator files

The generated layout includes:

Path Purpose
config/server.cfg Base non-secret server settings.
config/server.d/ Split non-secret configuration files.
config/rulesets/ Operator-defined rulesets.
config/modes/ Per-mode overrides.
config/maps/ Per-map overrides.
config/autoexec.cfg Final non-secret overrides.
config/rotation.json Startup map and rotation selection.
config/server-addons.json Workshop items, manual bindings, and collections.
config/mods/ VMod Admin groups, users, and operator-owned mod configuration.
secrets/server.secrets.cfg Sensitive settings such as the RCON password.
secrets/server.secrets.d/ Split sensitive configuration files.

The server applies server.cfg and server.d, the selected ruleset, mode and map overrides, autoexec.cfg, command-line overrides, secret files, then deployment overrides. Run authenticated cfg_reload to reapply the stack.

Keep passwords and tokens out of server.cfg. Sensitive commands found in an ordinary config layer are ignored.

Basic configuration

Uncomment only the settings you need in config/server.cfg. For example:

sv_ruleset casual
bot_quota 0
mp_timelimit 0
mp_roundtime 0
mp_winlimit 0
mp_maxrounds 0

Community and listen servers default to the bundled casual ruleset. A custom ruleset goes in config/rulesets/<name>.cfg and may inherit another ruleset:

// config/rulesets/community_plus.cfg
exec rulesets/casual.cfg
mp_allowspectators 0

Select it with sv_ruleset community_plus. During a live or overtime round, a change applies at the next round boundary unless now is supplied.

Configure RCON

Put RCON settings in secrets/server.secrets.cfg:

rcon_enable 1
rcon_password "use-a-long-unique-password"
rcon_port 27015
rcon_maxclients 3
rcon_timeout 30
rcon_failures 3
rcon_ban_time 300
rcon_log 1

Restrict access to the secret directory at the operating-system level. Expose the RCON TCP port only to administrator addresses or a private network. Do not reuse the server password or a Steam credential as the RCON password.

Configure map rotation

The default whitelist mode uses entries in file order:

{
  "listMode": "whitelist",
  "entries": [
    "as_compound",
    "community_castle"
  ]
}

Use internal map IDs from the package manifests. The server skips unavailable entries after addon synchronization and selects the first loadable entry. Startup fails when no entry can be loaded.

Set listMode to blacklist to rotate every registered map except the named entries:

{
  "listMode": "blacklist",
  "entries": [
    "as_compound",
    "community_ruins"
  ]
}

Blacklist expansion occurs after Workshop synchronization, so installed addon maps participate. Excluding every registered map is a startup error. Use changelevel <map> [mode] from authenticated console or RCON for an immediate manual change.

Install Workshop maps

Configure direct items and collections in config/server-addons.json. Store all Steam IDs as JSON strings:

{
  "schemaVersion": 1,
  "workshop": {
    "depotId": "",
    "items": [
      "1234567890"
    ],
    "manualItems": [],
    "collections": [
      "3456789012"
    ]
  }
}

items contains Workshop published-file IDs acquired by Steam. collections contains collection IDs; the server expands and installs their child items. Clients subscribe only to the addon required by the current map, not the whole collection.

Leave depotId empty unless Vellocet support directs you to override it. Grimwar supplies the fixed dedicated-server depot value.

Manually staged Workshop package

An operator can place an exact Workshop Release package below <data>/addons and bind it to the published item:

{
  "schemaVersion": 1,
  "workshop": {
    "depotId": "",
    "items": [],
    "manualItems": [
      {
        "publishedFileId": "1234567890",
        "addonId": "community_castle"
      }
    ],
    "collections": []
  }
}

Put an identity in exactly one acquisition list. The staged package must match the exact build currently uploaded to the Workshop item. Replace it after every Workshop update. Clients still download the Steam item; they never receive files from the server's staged folder.

Install VMods

  1. Run vmod_runtime_paths and use the printed addon directory.
  2. Copy the complete VMod addon folder below <data>/addons.
  3. Restart, or run vmod_runtime_reload while no scripted mode is active.
  4. Confirm the package with vmod_runtime_list.

VMod-only packages are server-only and are not currently acquired through Workshop. Admin users and groups live below <data>/config/mods. See VMod scripting and administration.

Startup and diagnostics

Before opening the server publicly:

  1. Run preflight with the production data directory and deployment port mapping.
  2. Start the server and confirm it reaches its ready/listening state.
  3. Run status -v and verify role, build, protocol, transport, map, mode, ruleset, data path, and player limit.
  4. Run cfg_paths and confirm the expected data and secret roots.
  5. Check that every rotation map is registered after Workshop synchronization.
  6. Join with a separate Steam account and test authentication, map delivery, round transition, and map change.
  7. Test RCON from an allowed administrator address.

Useful log prefixes are [ServerWorkshop] for server acquisition and activation, [WorkshopDL] for exact client/server addon matching, [SteamWorkshop] for Steam installation, [ContentDL] for provider selection, and [Net] for pre-login requirements. Set net_log 2 when per-addon network identities are needed.

Back up the data directory before game or addon updates. It contains operator configuration, VMod state, source selections, bans, and other mutable server data. The game install directory is not a substitute for that backup.