[Bug]: cs2server ignores the GSLT entered during install
维护者通常 1 天内回复
评估
调研方向
阅读 lgsm/config-default/config-lgsm/cs2server/_default.cfg 中 startparameters 定义附近的内容,并与其他 Source 服务器配置中的 GSLT 处理方式进行比较。在 +exec ${selfname}.cfg 后添加令牌参数,因为报告的测试表明顺序很重要。完成标准是:全新安装会将输入的令牌传递给服务器,并且服务器控制台使用该令牌登录 Steam gameserver 账户。
由索引模型根据 Issue 内容生成。
描述
Severity
severity: high
Reproducibility
reproducible: always
Regression
regression: yes
Affects latest release
latest-release: yes
User story
As a CS2 server administrator, I want the GSLT I enter during install to be used by the server, so that players can join it from the internet.
Script name
cs2server
Game
Counter-Strike 2
Linux distro
Debian 12
Command
command: install, command: start
Expected behavior
The GSLT entered at the GSLT TOKEN: prompt during install (stored as gslt in lgsm/config-lgsm/cs2server/cs2server.cfg) is passed to the server, and the console shows:
Logging into Steam gameserver account with logon token 'XXXXXXXX...'
Actual behavior
The token is stored but never reaches the server. The server logs into an anonymous game server account and only accepts LAN connections:
* No Steam account token was specified. *
* Logging into anonymous game server account. *
* Connections will be restricted to LAN only. *
Further information
install_gslt.sh asks for the token, writes it to lgsm/config-lgsm/cs2server/cs2server.cfg and tells the user that the GSLT can be changed there. But the cs2server startparameters in lgsm/config-default/config-lgsm/cs2server/_default.cfg (line 24) never uses ${gslt}:
startparameters="-dedicated -ip ${ip} -port ${port} -maxplayers ${maxplayers} -authkey ${wsapikey} +exec ${selfname}.cfg"
No module passes the token on either: sv_setsteamaccount does not appear anywhere in lgsm/modules/. The other 11 Source servers with a GSLT (csgo, css, tf2, gmod, ...) all have +sv_setsteamaccount ${gslt} in their startparameters.
How it got here:
- f33bfdf4 (2023-10-27): cs2server started with
+sv_setsteamaccount ${gslt}in its start parameters. - 2fff61f4 (#4405, 2024-01-19): the parameters, including
gslt, were moved into the game server config. The CS2server.cfgtemplate in Game-Server-Configs has ansv_setsteamaccount ""line. #4457 reported the missing parameters and was closed with "The CS2 start parameters were merged into the config file". - cac8b81a (2024-10-06):
gslt=""was added back to the cs2server config, so the installer prompts for the token again (command_install.shchecks[ -v gslt ]). But it was not added back tostartparameters, so the token entered at the prompt is ignored.
Today the token only works if it is also typed by hand into the sv_setsteamaccount line of serverfiles/game/csgo/cfg/cs2server.cfg. The installer does not mention this.
I tested where the parameter can go (fresh cs2server install, startparameters overridden in the instance config):
| Test | Token location | Order | Result |
|---|---|---|---|
| A | LinuxGSM gslt |
+exec ${selfname}.cfg +sv_setsteamaccount ${gslt} |
logon token |
| B | LinuxGSM gslt |
+sv_setsteamaccount ${gslt} +exec ${selfname}.cfg |
anonymous |
| C | game server config only, gslt="" |
+exec ${selfname}.cfg +sv_setsteamaccount ${gslt} |
Usage: sv_setsteamaccount <login_token>, then logon token |
B fails because the game server config template sets sv_setsteamaccount "", which clears a token set before it. Test A also shows that the Steam login happens after all command-line commands, even though the game server config contains a map line. Test C shows that an empty gslt only prints the usage line, so servers that set the token in the game server config keep working.
Suggested fix: add +sv_setsteamaccount ${gslt} after +exec ${selfname}.cfg. I will open a PR for it.
Pre-checks
- I ran update and validate before reporting this issue.
Reproduced on a fresh install on Debian 12.15 (bookworm) x86_64.
Relevant log output
$ grep -A8 "SteamGameServer_Init" log/console/cs2server-console.log
SteamGameServer_Init() OK, logging on to Steam
****************************************************
* *
* No Steam account token was specified. *
* Logging into anonymous game server account. *
* Connections will be restricted to LAN only. *
* *
* To create a game server account go to *
* http://steamcommunity.com/dev/managegameservers *
Steps to reproduce
- Run
./linuxgsm.sh cs2serverand./cs2server install, and enter a valid GSLT at theGSLT TOKEN:prompt. - Check that
lgsm/config-lgsm/cs2server/cs2server.cfgcontainsgslt="<token>". - Run
./cs2server start. - Run
grep -E "logon token|anonymous game server" log/console/cs2server-console.log: the anonymous login banner is shown. - Run
./cs2server details: the command-line parameters do not contain+sv_setsteamaccount.
🤖 Generated with Claude Code
- 主要语言
- Shell
- 星标
- 4.9k
- 派生
- 871
- 平均合并
- 14 小时 50 分钟
- 30 天内合并 PR
- 109
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
GameServerManagers/LinuxGSM 的其他 Issue
-
status: linux support confirmed type: game server request
难度 3/5 1-2 天 新手友好度 52/100
GameServerManagers/LinuxGSM#5110 · 1 条评论 ·
维护者通常 1 天内回复
-
command: start engine: unity3d game: Assetto Corsa priority: high scope: single game type: feature
难度 4/5 3-5 天 新手友好度 42/100
GameServerManagers/LinuxGSM#5099 ·
维护者通常 1 天内回复
-
[Bug]: two update runs can run at the same time and break each other's SteamCMD download可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭engine: source game: Team Fortress 2 game: Team Fortress 2 Classified info: docker info: steamcmd type: bug
难度 4/5 3-5 天 新手友好度 52/100
GameServerManagers/LinuxGSM#5094 ·
维护者通常 1 天内回复
-
fix(core): propagate archive extraction and copy failures可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭type: bug
难度 3/5 半天 新手友好度 42/100
GameServerManagers/LinuxGSM#5048 ·
维护者通常 1 天内回复
-
engine: unity3d engine: unreal4 Epic game: 7 Days to Die game: ARK: Survival Evolved game: Rust info: dependency type: feature
难度 5/5 一周以上 新手友好度 8/100
GameServerManagers/LinuxGSM#5047 · 1 条评论 ·
维护者通常 1 天内回复
查看 GameServerManagers/LinuxGSM 的全部 Issue
相似的 Issue
-
kind/bug/report meta/needs triage
难度 2/5 1-3 小时 新手友好度 74/100
docker-mailserver/docker-mailserver#4831 ·
维护者通常 1 天内回复
-
Hyprland 0.57: monitor-workspaces reconcile errors on every start and reload when a named workspace exists (workspace.id is nil)可能已有人在做 @jasasonc 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
priority middle
难度 1/5 1 小时以内 新手友好度 62/100
KATO-Hiro/AtCoderClans#12940 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
needs-triage
难度 2/5 1-3 小时 新手友好度 66/100
metal3-io/metal3-dev-env#1741 · 1 条评论 ·