[GH-ISSUE #4246] [Bug]: fn_info_game_con function not found #2670

Closed
opened 2026-02-27 03:04:34 +03:00 by kerem · 7 comments
Owner

Originally created by @jiwertz on GitHub (Jun 17, 2023).
Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/4246

User story

As a server administrator, I want the server to retrieve configuration settings from the serversettings.con file

Game

Battlefield 1942

Linux distro

Ubuntu 22.04

Command

command: start, command: details

Further information

After updating to the latest linuxgsm version, when executing any of the bf1942server commands (e.g. start, stop, details, etc..), multiple fn_info_game_con: command not found errors are printed from the info_game.sh script.

It seems that this functionality was recently re-worked, and this function was either removed or not implemented. Battlefield 1942 servers are unable to be started without any manual modifications to the info_game.sh file to ensure that important configuration settings (like server ip, port number, and server password) can be set, and the server be available for users to connect to.

The server starts, but with default settings instead of the settings defined in the serversettings.con file.

Example: serversettings.con file contains the property game.serverPort 14567, but linuxgsm is staring the server on port 0 instead.

Relevant log output

bf1942server@linux-server:~$ ./bf1942server details
fetching GitHub command_details.sh...OK
/home/bf1942server/lgsm/modules/info_game.sh: line 895: fn_info_game_con: command not found
/home/bf1942server/lgsm/modules/info_game.sh: line 896: fn_info_game_con: command not found
/home/bf1942server/lgsm/modules/info_game.sh: line 897: fn_info_game_con: command not found
/home/bf1942server/lgsm/modules/info_game.sh: line 898: fn_info_game_con: command not found
/home/bf1942server/lgsm/modules/info_game.sh: line 899: fn_info_game_con: command not found
/home/bf1942server/lgsm/modules/info_game.sh: line 895: fn_info_game_con: command not found
/home/bf1942server/lgsm/modules/info_game.sh: line 896: fn_info_game_con: command not found
/home/bf1942server/lgsm/modules/info_game.sh: line 897: fn_info_game_con: command not found
/home/bf1942server/lgsm/modules/info_game.sh: line 898: fn_info_game_con: command not found
/home/bf1942server/lgsm/modules/info_game.sh: line 899: fn_info_game_con: command not found
fetching GitHub info_messages.sh...OK
fetching GitHub query_gamedig.sh...OK

Distro Details
===================================================================================================================
Date:      Fri Jun 16 07:47:50 PM CDT 2023
Distro:    Ubuntu 22.04.2 LTS
Arch:      x86_64
Kernel:    5.19.0-45-generic
Hostname:  linux-server
Uptime:    0d, 1h, 39m
tmux:      tmux 3.2a
glibc:     2.35

Server Resource
===================================================================================================================
CPU         
Model:      AMD Ryzen 7 1700X Eight-Core Processor
Cores:      16
Frequency:  1767.755MHz
Avg Load:   0.43, 0.76, 0.61

Memory                                  
Mem:       total  used   free   cached  available
Physical:  16GB   4.8GB  11GB   7.7GB   11GB
Swap:      2.0GB  0B     2.0GB          

Storage                 
Filesystem:  /dev/sda2  
Total:                  228G
Used:                   111G
Available:   106G       

Network       
IP:           0.0.0.0
Internet IP:  <REDACTED>

Game Server Resource Usage
===================================================================================================================
CPU Used:  16.2%  
Mem Used:  0.4%   76MB

Storage       
Total:        259M
Serverfiles:  157M

Battlefield: 1942 Server Details
===================================================================================================================
Server name:      BFServer
Server Version:   v1.612
Server IP:        0.0.0.0:0
Internet IP:      <REDACTED>:0
Display IP:       <REDACTED>:0
Server password:  NOT SET
Players:          0/32
Current map:      kbely airfield
Status:           STARTED

bf1942server Script Details
===================================================================================================================
Script name:            bf1942server
LinuxGSM version:       v23.3.4
glibc required:         2.0
Discord alert:          on
Email alert:            off
Gotify alert:           off
IFTTT alert:            off
Mailgun (email) alert:  off
Pushbullet alert:       off
Pushover alert:         off
Rocketchat alert:       off
Slack alert:            off
Telegram alert:         off
Update on start:        off
User:                   bf1942server
Location:               /home/bf1942server
Config file:            /home/bf1942server/serverfiles/mods/bf1942/settings/serversettings.con

Backups
===================================================================================================================
No Backups created

Command-line Parameters
===================================================================================================================
 ./start.sh +hostServer 1 +dedicated 1

Ports
===================================================================================================================
Change ports by editing the parameters in:
/home/bf1942server/serverfiles/mods/bf1942/settings/serversettings.con

Useful port diagnostic command:
ss -tuplwn | grep bf1942_lnxded

DESCRIPTION  PORT   PROTOCOL  LISTEN
Game         0      udp       45
Query        22000  udp       1

Status:	STARTED

Steps to reproduce

No response

Originally created by @jiwertz on GitHub (Jun 17, 2023). Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/4246 ### User story As a server administrator, I want the server to retrieve configuration settings from the serversettings.con file ### Game Battlefield 1942 ### Linux distro Ubuntu 22.04 ### Command command: start, command: details ### Further information After updating to the latest linuxgsm version, when executing any of the bf1942server commands (e.g. start, stop, details, etc..), multiple `fn_info_game_con: command not found` errors are printed from the `info_game.sh` script. It seems that this functionality was recently re-worked, and this function was either removed or not implemented. Battlefield 1942 servers are unable to be started without any manual modifications to the `info_game.sh` file to ensure that important configuration settings (like server ip, port number, and server password) can be set, and the server be available for users to connect to. The server starts, but with default settings instead of the settings defined in the serversettings.con file. Example: serversettings.con file contains the property `game.serverPort 14567`, but linuxgsm is staring the server on port 0 instead. ### Relevant log output ```shell bf1942server@linux-server:~$ ./bf1942server details fetching GitHub command_details.sh...OK /home/bf1942server/lgsm/modules/info_game.sh: line 895: fn_info_game_con: command not found /home/bf1942server/lgsm/modules/info_game.sh: line 896: fn_info_game_con: command not found /home/bf1942server/lgsm/modules/info_game.sh: line 897: fn_info_game_con: command not found /home/bf1942server/lgsm/modules/info_game.sh: line 898: fn_info_game_con: command not found /home/bf1942server/lgsm/modules/info_game.sh: line 899: fn_info_game_con: command not found /home/bf1942server/lgsm/modules/info_game.sh: line 895: fn_info_game_con: command not found /home/bf1942server/lgsm/modules/info_game.sh: line 896: fn_info_game_con: command not found /home/bf1942server/lgsm/modules/info_game.sh: line 897: fn_info_game_con: command not found /home/bf1942server/lgsm/modules/info_game.sh: line 898: fn_info_game_con: command not found /home/bf1942server/lgsm/modules/info_game.sh: line 899: fn_info_game_con: command not found fetching GitHub info_messages.sh...OK fetching GitHub query_gamedig.sh...OK Distro Details =================================================================================================================== Date: Fri Jun 16 07:47:50 PM CDT 2023 Distro: Ubuntu 22.04.2 LTS Arch: x86_64 Kernel: 5.19.0-45-generic Hostname: linux-server Uptime: 0d, 1h, 39m tmux: tmux 3.2a glibc: 2.35 Server Resource =================================================================================================================== CPU Model: AMD Ryzen 7 1700X Eight-Core Processor Cores: 16 Frequency: 1767.755MHz Avg Load: 0.43, 0.76, 0.61 Memory Mem: total used free cached available Physical: 16GB 4.8GB 11GB 7.7GB 11GB Swap: 2.0GB 0B 2.0GB Storage Filesystem: /dev/sda2 Total: 228G Used: 111G Available: 106G Network IP: 0.0.0.0 Internet IP: <REDACTED> Game Server Resource Usage =================================================================================================================== CPU Used: 16.2% Mem Used: 0.4% 76MB Storage Total: 259M Serverfiles: 157M Battlefield: 1942 Server Details =================================================================================================================== Server name: BFServer Server Version: v1.612 Server IP: 0.0.0.0:0 Internet IP: <REDACTED>:0 Display IP: <REDACTED>:0 Server password: NOT SET Players: 0/32 Current map: kbely airfield Status: STARTED bf1942server Script Details =================================================================================================================== Script name: bf1942server LinuxGSM version: v23.3.4 glibc required: 2.0 Discord alert: on Email alert: off Gotify alert: off IFTTT alert: off Mailgun (email) alert: off Pushbullet alert: off Pushover alert: off Rocketchat alert: off Slack alert: off Telegram alert: off Update on start: off User: bf1942server Location: /home/bf1942server Config file: /home/bf1942server/serverfiles/mods/bf1942/settings/serversettings.con Backups =================================================================================================================== No Backups created Command-line Parameters =================================================================================================================== ./start.sh +hostServer 1 +dedicated 1 Ports =================================================================================================================== Change ports by editing the parameters in: /home/bf1942server/serverfiles/mods/bf1942/settings/serversettings.con Useful port diagnostic command: ss -tuplwn | grep bf1942_lnxded DESCRIPTION PORT PROTOCOL LISTEN Game 0 udp 45 Query 22000 udp 1 Status: STARTED ``` ### Steps to reproduce _No response_
Author
Owner

@dgibbs64 commented on GitHub (Sep 1, 2023):

I belive this should have been resolved by now with PR https://github.com/GameServerManagers/LinuxGSM/pull/4257

<!-- gh-comment-id:1703326753 --> @dgibbs64 commented on GitHub (Sep 1, 2023): I belive this should have been resolved by now with PR https://github.com/GameServerManagers/LinuxGSM/pull/4257
Author
Owner

@jiwertz commented on GitHub (Sep 6, 2023):

@dgibbs64, I agree that the "fn_info_game_con: command not found" error is no longer occurring, however, when running the bf1942server details command, it still doesn't appear to be parsing the information from the configuration file correctly.

Battlefield: 1942 Server Details
================================================================================
Server name:      NOT SET
Server IP:        0.0.0.0:0
Internet IP:      <REDACTED>:0
Display IP:       <REDACTED>:0
Server password:  NOT SET
Maxplayers:       0

These properties above should have populated from the serversettings.con file.

After investigating further, I've narrowed down the problem to the fn_info_game_keyvalue_pairs() method. It would seem this method is expecting the second argument (the config file property) to be followed by an = sign, and then the property's value, but Battlefield 1942 doesn't use an equals sign in it's serversettings.con file, it is separated by spaces. Example:

game.serverMaxPlayers 32
game.serverPort 14567

So the fn_info_game_keyvalue_pairs() is unable to parse the properties because of this.

In addition, the fn_info_game_bf1942() method is looking for the wrong property for the server IP. It is looking for game.serverIp, but it should actually be game.serverIP (note the capital "P"). WIthout this change, it is unable to find the correct IP address from the serversettings.con file.

Hopefully this information helps!

<!-- gh-comment-id:1707574433 --> @jiwertz commented on GitHub (Sep 6, 2023): @dgibbs64, I agree that the "fn_info_game_con: command not found" error is no longer occurring, however, when running the `bf1942server details` command, it still doesn't appear to be parsing the information from the configuration file correctly. ```bash Battlefield: 1942 Server Details ================================================================================ Server name: NOT SET Server IP: 0.0.0.0:0 Internet IP: <REDACTED>:0 Display IP: <REDACTED>:0 Server password: NOT SET Maxplayers: 0 ``` These properties above should have populated from the serversettings.con file. After investigating further, I've narrowed down the problem to the [`fn_info_game_keyvalue_pairs()`](https://github.com/GameServerManagers/LinuxGSM/blob/c6f752be07e216ee4c9d76fa8b3d612c2ffd78a1/lgsm/modules/info_game.sh#L40-L61) method. It would seem this method is expecting the second argument (the config file property) to be followed by an `=` sign, and then the property's value, but Battlefield 1942 doesn't use an equals sign in it's `serversettings.con` file, it is separated by spaces. Example: ``` game.serverMaxPlayers 32 game.serverPort 14567 ``` So the [`fn_info_game_keyvalue_pairs()`](https://github.com/GameServerManagers/LinuxGSM/blob/c6f752be07e216ee4c9d76fa8b3d612c2ffd78a1/lgsm/modules/info_game.sh#L40-L61) is unable to parse the properties because of this. In addition, the [`fn_info_game_bf1942()`](https://github.com/GameServerManagers/LinuxGSM/blob/c6f752be07e216ee4c9d76fa8b3d612c2ffd78a1/lgsm/modules/info_game.sh#L899C56-L899C56) method is looking for the wrong property for the server IP. It is looking for `game.serverIp`, but it should actually be `game.serverIP` (note the capital "P"). WIthout this change, it is unable to find the correct IP address from the serversettings.con file. Hopefully this information helps!
Author
Owner

@dgibbs64 commented on GitHub (Sep 6, 2023):

Thanks for this. I will sort out a big fix

<!-- gh-comment-id:1707878146 --> @dgibbs64 commented on GitHub (Sep 6, 2023): Thanks for this. I will sort out a big fix
Author
Owner

@dgibbs64 commented on GitHub (Sep 10, 2023):

github.com/GameServerManagers/LinuxGSM@82e5da4b1d

<!-- gh-comment-id:1712909526 --> @dgibbs64 commented on GitHub (Sep 10, 2023): https://github.com/GameServerManagers/LinuxGSM/commit/82e5da4b1d59ac29d8e701846355e5977fbf3e12
Author
Owner

@jiwertz commented on GitHub (Sep 10, 2023):

Seems to be working, for the most part. Not sure it's a major issue, but the new logic for fn_info_game_keyvalue_pairs_space() only captures the last word after the last space for the configuration parameter. So if you have something like the following in the config file:

game.ServerName "My Awesome BFServer"

It comes out as the server name being just "BFServer"

<!-- gh-comment-id:1712956423 --> @jiwertz commented on GitHub (Sep 10, 2023): Seems to be working, for the most part. Not sure it's a major issue, but the new logic for `fn_info_game_keyvalue_pairs_space()` only captures the last word after the last space for the configuration parameter. So if you have something like the following in the config file: ``` game.ServerName "My Awesome BFServer" ``` It comes out as the server name being just "BFServer"
Author
Owner

@dgibbs64 commented on GitHub (Sep 10, 2023):

Thanks. Getting the parsing correct for all configs is a work in progress 😅

<!-- gh-comment-id:1712961640 --> @dgibbs64 commented on GitHub (Sep 10, 2023): Thanks. Getting the parsing correct for all configs is a work in progress 😅
Author
Owner

@github-actions[bot] commented on GitHub (Oct 21, 2024):

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

<!-- gh-comment-id:2425308293 --> @github-actions[bot] commented on GitHub (Oct 21, 2024): This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
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#2670
No description provided.