[GH-ISSUE #3765] [BUG] Wrong port value in sfserver alerts in discord #2476

Open
opened 2026-02-27 03:03:13 +03:00 by kerem · 5 comments
Owner

Originally created by @shalak on GitHub (Jan 26, 2022).
Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/3765

User Story

As a sfserver user, I want queryport to be used in discord alerts.

Basic info

  • Distro: N/A
  • Game: [Satisfactory]
  • Command: [N/A]
  • LinuxGSM version: [v21.5.0]

Further Information

The alerts on discord are printing port, which for satisfactory is not the port a player should use in their game client (that one being queryport).

Expected behaviour

With default sfserver config values, I should see 15777 instead of 7777 in the alert below:
image

Originally created by @shalak on GitHub (Jan 26, 2022). Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/3765 ## User Story As a `sfserver` user, I want `queryport` to be used in discord alerts. ## Basic info * **Distro:** N/A * **Game:** [Satisfactory] * **Command:** [N/A] * **LinuxGSM version:** [v21.5.0] ## Further Information The [alerts on discord are printing `port`](https://github.com/GameServerManagers/LinuxGSM/blob/master/lgsm/functions/alert_discord.sh#L34), which for satisfactory is not the port a player should use in their game client (that one being `queryport`). ## Expected behaviour With default `sfserver` config values, I should see `15777` instead of `7777` in the alert below: <img width="597" alt="image" src="https://user-images.githubusercontent.com/1536554/151231471-efe74991-8d1d-49b3-8a4a-6ba9a080f93a.png">
Author
Owner

@shalak commented on GitHub (Jan 26, 2022):

The issue originales from the naming convention that Satisfactory uses.

The simplest solution, would be something like this:

diff --git a/lgsm/config-default/config-lgsm/sfserver/_default.cfg b/lgsm/config-default/config-lgsm/sfserver/_default.cfg
index 45ca1151..7fc3d39f 100644
--- a/lgsm/config-default/config-lgsm/sfserver/_default.cfg
+++ b/lgsm/config-default/config-lgsm/sfserver/_default.cfg
@@ -10,12 +10,12 @@
 
 ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters
 ip="0.0.0.0"
-queryport="15777"
+port="15777"
 beaconport="15000"
-port="7777"
+gameport="7777"
 
 ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
-startparameters="FactoryGame -multihome=${ip} -ServerQueryPort=${queryport} -BeaconPort=${beaconport} -Port=${port} -log -unattended"
+startparameters="FactoryGame -multihome=${ip} -ServerQueryPort=${port} -BeaconPort=${beaconport} -Port=${gameport} -log -unattended"
 
 #### LinuxGSM Settings ####
 

Unfortunately, this introduces inconsistency, because now parameter names would not reflect the variable names, which may be confusing.

Alternatively, there could be a completely new variable introduced, just for alert messages:

diff --git a/lgsm/config-default/config-lgsm/sfserver/_default.cfg b/lgsm/config-default/config-lgsm/sfserver/_default.cfg
index 45ca1151..75672fe7 100644
--- a/lgsm/config-default/config-lgsm/sfserver/_default.cfg
+++ b/lgsm/config-default/config-lgsm/sfserver/_default.cfg
@@ -37,6 +37,7 @@ postalert="off"
 # Discord Alerts | https://docs.linuxgsm.com/alerts/discord
 discordalert="off"
 discordwebhook="webhook"
+gameclientport=${queryport}
 
 # Email Alerts | https://docs.linuxgsm.com/alerts/email
 emailalert="off"
diff --git a/lgsm/functions/alert_discord.sh b/lgsm/functions/alert_discord.sh
index 9db56da3..1e83b4a4 100755
--- a/lgsm/functions/alert_discord.sh
+++ b/lgsm/functions/alert_discord.sh
@@ -31,7 +31,7 @@ json=$(cat <<EOF
 			},
 			{
 				"name": "Server IP",
-				"value": "[${alertip}:${port}](https://www.gametracker.com/server_info/${alertip}:${port})",
+				"value": "[${alertip}:${gameclientport:-${port}}](https://www.gametracker.com/server_info/${alertip}:${gameclientport:-${port}})",
 				"inline": true
 			},
 			{

But that, as I understand, won't make sense for gametracker service...

As a sidenote, I believe a user should be able to disable the overall gametracker link embedding above, as it exposes a risk of leaking a private server's address.

<!-- gh-comment-id:1022538906 --> @shalak commented on GitHub (Jan 26, 2022): The issue originales from the naming convention that Satisfactory uses. The simplest solution, would be something like this: ```diff diff --git a/lgsm/config-default/config-lgsm/sfserver/_default.cfg b/lgsm/config-default/config-lgsm/sfserver/_default.cfg index 45ca1151..7fc3d39f 100644 --- a/lgsm/config-default/config-lgsm/sfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sfserver/_default.cfg @@ -10,12 +10,12 @@ ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" -queryport="15777" +port="15777" beaconport="15000" -port="7777" +gameport="7777" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="FactoryGame -multihome=${ip} -ServerQueryPort=${queryport} -BeaconPort=${beaconport} -Port=${port} -log -unattended" +startparameters="FactoryGame -multihome=${ip} -ServerQueryPort=${port} -BeaconPort=${beaconport} -Port=${gameport} -log -unattended" #### LinuxGSM Settings #### ``` Unfortunately, this introduces inconsistency, because now parameter names would not reflect the variable names, which may be confusing. Alternatively, there could be a completely new variable introduced, just for alert messages: ```diff diff --git a/lgsm/config-default/config-lgsm/sfserver/_default.cfg b/lgsm/config-default/config-lgsm/sfserver/_default.cfg index 45ca1151..75672fe7 100644 --- a/lgsm/config-default/config-lgsm/sfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sfserver/_default.cfg @@ -37,6 +37,7 @@ postalert="off" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" discordwebhook="webhook" +gameclientport=${queryport} # Email Alerts | https://docs.linuxgsm.com/alerts/email emailalert="off" diff --git a/lgsm/functions/alert_discord.sh b/lgsm/functions/alert_discord.sh index 9db56da3..1e83b4a4 100755 --- a/lgsm/functions/alert_discord.sh +++ b/lgsm/functions/alert_discord.sh @@ -31,7 +31,7 @@ json=$(cat <<EOF }, { "name": "Server IP", - "value": "[${alertip}:${port}](https://www.gametracker.com/server_info/${alertip}:${port})", + "value": "[${alertip}:${gameclientport:-${port}}](https://www.gametracker.com/server_info/${alertip}:${gameclientport:-${port}})", "inline": true }, { ``` But that, as I understand, won't make sense for gametracker service... As a sidenote, I believe a user should be able to disable the overall gametracker link embedding above, as it exposes a risk of leaking a private server's address.
Author
Owner

@dgibbs64 commented on GitHub (Jan 26, 2022):

I can confirm this unusual behavior. Others servers you would enter the gameport to connect to in the game server browser. However it this instance you connect to the query port.

Since this is different from every other game I am unsure on how best to adapt it currently. There might have to be a connectport variable added for these sorts of issues

<!-- gh-comment-id:1022631560 --> @dgibbs64 commented on GitHub (Jan 26, 2022): I can confirm this unusual behavior. Others servers you would enter the gameport to connect to in the game server browser. However it this instance you connect to the query port. Since this is different from every other game I am unsure on how best to adapt it currently. There might have to be a connectport variable added for these sorts of issues
Author
Owner

@vinanrra commented on GitHub (Dec 20, 2023):

Hi, any news about this?

Just asking, because this it's a low priority.

<!-- gh-comment-id:1865067695 --> @vinanrra commented on GitHub (Dec 20, 2023): Hi, any news about this? Just asking, because this it's a low priority.
Author
Owner

@johnoclockdk commented on GitHub (Dec 24, 2023):

I can confirm this unusual behavior. Others servers you would enter the gameport to connect to in the game server browser. However it this instance you connect to the query port.

Since this is different from every other game I am unsure on how best to adapt it currently. There might have to be a connectport variable added for these sorts of issues

maybe in alerts have a check like
if{sfserver) { code goes here }

<!-- gh-comment-id:1868501604 --> @johnoclockdk commented on GitHub (Dec 24, 2023): > I can confirm this unusual behavior. Others servers you would enter the gameport to connect to in the game server browser. However it this instance you connect to the query port. > > Since this is different from every other game I am unsure on how best to adapt it currently. There might have to be a connectport variable added for these sorts of issues maybe in alerts have a check like `if{sfserver) { code goes here } `
Author
Owner

@vinanrra commented on GitHub (Dec 24, 2023):

Or maybe set the port at the config and if set don't use the default maybe?

<!-- gh-comment-id:1868501838 --> @vinanrra commented on GitHub (Dec 24, 2023): Or maybe set the port at the config and if set don't use the default maybe?
Sign in to join this conversation.
No labels
Atomic
Epic
cannot reproduce
command: backup
command: console
command: debug
command: details
command: fast-dl
command: install
command: mods
command: monitor
command: post-details
command: restart
command: send
command: start
command: stop
command: update
command: update-lgsm
command: validate
command: wipe
distro: AlmaLinux
distro: Arch Linux
distro: CentOS
distro: Debian
distro: Fedora
distro: RedHat
distro: Rocky Linux
distro: Ubuntu
distro: openSUSE
engine: goldsrc
engine: source
game: 7 Days to Die
game: ARMA 3
game: Ark: Survival Evolved
game: Assetto Corsa
game: Avorion
game: BATTALION: Legacy
game: Barotrauma
game: Battalion 1944
game: Battlefield 1942
game: Black Mesa: Deathmatch
game: Blade Symphony
game: Call of Duty 2
game: Call of Duty 4
game: Call of Duty: United Offensive
game: Counter-Strike 1.6
game: Counter-Strike 2
game: Counter-Strike: Global Offensive
game: Counter-Strike: Source
game: Day of Infamy
game: Dayz
game: Death Match Classic
game: Don't Starve Together
game: ET: Legacy
game: Eco
game: Factorio
game: Factorio
game: Garry's Mod
game: Half-Life
game: Hurtword
game: Insurgecy
game: Insurgecy
game: Insurgency: Sandstorm
game: Just Cause 3
game: Killing Floor
game: Killing Floor 2
game: Left 4 Dead 2
game: Minecraft
game: Minecraft Bedrock
game: Mordhau
game: Multi Theft Auto
game: Mumble
game: Natural Selection 2
game: No More Room in Hell
game: Pavlov VR
game: Post Scriptum
game: Project Zomboid
game: Quake 3
game: QuakeWorld
game: Red Orchestra: Ostfront 41-45
game: Return to Castle Wolfenstein
game: Rising World
game: Rust
game: San Andreas Multiplayer
game: Satisfactory
game: Soldat
game: Soldier of Fortune 2
game: Squad
game: Squad 44
game: Starbound
game: Stationeers
game: Sven Co-op
game: Team Fortress 2
game: Teamspeak 3
game: Teeworlds
game: Terraria
game: The Front
game: Unreal Tournament 2004
game: Unreal Tournament 3
game: Unreal Tournament 99
game: Unturned
game: Valheim
game: Wurm Unlimited
game: Zombie Master Reborn
game: label missing
good first issue
help wanted
info: alerts
info: dependency
info: docker
info: docs
info: email
info: query
info: steamcmd
info: systemd
info: tmux
info: website
info: website
needs more info
outcome: duplicate
outcome: issue resolved
outcome: issue resolved
outcome: issue unresolved
outcome: pr accepted
outcome: pr rejected
outcome: unconfirmed
outcome: wontfix
outcome: wrong forum
potential-duplicate
priority
pull-request
type: bug
type: feature
type: feature
type: feature request
type: game server request
type: refactor
waiting response
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/LinuxGSM#2476
No description provided.