如何架设暗黑破坏神2服务器

下载BnetD for win[必备程序]
D2GS1.9.1.5_for_bnetd[必备程序]
bnetw2bnetd[bnetw转换至bnetd的程序]

1:将bnetd-win32.rar 解压至任意位置,
2:修改etc目录下的d2cs.conf文件
realmaddr = 127.0.0.1:6113 将127.0.0.1修改为你所用服务器的ip
gameservlist = 127.0.0.1 将127.0.0.1修改为你所用服务器的ip
bnetdaddr = 127.0.0.1:6112 将127.0.0.1修改为你所用服务器的ip
3:修改etc目录下的d2dbs.conf文件
gameservlist = 127.0.0.1 将127.0.0.1修改为你所用服务器的ip
4:修改etc目录下的realm.list文件
“D2CS” “Diablo2 Realm Server” 127.0.0.1:6113 no 将127.0.0.1修改为你服务器的ip
5:运行其中的diablostar.exe,选择启动服务

6:将D2GS1.9.1.5_for_bnetd.rar 解压,其内容复制到diabloii所在的目录
修改d2gs.reg 文件将其中的ip 127.0.0.1修改为你cs服务器的ip
7:执行install.bat
H:在winxp的控制面板->服务中启动Diablo II Close Game Server服务〔就一个服务〕
I8:修改注册表test.reg 中127.0.0.1为你的cs服务器的ip,这个就是你的国度的注册表文件了
9:向进其他战网一样进自己的战网吧!^^

看好了以上步骤一个也不要拉下噢!
二.完善:(这一步及以后可不做)

1:给你的国度起个名字
修改realm.list文件
“Realm Name” “Diablo2 Realm Server” your.d2cs:port 将Realm Name改为你想要的国度名字
修改d2cs.conf文件
realmname = D2CS 将D2CS改为你国度的名字
2:游戏大厅上方的广告
1).修改ad.list文件(类似以下修改)
# –file name– when- time —————URL————— –next–
“ad000001.pcx” init 30 “http://www.mynenu.net/“; 0x000000
“ad000002.pcx” start 30 “mailto:admin@iool.net” 0x000001
“ad000003.pcx” start 30 “http://www.iool.net/“; 0x000002
2).修改files目录下的ad000001.pcx和ad000002.pcx或者自己新建pcx图片文件。
用photoshop打开修改,记住一定要256色,否则不会显示。
3:登陆BN时的欢迎信息
修改BNMOTD.TXT文件
4:修改游戏的存活时间
见[三]管理5:修改国度最大登陆的人数
见[三]管理6:修改国度的欢迎信息
见[三]管理7:用多个gs来带一个国度
修改d2cs.conf 和d2dbs.conf文件
gameservlist = ip1,ip2,ip3 //其中ip为你gs的ip地址

三.管理

注: “//”后的内容为注释

gs管理
telnet *.*.*.* 8888
//密码是:abcd123

//当你登陆后依次执行:
maxgame **//设置最大游戏数 我是60
maxlife **//设置游戏生存时间,单位是秒 我是7200
passwd ***//修改登陆密码 我不告诉你
gslog 0 //禁止日志生成 我是这样

到这里你应该万事ok了。
日常管理命令:

status //然后能看到下面的字样,察看gs运行状态
Maximum game number: 60//最大游戏数,此项为零即无法建立游戏,
Current game number: 60//当前游戏数
Current users in game: 122//当前玩家数
Maximum prefer users: 0
Maximum game life: 7200 seconds//游戏的生存时间
Connetion to D2CS(202.198.14*.*): connected//d2cs链接中
Connetion to D2DBS(202.198.14*.*): connected//d2dbs链接中
GS log to file: Disable//禁止gs日志
Physical memory usage: 260.898MB/284.832MB//已用gs物理内存
Virtual memory usage: 377.781MB/398.934MB//已用gs换页空间

gl //运行游戏的情况
cl **//察看gameid为**的游戏中的玩家
kick 玩家名//将玩家踢出游戏
restart **//在**时间后重新启动gs,建议不要使用
msg “sys” “#all” “你想对游戏中玩家说的话” //建议少用,让玩家心烦,但重新启动前务必使用,要不然…………
========建立GM账号=========
打开想设置为管理员的账号,在最后一行加入如下内容
“BNET\\auth\\admin”=”true”
========GM的管理命令=======
注意:在游戏中和大厅中使用以下命令!!
/kick acc
把某人从频道里踢出去,踢到the void频道里
/ban acc
把某人从频道里ban掉。
/unban
取消封禁
/announce
对整个bnet广播消息(要有announce权限),简写/ann
/addacct acc pass
新增一个acc,密码为pass
/chpass acc pass
将acc的密码改为pass,(admin only)
/restorepass acc pass
如果pass与系统记录的acc原始密码或者前一次密码符合,密码将回复为pass ,(admin
only)
/kill acc
将acc的bnet连接断开,(admin only)
/lockacct acc time
将acc锁住一定时间,time为小时数,缺少time参数则无限期lock (admin only)
/unlockacct acc
将acc解锁 (admin only)
/unloadacct acc
从bnet释放acc的内存占用 (admin only)
四.高级(For gamemaster)
在d2cs.conf文件中,有一部分关于d2gs的设置,下面解释一下他们的意思:
d2gs_checksum=0
这项设置了当d2gs连接d2cs时是否检验d2gs的checksum,checksum就是在d2gs中version命令显示的那个checksum,这里设置为0,代表不检测

d2gs_version=0
这项设置了当d2gs连接d2cs时是否检验d2gs的版本,这里设置为0,代表不检测

d2gs_password=””
设置d2gs连接d2cs时的密码,相对应d2gs注册表里的是D2CSSecrect,这个密码不是telnet d2gs console的密码!

game_maxlifetime=0
游戏最长时间,这里设置为0,代表无限,也就是遵循d2gs中的设置
我的服务器这里设置为3000秒,而d2gs那里设置的是3600秒,这样做就实现了:每个游戏最长时间1小时,当一个游戏已经运行超过50分钟了,那么它就在加入列表里看不到了,免得人家进去玩不到10分钟就被踢了。

bnetd运行所需要的暗黑文件列表

d2data.mpq
d2exp.mpq
d2sfx.mpq
d2speech.mpq
Patch_D2.mpq
D2GS.exe
D2GSSVC.exe
D2Client.dll
D2CMP.dll
D2Common.dll
D2Game.dll
D2gfx.dll
D2Lang.dll
D2MCPClient.dll
D2Net.dll
d2server.dll
D2sound.dll
D2Win.dll
Fog.dll
ijl11.dll
Storm.dll

游戏排第一位的问题
1;没有gs
2;gs配置不对,修改注册表中的d2csip和d2dbsip
3;d2dbs.conf和d2cs.conf中没有添加gameservlist
4;gs版本和d2cs不配套
5;gs console中设定的maxuser和maxgame有误
6.导入的GS端的注册表文件{d2gs.reg}中
“D2CSSecrect”=”NENU” 这个选项非空或者和国度名不符
例子:zixia的1.09beta的d2gs下载使用后出现排位1的问题,就是这个原因引起的

bnetd的升级
一般覆盖即可,但由于bnetd0.4之前和现行版本目录不一致所以需要转换工具转换,可以用bnetw2bnetd那个程序来转换。liunx版的可以到奶牛游侠论坛来下载

国度的备份
一定要重视这个,整个目录的备份就成,建议修改3个conf文件,将日志和国度的存档目录分开放

BNetD、d2dbs、d2cs、d2gs各自的用途
bnetd 主要负责bn的相关服务,如密码、天梯等信息
d2cs 是国度服务
d2dbs是负责玩家和d2gs交互的服务
d2gs就是真正和玩家相连的服务了
如果bnetd出问题了,大家就连接不到服务器了
d2cs 挂了回没有国度
d2dbs挂了无法建立游戏

还有一些,但疏于整理,这次暂时不放上来了

五.游戏中的命令
/me
做emote指令
/whisper *acc/char msg
给acc或者char发送消息,缩写/w ,/m功能类似,但/m的接收方不可直接reply
/users
查看在线人数
/who channel
查看谁在指定的channel里面
/whois *acc/char
查看玩家在哪里
/version
显示当前运行bnet的版本号以及编译时间
/uptime
bnetd持续运行时间
/join
加入指定频道
/rejoin
重新加入当前频道
/away msg
设置状态为离开状态,当其他玩家发送消息过来时,消息内容会显示,并且发送方会看
到你的away状态,以及away的原因msg
/dnd msg
设置状态为请勿打扰,当其他玩家发送消息过来时,消息内容不会显示,并且发送方会
看到你的dnd状态,以及dnd的原因msg
/ignore
忽略某玩家
/unignore
取消忽略
/designate
指定下一任的频道管理员
/resign
辞职(不做频道管理员)
/kick acc
把某人从频道里踢出去,踢到the void频道里
/ban acc
把某人从频道里ban掉。
/unban
取消封禁
/reply msg
回复/whisper发过来的消息
/announce
对整个bnet广播消息(要有announce权限),简写/ann
/realmann
对单个realm进行广播
/addacct acc pass
新增一个acc,密码为pass
/chpass acc pass
将acc的密码改为pass,(admin only)
/restorepass acc pass
如果pass与系统记录的acc原始密码或者前一次密码符合,密码将回复为pass ,(admin
only)
/logout
登出bnet
/kill acc
将acc的bnet连接断开,(admin only)
/lockacct acc time
将acc锁住一定时间,time为小时数,缺少time参数则无限期lock (admin only)
/unlockacct acc
将acc解锁 (admin only)
/unloadacct acc
从bnet释放acc的内存占用 (admin only)
六.bnetd.conf文件简单说明
##############################################################################
# bnetd.conf – Configuration file for the Unix Battle.net daemon #
#—————————————————————————-#
# #
# This file is an example configuration and may require modification to #
# suit your needs or your site. Blank lines and lines starting with a “#” #
# are ignored. Use quotes around values that contain spaces. #
# #
##############################################################################

##############################################################################
# File section #
# The pidfile can be set to “” to turn it off. #
# Use absolute paths in these lines to avoid problems! #
#—————————————————————————-#
这里尽量使用绝对路径
filedir = /usr/local/var/files/
userdir = /usr/local/var/users/
defacct = /usr/local/etc/bnetd_default_user
motdfile = /usr/local/etc/bnmotd.txt
channelfile = /usr/local/etc/channel.list
adfile = /usr/local/etc/ad.list
logfile = /usr/local/var/bnetd.log
realmfile = /usr/local/etc/realm.list

# #
##############################################################################

##############################################################################
# Message logs #
#—————————————————————————-#

# Multiple log levels can be defined by connecting them with a comma (,)
# Available loglevels are:
# none
# trace
# debug
# info
# warn
# error
# fatal
loglevels = fatal,error,warn,info,debug,trace
#loglevels = fatal,error,warn,info

# #
##############################################################################

##############################################################################
# D2CS settings #

# Version of D2CS server (set to zero to disable version check)
d2cs_version = 0

# Allow D2CS server to change realm name?
allow_d2cs_change_settings = true
这里一般在设置多国度时使用,true将使用d2cs中指定的国度名称,不使用realm.list
# #
##############################################################################

##############################################################################
# Downloadable files #
#—————————————————————————-#

# These filenames are reported directly to the client and are relative to
# the “filedir” directory specified above.

# Auto-updates work now, but remember it will force people to use the
# version specified in the autoupdate configuration file (or newer). Also,
# if it is enabled but the mpqauthfile is not avaliable, clients will hang
# when they first connect waiting for it to download.
mpqauthfile = “IX86ver1.mpq”

#Version check stuff
versioncheck_file = /usr/local/etc/versioncheck
update_bad_checksum = true
allow_unknown_version = true
# #
##############################################################################

##############################################################################
# Time values #
#—————————————————————————-#

# Time in seconds between account file updates, 0 means wait forever.
usersync = 300
# Number of seconds of inactivity before file is unloaded from memory.
# (only checked during account file updates)
userflush = 1200
这是users里面的帐号文件保存间隔时间设置
# Amount of time to delay shutting down server in seconds.
shutdown_delay = 300
# Amount of time delay period is decremented by either a SIGTERM or SIGINT
# (control-c) signal in seconds.
shutdown_decr = 60
shutdown时的一些等待时间设置
# #
##############################################################################

##############################################################################
# Policy options #
#—————————————————————————-#

# If you don’t want people to be able to create new accounts, set this to
# false.
new_accounts = true
是否开放帐号注册
# If someone attempts to log in more than once, should it kick off the old
# login, or deny the new one?
kick_old_login = true
#kick_old_login = false

# If a user is creating a new channel, should it be added automatically, or
# prompt them first?
ask_new_channel = true

# Should games with passwords be hidden on the game list?
hide_pass_games = true

# Should games already started be hidden on the game list? (for heavily
# loaded servers)
hide_started_games = false

# Should non-permanent channels hidden on the channel list?
hide_temp_channels = true
是否隐藏临时频道(未在channel.list中定义过的临时频道)
# Do you want to use the channel quota feature?
quota = yes
使用频道发言的限制
# The following options deal with flood prevention.
#
# How many lines do you accept in quota_time seconds?
# (The default should allow 5 lines in 5 seconds,
# longer time periods allow “bursts” of traffic before the quota is full.)
# must be between 1 and 100 lines
quota_lines = 5

# must be between 1 and 60 seconds
quota_time = 5

# “virtual wrapping”, so long lines count as multiple lines
# must be between 1 to 256 chars
quota_wrapline = 40

# absolute maximum characters allowed in a line
# must be between 1 to 256 chars
quota_maxline = 200
#
# How many lines do you accept in quota_time seconds before user is
# disconnected?
# (According to Jung-woo, Dobae is a Korean term for flooding the game server…
# it originally meant “to paint the wallpaper on a new or refurbished house”).
# If it less than or equal to quota_lines, there is no warning before
# disconnection so don’t set this too low.
# must be between 1 and 100 lines
quota_dobae = 10

# Allow banner for clients?
allow_adbanner = true

# Allow preload all accounts during startup?
preload_account = false
启动时预加载帐户文件
# Maximum number of kick time for account to ban
account_max_kicktime = 0
用户最大被kick次数,好像是超过这个限制就被kick到the void去了,没试过
# Default lock time in hours
account_lock_time = 72
默认锁定时间,好像是/lockacct是不指定时间,就按照这里的设置,没试过
# #
##############################################################################

##############################################################################
# Anti-hack settings #
#—————————————————————————-#
# The server will keep an ip address list in memory while running. #
# Each ip address will have an hack level set which is initial to zero #
# When server think a user is cheating or hacking. the hack level for the #
# ip address which the user connect from will be increased by a certain #
# number (which depended on the hacks user have done) #
# When the ip address hack level exceed the maximum level allowed, #
# The ip address will be banned for a certain period of time #
# To prevent user banned from mistake, the hack level for each ip address #
# will be decreased by 1 after a certain interval. #

# Maximum hack levels allowed before the user to be banned
max_hack_level = 10

# How many seconds will the ip address to be banned if hack level exceed #
hack_ban_time = 3600

# How many seconds will the hack level be updated (decreased) #
hack_update_interval = 60
这里是新加的防止hack功能,比如屡次输入错误的密码,就会被自动banip
# #
##############################################################################

##############################################################################
# Server network info #
#—————————————————————————-#

# Set this option to true to allow TCP to detect and close stale
# connections.
#use_keepalive = false

# This is a comma delimited list of hostnames that the server should
# listen on. It might be useful to make an internal-only server on a
# gateway machine for example. If the list is not set or if it has a
# entry with no host component, the server will bind to that port on all
# interfaces.
#servaddrs = “:9999”
#servaddrs = “myinternalname.some.com,localhost”
#servaddrs = “:” # default interface (all) and default port (6112)

# Don’t change these unless you really need to! You will need to run a proxy
# or modify the clients. Also note that these will not change when simply
# sending a HUP signal to the server; they are only read on startup.

# #
##############################################################################
七.d2cs.conf文件简单说明:
#################################################################################
# d2cs.conf – Configuration file for the diablo2 game control server #
#——————————————————————————-#
# #
# This file is an example configuration and may require modification to #
# suit your needs or your site. Blank lines and lines starting with a “#” #
# are ignored. Use quotes around values that contain spaces. #
# #
#################################################################################

#################################################################################
# Server Major Settings #
#——————————————————————————-#
# #
# Your realm server name #
realmname = D2CS
国度名称,如果bnetd.conf中设置allow_d2cs_change_settings = true,这里就生效了
# This is a comma delimited list of hostnames that the server should
# listen on. It might be useful to make an internal-only server on a
# gateway machine for example. If the list is not set or if it has a
# entry with no host component, the server will bind to that port on all
# interfaces.
# d2cs default listening port is 6113
servaddrs = 0.0.0.0:6113
指定d2cs监听的端口,不需修改
# Realm server address, this is the address used by bnetd to report to client
# Make sure client have direct connection to this address
# Set to blank to leave bnetd’s settings unchanged
#realmaddr = “192.169.0.1:6113”

# This is a comma delimited list of game servers
#gameservlist = your.gameserver,another.gameserver
d2gs的列表,做多game server用的,注意把前面的#去掉
# This is bnetd server address with port
# bnetd default listening port is 6112
bnetdaddr = “127.0.0.1:6112”
bnetd的地址和端口
# #
#################################################################################

#################################################################################
# Message logs #
#——————————————————————————-#
# Multiple log levels can be defined by connecting them with a comma (,)
# Available loglevels are:
# none
# trace
# debug
# info
# warn
# error
# fatal
#loglevels = fatal,error,warn,info
loglevels = fatal,error,warn,info,debug,trace

# #
#################################################################################

#################################################################################
# File and Path section #
# Use absolute paths in these lines to avoid problems! #
#——————————————————————————-#
# #
最好使用绝对路径
logfile = /usr/local/var/d2cs.log
charsavedir = /usr/local/var/charsave
charinfodir = /usr/local/var/charinfo
ladderdir = /usr/local/var/ladders
newbiefile = /usr/local/var/files/newbie.save
# #
#################################################################################

#################################################################################
# Misc #
#——————————————————————————-#
# #
# Message Of The Day, support hexcode
motd = “Tips: How to use color in your profile(Right click on your portrait to open pr ofile editing). Use \\\\xffc as Prefix (\\\\xff means ascii code 0xff,but you should use copy/paste trick to in put it, c means character ‘c’. Color also works in game chat,but have input limit). Then append the Color chara cter list below: \\xffc0White ‘0’ \\xffc1Red ‘1’ \\xffc2Green ‘2’ \\xffc3Blue ‘3’ \\xffc4Gold ‘4’ \\xffc5Gray ‘5’ Black ‘6’ \\xffc7DarkYellow ‘7’ \\xffc8Orange ‘8’ \\xffc9Yellow ‘9’ \\xffc:DarkGreen ‘:’ \\xffc;Purple ‘;’ \\xffc<LightDarkGreen ‘<‘”
就是“大厅”中右边的那些DD
# Set to non-zero to allow creation of new realm character
allow_newchar = 1
是否开放注册新角色
# Do you want d2cs to check client for multilogin for security reason?
check_multilogin = 0

# Maxinum number of character per account
maxchar = 8
一个帐户可拥有的角色数,超过8个就需要用键盘的方向键了,因为没滚动条
# Maxinum number of games will be shown in join game list
# Zero = infinite
maxgamelist = 20
game list最多显示的游戏数目,0无限制
# Set to non-zero to allow show all games with difficulty < character difficulty
# Otherwise, only game with difficulty = character difficulty will be shown
gamelist_showall = 0
0只显示玩家相同级别的游戏normal的只能看见normal的,1显示<玩家等级的游戏hell的可看见nightmare和normal的
# Maxinum time in seconds that a user can idle
# Zero = infinite
idletime = 3600

# Amount of time to delay shutting down server in seconds.
shutdown_delay = 300

# Amount of time delay period is decremented by either a SIGTERM or SIGINT
# (control-c) signal in seconds.
shutdown_decr = 60
#shutdown的延迟时间设置
#################################################################################

#################################################################################
# Internal System Settings #
# You may just ignore them and use the default value #
#——————————————————————————-#
#
# How often will the server purge all list to clean unused data (in seconds)
listpurgeinterval = 300

# How often will the server check game queues (in seconds)
gqcheckinterval = 60

# How often will the server retry to connect to bnetd
# when connection lost (in seconds)
s2s_retryinterval = 10

# How long time the s2s connection will timeout
s2s_timeout = 10

# How often the server will check server queues for expired data
sq_checkinterval = 300

# How long time will a server queue data expire
sq_timeout = 300

上面这些server to server的设置不晓得是干什么的
# Game serer binary files checksum, use zero to skip this checking
d2gs_checksum = 0
d2gs连接的时候检验checksum
# Game server version, use zero to skip this checking
d2gs_version = 0
d2gs连接的时候检验版本
# Game server password
d2gs_password = “”
d2gs连接的时候检验密码
# Maxinum number of second that a game will be shown on list( zero = infinite )
game_maxlifetime = 0
游戏最大时间,这些设置可以参见精华区的另一个帖子
# A game will be automatically destroied after how long time idle
max_game_idletime = 0

# Allow Limitation created game with password, player number or level limit?
allow_gamelimit = 1
是否开启游戏密码和人数的限制
# Ladder refresh time
ladder_refresh_interval = 3600

# server to server connection max idle time in seconds
s2s_idletime = 300

# server to server connection keepalive interval
s2s_keepalive_interval = 60

# all connection timeout check interval
timeout_checkinterval = 60

# game server restart interval
d2gs_restart_delay = 300

#
################################################

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注