Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rust): add default-terminal setting for Oxide #4383

Merged
merged 3 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lgsm/config-default/config-lgsm/rustserver/_default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ saveinterval="300" # Auto-save in seconds.
tickrate="30" # default: 30, range: 15-100.

## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
startparameters="-batchmode +app.listenip ${ip} +app.port ${appport} +server.ip ${ip} +server.port ${port} +server.queryport ${queryport} +server.tickrate ${tickrate} +server.hostname \"${servername}\" +server.identity \"${selfname}\" +server.gamemode ${gamemode} +server.level \"${serverlevel}\" +server.seed ${seed} +server.salt ${salt} +server.maxplayers ${maxplayers} +server.worldsize ${worldsize} +server.saveinterval ${saveinterval} +rcon.web ${rconweb} +rcon.ip ${ip} +rcon.port ${rconport} +rcon.password \"${rconpassword}\" -logfile"
startparameters="-batchmode +app.listenip ${ip} +app.port ${appport} +server.ip ${ip} +server.port ${port} +server.queryport ${queryport} +server.tickrate ${tickrate} +server.hostname \"${servername}\" +server.identity \"${selfname}\" +server.gamemode ${gamemode} +server.level \"${serverlevel}\" +server.seed ${seed} +server.salt ${salt} +server.maxplayers ${maxplayers} +server.worldsize ${worldsize} +server.saveinterval ${saveinterval} +rcon.web ${rconweb} +rcon.ip ${ip} +rcon.port ${rconport} +rcon.password \"${rconpassword}\" -logfile ${gamelog}"

#### LinuxGSM Settings ####

Expand Down Expand Up @@ -184,6 +184,7 @@ backupdir="${lgsmdir}/backup"
gamelogdir="${logdir}/server"
lgsmlogdir="${logdir}/script"
consolelogdir="${logdir}/console"
gamelog="${gamelogdir}/${selfname}-game.log"
lgsmlog="${lgsmlogdir}/${selfname}-script.log"
consolelog="${consolelogdir}/${selfname}-console.log"
alertlog="${lgsmlogdir}/${selfname}-alert.log"
Expand Down
18 changes: 18 additions & 0 deletions lgsm/modules/fix_rust.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,21 @@ if [ -f "${serverfiles}/carbon/tools/environment.sh" ]; then
# shellcheck source=/dev/null
source "${serverfiles}/carbon/tools/environment.sh"
fi

# fix for #4268
# insert set -g default-terminal "screen-256color" into ~/.tmux.conf
if [ -f "${serverfiles}/RustDedicated_Data/Managed/Oxide.Rust.dll" ]; then
# tmux version is 3.3 or higher
tmuxvdigit="$(tmux -V | sed "s/tmux //" | sed -n '1 p' | tr -cd '[:digit:]')"
if [ "${tmuxvdigit}" -ge "33" ]; then
if [ ! -f "${HOME}/.tmux.conf" ]; then
touch "${HOME}/.tmux.conf"
fi
if ! grep -q "set -g default-terminal \"screen-256color\"" "${HOME}/.tmux.conf"; then
fixname="tmux screen-256color"
fn_fix_msg_start
echo "set -g default-terminal \"screen-256color\"" >> "${HOME}/.tmux.conf"
fn_fix_msg_end
fi
fi
fi