指南:建立一个独立专用服务器
该页面正在建设中。请访问 技术支持页面 以获得更多技术支持信息(英文)。
该页面的内容由 Steam 支持部门和 Steam 用户社区共同维护 - 请小心任何连至外部网站的链接。
Steam 支持部门不会以任何理由向您索取您的 Steam 帐号密码,也绝对不会要求您将您的 Steam 帐号密码输入网站页面。
独立专用服务器是资深用户的最佳选择。若您想知道更多关于哪种游戏服务器最适合您的信息,请参考主题概述:游戏服务器类型。
下载并安装 HldsUpdateTool
- 下载 HldsUpdateTool 安装程序(大小约为700KB)。
- 运行安装程序并选择一个安装文件夹
请注意:不要使用任何在 Steam 文件夹中已存在的路径。
- 选择与您的地区最接近的地区信息(该信息将会被用于在用户的服务器浏览列表中确定您服务器的位置)。
- 在按照说明完成安装后,打开 HldsUpdateTool 安装文件夹并执行 HldsUpdateTool.exe 以下载工具的升级。
HldsUpdateTool 参数与变量
若通过命令行运行 HldsUpdateTool 程序,可以使用如下参数及标记:
命令格式:hldsupdatetool -command <命令> [参数] [标记]
- 命令
- -command version - 查看安装的版本
- -command list - 查看可用的游戏
- 参数
- -game <游戏> - 安装一款游戏,<tt<游戏></tt>为该款游戏的代码。
- -dir <安装路径> - 用<安装路径>来根据要求指定安装的绝对路径 (若无特别指定路径,那么该工具将安装到最后一次的安装路径)。
- -username <用户名> - Steam 帐号用户名 (仅用于获取部分内容)
- -password <密码> - Steam 帐户密码 (仅用于获取部分内容)
- 标记
- -remember_password - 记住密码 (当提供了 Steam 用户名及密码的时候)
- -verify_all - 验证所有的 HLDS 文件已经更新
- -retry - 如果 Steam 网络繁忙,每 30 秒钟自动重新进行连接
安装游戏内容
一旦HldsUpdateTool工具安装完毕, 您就可以开始安装游戏内容了:
- 打开命令窗口 (开始菜单 > 运行 > cmd)
- 进入 HldsUpdateTool 工具安装路径
- 使用如下命令来安装游戏:
hldsupdatetool -command update -game <game> -dir <installdir> (<game> 为下列游戏代码中的某个,<installdir> 为您希望将游戏内容保存的位置)
- Source 引擎游戏
- Counter-Strike Source - Counter-Strike Source
- dods - Day of Defeat: Source
- hl2mp - Half-Life 2: Deathmatch
- GoldSrc 引擎游戏
- cstrike - Counter-Strike 1.6
- czero - Counters-Strike: Condition Zero
- dmc - Deathmatch: Classic
- dod - Day of Defeat
- gearbox - Opposing Force
- ricochet - Ricochet
- tfc - Team Fortress Classic
- valve - Half-Life Deathmatch
- 第三方游戏内容
- redorchestra - Red Orchestra
- ship - The Ship
- sin - Sin Episodes
- darkmessiah - Dark Messiah
- garrysmod - Garry's Mod
第三方游戏修改模组
您必须将第三方游戏修改模组装在专用服务器文件夹。关于某个特定第三方模组的详细信息请查看该模组的支持页面。
配置服务器
这些配置对 GoldSrc 引擎服务器 (hlds.exe) 和 Source 引擎服务器 (srcds.exe) 都起作用。
启动参数
启动参数可以在命令行中输入或者保存于 hlds.exe 或者 srcds.exe 的 Windows 快捷方式中。如果您需要,使用多少启动参数都可以。不过,您必需准确输入所有的参数,否则专用服务器将不能启动。
- -autoupdate - 在有更新发布时自动升级服务器端
- -console - 采用控制台模式启动服务器端 (没有用户界面(GUI))
- -game <game name> - 指定服务器将要运行的游戏
- -ip <ipaddress> - 在有多个 IP 可用时指定服务器端IP
- -port <port number> - 指定服务器端的端口 (若无特别指定,27015 端口哦将作为默认端口加以启用)
- +maxplayers <number of players> - 设定服务器端允许的最大玩家数
- +map <map name> - 设定初始地图
server.cfg 设置
游戏服务器端的配置文件可以用来在服务器端开始运行时自动执行服务器控制台参数的设定。
每款游戏的 server.cfg 文件都可以在该游戏的安装目录中找到(该目录为在运行 HldsUpdateTool 工具时所指定 sv_cheats # - 设置单机作弊选项,当 #为1时为"启用",为0时为"禁用"
- sv_contact "admin@yourdomain.com" - 设置管理员联络e-mail地址
- sv_maxrate # - 设置服务器所允许的最大数据传输率(字节每秒),#最小值: 1000 / 默认值: 10000 / 最大值 25000
- sv_region # - 设置您的服务器所在的区域,当#为:
- -1 - 全球
- 0 - 美国东部
- 1 - 美国西部
- 2 - 南美洲
- 3 - 欧洲
- 4 - 亚洲
- 5 - 澳大利亚
- 6 - 中东
- 7 - 非洲
请参考主题 服务器设置 以获得完整的服务器命令列表
HLDS 资源管理命令
使用如下的命令来控制 HLDS/SRCDS 资源管理。
- sv_allowdownload # - 设为1来载入客户端上的内容 (地图, 喷图,以及相关材质) ,设为0来禁止载入
- sv_allowupload # - 设为1允许客户端上传自定义喷图到服务器,设为0来禁止自定义喷图
- hpk_maxsize # - 限制客户端上传的喷图文件的大小(范围: .1 MB 至1.5 MB - 设为0则允许任意大小的文件)
- sv_downloadurl <网址> - 使用这个设置来让客户端通过不同的服务器下载内容(将降低服务器由于客户端下载内容所产生的负载) - 设置您的<网址>为如下格式http://www.<domain>.com/<filepath>,请参考条目 快速 HTTP 下载 的说明
- sv_filetransfercompression # - 设为1来启用游戏服务器发送到客户端的文件的压缩功能,设为0则禁用该功能
- sv_send_logos # - 设为1时允许服务器端将自定义喷图发给每个客户端(sv_allowdownload也必须同时启用),而为0时的禁用喷图
- sv_send_resources # - 设为1来将安全资源(模型)发送至客户端,设为0则不发送
游戏设置
你也可以创建自定义设置文件,并使用命令 exec <文件名> 来载入这些文件(<文件名为游戏安装目录下的一个文件的名字)。
- Counter-Strike
- mp_timelimit <minutes> - 使用<minutes>来设置每张地图的持续时间(分钟)。
- mp_buytime <minutes> - 使用<minutes>来设置允许玩家在游戏开始之前可以购买武器的时间(分钟)
- mp_startmoney <amount> - 使用<amount>来设置开局时玩家的金钱数
- mp_c4timer <seconds> - 使用<seconds>来设置已安防的 C4 炸弹的引爆时间(秒)
- mp_freezetime <seconds> - 使用<seconds>来设置每局开始时玩家静止的时间(秒)
motd.txt
该文件包含有您的服务器的“每日信息”。只要您愿意,您可以在该文件中添加您的联络信息以及网站地址等信息。
该文件允许使用 HTML 编码。
motd.txt举例:
MESSAGE OF THE DAY
Welcome to my Counterstrike Server
Map Rotation For This Server:
de_dust2
cs_assault
de_train
cs_Havana
mapcycle.txt
该文件包含有您服务器所运行的地图列表。
mapcycle.txt 举例:
de_dust2
cs_assault
de_train
cs_Havana
快速 HTTP 下载
用户可以通过HTTP的网页服务器下载自定义内容,以减轻对您专用服务器的资源及带宽要求。快速 HTTP 下载允许 SRCDS 或者 HLDS 使用所有可用资源及带宽。
- 将您服务器中使用的所有自定义文件(bsp, wav, mdl等等)列为清单。
- 按照目录结构上传文件到网页服务器。
- 可选: 要显示横幅图片(比如,一张显示“下载服务由...提供”信息的图片),上传一张 340x56 像素的图片到<自定义内容目录>/gfx/banner.gif
- 使用sv_downloadurl <url>命令并设置<url>为http://<domain>/<custom_content_directory>/(<domain>为您网页服务器域名,<custom_content_directory>为映射您 HLDS 或者 SRCDS 游戏安装目录自定义内容文件夹的路径名)
若您的网页服务器使用了基础 HTTP 认证进行安全保护,请使用如下格式http://<username>:<password>@<domain>/<custom_content_directory>来添加 HTTP 用户名及密码已进行认证,<username>和<password>就是对您服务器上的内容文件拥有读取权限的帐户的用户名和密码的组合。
关于专用服务器设置的其他资源
专用服务器帮助资源
加入您相应操作系统的专用服务器讨论列表并查看邮件列表存档以找到关于专用服务器问题的解决方案:
English content to translate (START)
Standalone dedicated servers are the best choice for experienced users. Please see the Overview: Types of Game Servers topic if you would like more information to determine which type of game server is the best choice for you.
Download and Install HldsUpdateTool
- Download the HldsUpdateTool Installer (approximately 700 KB)
- Run the installer and select an installation folder
Note: Do not use a path within any existing Steam folders
- Select the region which most closely matches your region (this value will be used to position your server in users' server browser lists)
- Upon completing the guided installation, navigate to the HldsUpdateTool installation folder and execute HldsUpdateTool.exe to download updates for the tool
HldsUpdateTool Parameters and Flags
Use these parameters and flags when running HldsUpdateTool program from the command line:
Format: hldsupdatetool -command <command> [parameters] [flags]
- Commands
- -command version - View installed versions
- -command list - View available games
- Parameters
- -game <game> - Install a game where <tt<game></tt> is the desired game's code
- -dir <installdir> - Specify the absolute path to the desired installation directory with <installdir> (the tool will install to the last directory used if no directory is specified)
- -username <username> - Steam account username (only needed to access limited content)
- -password <password> - Steam account password (only needed to access limited content)
- Flags
- -remember_password - Remember password (if a Steam account username and password are supplied)
- -verify_all - Verify that all HLDS files have been updated
- -retry - Automatically retry every 30 seconds if the Steam Network is busy
Install Game Content
Once HldsUpdateTool has been installed, you may begin installing game content:
- Open a command prompt (Start > Run > cmd)
- Navigate to the HldsUpdateTool installation directory
- Use the following command install a game:
hldsupdatetool -command update -game <game> -dir <installdir> (Where <game> is one of the game codes listed below and <installdir> is the absolute path to the folder where you wish to store the content)
- Source-engine Games
- Counter-Strike Source - Counter-Strike Source
- dods - Day of Defeat: Source
- hl2mp - Half-Life 2: Deathmatch
- GoldSrc-engine Games
- cstrike - Counter-Strike 1.6
- czero - Counters-Strike: Condition Zero
- dmc - Deathmatch: Classic
- dod - Day of Defeat
- gearbox - Opposing Force
- ricochet - Ricochet
- tfc - Team Fortress Classic
- valve - Half-Life Deathmatch
- Third-party Game Content
- redorchestra - Red Orchestra
- ship - The Ship
- sin - Sin Episodes
- darkmessiah - Dark Messiah
- garrysmod - Garry’s Mod
Third-party Mods
You must install the third-party mod files under the dedicated server folder. Please refer to the third-party mod support site for additional information on specific mods.
Configure the Server
These configuration procedures apply to both GoldSrc-engine servers (hlds.exe) and Source-engine servers (srcds.exe).
Launch Switches
Launch switches may be entered at the command prompt or saved with the hlds.exe or srcds.exe Windows shortcut. You may use as many launch switches as you would like, however, the switches must be entered correctly or your dedicated server will not start.
- -autoupdate - Automatically updates the server whenever updates are released
- -console - Starts the server in console mode (no GUI)
- -game <game name> - Indicates which game server to launch
- -ip <ipaddress> - Sets the server IP if multiple IPs are available
- -port <port number> - Sets the port which the server will accept connections through (port 27015 will be used by default if no port is specified)
- +maxplayers <number of players> - Sets the maximum number of players allowed on the server
- +map <map name> - Sets the starting map
server.cfg Settings
A game server config file can be used to automatically execute set server console variables (CVARs) whenever the server is started.
Each game's server.cfg file can be found under the game's installation directory (this will be a subfolder named after the game's code under the installation directory specified when running HldsUpdateTool).
- hostname "yourhostname" - Enter yourhostname as the server name which you would like to appear players' server browser
- rcon_password "yourpassword" - Enter yourpassword as the secure password you would like to use to authenticate so you may change the server's configuration while logged in to play as a client
- sv_aim # - Set auto-aiming for players where # is 1 for "on" and 0 for "off"
- sv_cheats # - Set single-player cheat options where # is 1 for "enabled" and 0 for "disabled"
- sv_contact "admin@yourdomain.com" - Sets the administrative contact e-mail address
- sv_maxrate # - Set the maximum rate of bytes per second which the server is allowed to transmit where # is at minimum: 1000 / at default: 10000 / at maximum 25000
- sv_region # - Sets the region which your server will report as its location where # is:
- -1 - World
- 0 - US East Coast
- 1 - US West Coast
- 2 - South America
- 3 - Europe
- 4 - Asia
- 5 - Australia
- 6 - Middle East
- 7 - Africa
Please see the Server Settings topic for an extensive list of server commands.
HLDS Resource Management CVARS
Use the following CVARs to control how the HLDS/SRCDS manages resources.
- sv_allowdownload # - Set to 1 to load content on the client (maps, sprays, and related materials) and 0 to disable
- sv_allowupload # - Set to 1 to allow clients to upload custom sprays to the server and 0 to disable custom sprays
- hpk_maxsize # - Limits the file size of spray uploads from clients (range: .1 MB to 1.5 MB - set to 0 to allow any file size)
- sv_downloadurl <url> - Use this setting to allow clients to use a different server to download content (this reduces the server load associated with clients downloading content) - set your <url> in the format http://www.<domain>.com/<filepath> as directed in the Fast HTTP Downloading instructions
- sv_filetransfercompression # - Set to 1 to enable file compression on files sent from the gameserver to the client and 0 to disable
- sv_send_logos # - Set to 1 to allow the server to send custom sprays back to all players (sv_allowdownload must also be enabled) and 0 to disable sprays
- sv_send_resources # - Set to 1 to enforce the sending of secure resources (models) to clients and 0 to disable
Game Settings
You may also create custom config files and load them by using the exec <filename> CVAR (where <filename is the name of a file located in the game installation folder).
- Counter-Strike
- mp_timelimit <minutes> - Use <minutes> to set the number of minutes spent on each map
- mp_buytime <minutes> - Use <minutes> to set the amount of time players are allowed to buy/rebuy weapons before the round starts
- mp_startmoney <amount> - Use <amount> to set the amount of money players start the round with
- mp_c4timer <seconds> - Use <seconds> to set the detonation timer for C4 which has been planted
- mp_freezetime <seconds> - Use <seconds> to set how long players are frozen before being able to move at the beginning of each round
motd.txt
This file contains your servers "Message of the Day". You may include your contact information and website address in this file if you wish.
HTML code is allowed in this file.
Example motd.txt:
MESSAGE OF THE DAY
Welcome to my Counterstrike Server
Map Rotation For This Server:
de_dust2
cs_assault
de_train
cs_Havana
mapcycle.txt
This file contains the list of maps your server cycles through.
Example mapcycle.txt:
de_dust2
cs_assault
de_train
cs_Havana
Fast HTTP Downloading
Users may download custom content from a web server over HTTP to reduce the resources and bandwidth required by your dedicated server. Fast HTTP downloading allows the SRCDS or HLDS to use all the available resources and bandwidth for hosted games.
- Make a list of all the custom files (bsp, wav, mdl, etc) used on your server
- Upload the files to a web server while keeping the directory structure intact
- Optional: To display a banner image (for example, an image with the message "Content Hosting Provided By ...") upload a 340x56 pixel image to <custom content directory>/gfx/banner.gif
- Use the sv_downloadurl <url> CVAR and set <url> to http://<domain>/<custom_content_directory>/ (where <domain> is the domain name which points to your web server and <custom_content_directory> is the name of the directory which mirrors the custom content directory under your HLDS or SRCDS game installation folder)
If your web server is secured with Basic HTTP Authentication, use the format http://<username>:<password>@<domain>/<custom_content_directory> to add your HTTP username and password for authentication where <username> and <password> is the username and password combination for a web server account with read privileges for the content files
Additional Dedicated Server Configuration Resources
Dedicated Server Assistance
Join the dedicated server discussion list for your operating system and review the mailing list archives to find solutions for dedicated server issues:
(END) English content to translate
|