Skip to content

introduce MAXPLAYERS environment variable#10

Merged
EvilOlaf merged 3 commits intomainfrom
maxplayers
Nov 27, 2025
Merged

introduce MAXPLAYERS environment variable#10
EvilOlaf merged 3 commits intomainfrom
maxplayers

Conversation

@EvilOlaf
Copy link
Owner

@EvilOlaf EvilOlaf commented Nov 27, 2025

  • Allows setting the max amount of players via docker-compose.yml instead of having hard-coded 32.
  • fallback is still 32

Summary by CodeRabbit

  • New Features
    • Maximum player count is now configurable via environment variable, with a default fallback of 32 players.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 27, 2025

Walkthrough

Introduces a configurable maximum player limit for a game server by adding an environment variable to the Docker Compose configuration and updating the server startup script to reference this variable with a default fallback value of 32.

Changes

Cohort / File(s) Summary
Configuration and startup script updates
docker-compose.yml, start-server.sh
Adds MAXPLAYERS=32 environment variable to the scum-server service; updates the server startup script to reference MAXPLAYERS with a fallback to 32 (-MaxPlayers=${MAXPLAYERS:-32}), replacing the previously hardcoded value

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

This is a straightforward configuration change with consistent variable substitution across two files. The fallback syntax is standard shell expansion, and the changes are self-contained with no complex logic or edge cases.

Poem

🐰 A player limit, now set free,
No longer chained to thirty-three!
With MAXPLAYERS in the air,
Configuration becomes so fair,
The server hops with graceful care.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: introducing a MAXPLAYERS environment variable for configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch maxplayers

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1b2c79e and 063dfd2.

📒 Files selected for processing (2)
  • docker-compose.yml (1 hunks)
  • start-server.sh (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (2)
start-server.sh (1)

30-30: ✓ Correct use of bash parameter expansion with appropriate fallback.

The change correctly implements a configurable environment variable with proper fallback behavior. The syntax ${MAXPLAYERS:-32} is idiomatic bash and maintains backward compatibility.

Verify that the game server (SCUMServer.exe) validates the MAXPLAYERS parameter to prevent misconfiguration if a user passes invalid values (e.g., non-numeric, zero, or negative numbers).

docker-compose.yml (1)

8-8: ✓ Environment variable correctly configured with appropriate default value.

The MAXPLAYERS variable is properly placed in the environment section and matches the fallback value defined in start-server.sh. This allows users to easily override the max player limit by modifying this value in docker-compose.yml.


Comment @coderabbitai help to get the list of available commands and usage tips.

@EvilOlaf EvilOlaf merged commit 58f3480 into main Nov 27, 2025
4 checks passed
@EvilOlaf EvilOlaf deleted the maxplayers branch November 27, 2025 16:51
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