Skip to content

fix(hwserver): fix startup and change logging #4189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lgsm/config-default/config-lgsm/hwserver/_default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ####

Expand Down
4 changes: 2 additions & 2 deletions lgsm/modules/info_game.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"}"
}

Expand Down Expand Up @@ -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
Expand Down