AzerothCore bash 仪表盘(dashboard)是一组用于帮助安装和维护 AzerothCore 服务器的脚本。 它让你只需极少的步骤,就能在你的机器上轻松地安装、更新和运行 AzerothCore。
安装一个用于开发或生产环境的私服从未如此简单。 如果你需要任何帮助,只需提一个问题。
你的机器上需要安装有 git、curl、unzip、sudo。 除此之外无需手动安装任何其他软件。
apt update && apt install git curl unzip sudo
brew install git
brew install bash)git clone https://github.com/azerothcore/azerothcore-wotlk.git; cd azerothcore-wotlk
有一个 conf/dist/config.sh
文件包含默认配置。请查看一下它。
大部分默认配置很可能适用于你的情况,
但你也可以把它复制到 conf/config.sh 下,并随意修改其中的值。
./acore.sh install-deps
注意:在 Windows 上,需要以管理员身份执行
./acore.sh compiler all
sudo mysql -u root),并通过运行以下命令手动创建 acore MySQL 用户:DROP USER IF EXISTS 'acore'@'localhost';
DROP USER IF EXISTS 'acore'@'127.0.0.1';
CREATE USER 'acore'@'localhost' IDENTIFIED BY 'acore';
CREATE USER 'acore'@'127.0.0.1' IDENTIFIED BY 'acore';
GRANT ALL PRIVILEGES ON * . * TO 'acore'@'localhost' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON * . * TO 'acore'@'127.0.0.1' WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit;
注意:尽管 acore 用户只能从 localhost 访问,
但将其密码改为更安全的密码仍是一个好习惯。
获取最新的客户端数据:
./acore.sh client-data
创建以下 2 个文件。它们包含 worldserver 和 authserver 的默认配置,如果你不想修改,直接复制即可。
cp env/dist/etc/authserver.conf.dist env/dist/etc/authserver.conf
cp env/dist/etc/worldserver.conf.dist env/dist/etc/worldserver.conf
cp env/dist/configs/authserver.conf.dist env/dist/configs/authserver.conf
cp env/dist/configs/worldserver.conf.dist env/dist/configs/worldserver.conf
如果你按照上述步骤操作,你的服务器将位于 env/dist 目录内。
worldserver 和 authserver 二进制文件位于 azerothcore-wotlk/env/dist/bin。
你可以直接运行它们,也可以使用重启器(见下文)。
worldserver 首次启动时会安装一个完整的 AzerothCore 数据库。此时无需导入任何数据库更新。
AzerothCore 仪表盘附带了一套重启器:
./acore.sh run-worldserver
等待进程运行完成,然后运行:
./acore.sh run-authserver
对于专用服务器,
你可能希望使用 tmux(见下文)等工具在终端复用会话中运行它们。
更新源码:
git pull
重新编译:
./acore.sh compiler build
更新数据库:
database-keeping-the-server-up-to-date
就这样。
想通过 Telegram 消息每天直接把私服数据库的备份发送到你的手机/电脑?
是的,这是可行的。只需使用:azerothcore/telegram-automated-db-backup
你可以在没有任何 GUI 的 Linux 服务器上轻松安装 AzerothCore, 只需通过 Visual Studio Code 使用 SSH 远程连接即可, 配合 SSH 和 SSH: Editing Configuration Files 扩展, 你会感觉就像在自己家里一样。
你可以使用 tmux 作为终端复用器, 它可以让你轻松地在没有 GUI 的服务器中管理进程。
你可以创建 2 个会话,并在其中运行 worldserver 和 authserver 进程:
tmux new -s world-session
然后在其中运行 ./acore.sh run-worldserver,之后从中分离
tmux new -s auth-session
然后在其中运行 ./acore.sh run-authserver,之后从中分离
你可以使用 CTRL+B+D 分离,在不终止进程的情况下退出会话。
如果通过 VSCode SSH 连接,你只需关闭终端会话即可。
你可以使用以下命令重新连接到 world-session 会话:
tmux attach -t world-session其他有用的命令:
tmux new -s my_session
tmux ls
tmux kill my_session(或连接到它后输入 exit)tmux kill-server
你可以使用这个简单的脚本自动创建 tmux 会话并执行 authserver 和 worldserver:
#!/usr/bin/env bash
# ALLOW TMUX TO WAIT FOR MYSQL TO BE READY
# YOU MUST CHANGE THE USER AND PASSWORD TO CORRESPOND WITH YOUR INSTALL
mysql_ready() {
mysqladmin ping --host=127.0.0.1 --user=YOURUSER --password=YOURPASSWORD > /dev/null 2>&1
}
while !(mysql_ready)
do
sleep 3
echo "waiting for mysql ..."
done
# CHANGE THESE WITH THE CORRECT PATHS
authserver="/path/to/azerothcore-wotlk/acore.sh run-authserver"
worldserver="/path/to/azerothcore-wotlk/acore.sh run-worldserver"
authserver_session="auth-session"
worldserver_session="world-session"
if tmux new-session -d -s $authserver_session; then
echo "Created authserver session: $authserver_session"
else
echo "Error when trying to create authserver session: $authserver_session"
fi
if tmux new-session -d -s $worldserver_session; then
echo "Created worldserver session: $worldserver_session"
else
echo "Error when trying to create worldserver session: $worldserver_session"
fi
if tmux send-keys -t $authserver_session "$authserver" C-m; then
echo "Executed \"$authserver\" inside $authserver_session"
echo "You can attach to $authserver_session and check the result using \"tmux attach -t $authserver_session\""
else
echo "Error when executing \"$authserver\" inside $authserver_session"
fi
if tmux send-keys -t $worldserver_session "$worldserver" C-m; then
echo "Executed \"$worldserver\" inside $worldserver_session"
echo "You can attach to $worldserver_session and check the result using \"tmux attach -t $worldserver_session\""
else
echo "Error when executing \"$worldserver\" inside $worldserver_session"
fi
在 unix 系统上,你可以使用 crontab 在系统启动时自动运行该脚本:
crontab -e
然后添加这一行(将 /path/to/startup.sh 替换为你放置上述脚本的路径):
@reboot /bin/bash /path/to/startup.sh