Zh/Counter-Strike: Global Offensive/Dedicated Servers
此页面列出了设置和运行反恐精英:全球攻势专用服务器的基础教程。


下载 CS:GO 专用服务器
本段介绍了更新 CS:GO 专用服务器的方法。每次游戏更新时都需要执行这些步骤。若想在未来自动执行此步骤,请参见:自动执行Steam。
1. 下载并安装 SteamCMD。
2. 启动 SteamCMD。在看到 Steam> 提示符后设置你的 CS:GO 专属服务器安装路径。

示例代码:
- Windows 操作系统:
force_install_dir c:\csgo-ds\ force_install_dir .\csgo-ds\
- Linux 操作系统:
force_install_dir /full/path/to/csgo-ds/
3. 安装或升级 CS:GO。 如果您是第一次安装或需要检查服务器文件的完整性:
app_update 740 validate
如果只是对先有服务器进行更新:
app_update 740
4. 一旦完成安装,请在 Steam> 提示符后输入 quit 命令来退出 Steam 。
注册服务器登录令牌
如果您的服务器没有使用服务器登录令牌(GSLT)登录永久性游戏服务器账号, 则您的 CS:GO 游戏服务器和 GOTV 观战系统将只允许同一局域网内的客户端以 RFC 1918 的 IP 地址连接。
RFC 1918 是指私有网络地址分配,其中包含的 IP 地址范围是:
10.0.0.0-10.255.255.255 172.16.0.0-172.31.255.255 192.168.0.0-192.168.255.25
如果您的服务器有一个公网 IP 地址,并且客户端需要从互联网访问服务器,则需要注册一个服务器登录令牌(GSLT)。
注册服务器登录令牌(GSLT)的过程非常简单,请访问此网站并根据提示注册: http://steamcommunity.com/dev/managegameservers (无需担心,一个合格的账户允许注册1000个服务器令牌)
每个服务器登录令牌(GSLT)只允许在一个游戏服务器示例上使用。这意味着如果您有多台 CS:GO 服务器,则需要为每一台服务器生成一个独一无二的令牌。
令牌在启动服务器时,通过在命令行中添加 +sv_setsteamaccount <十六进制令牌>
来使用。您也可以通过添加 -net_port_try 1
命令来验证令牌的唯一性.
对了,凡是使用了令牌登录的公网服务器都必须严格遵守我们的服务器操作指南: http://blog.counter-strike.net/index.php/server_guidelines/
启动服务器


srcds
替换为 ./srcds_run
;
+sv_setsteamaccount <十六进制服务器令牌> -net_port_try 1
命令以使用GSLT(游戏服务器登录令牌)。休闲模式:
srcds -game csgo -console -usercon +game_type 0 +game_mode 0 +mapgroup mg_active +map de_dust2
竞技模式:
srcds -game csgo -console -usercon +game_type 0 +game_mode 1 +mapgroup mg_active +map de_dust2
军备竞赛模式:
srcds -game csgo -console -usercon +game_type 1 +game_mode 0 +mapgroup mg_armsrace +map ar_shoots
爆破模式:
srcds -game csgo -console -usercon +game_type 1 +game_mode 1 +mapgroup mg_demolition +map de_lake
死亡竞赛模式:
srcds -game csgo -console -usercon +game_type 1 +game_mode 2 +mapgroup mg_allclassic +map de_dust

csgosl - 一个跨平台的 CSGO 图形化界面
github wiki (with pics) download
csgosl is a graphical user interface for the Counter Strike Global Offensive Dedicated Server (CSGO server from now on). csgosl supports one-click install, update, start and stop server on windows and linux platforms (supported platforms). If you just want your own CSGO server up and running in no time this is the place for you. csgosl supports most mainstream server options. For the advanced user exits the advanced mode providing support for nearly any setting.
csgosl features:
- Completely automatic install (steamcmd + srcds + metamod/sourcemod/plugins)
- Server update, automatic or manual
- Start/monitor/stop server
- Host lan only or public servers
- Host workshop maps and map groups
- Manage all your maps and create your own map groups using the map group editor
- Easily view and select all installed maps using map previews
- Greatly simplified server settings with reasonable defaults
- Advanced settings mode for the control freak (supports all cvars with in app help texts)
- Override settings in one place for all game modes/types
- Online help easily accessible from the application
- Comes preinstalled with sourcemod, metamod and some plugins
Linux 脚本
csgo-server-launcher
A simple script has been created to manage the server. It was tested on Debian and Ubuntu distributions and it can create, start, stop, restart, update the server. You can also display the console via the console command. If you are in console mod, don't forget to press CTRL+A then D to stop the screen without stopping the server.
Features
- start - Start the server with the PARAM_START var in a screen.
- stop - Stop the server and close the screen loaded.
- status - Display the status of the server (screen down or up)
- restart - Restart the server (stop && start)
- console - Display the server console where you can enter commands.
- update - Update the server based on the PARAM_UPDATE then save the log file in LOG_DIR and send an e-mail to LOG_EMAIL if the var is filled.
- create - Create a server (script must be configured first).
This script is available on GitHub : csgo-server-launcher
LGSM csgoserver
Part of Linux Game Server Managers scripts, csgoserver is a command line tool for quick, simple deployment and management of a Counter Strike: Global Offensive Linux dedicated server.
Main Features
- Server installer (SteamCMD).
- Loads of default start parameters (including workshop support)
- Start/Stop/Restart server.
- Server console.
- Server monitoring (including email notification).
- Server update (SteamCMD).
- Server backup.
Compatibility
The Linux Game Server Manager is tested to work on the following Linux distributions :
- Debian based distros (Ubuntu, Mint etc.).
- Redhat based distros (CentOS, Fedora etc.).
Get the script at gameservermanagers.com.
Get more info : Github Wiki.
Get help : LGSM Steam group.
Windows 软件/脚本
SteamCMD GUI
This tool allows the user to use SteamCMD on Windows without command lines and/or batch files.
GitHub Repo: https://github.com/DioJoestar/SteamCMD-GUI.git
pyr0s-csgo-server-launcher
A simple script to launch 3 different servers in any of the 4 game modes available. My First ever attempt at any sort of scripting.
URL : http://code.google.com/p/pyr0s-csgo-server-launcher/
高级设置
Configuring your new Counter-Strike: Global Offensive server differs from what server administrators have seen with previous dedicated servers. There are some primary differences, which we'll cover here.
autoexec.cfg
The file has to be created in \csgo\cfg.
This file is executed before the first map starts. The valve.rc executes the autoexec.cfg and in the next line the cmd stuffcmds, which will execute the parameters with + from the commandline.
In your autoexec.cfg you can set cvars that have to be set only one time:
log on //This is set to turn on logging! Don't put this in your server.cfg hostname "Counter-Strike: Global Offensive Dedicated Server" rcon_password "yourrconpassword" sv_password "" //Only set this if you intend to have a private server! sv_cheats 0 //This should always be set, so you know it's not on sv_lan 0 //This should always be set, so you know it's not on exec banned_user.cfg exec banned_ip.cfg
server.cfg
The server.cfg file can be found under \csgo\cfg. (make it if it doesn't exist)
This file is executed every map change, and before the gamemode files listed below. Here is an example of a very simple server.cfg file:
mp_autoteambalance 1 mp_limitteams 1 writeid writeip
gamemodes.txt
This file can be found under the \csgo\ folder.
Essentially, this file defines Valve's standard "rules" for each game mode. For example, a classic casual game gives defuse kits to CTs automatically, while in a classic competitive game they are purchasable like in previous versions of CS. You should not edit this file because Valve may decide to change the rules for a particular game mode at any time. If you customize this file, your changes will be wiped out any time Valve chooses to push an update to this file.
Even though you shouldn't edit this file, it's still useful to use this file to determine how exactly to make a particular convar change. Find the section you want to edit, and you'll see the group of appropriate convars you can set. Again, you will need to make your actual changes in gamemodes_server.txt.
Each section of the file is separated by the game type. The game types are Casual, Competitive, Arms Race (gungameprogressive), Demolition (gungametrbomb), and Deathmatch.
gamemodes_server.txt
This file must be created or otherwise generated from gamemodes_server.txt.example under the \csgo\ folder. This file allows the server administrator to customize each game mode for their own server. It overrides and defaults set by Valve in gamemodes.txt. With this file, for example, you can change the maxrounds for a game type from the default, or enable friendly fire but reduce the amount of damage friendlies deal.
IT IS IMPORTANT TO MAINTAIN THE SAME HIERARCHY AND SYNTAX AS GAMEMODES.TXT!!! Included with your server installation is a gamemodes_server.txt.example file to help you learn the syntax. There is no file specifically named gamemodes_server.txt in the standard server install. You must rename, copy, or make a new file called gamemodes_server.txt to be able to customize your game modes.
Bots
You can change the amount of bots, the way the bots populate the server and how chatty they are by updating the convars below:
"bot_quota_mode" "fill" "bot_defer_to_human_items" "1" "bot_defer_to_human_goals" "0" "bot_difficulty" "1" "bot_dont_shoot" "0" "bot_chatter" "normal" "bot_autodifficulty_threshold_low" "-2.0" // Value between -20.0 and 20.0 (Amount below avg human contribution score, below which a bot should raise its difficulty) "bot_autodifficulty_threshold_high" "0.0" // Value between -20.0 and 20.0 (Amount above avg human contribution score, above which a bot should lower its difficulty)
Round Convars
The following convars can be changed to update how the rounds are played out. You can change from round limits to time limits, to how long you force players to freeze in place to buy to forcing the camera to only specatating your team members while dead. Each convar is set specifically for each game type, so you'll have to go through each of the different game modes to get them all updated! These may be overridden by settings in cfg/gamemode_XXX.cfg and cfg/gamemode_XXX_server.cfg, the details of which are specified below.
"mp_afterroundmoney" "0" "mp_playercashawards" "1" "mp_teamcashawards" "1" "mp_maxrounds" "30" "mp_timelimit" "0" "mp_roundtime" "2" "mp_freezetime" "15" "mp_buytime" "45" "mp_forcecamera" "1" // Set to 1 for team only spectating. "mp_defuser_allocation" "0" "mp_death_drop_gun" "1" // 0=none, 1=best, 2=current or best "mp_death_drop_grenade" "2" // 0=none, 1=best, 2=current or best "mp_death_drop_defuser" "1"
Gun Game and Demolition Progression
You'll find convars available to update how the server progresses individuals through the weapons in both Gun Game modes. You can set the weapon order and the kill requirements in order to move on to the next weapon. These convars are separated by team, so be careful to make changes for both sides or you could potentially unbalance the matches on your server.
As an example, here is a list of the convars of weapon progression on Arms Race for a single team:
"mp9" { "kills" "1" } "mac10" { "kills" "1" } "mp7" { "kills" "1" } "bizon" { "kills" "1" } "ump45" { "kills" "1" } "p90" { "kills" "1" } "nova" { "kills" "1" } "mag7" { "kills" "1" } "xm1014" { "kills" "1" } "sawedoff" { "kills" "1" } "galilar" { "kills" "1" } "famas" { "kills" "1" } "ak47" { "kills" "1" } "m4a1" { "kills" "1" } "sg556" { "kills" "1" } "aug" { "kills" "1" } "awp" { "kills" "1" } "m249" { "kills" "1" } "negev" { "kills" "1" } "glock" { "kills" "1" } "hkp2000" { "kills" "1" } "tec9" { "kills" "1" } "p250" { "kills" "1" } "deagle" { "kills" "1" } "fiveseven" { "kills" "1" } "elite" { "kills" "1" } "knifegg" { "kills" "1" }
Here is an example of the weapon progression on Demolition for a single team:
"m4a1" { "kills" "1" } "p90" { "kills" "1" } "ump45" { "kills" "1" } "deagle" { "kills" "1" } "nova" { "kills" "1" } "fiveseven" { "kills" "1" } "hkp2000" { "kills" "1" } "ssg08" { "kills" "1" } "awp" { "kills" "1" } "Scar20" { "kills" "1" }
Note that Arms Race uses random weapons by default. To force the custom list to be used, set mp_ggprogressive_use_random_weapons
to 0
.
gamemode_casual_server.cfg
Files gamemode_casual_server.cfg and gamemode_casual.cfg reside in the cfg directory. The latter (gamemode_casual.cfg) is configured by Valve, and contains the convars that are set at the beginning of each Classic Casual match (they are set each time the server loads a map). A similar file exists for each game mode (replace casual with the appropriate mode ie. competitive, or armsrace). The format of this file is simple, it is "convar setting //optional comment
". For example, from gamemode_casual.cfg:
bot_autodifficulty_threshold_high 0.0 // Value between -20.0 and 20.0 (Amo... cash_player_bomb_defused 200
Admins should not modify the gamemode_XXX.cfg files. Valve's file naming convention suggests that these files may be modified in the future, and your settings may be overwritten. Instead, modify the file ending in _server.cfg you create.
Each gamemode_XXX.cfg file may have a corresponding gamemode_XXX_server.cfg file within the cfg directory. Valve's file naming convention suggests that _server.cfg files will not be overwritten by future updates. Any settings specified in the _server.cfg file will override those in the original config file because the _server.cfg file is executed after it. This ordering is visible within gamemodes.txt .
Settings in gamemode_XXX.cfg and gamemode_XXX_server.cfg seem to override those within gamemodes_server.txt, and server.cfg. Furthermore, it's easier to modify the settings in gamemode_XXX_server.cfg due to the formatting.
When modifying settings, the amount of spaces or tabs between convar and setting seems to be irrelevant, but there must be some. Comments are single-line C++ style, and must come only after a //.
Once you've launched your dedicated server, you can type in the following command to output all available convars that can be altered:
//The output file will be located in the csgo folder of your dedicated server cvarlist log cvarlist.txt
Maps
The game no longer uses maplist.txt files and the maps you play are now controlled by map groups. A server must be started with a mapgroup or workshop_collection or maps will not cycle correctly. See the included gamemodes_server.txt.example file for an example mapgroup.
FAQ 和 已知问题
For known issues and workarounds, please visit CSGO DS known issues.