客户端安装:
下载地址 (3.3.5a enUS),安装到:/Applications/World of Warcraft 目录下(后面会用到)
安装 Xcode:
自行到 App Store 下载,完成之后需要执行 xcodeselect --install
来安装 command line tools
安装 homebrew:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
安装依赖:
MySQL Community Server: brew install mysql
GNU Readline: brew install readline
OpenSSL: brew install openssl
Adaptive Communication Environment (ACE): brew install ace
CMake: brew install cmake
下载源码:
cd ~/Trinity git clone https://github.com/TrinityCore/TrinityCore.git repo
创建编译目录:
mkdir build cd build
使用 cmake 生成 XCode 项目文件:
cmake ../repo -GXcode \ -DMYSQL_ADD_INCLUDE_PATH=/usr/local/include \ -DMYSQL_LIBRARY=/usr/local/lib/libmysqlclient_r.dylib \ -DREADLINE_INCLUDE_DIR=/usr/local/opt/readline/include \ -DREADLINE_LIBRARY=/usr/local/opt/readline/lib/libreadline.dylib \ -DACE_INCLUDE_DIR=/usr/local/opt/ace/include \ -DACE_LIBRARY=/usr/local/opt/ace/lib/libACE.dylib \ -DOPENSSL_SSL_LIBRARIES=/usr/local/opt/openssl/lib/libssl.dylib \ -DOPENSSL_CRYPTO_LIBRARIES=/usr/local/opt/openssl/lib/libcrypto.dylib \ -DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include \ -DPREFIX=$HOME/Trinity \ -DWITH_WARNINGS=1 \ -DTOOLS=1
编译代码:
xcodebuild -target install -config Release
编译所需要的时间和机器配置有关,期间 CPU 会很高,我这里大概用了 20 分钟左右(air 13 i7 8G)。下面是编译完成后的结果:
tsl0922s-air:~ tsl0922$ ls -l Trinity/bin Trinity/etc Trinity/bin: total 44944 -rwxr-xr-x 1 tsl0922 staff 398792 5 17 12:59 authserver -rwxr-xr-x 1 tsl0922 staff 83360 5 17 12:59 mapextractor -rwxr-xr-x 1 tsl0922 staff 932888 5 17 12:59 mmaps_generator -rwxr-xr-x 1 tsl0922 staff 695132 5 17 12:59 vmap4assembler -rwxr-xr-x 1 tsl0922 staff 97468 5 17 02:07 vmap4extractor -rwxr-xr-x 1 tsl0922 staff 20795028 5 17 12:59 worldserver Trinity/etc: total 200 -rw-r--r-- 1 tsl0922 staff 8760 5 15 23:47 authserver.conf.dist -rw-r--r-- 1 tsl0922 staff 89343 5 17 01:46 worldserver.conf.dist
cd /Applications/World of Warcraft # dbc and maps ~/Trinity/bin/mapextractor mkdir ~/Trinity/data cp -r dbc maps ~/Trinity/data # vmaps(optional) ~/Trinity/bin/vmap4extractor mkdir vmaps ~/Trinity/bin/vmap4assembler Buildings vmaps cp -r vmaps ~/Trinity/data
cd ~/Trinity/etc cp worldserver.conf.dist worldserver.conf cp authserver.conf.dist authserver.conf
把两个配置文件的 LogsDir
配置都改为:logs,worldserver配置里的 DataDir
配置改为:data。如果你没有启用 vmaps,还需要在 worldserver 配置文件里禁用 vmaps(默认启用)。
自行到到这里下载 最新 TDB 数据库并把 sql 文件解压到~/Trinity目录下,目前下载得到的文件名为:TDB_full_335.53_2014_03_29.sql
。
执行命令(数据库 root 用户密码为空):
cd ~/Trinity # start mysql server mysql.server start # create user and database mysql -u root < repo/sql/create/create_mysql.sql # init database mysql -u root < TDB_full_335.53_2014_03_29.sql mysql -u root < repo/sql/base/auth_database.sql mysql -u root < repo/sql/base/characters_database.sql # update database for file in `ls repo/sql/updates/auth`; do mysql -u root auth < repo/sql/updates/auth/$file; done for file in `ls repo/sql/updates/characters`; do mysql -u root characters < repo/sql/updates/characters/$file; done for file in `ls repo/sql/updates/world`; do mysql -u root world < repo/sql/updates/world/$file; done
需要开启2个终端窗口,分别执行:
# first terminal cd ~/Trinity ./bin/authserver # second terminal cd ~/Trinity ./bin/worldserver
先创建一个用户:worldserver 启动后会有个自己的命令提示符,在里面执行:
account create test 123456 account set gmlevel test 3 -1
修改《魔兽世界》客户端目录下的 Data/enUS/realmlist.wtf, 把里面的 set realmlist
语句改为:set realmlist 127.0.0.1
。
启动《魔兽世界》客户端(不要从 Launcher 启动,否则会自动更新),输入用户名:test,密码:123456 登陆本地服务器。
参考:
http://collab.kpsn.org/display/tc/How-to_Mac
http://collab.kpsn.org/display/tc/How-to_Linux
http://collab.kpsn.org/display/tc/Database_master
http://collab.kpsn.org/display/tc/How-to_First_step_into_Trinity_Core