File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,5 +20,9 @@ elif [ "$GENERATE_SETTINGS" = "false" ]; then
2020 LogWarn " GENERATE_SETTINGS=false, not overwriting settings"
2121fi
2222
23+ # Always update MAX_PLAYERS setting regardless of GENERATE_SETTINGS
24+ LogAction " Updating MAX_PLAYERS setting"
25+ /home/steam/server/update-max-players.sh
26+
2327LogAction " Starting server"
2428su steam -c " ./FactoryServer.sh -Port=${GAME_PORT} -ReliablePort=${RELIABLE_PORT} -ExternalReliablePort=${RELIABLE_PORT} -ini:Engine:[HTTPServer.Listeners]:DefaultBindAddress=any"
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # shellcheck source=scripts/functions.sh
3+ source " /home/steam/server/functions.sh"
4+
5+ config_file=" /satisfactory/FactoryGame/Saved/Config/LinuxServer/Game.ini"
6+
7+ MAX_PLAYERS=${MAX_PLAYERS:- 8}
8+
9+ if [ -f " $config_file " ] && grep -q " ^MaxPlayers=" " $config_file " ; then
10+ sed -i " s/^MaxPlayers=.*/MaxPlayers=$MAX_PLAYERS /" " $config_file "
11+ elif [ -f " $config_file " ] && grep -q " ^\[/Script/Engine.GameSession\]" " $config_file " ; then
12+ sed -i " /^\[\/Script\/Engine.GameSession\]/a MaxPlayers=$MAX_PLAYERS " " $config_file "
13+ else
14+ cat >> " $config_file " << EOF
15+
16+ [/Script/Engine.GameSession]
17+ MaxPlayers=$MAX_PLAYERS
18+ EOF
19+ fi
You can’t perform that action at this time.
0 commit comments