diff --git a/lgsm/config-default/config-lgsm/wurmserver/_default.cfg b/lgsm/config-default/config-lgsm/wurmserver/_default.cfg index 754fc5922..f648abe05 100644 --- a/lgsm/config-default/config-lgsm/wurmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wurmserver/_default.cfg @@ -8,9 +8,52 @@ #### Game Server Settings #### +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +# https://www.wurmpedia.com/index.php/Server_administration_(Wurm_Unlimited) + +# Game mode (Creative|Adventure) +gamemode="Creative" + +# The kingdom the server belongs to. +# If you're using the Adventure base, use 1, 2, or 3. +# If you're using Creative, use 4. +# Kingdom numbers: +# 0 - No kingdom +# 1 - Jen-Kellon +# 2 - Mol-Rehan +# 3 - Horde of the Summoned +# 4 - Freedom +homekingdom="4" + +# Unlocks the admin commands from within the game, that can be used to change +# the gameplay settings of the server, such as skill gain rate and field growth time. +adminpassword="ADMINPASSWORD" + +# If true the server will follow the rules from the Epic servers in Wurm Online. +# For instance it will use the skill curve. +epicsettings="false" + +# If the server is a home server (belongs to a single kingdom). +homeserver="true" + +# Defaults to true, should only be set to false if the server is intended to be +# connected with another server that is going to act as a loginserver. +loginserver="true" + +# Used for server to server communication. +rmiport="7221" +rmiregport="7220" + +maxplayers="200" +servername="LinuxGSM" +serverpassword="" +ip="0.0.0.0" +port="3724" +queryport="27016" + ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters # Parameters are edited in the game server config file. -startparameters="ADMINPWD=\"$ADMINPWD\" EPICSETTINGS=\"$EPICSETTINGS\" EXTERNALPORT=\"$EXTERNALPORT\" HOMESERVER=\"$HOMESERVER\" HOMEKINGDOM=\"$HOMEKINGDOM\" LOGINSERVER=\"$LOGINSERVER\" MAXPLAYERS=\"$MAXPLAYERS\" QUERYPORT=\"$QUERYPORT\" SERVERNAME=\"$SERVERNAME\" SERVERPASSWORD=\"$SERVERPASSWORD\" START=\"$START\" IP=\"$IP\"" +startparameters="start=${gamemode} adminpwd='${adminpassword}' epicsettings='${epicsettings}' externalport='${port}' homeserver='${homeserver}' homekingdom='${homekingdom}' loginserver='${loginserver}' maxplayers='${maxplayers}' queryport='${queryport}' rmiport='${rmiport}' rmiregport='${rmiregport}' servername='${servername}' serverpassword='${serverpassword}' ip='${ip}'" #### LinuxGSM Settings #### @@ -157,13 +200,7 @@ glibc="2.14" ## Game Server Directories systemdir="${serverfiles}" executabledir="${systemdir}" -preexecutable="xvfb-run" executable="./WurmServerLauncher" -servercfgdir="${systemdir}" -servercfg="${selfname}.cfg" -servercfgdefault="server.cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" -source "${servercfgfullpath}" ## Backup Directory backupdir="${lgsmdir}/backup" diff --git a/lgsm/modules/fix_wurm.sh b/lgsm/modules/fix_wurm.sh index 1536df2e7..73eaac93e 100644 --- a/lgsm/modules/fix_wurm.sh +++ b/lgsm/modules/fix_wurm.sh @@ -10,14 +10,15 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # First run requires start with no parms. # After first run new dirs are created. if [ ! -d "${serverfiles}/Creative" ]; then - parmsbypass=1 - fixbypass=1 - exitbypass=1 - command_start.sh - fn_firstcommand_reset - sleep 10 - exitbypass=1 - command_stop.sh - fn_firstcommand_reset - unset parmsbypass + fixname="Copy Creative directory" + fn_fix_msg_start + cp -R "${serverfiles}/dist/Creative" "${serverfiles}/Creative" + fn_fix_msg_end +fi + +if [ ! -d "${serverfiles}/Adventure" ]; then + fixname="Copy Adventure directory" + fn_fix_msg_start + cp -R "${serverfiles}/dist/Adventure" "${serverfiles}/Adventure" + fn_fix_msg_end fi diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index d52810e37..d5e671205 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -2175,36 +2175,25 @@ fn_info_game_wmc() { fi } -# Config Type: custom (key-value) -# Comment: # -# Example: SERVERNAME=SERVERNAME +# Config Type: parameters +# Parameters: true +# Comment: +# Example: hostname='SERVERNAME' +# Filetype: parameters fn_info_game_wurm() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - port="${zero}" - queryport="${zero}" - rconpassword="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - adminpassword="${unavailable}" - maxplayers="${zero}" - else - port=$(grep "EXTERNALPORT=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - queryport=$(grep "QUERYPORT=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - servername=$(grep "SERVERNAME=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERNAME//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "SERVERPASSWORD=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERPASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - adminpassword=$(grep "ADMINPWD=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/ADMINPWD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "MAXPLAYERS=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - configip=$(grep "IP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/IP//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not set - port="${port:-"3724"}" - queryport="${queryport:-"27017"}" - servername="${servername:-"NOT SET"}" - serverpassword="${serverpassword:-"NOT SET"}" - adminpassword="${adminpassword:-"NOT SET"}" - maxplayers="${maxplayers:-"0"}" - fi + gamemode="${gamemode:-"NOT SET"}" + homekingdom="${homekingdom:-"0"}" + adminpassword="${adminpassword:-"NOT SET"}" + epicsettings="${epicsettings:-"NOT SET"}" + homeserver="${homeserver:-"NOT SET"}" + loginserver="${loginserver:-"NOT SET"}" + rmiport="${rmiport:-"0"}" + rmiregport="${rmiregport:-"0"}" + maxplayers="${maxplayers:-"0"}" + servername="${servername:-"NOT SET"}" + # serverpassword="${serverpassword:-"NOT SET"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" } unavailable="${red}UNAVAILABLE${default}" diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index 302f54a38..8c601a654 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -1666,6 +1666,8 @@ fn_info_message_wurm() { fn_port "header" fn_port "Game" port tcp fn_port "Query" queryport udp + fn_port "RMI" rmiport tcp + fn_port "RMI Registry" rmiregport tcp } | column -s $'\t' -t }