当前位置:Linux教程 - Linux - 在linux下架设自己的mudos服务

在linux下架设自己的mudos服务

第一步:获得MudOS 源代码。
MudOS的源代码是share的,所以可以在不少地方得到它。可以从MudOS 的产地下载。
网址是:ftp://ftp.imaginary.com/pub/LPC/servers/MudOS/。但是我们推荐到Jackyboy(胖胖)的泥巴大王http://mudking.com那里下载。因为下载回的代码有不少的漏洞。对于C ++功力不够的巫师还无法修改。而从Mud King下载的源代码已经由JackyBoy修改好了,不需要修改就可以直接编译。(我的源程序就是从这里下载的)
第二步:上传源代码到服务器。
好了。这样我们从http://www.mudking.com下载了代码后,就需要将源代码上传到服务器来执行编译过程。
推荐:
用CuteFtp将下载回的tar格式文件上传到服务器。请不要一个一个文件的上传这样会出现不可预见的编译错误。
第三步:解开压缩包。
在终端窗口中解开压缩包。
zcat v22pre11.tar|tar xv
解压缩后 进入v22pre11的所在目录。
第四步:执行编译初始化Shell命令集。
执行命令:./build.MudOS
推荐:
由于不同的Lunix版本,使用的Shell也不同,所以最好用以下格式打入此命令:
./build.MudOS
Shell初始化全部正常就可以进行MUDOS的编译了!
第五步:执行编译清除旧文件。
执行命令:make clean
第六步:执行编译命令集。
执行命令:./make
第七步:安装编译出的MudOS。
执行命令:./make install

第八步:架设MudLIB。
编译好的MudOS 必须配合配置文件才能启动MudLIB。
打开MudOS 源代码目录下的config.example,做以下修改。

# name of this mud
name : 刀剑笑 (修改为你的Mud的名字)

# port number to accept users on
port number : 5555 (Mud连接的端口号)

address server ip : localhost
address server port : 8888 (修改为你准备添加的服务器端口号)

# absolute pathname of mudlib
mudlib directory : ../mud (此目录为你存放你MudLIB的目录)

# absolute pathname of driver/config dir
binary directory : ../bin (此目录为你存放你MudOS的目录)

根据你的MudLIB,以下几项也需要做相应的修改。
# 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就可以启动Mud。

容易出的错误:
●将MudLIB的目录填错。

推荐:
由于在Mud 维护中不时都要reboot系统。每次reboot后MudOS不会自动重起。
所以我们可以编制一个Shell 来使MudOS执行。
以下是一个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

这时就可以打入:./startmud&来启动MudOS了。
如果有什么不明白可以发E-MAIL给我 [email protected]