Skip to content

Introduce server.toml#71

Merged
cb341 merged 16 commits intomainfrom
feature/config
Feb 1, 2026
Merged

Introduce server.toml#71
cb341 merged 16 commits intomainfrom
feature/config

Conversation

@cb341
Copy link
Owner

@cb341 cb341 commented Feb 1, 2026

Server config 🥰

$ car rs config
Actions regarding server configuration

Usage: server config <COMMAND>

Commands:
  init      Initialize config file with default settings
  show      Show currently applied configuration
  defaults  Show defaults
  help      Print this message or the help of the given subcommand(s)

Options:
  -h, --help  Print help

Allows setting partial configs:

# server.toml
[world]
backups_dir = "/dev/null"

Defaults:

[world]
backups_dir = "backups/"
worlds_dir = "worlds/"
world_extension = ".rsmcw"
world_save_interval_seconds = 30
world_backup_interval_seconds = 180
spawn_area_distance = [4, 3, 4]

[generator.height]
splines = [[-1.0, 4.0], [0.0, 0.0], [0.0, 0.0], [0.05, 20.0], [1.0, 35.0]]

[generator.height.noise]
octaves = 4
height = 0.0
lacuranity = 2.0
frequency = 0.0033333333333333335
amplitude = 30.0
persistence = 0.5

[generator.height_adjust.noise]
octaves = 4
height = 0.0
lacuranity = 2.0
frequency = 0.008333333333333333
amplitude = 30.0
persistence = 0.5

[generator.density]
squash_factor = 0.01
height_offset = -20.0

[generator.density.noise]
octaves = 4
height = 0.0
lacuranity = 2.0
frequency = 0.016666666666666666
amplitude = 10.0
persistence = 0.5

[generator.cave]
base_value = 0.0
threshold = 0.25

[generator.cave.noise]
octaves = 2
height = 0.0
lacuranity = 0.03
frequency = 0.05
amplitude = 30.0
persistence = 0.59

[generator.tree]
spawn_attempts_per_chunk = 500
min_stump_height = 2
max_stump_height = 20
min_bush_radius = 3
max_bush_radius = 5

[generator.grass]
frequency = 10

Error handling

Invalid TOML

$ car rs config show
Could not parse config file at 'server.toml'
Err: TOML parse error at line 9, column 18
  |
9 | [generator.height
  |                  ^
unclosed table, expected `]`

Invalid Field

$ car rs config show
Could not parse config file at 'server.toml'
Err: TOML parse error at line 8, column 1
  |
8 | foo_bar = "676767"
  | ^^^^^^^
unknown field `foo_bar`, expected one of `backups_dir`, `worlds_dir`, `world_extension`, `world_save_interval_seconds`, `world_backup_interval_seconds`, `spawn_area_distance`

@cb341 cb341 self-assigned this Feb 1, 2026
@cb341 cb341 changed the title Feature/config Introduce Server Side Configuration Feb 1, 2026
@cb341 cb341 marked this pull request as ready for review February 1, 2026 16:43
@cb341 cb341 changed the title Introduce Server Side Configuration Introduce server.toml Feb 1, 2026
@cb341 cb341 merged commit 4c4e451 into main Feb 1, 2026
3 checks passed
@cb341 cb341 deleted the feature/config branch February 1, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant