安装依赖
sh
apt-get update
apt-get install git clang cmake make gcc g++ libmysqlclient-dev libssl-dev libbz2-dev libreadline-dev libncurses-dev libboost-all-dev mysql-server p7zip
# 将编译工具替换为Clang
update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang 100
下载TrinityCore源码
sh
git clone https://github.com/TrinityCore/TrinityCore.git
源码编译
创建一个目录用于后面我面编译后安装
sh
mkdir /home/tang/game
切换分支
进入TrinityCore源码目录,切换到3.3.5分支
sh
git checkout 3.3.5
编译
sh
mkdir build
cd build
cmake ../ -DCMAKE_INSTALL_PREFIX=/home/tang/game -DCONF_DIR=/home/tang/game/bin
make -j 8
make install
安装后可以看到game目录下多了我们刚才编译好的二进制文件
生成数据信息
创建一个资源目录
在game目录下,我们创建一个res
目录
sh
mkdir res
下载wow3.3.5客户端版本
我们需要下载wow3.3.5的客户端版本,大小大约有22G大小左右,下载后我们将游戏中的Data
目录和Interface
目录上传到我们刚才创建的res
目录中
这里有个客户端的网盘地址,大家可以下载
链接: pan.baidu.com/s/1vQyUq4pW... 提取码: 3j81
生成地图信息
进入res目录中我们执行../bin/mapextractor
,该命令会生成两个文件夹dbc
和maps
sh
../bin/mapextractor
执行完上面的命令后再执行../bin/vmap4extractor
,该命令会生成vmaps
目录
sh
../bin/vmap4extractor
再执行如下的命令
sh
../bin/vmap4assembler Buildings vmaps
mkdir mmaps
../bin/mmaps_generator
执行上面一些命令后,最后res目录中的文件结构如下
sh
➜ res tree -L 1
.
├── Buildings
├── Cameras
├── Data
├── dbc
├── Interface
├── maps
├── mmaps
└── vmaps
生成数据库信息
首先我们需要在服务器上搭建mysql环境,设置密码等,具体可以参考mysql官网,这里我们跳过直接连接数据库开始导入数据。
连接数据库
sh
mysql -uroot -h192.168.0.11 -p
执行SQL导入数据
在TrinityCore的源码的sql/create
目录下有个create_mysql.sql
文件,该文件为数据库的初始化文件,我们执行这个文件。执行source /home/tang/sources/TrinityCore/sql/create/create_mysql.sql
导入。
sh
mysql> source /home/tang/sources/TrinityCore/sql/create/create_mysql.sql
Query OK, 0 rows affected (0.02 sec)
Query OK, 0 rows affected (0.01 sec)
Query OK, 1 row affected (0.01 sec)
Query OK, 1 row affected (0.02 sec)
Query OK, 1 row affected (0.01 sec)
Query OK, 0 rows affected (0.01 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.01 sec)
查看一下数据库,可以看到多了auth
、characters
、 world
三个库
sh
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| auth |
| characters |
| information_schema |
| mysql |
| performance_schema |
| sys |
| world |
+--------------------+
7 rows in set (0.00 sec)
mysql>
启动服务端
启动worldserver
首先我们需要先拷贝一下worldserver.conf.dist
文件,我们创建一个服务需要的配置文件worldserver.conf
sh
cp worldserver.conf.dist worldserver.conf
修改配置文件的资源目录,我们将配置文件中的DataDir
目录设置为res
目录。
运行服务
sh
➜ bin ./worldserver
TrinityCore rev. 81434cf171c8 2025-04-03 11:22:59 +0200 (3.3.5 branch) (Unix, RelWithDebInfo, Static) (worldserver-daemon)
<Ctrl-C> to stop.
______ __
/\__ _\ __ __/\ \__
\/_/\ \/ _ __ /\_\ ___ /\_\ \, _\ __ __
\ \ \/\`'__\/\ \ /' _ `\/\ \ \ \/ /\ \/\ \
\ \ \ \ \/ \ \ \/\ \/\ \ \ \ \ \_\ \ \_\ \
\ \_\ \_\ \ \_\ \_\ \_\ \_\ \__\\/`____ \
\/_/\/_/ \/_/\/_/\/_/\/_/\/__/ `/___/> \
C O R E /\___/
http://TrinityCore.org \/__/
Using configuration file /home/tang/game/bin/worldserver.conf.
Using SSL version: OpenSSL 3.0.13 30 Jan 2024 (library: OpenSSL 3.0.13 30 Jan 2024)
Using Boost version: 1.83.0
Database Auth is empty, auto populating it...
>> Applying '/home/tang/sources/TrinityCore/sql/base/auth_database.sql'...
mysql: [Warning] Using a password on the command line interface can be insecure.
>> Done!
Database Character is empty, auto populating it...
>> Applying '/home/tang/sources/TrinityCore/sql/base/characters_database.sql'...
mysql: [Warning] Using a password on the command line interface can be insecure.
>> Done!
Database World is empty, auto populating it...
>> File "TDB_full_world_335.24111_2024_11_22.sql" is missing, download it from "https://github.com/TrinityCore/TrinityCore/releases" uncompress it and place the file "TDB_full_world_335.24111_2024_11_22.sql" in the directory "/home/tang/game/bin".
Could not populate the World database, see log for details.
运行程序发现提示我们少了一个sql,我们按照提示下载sql放到当前bin
目录下。
sh
# 下载
wget https://github.com/TrinityCore/TrinityCore/releases/download/TDB335.24111/TDB_full_world_335.24111_2024_11_22.7z
# 解压缩
7z x TDB_full_world_335.24111_2024_11_22.7z
# 拷贝sql到bin目录下
cp TDB_full_world_335.24111_2024_11_22.sql /home/tang/game/bin
再次执行./worldserver
sh
./worldserver
TrinityCore rev. 81434cf171c8 2025-04-03 11:22:59 +0200 (3.3.5 branch) (Unix, RelWithDebInfo, Static) (worldserver-daemon) ready...
TC>
启动authserver
首先我们需要先拷贝一下authserver.conf.dist
文件,我们创建一个服务需要的配置文件authserver.conf
sh
cp authserver.conf.dist authserver.conf
运行服务,执行./authserver
sh
➜ bin ./authserver
TrinityCore rev. 81434cf171c8 2025-04-03 11:22:59 +0200 (3.3.5 branch) (Unix, RelWithDebInfo, Static) (authserver)
<Ctrl-C> to stop.
______ __
/\__ _\ __ __/\ \__
\/_/\ \/ _ __ /\_\ ___ /\_\ \, _\ __ __
\ \ \/\`'__\/\ \ /' _ `\/\ \ \ \/ /\ \/\ \
\ \ \ \ \/ \ \ \/\ \/\ \ \ \ \ \_\ \ \_\ \
\ \_\ \_\ \ \_\ \_\ \_\ \_\ \__\\/`____ \
\/_/\/_/ \/_/\/_/\/_/\/_/\/__/ `/___/> \
C O R E /\___/
http://TrinityCore.org \/__/
Using configuration file /home/tang/game/bin/authserver.conf.
Using SSL version: OpenSSL 3.0.13 30 Jan 2024 (library: OpenSSL 3.0.13 30 Jan 2024)
Using Boost version: 1.83.0
Automatic database updates are disabled for all databases!
Opening DatabasePool 'auth'. Asynchronous connections: 1, synchronous connections: 1.
MySQL client library: 8.0.41
MySQL server ver: 8.0.41-0ubuntu0.24.04.1
Connected to MySQL database at 127.0.0.1
MySQL client library: 8.0.41
MySQL server ver: 8.0.41-0ubuntu0.24.04.1
Connected to MySQL database at 127.0.0.1
DatabasePool 'auth' opened successfully. 2 total connections running.
Started auth database connection pool.
Loading IP Location Database...
Added realm "Trinity" at 127.0.0.1:8085.
修改ip地址
我们需要修改下auth数据库中的realmlist表下的Trinity的地址
sh
mysql> use auth
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select * from realmlist\G
*************************** 1. row ***************************
id: 1
name: Trinity
address: 127.0.0.1
localAddress: 127.0.0.1
localSubnetMask: 255.255.255.0
port: 8085
icon: 0
flag: 2
timezone: 1
allowedSecurityLevel: 0
population: 0
gamebuild: 12340
1 row in set (0.00 sec)
执行如下sql修改
sql
update realmlist set address = "192.168.0.11" where id=1;
再次查看下
创建账号
在执行./worldserver
之后会显示一个TC>
提示符,我们在上面创建一个账号,用户名是gillbert,密码位1234
sh
TC> account create gillbert 1234
TC> Account created: gillbert
配置客户端
下载客户端
我们需要下载下WOW3.3.5的客户端,这里有个网盘地址,大家可以下载
链接: pan.baidu.com/s/1vQyUq4pW... 提取码: 3j81
修改ip
下载完成后解压缩,有一个单机登陆器.bat
文件,我们修改这个文件
登录客户端
双击单机登陆器.bat
即可进入游戏