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(kf): ensure newer steamclient.so is copied to serverfiles #4391

Merged
merged 4 commits into from
Nov 25, 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
2 changes: 1 addition & 1 deletion lgsm/config-default/config-lgsm/kfserver/_default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ steamcmdforcewindows="no"
branch=""
betapassword=""
# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server
steammaster="false"
steammaster="true"

## Stop Mode | https://docs.linuxgsm.com/features/stop-mode
# 1: tmux kill
Expand Down
4 changes: 2 additions & 2 deletions lgsm/modules/fix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ fn_apply_fix() {
fi
}

apply_pre_start_fix=(arma3 armar ark av bt bo csgo cmw dst hw ins nmrih onset pvr rust rw sdtd sfc sof2 squad st tf2 terraria ts3 mcb mta unt vh wurm zmr)
apply_post_install_fix=(av kf kf2 ro samp ut2k4 ut ut3)
apply_pre_start_fix=(arma3 armar ark av bt bo csgo cmw dst hw ins kf nmrih onset pvr rust rw samp sdtd sfc sof2 squad st tf2 terraria ts3 mcb mta unt vh wurm zmr)
apply_post_install_fix=(av kf kf2 ro ut2k4 ut ut3)

# validate registered fixes for safe development
for fix in "${apply_pre_start_fix[@]}" "${apply_post_install_fix[@]}"; do
Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/fix_armar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Website: https://linuxgsm.com
# Description: Resolves issues with Arma Reforger.

module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"

# Fixes: Profile directory doesn't exist.
# Issue Link: https://feedback.bistudio.com/T164845
Expand Down
129 changes: 105 additions & 24 deletions lgsm/modules/fix_kf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,111 @@

moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"

echo -e "applying WebAdmin ROOst.css fix."
echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13"
# echo -e "applying WebAdmin ROOst.css fix."
# echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13"
sed -i 's/none}/none;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css"
sed -i 's/underline}/underline;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css"
fn_sleep_time
echo -e "applying WebAdmin CharSet fix."
echo -e "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1"
# echo -e "applying WebAdmin CharSet fix."
# echo -e "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1"
sed -i 's/CharSet="iso-8859-1"/CharSet="utf-8"/g' "${systemdir}/UWeb.int"
fn_sleep_time
echo -e "applying server name fix."
fn_sleep_time
echo -e "forcing server restart..."
fn_sleep_time
exitbypass=1
command_start.sh
fn_firstcommand_reset
fn_sleep_time_5
exitbypass=1
command_stop.sh
fn_firstcommand_reset
exitbypass=1
command_start.sh
fn_firstcommand_reset
fn_sleep_time_5
exitbypass=1
command_stop.sh
fn_firstcommand_reset

# get md5sum of steamclient.so
if [ -f "${serverfiles}/System/steamclient.so" ]; then
steamclientmd5=$(md5sum "${serverfiles}/System/steamclient.so" | awk '{print $1;}')
fi
#get md5sum of libtier0_s.so
if [ -f "${serverfiles}/System/libtier0_s.so" ]; then
libtier0_smd5=$(md5sum "${serverfiles}/System/libtier0_s.so" | awk '{print $1;}')
fi
#get md5sum of libvstdlib_s.so
if [ -f "${serverfiles}/System/libvstdlib_s.so" ]; then
libvstdlib_smd5=$(md5sum "${serverfiles}/System/libvstdlib_s.so" | awk '{print $1;}')
fi

# get md5sum of steamclient.so from steamcmd
if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then
steamcmdsteamclientmd5=$(md5sum "${HOME}/.steam/steamcmd/linux32/steamclient.so" | awk '{print $1;}')
elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then
steamcmdsteamclientmd5=$(md5sum "${steamcmddir}/linux32/steamclient.so" | awk '{print $1;}')
elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/steamclient.so" ]; then
steamcmdsteamclientmd5=$(md5sum "${HOME}/.local/share/Steam/steamcmd/linux32/steamclient.so" | awk '{print $1;}')
fi

# get md5sum of libtier0_s.so from steamcmd
if [ -f "${HOME}/.steam/steamcmd/linux32/libtier0_s.so" ]; then
steamcmdlibtier0_smd5=$(md5sum "${HOME}/.steam/steamcmd/linux32/libtier0_s.so" | awk '{print $1;}')
elif [ -f "${steamcmddir}/linux32/libtier0_s.so" ]; then
steamcmdlibtier0_smd5=$(md5sum "${steamcmddir}/linux32/libtier0_s.so" | awk '{print $1;}')
elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/libtier0_s.so" ]; then
steamcmdlibtier0_smd5=$(md5sum "${HOME}/.local/share/Steam/steamcmd/linux32/libtier0_s.so" | awk '{print $1;}')
fi

# get md5sum of libvstdlib_s.so from steamcmd
if [ -f "${HOME}/.steam/steamcmd/linux32/libvstdlib_s.so" ]; then
steamcmdlibvstdlib_smd5=$(md5sum "${HOME}/.steam/steamcmd/linux32/libvstdlib_s.so" | awk '{print $1;}')
elif [ -f "${steamcmddir}/linux32/libvstdlib_s.so" ]; then
steamcmdlibvstdlib_smd5=$(md5sum "${steamcmddir}/linux32/libvstdlib_s.so" | awk '{print $1;}')
elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/libvstdlib_s.so" ]; then
steamcmdlibvstdlib_smd5=$(md5sum "${HOME}/.local/share/Steam/steamcmd/linux32/libvstdlib_s.so" | awk '{print $1;}')
fi

if [ ! -f "${serverfiles}/System/steamclient.so" ] || [ "${steamcmdsteamclientmd5}" != "${steamclientmd5}" ]; then
fixname="steamclient.so x86"
fn_fix_msg_start
if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then
cp "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/System/steamclient.so"
elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then
cp "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/System/steamclient.so"
elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/steamclient.so" ]; then
cp "${HOME}/.local/share/Steam/steamcmd/linux32/steamclient.so" "${serverfiles}/System/steamclient.so"
fi
fn_fix_msg_end
fi

if [ ! -f "${serverfiles}/System/libtier0_s.so" ] || [ "${steamcmdlibtier0_smd5}" != "${libtier0_smd5}" ]; then
fixname="libtier0_s.so"
fn_fix_msg_start
if [ -f "${HOME}/.steam/steamcmd/linux32/libtier0_s.so" ]; then
cp "${HOME}/.steam/steamcmd/linux32/libtier0_s.so" "${serverfiles}/System/libtier0_s.so"
elif [ -f "${steamcmddir}/linux32/libtier0_s.so" ]; then
cp "${steamcmddir}/linux32/libtier0_s.so" "${serverfiles}/System/libtier0_s.so"
elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/libtier0_s.so" ]; then
cp "${HOME}/.local/share/Steam/steamcmd/linux32/libtier0_s.so" "${serverfiles}/System/libtier0_s.so"
fi
fn_fix_msg_end
fi

if [ ! -f "${serverfiles}/System/libvstdlib_s.so" ] || [ "${steamcmdlibvstdlib_smd5}" != "${libvstdlib_smd5}" ]; then
fixname="libvstdlib_s.so"
fn_fix_msg_start
if [ -f "${HOME}/.steam/steamcmd/linux32/libvstdlib_s.so" ]; then
cp "${HOME}/.steam/steamcmd/linux32/libvstdlib_s.so" "${serverfiles}/System/libvstdlib_s.so"
elif [ -f "${steamcmddir}/linux32/libvstdlib_s.so" ]; then
cp "${steamcmddir}/linux32/libvstdlib_s.so" "${serverfiles}/System/libvstdlib_s.so"
elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/libvstdlib_s.so" ]; then
cp "${HOME}/.local/share/Steam/steamcmd/linux32/libvstdlib_s.so" "${serverfiles}/System/libvstdlib_s.so"
fi
fn_fix_msg_end
fi

# if running install command
if [ "${commandname}" == "INSTALL" ]; then
echo -e "applying server name fix."
fn_sleep_time
echo -e "forcing server restart..."
fn_sleep_time
exitbypass=1
command_start.sh
fn_firstcommand_reset
fn_sleep_time_5
exitbypass=1
command_stop.sh
fn_firstcommand_reset
exitbypass=1
command_start.sh
fn_firstcommand_reset
fn_sleep_time_5
exitbypass=1
command_stop.sh
fn_firstcommand_reset
fi