本指南介绍如何在 Legion Hosting 上为 Counter-Strike 2 服务器设置管理员权限、RCON、管理员命令和竞技比赛配置。有关初始服务器设置(包括 GSLT、游戏模式和连接方式),请参阅 CS2 服务器设置指南。
RCON(远程控制台)设置
RCON 允许您从游戏内控制台或 GPanel 远程运行服务器命令,无需重启。它通过 server.cfg 中的 rcon_password cvar 进行配置。
设置 RCON 密码
通过 GPanel 中的 File Manager 或通过 SFTP 打开 game/csgo/cfg/server.cfg,添加或编辑以下内容:
rcon_password "YourStrongPassword"
在游戏内使用 RCON
使用 `(波浪键)打开开发者控制台。先进行身份验证,然后输入命令:
rcon_password YourStrongPassword
rcon changelevel de_mirage
rcon mp_maxrounds 30
rcon status
验证通过后,每个命令前加上 rcon 前缀即可在服务器上执行。
从 GPanel 使用 RCON
您也可以直接在 GPanel 的 Console 选项卡中运行命令,无需 rcon 前缀。这是最简便的服务器管理方式。
常用管理员命令
以下命令可通过 RCON 或 GPanel 控制台运行。
玩家管理
| 命令 | 描述 |
|---|---|
status |
列出所有已连接玩家及其 Steam ID 和延迟 |
kick <name> |
按名称踢出玩家 |
kickid <userid> |
按用户 ID 踢出玩家(来自 status 输出) |
banid <minutes> <steamid> |
按 Steam ID 封禁玩家(0 = 永久封禁) |
removeid <steamid> |
从封禁列表中移除某个 Steam ID |
users |
列出已验证的 RCON 用户 |
服务器控制
| 命令 | 描述 |
|---|---|
changelevel <map> |
更换当前地图(例如 de_inferno) |
mp_restartgame 1 |
1 秒后重启当前游戏 |
mp_warmup_end |
立即结束热身 |
mp_pause_match |
暂停当前比赛 |
mp_unpause_match |
取消暂停当前比赛 |
bot_add_t / bot_add_ct |
向指定队伍添加机器人 |
bot_kick |
踢出服务器中所有机器人 |
exec <filename> |
执行配置文件(例如 exec competitive.cfg) |
竞技比赛配置
对于竞技比赛,创建或编辑 game/csgo/cfg/autoexec.cfg(每次地图加载时自动执行),在游戏模式默认设置基础上应用竞技调优:
// -----------------------------------------------
// Competitive / match settings
// -----------------------------------------------
mp_overtime_enable 1 // Enable overtime if scores are tied
mp_overtime_maxrounds 6 // Rounds per overtime half (3+3)
mp_overtime_halftime_pausetimer 0
mp_halftime 1 // Enable halftime side switch
mp_maxrounds 24 // Standard 12 per half
mp_freezetime 15 // Seconds players are frozen at round start
mp_roundtime 1.92 // Round time in minutes (1:55 approx)
mp_roundtime_defuse 1.92
mp_buytime 20 // Seconds players can buy after round start
mp_buy_anywhere 0 // Players must be in buy zone
mp_startmoney 800 // Starting money
mp_friendlyfire 1 // Team damage on (standard competitive)
mp_warmup_pausetimer 0
mp_warmuptime 30
// -----------------------------------------------
// Anti-cheat and security
// -----------------------------------------------
sv_pure 1 // Only allow official files (1) or workshop (0)
sv_pure_kick_clients 1
// -----------------------------------------------
// Bot behaviour (remove bots for real matches)
// -----------------------------------------------
bot_quota 0
bot_join_after_player 0
practice.cfg、match.cfg、warmup.cfg),并通过 RCON 或 GPanel 控制台使用 exec practice.cfg 加载它们。
GOTV(观战和录像)
GOTV 允许观众以可配置的延迟观看比赛,并可录制录像供赛后回顾。将以下设置添加到您的 server.cfg 中:
tv_enable 1 // Enable GOTV
tv_name "GOTV" // Name shown to spectators
tv_delay 30 // Delay in seconds before GOTV shows action
tv_maxclients 10 // Maximum GOTV spectators
connect YOUR.SERVER.IP:GOTV_PORT 进行连接。
通过 RCON 手动录制录像:
tv_record mydemoclip
// ... match plays ...
tv_stoprecord
录像文件保存在服务器的 game/csgo/ 目录中,可通过 SFTP 下载。
相关文章
- CS2 服务器设置指南 — GSLT、server.cfg、游戏模式、连接方式
- CS2 故障排除 — 常见错误和修复方法
- 如何查找服务器 IP 和端口
- 如何通过 SFTP 上传文件