Counter-Strike 1.6 Server On FreeBSD

前幾天雄雄間心中湧起想打cs 的念頭。

從大二後就幾乎沒打過cs , 突然很想回味一下

在網路上找找文章,看了一下知道原來要架cs server 有一個軟体(hlds)

上網找了找~~最新的好像是hlds_1120,不過這個似乎是在linux suse 下的環境 compile的

so要在bsd 上裝的話,就要裝linux emulator 了

在freebsd 中的manual 中有說該如何去裝linux emulator

————————————–Linux emulator 安裝 start ———————————–

Linux binary compatibility is not turned on by default. The easiest way to enable this functionality is to load the linux KLD object (“Kernel LoaDable object”). You can load this module by typing the following as root:

# kldload linux

If you would like Linux compatibility to always be enabled, then you should add the following line to /etc/rc.conf:

linux_enable="YES"

The kldstat(8) command can be used to verify that the KLD is loaded:

% kldstat Id Refs Address    Size     Name 1    2 0xc0100000 16bdb8   kernel 7    1 0xc24db000 d000     linux.ko

10.2.1.1 Installing Using the linux_base Port

This is by far the easiest method to use when installing the runtime libraries. It is just like installing any other port from the Ports Collection. Simply do the following:

# cd /usr/ports/emulators/linux_base-fc4 # make install distclean

You should now have working Linux binary compatibility. Some programs may complain about incorrect minor versions of the system libraries. In general, however, this does not seem to be a problem.

Note: There may be multiple versions of the emulators/linux_base port available, corresponding to different versions of various Linux distributions. You should install the port most closely resembling the requirements of the Linux applications you would like to install.

————————————–Linux emulator 安裝 end ———————————–

裝好linux emulator 後就可以開始裝 hlds了

我找到了兩個版本

一個是hlds_l_1120_full.tar.gz –>有steam(怕死的用這個)

一個是hlds_l.tar.gz –>幾乎全都有(dmc,cstrike,czero,valva,dod),還須要一個nosteam 的engine(engine.v15.tgz)

接下來有兩種裝法

先講hlds_l_1120_full.tgz

很簡單,就用ports裝就好了

把 hlds_l_1120_full.tgz放到/usr/ports/distfiles下,然後到/usr/ports/games/hlserver-cs

make install 就可以了

另一個是hlds_l.tar.gz

就把hlds_l.tar.gz解壓(看你想放那)

然後把 engine.v15.tgz解壓,會看到有這些

engine_amd.so
engine_amd64.so
engine_i486.so
engine_i686.so

就把解出來的這些覆蓋掉hlds_l 中的一模一樣的檔案(其實你只要蓋掉你的cpu type 的就行了)

然後去編輯你要玩的server.cfg

我是只玩cs,所以就只編cstrike/server.cfg這個檔案

記得要加入sv_lan(只對lan 開放–>0 關掉,1 開啟)

我是這樣sv_lan 0

接下來就可以執行了

到hlds 目錄下

./hlds_run -game cstrike +exec server.cfg +ip 你的ip +port 27015 +maxplayers 16 +map de_dust -nomaster

nomaster 表示你不要讓你的server 可以被人家用find server 找到,因為沒加到cs 的 master server的list 中

基本上這樣就可以玩了~~照例附上圖片(有圖有真相啦)

大功告成,打完收工(叫我武狀元,哈哈哈)

在〈Counter-Strike 1.6 Server On FreeBSD〉中有 4 則留言

  1. heaven

    你好

    不好意思想請問一下

    按照您的步驟安裝

    PORT TREE底下的/usr/ports/games/hlserver-cs

    UPDATE完裡面只有四個檔案

    Makefile distinfo pkg-descr pkg-plist

    make install時會發生

    ===> hlserver-cs-1.6 is marked as broken: Incomplete fetch instructions.
    *** Error code 1

    Stop in /usr/ports/games/hlserver-cs.
    這類型的錯誤

    請問一下是我操作步驟上的不正確嗎

    在此打擾一下…

    不好意思

    回覆
  2. gimor

    hi ur tutorial is good but i dont understand ur language chinese ,can u english pls , thanks q ,post to my email counter-strike 1.6 server on freebsd .

    回覆
  3. gimor

    hi ur tutorial is good but i dont understand ur language chinese ,can u english pls , thanks q ,post to my email english tutorial counter-strike 1.6 server on freebsd 6.1

    回覆

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

這個網站採用 Akismet 服務減少垃圾留言。進一步瞭解 Akismet 如何處理網站訪客的留言資料