From b15239eeae334fed258dab7d9aa7019a36a698bc Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 18 Nov 2023 22:34:53 +0000 Subject: [PATCH 1/3] fix(rust): add default-terminal setting for Oxide This commit fixes issue #4268 by adding the line "set -g default-terminal "screen-256color"" to the ~/.tmux.conf file. This ensures compatibility with tmux version 3.3 or higher when running RustDedicated servers with Oxide.Rust.dll. --- lgsm/modules/fix_rust.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lgsm/modules/fix_rust.sh b/lgsm/modules/fix_rust.sh index 6d4cebc01c..c64e16c612 100644 --- a/lgsm/modules/fix_rust.sh +++ b/lgsm/modules/fix_rust.sh @@ -30,3 +30,23 @@ 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 From c7e2ac92057331b4ca89b8e223dc0e5e27bfa2d2 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 19 Nov 2023 11:45:13 +0000 Subject: [PATCH 2/3] add gamelog to start parameters --- lgsm/config-default/config-lgsm/rustserver/_default.cfg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/rustserver/_default.cfg b/lgsm/config-default/config-lgsm/rustserver/_default.cfg index e045777921..2652bc5970 100644 --- a/lgsm/config-default/config-lgsm/rustserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rustserver/_default.cfg @@ -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 #### @@ -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" From 9339d87d79f1a6af62f89d6bd157b755d2e7764b Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 19 Nov 2023 11:46:27 +0000 Subject: [PATCH 3/3] tidy --- lgsm/modules/fix_rust.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/lgsm/modules/fix_rust.sh b/lgsm/modules/fix_rust.sh index c64e16c612..809b5b1df0 100644 --- a/lgsm/modules/fix_rust.sh +++ b/lgsm/modules/fix_rust.sh @@ -36,7 +36,6 @@ fi 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" @@ -46,7 +45,6 @@ if [ -f "${serverfiles}/RustDedicated_Data/Managed/Oxide.Rust.dll" ]; then fn_fix_msg_start echo "set -g default-terminal \"screen-256color\"" >> "${HOME}/.tmux.conf" fn_fix_msg_end - fi fi fi