Procházet zdrojové kódy

refactor(sdtd): changes required for A17 update (#2121)

* feat(sdtd): added sdtd_fix
* refactor(config): add local config copying
* fix(sdtd): repair selection of 64 bit executable
* fix(sdtd): adjust configfile path
Daniel Gibbs před 7 roky
rodič
revize
820b0cf725

+ 8 - 2
lgsm/config-default/config-lgsm/sdtdserver/_default.cfg

@@ -101,9 +101,15 @@ engine="unity3d"
 ## Server Specific Directories
 systemdir="${serverfiles}"
 executabledir="${serverfiles}"
-executable="./7DaysToDieServer.x86"
-servercfg="${servicename}.xml"
+if [ "$(uname -m)" == "x86_64" ]; then
+	executable="./7DaysToDieServer.x86_64" 
+else
+	executable="./7DaysToDieServer.x86"
+fi	
 servercfgdefault="serverconfig.xml"
+servercfgdirdefault="${serverfiles}"
+servercfgfullpathdefault="${servercfgdirdefault}/${servercfgdefault}"
+servercfg="${servicename}.xml"
 servercfgdir="${serverfiles}"
 servercfgfullpath="${servercfgdir}/${servercfg}"
 

+ 5 - 0
lgsm/functions/core_functions.sh

@@ -367,6 +367,11 @@ functionfile="${FUNCNAME}"
 fn_fetch_function
 }
 
+fix_sdtd.sh(){
+functionfile="${FUNCNAME}"
+fn_fetch_function
+}
+
 fix_ss3.sh(){
 functionfile="${FUNCNAME}"
 fn_fetch_function

+ 2 - 0
lgsm/functions/fix.sh

@@ -58,6 +58,8 @@ if [ "${function_selfname}" != "command_install.sh" ]&&[ -z "${fixbypass}" ]; th
 		fix_rust.sh
 	elif [ "${shortname}" == "rw" ]; then
 		fix_rw.sh
+	elif [ "${shortname}" == "sdtd" ]; then
+		fix_sdtd.sh
 	elif [ "${shortname}" == "ss3" ]; then
 		fix_ss3.sh
 	elif [ "${shortname}" == "ts3" ]; then

+ 10 - 0
lgsm/functions/fix_sdtd.sh

@@ -0,0 +1,10 @@
+#!/bin/bash
+# LinuxGSM fix_sdtd.sh function
+# Author: Daniel Gibbs
+# Website: https://linuxgsm.com
+# Description: Resolves startup issue with 7 Days to Die
+
+local commandname="FIX"
+local commandaction="Fix"
+
+export LD_LIBRARY_PATH="${serverfiles}"

+ 8 - 4
lgsm/functions/install_config.sh

@@ -53,6 +53,13 @@ fn_default_config_remote(){
 	sleep 0.5
 }
 
+# Copys local default config to server config location
+fn_default_config_local(){
+	echo "copying ${servercfgdefault} config file."	
+	cp -nv "${servercfgfullpathdefault}" "${servercfgfullpath}"
+	sleep 0.5
+}
+
 # Changes some variables within the default configs
 # SERVERNAME to LinuxGSM
 # PASSWORD to random password
@@ -139,10 +146,7 @@ fn_set_dst_config_vars(){
 
 if [ "${gamename}" == "7 Days To Die" ]; then
 	gamedirname="7DaysToDie"
-	array_configs+=( serverconfig.xml )
-	fn_fetch_default_config
-	fn_default_config_remote
-	fn_set_config_vars
+	fn_default_config_local
 elif [ "${gamename}" == "ARK: Survival Evolved" ]; then
 	gamedirname="ARKSurvivalEvolved"
 	fn_check_cfgdir