Browse Source
fix(hwserver): fix startup and change logging (#4189)
* fix(hwserver): fix startup and change logging
* Update info_game.sh
---------
Co-authored-by: Daniel Gibbs <[email protected]>
pull/4213/head
Christian
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
3 additions and
4 deletions
-
lgsm/config-default/config-lgsm/hwserver/_default.cfg
-
lgsm/modules/info_game.sh
|
|
@ -16,7 +16,6 @@ queryport="12881" |
|
|
|
maxplayers="20" |
|
|
|
defaultmap="" # Optional |
|
|
|
creativemode="0" # Free Build: creativemode="1" |
|
|
|
gamelog="gamelog.txt" |
|
|
|
|
|
|
|
## Add admins using STEAMID64 |
|
|
|
# Example : addadmin 012345678901234567; addadmin 987654321098765432 |
|
|
@ -28,7 +27,7 @@ loadsave="" |
|
|
|
|
|
|
|
## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters |
|
|
|
# Edit with care | http://hurtworld.wikia.com/wiki/Hosting_A_Server |
|
|
|
startparameters="-batchmode -nographics -exec \"host ${port} ${defaultmap} ${loadsave};queryport ${queryport};maxplayers ${maxplayers};servername ${servername};creativemode ${creativemode};${admins}\"" |
|
|
|
startparameters="-batchmode -nographics -logfile ${gamelog} -exec \"host ${port} ${defaultmap} ${loadsave};queryport ${queryport};maxplayers ${maxplayers};servername ${servername};creativemode ${creativemode};${admins}\"" |
|
|
|
|
|
|
|
#### LinuxGSM Settings #### |
|
|
|
|
|
|
|
|
|
@ -1201,7 +1201,8 @@ fn_info_game_hw() { |
|
|
|
port="${port:-"0"}" |
|
|
|
queryport="${queryport:-"0"}" |
|
|
|
maxplayers="${maxplayers:-"0"}" |
|
|
|
defaultmap="${defaultmap:-"NOT SET"}" |
|
|
|
# #4189 option setting can be blank |
|
|
|
# defaultmap="${defaultmap:-"NOT SET"}" |
|
|
|
creativemode="${creativemode:-"NOT SET"}" |
|
|
|
} |
|
|
|
|
|
|
@ -2385,7 +2386,6 @@ if [ -z "${displaymasterserver}" ]; then |
|
|
|
if [ "${steammaster}" == "true" ] || [ "${commandname}" == "DEV-QUERY-RAW" ]; then |
|
|
|
# Query external IP first as most liky to succeed. |
|
|
|
masterserver="$(curl --connect-timeout 10 -m 3 -s "https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${extip}&format=json" | jq --arg port "${port}" --arg queryport "${queryport}" 'if .response.servers != null then .response.servers[] | select((.gameport == ($port|tonumber) or .gameport == ($queryport|tonumber))) | .addr else empty end' | wc -l 2> /dev/null)" |
|
|
|
|
|
|
|
if [ "${masterserver}" == "0" ]; then |
|
|
|
# Loop though server IP addresses if external IP fails. |
|
|
|
for queryip in "${queryips[@]}"; do |
|
|
|