环境:debian11
参考:
https://trinitycore.atlassian.net/wiki/spaces/tc/pages/10977309/Linux+Core+Installation
要求
Processor with SSE2 support
Boost ≥ 1.67
MySQL ≥ 5.7.0
OpenSSL = 1.x.x
CMake ≥ 3.13.4
Clang ≥ 5 (heavy recommended, especially on master branch) or GCC ≥ 7.1.0
zlib ≥ 1.2.7
安装环境
Debian 10.x (you will need to use su to install the packages)
apt-get update
apt-get install git clang cmake make gcc g++ libmariadbclient-dev-compat libssl-dev libbz2-dev libreadline-dev libncurses-dev libboost-all-dev mariadb-server p7zip default-libmysqlclient-dev
update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang 100
创建用户
sudo su - <username>
下载代码
3.3.5版本
cd /home/wow
git clone -b 3.3.5 git://github.com/TrinityCore/TrinityCore.git
编译
cd TrinityCore
mkdir build
cd build
cmake ../ -DCMAKE_INSTALL_PREFIX=/home/<username>/server
make -j $(nproc) install
[X代表CPU核心数 CPU核心越多编译越快]
make -j X install
cmake ../ -DCMAKE_INSTALL_PREFIX=/home/wow/server
# 下面步骤可能时间比较长,可以用nohup或者screen执行
make -j $(nproc) install
编译可能问题
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
增加swap内存
1.安装5.7 MYSQL
wget http://repo.mysql.com/mysql-apt-config_0.8.13-1_all.deb
apt install -y gnupg
sudo dpkg -i mysql-apt-config_0.8.13-1_all.deb
sudo dpkg-reconfigure mysql-apt-config
sudo apt update
sudo apt install mysql-server
配置mysql远程登录
mysql_secure_installation
mysql -u root -p
GRANT ALL PRIVILEGES ON *.* TO root@%IDENTIFIED BY 123123 WITH GRANT OPTION;
使用mysql工具登录mysql执行wiki查询语句[打开下面链接把指令全复制到mysql查询里执行]
https://github.com/TrinityCore/TrinityCore/blob/3.3.5/sql/create/create_mysql.sql
下载最新数据库包
https://github.com/TrinityCore/TrinityCore/releases
2.安装编译环境
apt-get install git clang cmake make gcc g++ libmariadbclient-dev libssl-dev libbz2-dev libreadline-dev libncurses-dev libboost-all-dev p7zip default-libmysqlclient-dev
update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang 100
查看磁盘的使用情况
df -lh
cp -r 递归可以复制文件里面的
cp -R 只复制文件夹
4.防火墙白名单端口
FTP端口
iptables -A INPUT -p tcp --dport 21 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 21 -j ACCEPT
MYSQL端口
iptables -A INPUT -p tcp --dport 3306 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 3306 -j ACCEPT
魔兽登录端口
iptables -A INPUT -p tcp --dport 3724 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 3724 -j ACCEPT
魔兽服务端端口
iptables -A INPUT -p tcp --dport 8085 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 8085 -j ACCEPT
更换apt源
nano /etc/apt/sources.list
用#注释掉原来的
加入一下记录
deb https://mirrors.aliyun.com/debian stable main contrib non-free
deb https://mirrors.aliyun.com/debian stable-updates main contrib non-free
vim 不能粘贴
1. 编辑 vim 的默认配置文件
vim /usr/share/vim/vim80/defaults.vim
2. 转至第 70 行,找到:
if has('mouse')
set mouse=a
endif
3. 将 set mouse=a 改为:set mouse-=a
4. 输入 :wq 保存即可生效。
debian11
安装ssh
设置 开启远程
vim /etc/ssh/sshd_config
PermitRootLogin yes
重启配置
/etc/init.d/ssh restart
3.开始编译
登录编译账号
su wow
cd ~/
获取代码
git clone -b 3.3.5 git://github.com/TrinityCore/TrinityCore.git
地图制作
game目录,游戏客户端目录
DBC and Maps files
/home/wow/server/bin/mapextractor
mkdir /home/wow/server/data
cp -r dbc maps /home/wow/server/data
Visual Maps (aka vmaps)
cd <your WoW client directory>
/home/<username>/server/bin/vmap4extractor
mkdir vmaps
/home/<username>/server/bin/vmap4assembler Buildings vmaps
cp -r vmaps /home/<username>/server/data
Movement MapsMovement Maps (aka mmaps)
cd <your WoW client directory>
mkdir mmaps
/home/<username>/server/bin/mmaps_generator
cp -r mmaps /home/<username>/server/data
启动
screen -S world
/home/wow/server/bin/worldserver
screen -S auth
/home/wow/server/bin/authserver
初始化数据库
mysql_secure_installation
/etc/mysql/mariadb.conf.d# vim 50-server.cnf
修改ip
0.0.0.0
service mariadb restart
、选项参数
-c:(create)建立打包文件
-t :查看打包文件的内容含有哪些文件
-x :解打包或解压缩的功能,可以搭配-C(大写)在特定目录解开
-j :通过bzip2的支持进行压缩/解压缩,此时文件最好为*.tar.bz2
-z :通过gzip的支持进行压缩/解压缩,此时文件最好为*.tar.gz
-v :在压缩/解压缩的过程中,将正在处理的文件名显示出来
-f filename:-f 后面跟处理后文件的全名称(路径+文件名+后缀名)
-C 目录:这个选项用在解压缩,若要在特定目录解压缩,可以使用这个选项
-p:保留备份数据的原本权限与属性,常用于备份(-c)重要的配置文件
--exclude=FILE:在压缩的过程中,不要将那些文件打包
注意-c, -t, -x 不可同时出现在一串指令列中。
压缩
tar -czvf server-wow.tar.gz server
解压
tar -xzvf myetc.tar.gz
mysqldump -h 远程服务器IP或域名 -u 远端数据库账号 -p'远端数据库密码' --default-character-set=utf8 数据库名字 > /tmp/database_db.sql
创建数据库
参考:
https://github.com/TrinityCore/TrinityCore/blob/3.3.5/sql/create/create_mysql.sql
CREATE USER 'trinity'@'localhost' IDENTIFIED BY 'trinity' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0;
GRANT USAGE ON * . * TO 'trinity'@'localhost';
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 'trinity'@'localhost' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON `characters` . * TO 'trinity'@'localhost' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON `auth` . * TO 'trinity'@'localhost' WITH GRANT OPTION;