标签 azerothcore 下的文章

作者: reistlin
来源: http://www.reistlin.com/blog/447
更新时间: 2024.03
版权声明: 原创文章.转载请保留作者信息和原文完整.谢绝任何方式的摘要

azerothcore.png

AzerothCore 主页:[https://www.azerothcore.org]
AzerothCore Wiki 文档:[https://www.azerothcore.org/wiki/home]

一,使用 screen 启动 worldserver

1、安装 screen:

apt-get install screen

2、使用 screen 启动 worldserver,窗口名称为:worldserver

cd /home/reistlin/azerothcore/bin
screen -S worldserver
./worldserver

3、退出当前 screen 窗口

Ctrl + a键 d键

4、查看 screen 窗口状态

reistlin@Debian:~/azerothcore/bin$ screen -ls
There is a screen on:
        112233.worldserver      (03/20/2024 10:00:00 AM)        (Attached)
1 Socket in /run/screen/S-reistlin.

二,使用 restart.sh 重启 AzerothCore

acore_screen:screen 窗口名称(默认:worldserver)
acore_path:AzerothCore 系统根目录(默认:/home/reistlin/azerothcore)
acore_delay:服务器计划重启时间,默认 60 秒后重启,同时通知所有在线玩家
app_user:运行 worldserver 的用户名称

#!/bin/bash

# name: restart AzerothCore by screen v0.1 (Linux Server)
# author: reistlin
# website: www.reistlin.com
# date: 2024.03.20

acore_screen="worldserver"
acore_path="/home/reistlin/azerothcore"
acore_delay="60"

app_user="reistlin"
app_process="SCREEN -S ${acore_screen}"
app_port="8085"

check1=`ps v -U ${app_user} | grep "${app_process}" | grep -v "grep" | wc -l`
check2=`netstat -nlpt | grep ":${app_port}" | wc -l`

if [ "${check1}" -eq 1 ] && [ "${check2}" -eq 1 ]; then
	# save
	screen -x -S ${acore_screen} -p 0 -X stuff "save\n"          
	sleep 1

	# shutdown
	screen -x -S ${acore_screen} -p 0 -X stuff "server shutdown ${acore_delay}\n"
	sleep `expr ${acore_delay} + 3`

	# start
	screen -x -S ${acore_screen} -p 0 -X stuff "${acore_path}/bin/worldserver\n"
	sleep 1

	# logfile
	echo "[`date "+%Y-%m-%d %H:%M:%S"`] ${acore_screen} service has successfully restarted" >> $HOME/crontab/restart.log
else
	echo "[EXIT] Not found worldserver by screen"
fi

编辑 crontab,设置每天凌晨 6 点自动重启

# restart AzerothCore worldserver
0  6 * * * /home/reistlin/crontab/restart.sh > /dev/null 2>&1

作者: reistlin
来源: http://www.reistlin.com/blog/439
更新时间: 2023.07
版权声明: 原创文章.转载请保留作者信息和原文完整.谢绝任何方式的摘要

azerothcore.png

AzerothCore 主页:[https://www.azerothcore.org]
AzerothCore Wiki 文档:[https://www.azerothcore.org/wiki/home]
Eluna Lua Engine 主页:[https://github.com/azerothcore/mod-eluna]
Eluna Lua Engine API 文档:[https://www.azerothcore.org/pages/eluna/index.html]

一,安装 MySQL 8.0

wget https://repo.mysql.com//mysql-apt-config_0.8.29-1_all.deb -O /tmp/mysql-apt-config_all.deb

apt-get install gnupg

Debian 11

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AABBCC1122334455

Debian 12

gpg --keyserver keyserver.ubuntu.com --recv-keys AABBCC1122334455
gpg --export --armor AABBCC1122334455 | apt-key add
apt-get update
apt-get upgrade

dpkg -i /tmp/mysql-apt-config_all.deb

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

三,通过 alternatives 设置 clang 版本

update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang 100

四,通过 git clone 下载 AzerothCore,同时安装 mod-ah-bot 和 mod-eluna

cd /home/reistlin
mkdir AzerothCore
git clone https://github.com/azerothcore/azerothcore-wotlk.git --branch master --single-branch AzerothCore --depth 1
cd AzerothCore/modules
git clone https://github.com/azerothcore/mod-ah-bot.git
git clone https://github.com/azerothcore/mod-eluna.git

五,编译安装

cd /home/reistlin/AzerothCore
mkdir build
cd build

cmake ../ -DCMAKE_INSTALL_PREFIX=/home/reistlin/azerothcore/ -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DWITH_WARNINGS=1 -DTOOLS_BUILD=all -DSCRIPTS=static -DMODULES=static

make -j 8
make install

六,MySQL 设置

mysql -u root -p

DROP USER IF EXISTS 'acore'@'localhost';
CREATE USER 'acore'@'%' IDENTIFIED BY 'NEWPASSWORD';
GRANT ALL PRIVILEGES ON * . * TO 'acore'@'%';
GRANT ALL PRIVILEGES ON `acore_world` . * TO 'acore'@'%';
GRANT ALL PRIVILEGES ON `acore_characters` . * TO 'acore'@'%';
GRANT ALL PRIVILEGES ON `acore_auth` . * TO 'acore'@'%';
exit