Просмотр исходного кода

Merge remote-tracking branch 'refs/remotes/origin/SingingTree-terraria_config_install' into pr/498

Daniel Gibbs 10 лет назад
Родитель
Сommit
89e6579173
5 измененных файлов с 22 добавлено и 2 удалено
  1. 1 1
      Terraria/cfg/lgsm-default.txt
  2. 1 0
      Terraria/terrariaserver
  3. 1 1
      functions/fn_details
  4. 7 0
      functions/fn_details_config
  5. 12 0
      functions/fn_install_config

+ 1 - 1
Terraria/cfg/terraria-server.txt → Terraria/cfg/lgsm-default.txt

@@ -64,5 +64,5 @@
 #npcstream=60
 #npcstream=60
 
 
 #Default system priority 0:Realtime, 1:High, 2:AboveNormal, 3:Normal, 4:BelowNormal, 5:Idle
 #Default system priority 0:Realtime, 1:High, 2:AboveNormal, 3:Normal, 4:BelowNormal, 5:Idle
-priority=1
+#priority=1
 
 

+ 1 - 0
Terraria/terrariaserver

@@ -46,6 +46,7 @@ executable="./TerrariaServer"
 servercfg="${servicename}.txt"
 servercfg="${servicename}.txt"
 servercfgdir="${filesdir}"
 servercfgdir="${filesdir}"
 servercfgfullpath="${servercfgdir}/${servercfg}"
 servercfgfullpath="${servercfgdir}/${servercfg}"
+servercfgdefault="${servercfgdir}/lgsm-default.txt"
 backupdir="${rootdir}/backups"
 backupdir="${rootdir}/backups"
 
 
 # Logging
 # Logging

+ 1 - 1
functions/fn_details

@@ -541,7 +541,7 @@ echo -e ""
 echo -e "\e[92mPorts\e[0m"
 echo -e "\e[92mPorts\e[0m"
 printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
 printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
 echo -e "Change ports by editing the command-line"
 echo -e "Change ports by editing the command-line"
-echo -e "parameters in ${selfname}."
+echo -e "parameters in ${servercfgfullpath}."
 echo -e ""
 echo -e ""
 echo -e "Useful port diagnostic command:"
 echo -e "Useful port diagnostic command:"
 echo -e "netstat -atunp | grep terraia"
 echo -e "netstat -atunp | grep terraia"

+ 7 - 0
functions/fn_details_config

@@ -388,6 +388,13 @@ elif [ "${engine}" == "teeworlds" ]; then
 	if [ -f "${servercfgfullpath}" ]; then
 	if [ -f "${servercfgfullpath}" ]; then
 		port=$(grep "DefaultPort=" "${servercfgfullpath}" | tr -cd "[:digit:]")
 		port=$(grep "DefaultPort=" "${servercfgfullpath}" | tr -cd "[:digit:]")
 	fi
 	fi
+			
+elif [ "${engine}" == "terraria" ]; then
+
+	# port
+	if [ -f "${servercfgfullpath}" ]; then
+		port=$(grep "port=" "${servercfgfullpath}" | tr -cd "[:digit:]")
+	fi
 	if [ ! -n "${port}" ]; then
 	if [ ! -n "${port}" ]; then
 		port="0"
 		port="0"
 	fi
 	fi

+ 12 - 0
functions/fn_install_config

@@ -116,6 +116,13 @@ sed -i "s/\"rconpassword\"/\"${rconpass}\"/g" "${servercfgfullpath}"
 echo ""
 echo ""
 }
 }
 
 
+fn_terrariaconfig(){
+echo "creating ${servercfg} config file."
+cp -v "${servercfgdefault}" "${servercfgfullpath}"
+sleep 1
+echo ""
+}
+
 fn_ts3config(){
 fn_ts3config(){
 echo "creating blank ${servercfg} config file."
 echo "creating blank ${servercfg} config file."
 sleep 1
 sleep 1
@@ -322,6 +329,11 @@ elif [ "${gamename}" == "Team Fortress Classic" ]; then
 	wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/TeamFortressClassic/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq
 	wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/TeamFortressClassic/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq
 	sleep 1
 	sleep 1
 	fn_goldsourceconfig
 	fn_goldsourceconfig
+elif [ "${gamename}" == "Terraria" ]; then
+	echo -e "downloading lgsm-default.txt...\c"
+	wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/Terraria/cfg/lgsm-default.txt 2>&1 | grep -F HTTP | cut -c45- | uniq
+	sleep 1
+	fn_terrariaconfig
 elif [ "${gamename}" == "Unreal Tournament 2004" ]; then
 elif [ "${gamename}" == "Unreal Tournament 2004" ]; then
 	fn_unreal2config
 	fn_unreal2config
 elif [ "${gamename}" == "Unreal Tournament 99" ]; then
 elif [ "${gamename}" == "Unreal Tournament 99" ]; then