TrinityCore笔记

准备工作

在群晖的Virtual Machine Manager里创建新的虚拟机
在Debian官网下载镜像(https://www.debian.org/distrib/)
建议内存4GB/硬盘40GB

服务器安装

最好先安装lnmp

之前的工作看这里

  • LNMP安装笔记 接着做环境准备
    1
    2
    3
    4
    $ sudo apt-get update
    $ sudo apt-get install git clang cmake make gcc g++ libmariadbclient-dev libssl-dev libbz2-dev libreadline-dev libncurses-dev libboost-all-dev p7zip-full
    $ sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100
    $ sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang 100
    下载3.3.5源码
    1
    2
    $ cd ~/
    $ git clone -b 3.3.5 git://github.com/TrinityCore/TrinityCore.git
    配置
    1
    $ sudo cmake ../ -DCMAKE_INSTALL_PREFIX=/home/wow/server
  • DTOOLS=0 是不编译地图提取工具的选项
    编译
    1
    2
    $ sudo make
    $ sudo make install
    后续可以拉取git代码更新
    1
    2
    $ cd ~/TrinityCore/
    $ git pull origin 3.3.5

    服务器设置

    上传客户端到~/wow_client
    提取DBC和Maps
    1
    2
    3
    4
    $ cd ~/wow_client/
    $ /home/wow/server/bin/mapextractor
    $ mkdir /home/wow/server/data
    $ cp -r dbc maps /home/wow/server/data
    提取vmaps(可选)
    1
    2
    3
    4
    5
    $ cd ~/wow_client/
    $ /home/wow/server/bin/vmap4extractor
    $ mkdir vmaps
    $ /home/wow/server/bin/vmap4assembler Buildings vmaps
    $ cp -r vmaps /home/wow/server/data
    提取mmaps(可选,我用了6个多小时)
    1
    2
    3
    4
    $ cd ~/wow_client/
    $ mkdir mmaps
    $ /home/wow/server/bin/mmaps_generator
    $ cp -r mmaps /home/wow/server/data
    拷贝配置文件
    1
    2
    3
    $ cd ~/server/etc/
    $ cp worldserver.conf.dist worldserver.conf
    $ cp authserver.conf.dist authserver.conf
    编辑worldserver.conf
    1
    DataDir = "../data"
    还有数据库配置(帐号wow,密码trinity)
    1
    2
    3
    LoginDatabaseInfo = "127.0.0.1;3306;wow;trinity;auth" #worldserver.conf
    WorldDatabaseInfo = "127.0.0.1;3306;wow;trinity;world" #worldserver.conf
    CharacterDatabaseInfo = "127.0.0.1;3306;wow;trinity;characters" #worldserver.conf
    编辑authserver.conf
    1
    LoginDatabaseInfo = "127.0.0.1;3306;trinity;trinity;auth"

    安装数据库

    1
    2
    3
    4
    5
    6
    CREATE DATABASE `world` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
    CREATE DATABASE `characters` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
    CREATE DATABASE `auth` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
    GRANT ALL PRIVILEGES ON `world` . * TO 'wow'@'localhost' WITH GRANT OPTION;
    GRANT ALL PRIVILEGES ON `characters` . * TO 'wow'@'localhost' WITH GRANT OPTION;
    GRANT ALL PRIVILEGES ON `auth` . * TO 'wow'@'localhost' WITH GRANT OPTION;
    这三个数据库的说明如下

    auth - holds account data - usernames, passwords, GM access, realm information, etc.
    characters - holds character data - created characters, inventory, bank items, auction house, tickets, etc.
    world - holds game-experience content such as NPCs, quests, objects, etc
    hotfixes (master only) - holds fixes not already added to the core or other official databases.

下载最新的数据库文件(https://github.com/TrinityCore/TrinityCore/releases)
把它放在server/bin目录下

1
2
3
4
5
$ cd ~/server/bin/
$ wget https://github.com/TrinityCore/TrinityCore/releases/download/TDB335.20021/TDB_full_world_335.20021_2020_02_15.7z
$ 7z x TDB_full_world_335.20021_2020_02_15.7z
$ rm TDB_full_world_335.20021_2020_02_15.7z
$ ./worldserver

执行结束,数据库导入完成

配置修改

修改本机客户端文件\Data\zhCN\realmlist.wtf,改为服务器地址

1
set realmlist xxx.xxx.xxx.xxx

修改数据库authrealmlist

  • name是服务器名称
  • address是服务器地址
  • gamebuild是客户端版本号(客户端启动时左下角可见)

测试

启动服务器

1
2
3
$ cd ~/server/bin/
$ ./authserver &
$ ./worldserver

创建帐号并设置为gm(3级权限)

1
2
account create user password
account set gmlevel userid 3 1

如果要和朋友一起玩,就映射一个域名上去
frp映射好本地服务器的37248085端口
frp服务器开对应的防火墙端口即可

gm指令请惠存
(https://trinitycore.atlassian.net/wiki/spaces/tc/pages/2130065/GM+Commands)

优秀插件
(https://rochet2.github.io/downloads/)

引用
https://trinitycore.atlassian.net/wiki/spaces/tc/pages/2130077/Installation+Guide