فهرست منبع

Merge branch 'hurt-world' of https://github.com/dgibbs64/linuxgsm into hurt-world

Daniel Gibbs 10 سال پیش
والد
کامیت
d6df2ed7d5
7فایلهای تغییر یافته به همراه53 افزوده شده و 37 حذف شده
  1. 1 3
      GameServerQuery/gsquery.py
  2. 19 9
      Hurtworld/hwserver
  3. 16 14
      functions/fn_details
  4. 2 2
      functions/fn_details_config
  5. 9 6
      functions/fn_install_config
  6. 2 2
      functions/fn_install_gsquery
  7. 4 1
      functions/fn_monitor_query

+ 1 - 3
GameServerQuery/gsquery.py

@@ -27,8 +27,6 @@ class GameServer:
 			self.query_prompt_string = '\xFF\xFF\xFF\xFFTSource Engine Query\0'
 		if self.option.engine == 'unity3d':
 			self.query_prompt_string = '\xFF\xFF\xFF\xFFTSource Engine Query\0'
-		if self.option.engine == 'hwunity3d':
-			self.query_prompt_string = '\xFF\xFF\xFF\xFFTSource Engine Query\0'
 		elif self.option.engine == 'unreal':
 			self.query_prompt_string = '\x5C\x69\x6E\x66\x6F\x5C'
 		elif self.option.engine == 'unreal2':
@@ -103,7 +101,7 @@ if __name__ == '__main__':
 		action = 'store',
 		dest = 'engine',
 		default = False,
-		help = 'Engine type: avalanche, goldsource, realvirtuality, spark, source, unity3d, hwunity3d, unreal, unreal2.'
+		help = 'Engine type: avalanche, goldsource, realvirtuality, spark, source, unity3d, unreal, unreal2.'
 	)
 	parser.add_option(
 		'-v', '--verbose',

+ 19 - 9
Hurtworld/hwserver

@@ -23,23 +23,29 @@ email="email@example.com"
 steamuser="anonymous"
 steampass=""
 
-# Start Variables
+# Server settings
 servername="Hurtworld LGSM Server"
 ip="0.0.0.0"
 port="12871"
 queryport="12881"
 maxplayers="20"
-map=""
-creativemode="0"  #Free Build (0 is off)
-updateonstart="off"
+map="" #Optional
+creativemode="0" #Free Build
+logfile="gamelog.txt"
+
+# Adding admins using STEAMID64
+# Example : addadmin 012345678901234567; addadmin 987654321098765432
+admins=""
 
-# Maintenance Variables
+# Advanced
+# Rollback server state (remove after start command)
 loadsave=""
-logfile="gamelog.txt"
+# Use unstable 64 bit server executable (O/1)
+x64mode="0"
 
 # http://hurtworld.wikia.com/wiki/Hosting_A_Server
 fn_parms(){
-parms="-batchmode -nographics -exec \"host ${port} ${map} ${save};queryport ${queryport};maxplayers ${maxplayers};servername ${servername};creativemode ${creativemode}\" -logfile \"${logfile}\" "
+parms="-batchmode -nographics -exec \"host ${port} ${map} ${loadsave};queryport ${queryport};maxplayers ${maxplayers};servername ${servername};creativemode ${creativemode};${admins}\" -logfile \"${logfile}\" "
 }
 
 #### Advanced Variables ####
@@ -57,7 +63,7 @@ appid="405100"
 # Server Details
 servicename="hurtworld-server"
 gamename="Hurtworld"
-engine="hwunity3d"
+engine="unity3d"
 
 # Directories
 rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
@@ -66,7 +72,11 @@ lockselfname=".${servicename}.lock"
 filesdir="${rootdir}/serverfiles"
 systemdir="${filesdir}"
 executabledir="${filesdir}"
-executable="./Hurtworld.x86"
+if [ "${x64mode}" == "1" ]; then
+	executable="./Hurtworld.x86_64"
+else
+	executable="./Hurtworld.x86"
+fi
 backupdir="${rootdir}/backups"
 
 # Logging

+ 16 - 14
functions/fn_details

@@ -554,7 +554,7 @@ echo -e ""
 fn_details_statusbottom
 }
 
-fn_details_unity3d(){
+fn_details_sdtd(){
 fn_check_ip
 fn_parms
 fn_details_config
@@ -719,17 +719,19 @@ fn_details_statusbottom
 }
 
 if [ ! -e "${servercfgfullpath}" ]; then
-	echo ""
-	fn_printwarnnl "\e[0;31mCONFIGURATION FILE MISSING!\e[0m"
-	echo "${servercfgfullpath}"
-	echo "Some details cannot be displayed"
-	echo -en ".\r"
-	sleep 1
-	echo -en "..\r"
-	sleep 1
-	echo -en "...\r"
-	sleep 1
-	echo -en "   \r"
+	if [ "${gamename}" != "Hurtworld" ]; then
+		echo ""
+		fn_printwarnnl "\e[0;31mCONFIGURATION FILE MISSING!\e[0m"
+		echo "${servercfgfullpath}"
+		echo "Some details cannot be displayed"
+		echo -en ".\r"
+		sleep 1
+		echo -en "..\r"
+		sleep 1
+		echo -en "...\r"
+		sleep 1
+		echo -en "   \r"
+	fi
 fi
 
 fn_details_glibc
@@ -754,14 +756,14 @@ elif [ "${engine}" == "teeworlds" ]; then
 	fn_details_teeworlds
 elif [ "${engine}" == "terraria" ]; then
 	fn_details_terraria
-elif [ "${engine}" == "unity3d" ]; then
-	fn_details_unity3d
 elif [ "${engine}" == "unreal" ] || [ "${engine}" == "unreal2" ]; then
 	fn_details_unreal
 elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then
 	fn_details_ark
 elif [ "${gamename}" == "Hurtworld" ]; then
 	fn_details_hurtworld
+elif [ "${gamename}" == "7 Days To Die" ]; then
+	fn_details_sdtd
 elif [ "${gamename}" == "Teamspeak 3" ]; then
 	fn_details_teamspeak3
 else

+ 2 - 2
functions/fn_details_config

@@ -608,7 +608,7 @@ elif [ "${gamename}" == "Hurtworld" ]; then
 
 	# slots
 	if [ -n "${maxplayers}" ]; then
-		slots="{maxplayers}"
+		slots="${maxplayers}"
 	else
 		slots="NOT SET"
 	fi
@@ -617,7 +617,7 @@ elif [ "${gamename}" == "Hurtworld" ]; then
 	if [ -n "${map}" ]; then
 		gameworld="${map}"
 	else
-		gameworld="\e[0;31mUNAVAILABLE\e[0m"
+		gameworld="NO MAP SET"
 	fi
 
 	# port

+ 9 - 6
functions/fn_install_config

@@ -5,9 +5,9 @@
 lgsm_version="201215"
 
 fn_defaultconfig(){
-echo "creating ${servercfg} config file."
-cp -v "${servercfgdefault}" "${servercfgfullpath}"
-sleep 1
+	echo "creating ${servercfg} config file."
+	cp -v "${servercfgdefault}" "${servercfgfullpath}"
+	sleep 1
 }
 
 fn_userinputconfig(){
@@ -151,12 +151,15 @@ echo ""
 }
 
 echo ""
+if [ "${gamename}" != "Hurtworld" ]; then
 echo "Creating Configs"
 echo "================================="
 sleep 1
-mkdir -pv "${servercfgdir}"
-cd "${servercfgdir}"
-githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}"
+	mkdir -pv "${servercfgdir}"
+	cd "${servercfgdir}"
+	githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}"
+fi
+
 if [ "${gamename}" == "7 Days To Die" ]; then
 	fn_defaultconfig
 elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then

+ 2 - 2
functions/fn_install_gsquery

@@ -2,7 +2,7 @@
 # LGSM fn_install_gsquery function
 # Author: Daniel Gibbs
 # Website: http://gameservermanagers.com
-lgsm_version="061115"
+lgsm_version="221215"
 
 fn_dlgsquery(){
 cd "${rootdir}"
@@ -11,7 +11,7 @@ wget -N /dev/null "http://gameservermanagers.com/dl/gsquery.py" 2>&1 | grep -F "
 chmod +x gsquery.py
 }
 
-if [ "${engine}" == "avalanche" ]||[ "${engine}" == "goldsource" ]||[ "${engine}" == "realvirtuality" ]||[ "${engine}" == "source" ]||[ "${engine}" == "spark" ]||[ "${engine}" == "unity3d" ]||[ "${engine}" == "hwunity3d" ]||[ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
+if [ "${engine}" == "avalanche" ]||[ "${engine}" == "goldsource" ]||[ "${engine}" == "realvirtuality" ]||[ "${engine}" == "source" ]||[ "${engine}" == "spark" ]||[ "${engine}" == "unity3d" ]||[ "${gamename}" == "Hurtworld" ]||[ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
 	echo ""
 	echo "GameServerQuery"
 	echo "============================"

+ 4 - 1
functions/fn_monitor_query

@@ -17,9 +17,12 @@ if [ -f "${rootdir}/gsquery.py" ]; then
 	elif [ "${engine}" == "realvirtuality" ]; then
 		queryport=$(grep -s steamqueryport= "${servercfgfullpath}"|grep -v //|tr -d '\r'|tr -cd '[:digit:]')
 		port=${queryport}
-	elif [ "${engine}" == "unity3d" ]; then
+	elif [ "${gamename}" == "7 Days To Die" ]; then
 		gameport=$(grep ServerPort "${servercfgfullpath}"|tr -cd '[:digit:]')
 		port=$((${gameport} + 1))
+	elif [ "${gamename}" == "Hurtworld" ]; then
+		gameport="${port}"
+		port="${queryport}"
 	fi
 	fn_printinfo "Detected gsquery.py"
 	fn_scriptlog "Detected gsquery.py"