在linux下架設(shè)自己的mudos服務(wù)
2024-07-21 02:37:32
供稿:網(wǎng)友
 
             
  第一步:獲得MudOS 源代碼。 
  MudOS的源代碼是share的,所以可以在不少地方得到它。可以從MudOS 的產(chǎn)地下載。 
                                                                                              網(wǎng)址是:FTP://ftp.imaginary.com/pub/LPC/servers/MudOS/。但是我們推薦到Jackyboy(胖胖)的泥巴大王http://mudking.com那里下載。因?yàn)橄螺d回的代碼有不少的漏洞。對(duì)于C ++功力不夠的巫師還無(wú)法修改。而從Mud King下載的源代碼已經(jīng)由JackyBoy修改好了,不需要修改就可以直接編譯。(我的源程序就是從這里下載的) 
  第二步:上傳源代碼到服務(wù)器。 
  好了。這樣我們從http://www.mudking.com下載了代碼后,就需要將源代碼上傳到服務(wù)器來(lái)執(zhí)行編譯過(guò)程。 
  推薦: 
  用CuteFTP將下載回的tar格式文件上傳到服務(wù)器。請(qǐng)不要一個(gè)一個(gè)文件的上傳這樣會(huì)出現(xiàn)不可預(yù)見(jiàn)的編譯錯(cuò)誤。 
  第三步:解開(kāi)壓縮包。 
  在終端窗口中解開(kāi)壓縮包。 
  zcat v22PRe11.tartar xv 
  解壓縮后 進(jìn)入v22pre11的所在目錄。 
  第四步:執(zhí)行編譯初始化Shell命令集。 
  執(zhí)行命令:./build.MudOS 
  推薦: 
  由于不同的Lunix版本,使用的Shell也不同,所以最好用以下格式打入此命令: 
  ./build.MudOS 
  Shell初始化全部正常就可以進(jìn)行MUDOS的編譯了! 
  第五步:執(zhí)行編譯清除舊文件。 
  執(zhí)行命令:make clean 
  第六步:執(zhí)行編譯命令集。 
  執(zhí)行命令:./make 
  第七步:安裝編譯出的MudOS。 
  執(zhí)行命令:./make install 
  
  第八步:架設(shè)MudLIB。 
  編譯好的MudOS 必須配合配置文件才能啟動(dòng)MudLIB。 
  打開(kāi)MudOS 源代碼目錄下的config.example,做以下修改。 
  
  # name of this mud 
  name : 刀劍笑 (修改為你的Mud的名字) 
  
  # port number to accept users on 
  port number : 5555 (Mud連接的端口號(hào)) 
  
  address server ip : localhost 
  address server port : 8888 (修改為你預(yù)備添加的服務(wù)器端口號(hào)) 
  
  # absolute pathname of mudlib 
  mudlib Directory : ../mud (此目錄為你存放你MudLIB的目錄) 
  
  # absolute pathname of driver/config dir 
  binary directory : ../bin (此目錄為你存放你MudOS的目錄) 
  
  根據(jù)你的MudLIB,以下幾項(xiàng)也需要做相應(yīng)的修改。 
  # the file which defines the master object 
  master file : /single/master 
  # the file where all global simulated efuns are defined. 
  simulated efun file : /single/simul_efun 
  # file to swap out objects; not used if time to swap is 0 
  swap file : /single/swapfile 
  # alternate debug.log file name (assumed to be in specified 'log directory') 
  debug log file : debug.log 
  # This is an include file which is automatically #include'd in all objects 
  global include file : "/include/globals.h" 
  
  其他的基本上可以不修改。 
  
  修改好后直接打入:./driver config.example就可以啟動(dòng)Mud。 
  
  輕易出的錯(cuò)誤: 
  ●將MudLIB的目錄填錯(cuò)。 
  
  推薦: 
  由于在Mud 維護(hù)中不時(shí)都要reboot系統(tǒng)。每次reboot后MudOS不會(huì)自動(dòng)重起。 
  所以我們可以編制一個(gè)Shell 來(lái)使MudOS執(zhí)行。 
  以下是一個(gè)Shell 的例子: 
  
  cat startmud 
  
  while true 
  do 
  ulimit -n 256 
  rm -fr ../mud/binaries 
  mkdir ../mud/binaries 
  ./addr_server 8800& 
  ./driver config.djx 
  sleep 5 
  done 
  
  這時(shí)就可以打入:./startmud&來(lái)啟動(dòng)MudOS了。
                          
  假如有什么不明白可以發(fā)E-MAIL給我 SKANES@SINA.COM