Skip to content

feat(config): add extraparams to all game server configs - #4970

Open
borzaka wants to merge 1 commit into
GameServerManagers:developfrom
borzaka:feat/add-extraparams
Open

borzaka wants to merge 1 commit into
GameServerManagers:developfrom
borzaka:feat/add-extraparams

Conversation

@borzaka

@borzaka borzaka commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds an extraparams variable to every game server's _default.cfg and appends it to the end of startparameters.

Users can now add their own start parameters in instance.cfg (or common.cfg) without copying and overriding the whole startparameters line. They also keep getting future upstream changes to the default parameters.

# lgsm/config-lgsm/cs2server/cs2server.cfg
extraparams="+sv_lan 1"

Details:

  • extraparams="" is the last entry of the ## Predefined Parameters block in all 143 server configs. Configs that had no such block got one.
  • Every startparameters now ends with ${extraparams}. The default is empty, so nothing changes unless the user sets it.
  • The commented-out alternative startparameters lines (hcuserver, kfserver) include it too.
  • kf2server: ${extraparams} sits inside the escaped quotes, next to -QueryPort, which is also inside them.

This revives #2120 (first opened in 2018 as #2084) on top of the current develop branch, squashed into a single commit. The original implementation was co-authored by @Frisasky.

Fixes #2183
Supersedes #2120

Type of change

  • Bug fix (a change which fixes an issue).
  • New feature (a change which adds functionality).
  • New Server (new server added).
  • Refactor (restructures existing code).
  • Comment update (typo, spelling, explanation, examples, etc).

Testing

Please list the exact validation you performed and the outcome.

  • Commands/tests run:
    • bash -n on all 143 _default.cfg files.
    • Simulated fn_reload_startparameters() for every config. Each test sourced _default.cfg, set extraparams="-lgsmtest a -lgsmtest2 b" the way an instance config would, and re-evaluated the startparameters line the same way linuxgsm.sh does (eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' ...)").
    • Compared each config against develop to confirm that startparameters is unchanged apart from the appended ${extraparams}.
    • git diff --check.
  • Result:
    • bash -n: no syntax errors.
    • Simulation: 143/143 configs end with the user's extra parameters. The default extraparams is empty in all configs.
    • Comparison with develop: 143/143 changed only by the appended ${extraparams}.
    • git diff --check: no whitespace issues.
    • No game servers were actually started; the Details Check workflow will run for all affected servers.
  • Environment used (distro/version): Ubuntu 22.04.5 LTS, bash 5.1.16

Risk and rollback

  • Risk level: low
    • With the default empty value, startparameters only gains a trailing space, which shell word splitting drops. The one exception is kf2server, where the space lands inside the quoted argument.
    • Users who already override startparameters in their instance config are not affected.
  • Rollback plan: revert the single commit. No data or config migration is involved.

Breaking changes

  • No breaking changes.
  • Breaking changes included (describe below).

Documentation impact

  • No documentation update required.
  • User documentation update required.
  • Developer documentation update required.

The start parameters page (https://docs.linuxgsm.com/configuration/start-parameters) should describe extraparams.

Checklist

PR will not be merged until all steps are complete.

  • This pull request links to an issue.
  • This pull request uses the develop branch as its base.
  • This pull request subject follows the Conventional Commits standard.
  • This code follows the style guidelines of this project.
  • I have performed a self-review of my code.
  • I have provided a detailed enough description of this PR.

Documentation

If documentation does need updating either update it by creating a PR (preferred) or request a documentation update.

Thank you for your Pull Request!

🤖 Generated with Claude Code

Add an `extraparams` variable to every game server's _default.cfg so users can append custom start parameters from their instance.cfg without copying and overriding the whole `startparameters` line.

`extraparams=""` is the last entry of the "Predefined Parameters" block in every config, and every `startparameters` ends with `${extraparams}`.

Supersedes GameServerManagers#2120.

Co-authored-by: Frisasky <digimoncn@gmail.com>
@borzaka
borzaka force-pushed the feat/add-extraparams branch from 8dbe659 to 57ad717 Compare October 11, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extra Parameters Option

1 participant