Skip to content

Commit ab09a32

Browse files
authored
fix: rework wurm server (#4266)
* feat: copy missing directories Copy the Creative and Adventure directories if they are missing in the server files. This ensures that the necessary directories are present for proper functioning of the server. * refactor: update default configuration for Wurm server - Updated the default configuration file for Wurm server. - Added predefined parameters for game mode, home kingdom, admin password, epic settings, home server, login server, max players, server name, IP address, and ports. - Modified start parameters to include the new predefined parameters. - Removed unnecessary lines related to glibc version and sourcing the server config file. - Updated backup directory path. * feat: add rmiport and rmiregport to startparameters This commit adds the `rmiport` and `rmiregport` parameters to the `startparameters` configuration in the Wurm server default config file. These parameters are used for remote method invocation (RMI) port configuration. * feat: update Wurm server configuration and information - Updated the default configuration file for the Wurm server. - Added a new parameter for server-to-server communication. - Modified the game information script to display the RMI and RMI Registry ports. This commit improves the configuration and information retrieval for the Wurm server. * refactor: update startparameters in wurmserver config The startparameters variable in the wurmserver config file has been updated to remove unnecessary single quotes around the gamemode parameter. This change improves consistency and readability of the code. * refactor: update startparameters in wurmserver config The startparameters variable in the wurmserver config file has been updated to include additional parameters for the game server. This change ensures that the server starts with the correct settings and configurations. * refactor: remove unnecessary start parameter The commit removes the 'start' parameter from the server's start parameters in the default configuration file. This change simplifies the configuration by removing an unnecessary parameter. * refactor: update default value for adminpassword in fn_info_game_wurm The default value for the adminpassword variable in the fn_info_game_wurm function has been updated to "NOT SET" instead of "0". This change ensures that the admin password is properly initialized when not explicitly set. * feat: add link to Wurm Unlimited server administration documentation Added a link to the Wurm Unlimited server administration documentation in the default configuration file for LGSM's Wurm server. This will provide users with easy access to information on managing their game servers. * refactor: remove unnecessary configs in wurmserver config The commit removes unused lines in the wurmserver configuration file. The removed lines include servercfgdir, servercfg, servercfgdefault, and servercfgfullpath. These lines are no longer needed and have been removed to clean up the code.
1 parent 9be4a09 commit ab09a32

File tree

4 files changed

+75
-46
lines changed

4 files changed

+75
-46
lines changed

lgsm/config-default/config-lgsm/wurmserver/_default.cfg

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,52 @@
88

99
#### Game Server Settings ####
1010

11+
## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters
12+
# https://www.wurmpedia.com/index.php/Server_administration_(Wurm_Unlimited)
13+
14+
# Game mode (Creative|Adventure)
15+
gamemode="Creative"
16+
17+
# The kingdom the server belongs to.
18+
# If you're using the Adventure base, use 1, 2, or 3.
19+
# If you're using Creative, use 4.
20+
# Kingdom numbers:
21+
# 0 - No kingdom
22+
# 1 - Jen-Kellon
23+
# 2 - Mol-Rehan
24+
# 3 - Horde of the Summoned
25+
# 4 - Freedom
26+
homekingdom="4"
27+
28+
# Unlocks the admin commands from within the game, that can be used to change
29+
# the gameplay settings of the server, such as skill gain rate and field growth time.
30+
adminpassword="ADMINPASSWORD"
31+
32+
# If true the server will follow the rules from the Epic servers in Wurm Online.
33+
# For instance it will use the skill curve.
34+
epicsettings="false"
35+
36+
# If the server is a home server (belongs to a single kingdom).
37+
homeserver="true"
38+
39+
# Defaults to true, should only be set to false if the server is intended to be
40+
# connected with another server that is going to act as a loginserver.
41+
loginserver="true"
42+
43+
# Used for server to server communication.
44+
rmiport="7221"
45+
rmiregport="7220"
46+
47+
maxplayers="200"
48+
servername="LinuxGSM"
49+
serverpassword=""
50+
ip="0.0.0.0"
51+
port="3724"
52+
queryport="27016"
53+
1154
## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
1255
# Parameters are edited in the game server config file.
13-
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\""
56+
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}'"
1457

1558
#### LinuxGSM Settings ####
1659

@@ -157,13 +200,7 @@ glibc="2.14"
157200
## Game Server Directories
158201
systemdir="${serverfiles}"
159202
executabledir="${systemdir}"
160-
preexecutable="xvfb-run"
161203
executable="./WurmServerLauncher"
162-
servercfgdir="${systemdir}"
163-
servercfg="${selfname}.cfg"
164-
servercfgdefault="server.cfg"
165-
servercfgfullpath="${servercfgdir}/${servercfg}"
166-
source "${servercfgfullpath}"
167204

168205
## Backup Directory
169206
backupdir="${lgsmdir}/backup"

lgsm/modules/fix_wurm.sh

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
1010
# First run requires start with no parms.
1111
# After first run new dirs are created.
1212
if [ ! -d "${serverfiles}/Creative" ]; then
13-
parmsbypass=1
14-
fixbypass=1
15-
exitbypass=1
16-
command_start.sh
17-
fn_firstcommand_reset
18-
sleep 10
19-
exitbypass=1
20-
command_stop.sh
21-
fn_firstcommand_reset
22-
unset parmsbypass
13+
fixname="Copy Creative directory"
14+
fn_fix_msg_start
15+
cp -R "${serverfiles}/dist/Creative" "${serverfiles}/Creative"
16+
fn_fix_msg_end
17+
fi
18+
19+
if [ ! -d "${serverfiles}/Adventure" ]; then
20+
fixname="Copy Adventure directory"
21+
fn_fix_msg_start
22+
cp -R "${serverfiles}/dist/Adventure" "${serverfiles}/Adventure"
23+
fn_fix_msg_end
2324
fi

lgsm/modules/info_game.sh

Lines changed: 18 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2175,36 +2175,25 @@ fn_info_game_wmc() {
21752175
fi
21762176
}
21772177

2178-
# Config Type: custom (key-value)
2179-
# Comment: #
2180-
# Example: SERVERNAME=SERVERNAME
2178+
# Config Type: parameters
2179+
# Parameters: true
2180+
# Comment:
2181+
# Example: hostname='SERVERNAME'
2182+
# Filetype: parameters
21812183
fn_info_game_wurm() {
2182-
# Config
2183-
if [ ! -f "${servercfgfullpath}" ]; then
2184-
port="${zero}"
2185-
queryport="${zero}"
2186-
rconpassword="${unavailable}"
2187-
servername="${unavailable}"
2188-
serverpassword="${unavailable}"
2189-
adminpassword="${unavailable}"
2190-
maxplayers="${zero}"
2191-
else
2192-
port=$(grep "EXTERNALPORT=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
2193-
queryport=$(grep "QUERYPORT=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
2194-
servername=$(grep "SERVERNAME=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERNAME//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
2195-
serverpassword=$(grep "SERVERPASSWORD=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERPASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
2196-
adminpassword=$(grep "ADMINPWD=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/ADMINPWD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
2197-
maxplayers=$(grep "MAXPLAYERS=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
2198-
configip=$(grep "IP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/IP//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
2199-
2200-
# Not set
2201-
port="${port:-"3724"}"
2202-
queryport="${queryport:-"27017"}"
2203-
servername="${servername:-"NOT SET"}"
2204-
serverpassword="${serverpassword:-"NOT SET"}"
2205-
adminpassword="${adminpassword:-"NOT SET"}"
2206-
maxplayers="${maxplayers:-"0"}"
2207-
fi
2184+
gamemode="${gamemode:-"NOT SET"}"
2185+
homekingdom="${homekingdom:-"0"}"
2186+
adminpassword="${adminpassword:-"NOT SET"}"
2187+
epicsettings="${epicsettings:-"NOT SET"}"
2188+
homeserver="${homeserver:-"NOT SET"}"
2189+
loginserver="${loginserver:-"NOT SET"}"
2190+
rmiport="${rmiport:-"0"}"
2191+
rmiregport="${rmiregport:-"0"}"
2192+
maxplayers="${maxplayers:-"0"}"
2193+
servername="${servername:-"NOT SET"}"
2194+
# serverpassword="${serverpassword:-"NOT SET"}"
2195+
port="${port:-"0"}"
2196+
queryport="${queryport:-"0"}"
22082197
}
22092198

22102199
unavailable="${red}UNAVAILABLE${default}"

lgsm/modules/info_messages.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1666,6 +1666,8 @@ fn_info_message_wurm() {
16661666
fn_port "header"
16671667
fn_port "Game" port tcp
16681668
fn_port "Query" queryport udp
1669+
fn_port "RMI" rmiport tcp
1670+
fn_port "RMI Registry" rmiregport tcp
16691671
} | column -s $'\t' -t
16701672
}
16711673

0 commit comments

Comments
 (0)