Dedicated Server:th
Contents |
สิ่งที่ต้องการ
เซิร์ฟเวอร์ ns2 ต้องการสิ่งเหล่านี้:
- physx*
- directx*
- HLDS Update Tool หรือ Steam (สำหรับอัพเดท)
- NS2 เวอร์ชั่นตัวเต็ม (หากใช้ Steam)
* ใส่ไว้ใน .\\steam\steamapps\common\natural selection 2\redist
ติดตั้งผ่าน HLDSUpdateTool
เป็นวิธีที่แนะนำและวิธีที่ง่ายสำหรับการติดตั้งและอัพเดทเซิร์ฟเวอร์
การติดตั้งเซิร์ฟเวอร์ Natural Selection 2 ด้วย HLDSUpdateTool นั้นง่ายดายมาก ขั้นแรกจะต้องดาวน์โหลด installer จาก Valve.
หากคุณได้ใช้ HLDSUpdateTool สำหรับเซิร์ฟเวอร์เกมอื่นๆ ก็ไม่ต้องติดตั้งซ้ำ
เมื่อติดตั้ง HLDSUpdateTool แล้ว, เปิด command prompt (หรือที่ชาวบ้านเขาเรียกกันว่า DOS)ในฐานะ administrator จากนั้นก็ใส่คำสั่ง (ตามตำแหน่งที่ได้ติดตั้ง HLDSUpdateTool ไว้):
cd "c:\Program Files\Valve\HLServer"<br/> HLDSUpdateTool -command update -game naturalselection2 -dir <install dir>
Substitute the directory where you would like the server files to be installed for <install dir>. Instructions for how to run a dedicated server are included in the file dedicated_server_usage.txt that will be installed along with the game files (see below).
การติดตั้งในระบบปฏิบัติการ Windows
Basic Setup
- 1. Forward port 27015 สำหรับ router/firewall สำหรับเซิร์ฟเวอร์: Portforward.com
- 2. ดาวน์โหลดสำหรับตัวเซิร์ฟเวอร์ที่ชื่อ HLDS Update Tool (ดูข้างบนสำหรับวิธีการ).
- 3. Alternatively you can use Steam*
- 3.1 เข้าไปที่ี \Steam\steamapps\common\natural selection 2
- 3.2 คลิกขวา server.exe แล้วสร้าง shortcut
- 3.3 Right click on the shortcut for server.exe and edit the target line to show something similar to this
.\\Steam\steamapps\common\natural selection 2\Server.exe" -name SERVERNAME -map ns2_tram -limit 8 -lan false
- 4. เปิดเซิร์ฟเวอร์!
หมายเหตุ: สำหรับการปรับแต่งเซิร์ฟเวอร์ขั้นสูง โปรดดูข้อมูลด้านล่าง
* Steam ไม่จำเป็นสำหรับเซิร์ฟเวอร์ มักใช้ในการอัพเดทตัวเกมเท่านั้น * แนะนำให้ใช้ HLDS Update Tool สำหรับเซิร์ฟเวอร์
การอัพเดท
The NS2 server does not have any method to do automatic updates yet. There is a third party tool that can be found here that will do it. To install it, perform the Basic Setup above, then follow the instructions on the NS2Update readme. Note: You must use hldsupdatetool if you want to make use of this.
Linux Setup
Zimzum posted linux guide, he uses opensuse v11.3 with latest build of wine v1.2. You MUST use 32-bit wine 1.2.2 or higher for wine to work with ns2. This script installs 32bit wine-1.2.2 for 64 bit centos 5.
All you have to do is run server.exe through wine with the command line parameters:
wine Server.exe -name <whatever> -map ns2_tram -limit 8 -lan <whatever>
* A Linux dedicated server is planned, but for now don't have high priority (sorry, lots of other things to do first).
Dedicated_Server_Usage.txt
เซิร์ฟเวอร์จะเก็บข้อมูลการตั้งค่าไว้ในไฟล์นี้: %APPDATA%/Natural Selection 2/server.xml
If the file does not exist, it will create a default copy the first time it is run.
The server options can be changed in the file manually, or they can be specified individually on the command line (those changes will be saved by default.)
Optional command line settings are:
-file [path] (allows you to specify a different configuration file for server settings) -name [name] (specifies the server name to be shown in the server browser) -map [name] (specifies the map to load) -ip [address] (specifies IP address) -port [number] (ปกติจะเป็น 27015) -limit [number] -lan [1 or 0, or true/false] (specifies how/if this map shows up in the master server list - default is false) -password [optional] -save [1 or 0, or true/false] - (specifies whether to save out command line overrides - default is true)
หมายเหตุ: แนะนำว่าอย่าโฮสต์เกมไว้ในพอร์ต 27016 เพราะมันจะไปขัดแย้งกับระบบรายชื่อเซิร์ฟเวอร์
ตัวอย่าง:
- Server.exe -map ns2_tram -limit 32 -lan false
- Server.exe -file "c:\my servers\config.xml" -map ns2_rockdown -lan true -save false
Server.xml
คุณยังสามารถแก้ไข server.xml ที่อยู่ใน %appdata%\roaming\natural selection 2 หรือ %appdata%\natural selection 2
<options>
<lanGame>false</lanGame>
<mapName>ns2_tram</mapName>
<password></password>
<port>27015</port>
<serverName>SERVERNAME</serverName>
<address></address>
<playerLimit>8</playerLimit>
</options>
It is a good practice to add on the name of the server the players limit, and if it's a dedicated server or a home based one.
Web Administration
You can also administer the server via a web interface. This feature was added in alpha patch 152. By default the web administration feature is turned off. Take into consideration that it is still beta and many features are not added or correctly working.
To add a user to have access to the web interface do the following:
Server.exe -webadduser newuser -webpass secret -webdir "c:\web_directory" -webdomain localhost
Commands relevant to user administrator for the web interface:
-webadduser username (Adds a new user to the .htpasswd file.) -webedituser username (Updates the settings of a user in the .htpasswd file) -webdeleteuser username (Removes an existing user from the .htpasswd file)
When configuring users, the following options (described in the previous section) must be set as well:
-webdomain [name] -webdir [directory] -webpass [password, required for adding/editing users only]
Examples for configuring users:
Server.exe -webadduser newuser -webpass secret -webdir "c:\web_directory" -webdomain localhost Server.exe -webedituser existinguser -webpass newsecret -webdir "c:\web_directory" -webdomain localhost Server.exe -webdeleteuser existinguser -webdir "c:\web_directory" -webdomain localhost
To turn on the web interface do the following:
Server.exe -webadmin 1 -webdir "c:\web_directory" -webdomain localhost
หรือคุณสามารถเขียนใน server.xml :
<webadminActive>true</webadminActive> <webadminDomain>localhost</webadminDomain> <webadminDirectory>"c:\web_directory"</webadminDirectory>
By default the web administration interface uses port 8080.
Additional command line settings relevant for web administration:
-webadmin [1 or 0, or true/false] (specifies whether web administration is active - default is false) -webdomain [name] (specifies the web server's domain name, primarily used in authentication phase) -webdir [directory] (specifies the web server's root directory, which must exist on disk and must contain a .htpasswd file) -webport [number] (default is 8080)
To access the web interface use the following
http://<webdomain>:<webport>
ตัวอย่าง:
http://localhost:8080
ข้อเสนอแนะสำหรับเซิร์ฟเวอร์
สำหรับข้อเสนอแนะสำหรับเซิร์ฟเวอร์ โปรดรายงาน ที่นี่
