您的位置首页  散文评论

keyclone(keyclone1.8 魔兽多开教程)干货分享

我是艾西,今天魔兽世界服务端AzerothCore核心Centos系统编译教程就到这里啦,希望对有需要的小伙伴有帮助。

keyclone(keyclone1.8 魔兽多开教程)干货分享

 

大家好,我是艾西今天跟大家分享下用linux系统怎么编译一个自己的魔兽世界服务端准备工作:服务器一台、 安装软件、下载源码、 地图文件、 修改配置文件修改文件执行权限、 修改配置文件、编译及启动、编译项目

数据库表修改、游戏测试(创建GM账户、 客户端登录游戏、GM指令 这几项比较简单不做介绍)linux系统服务器1台8H16G Centos7 系统服务器能够访问外网

安装软件:输入代码指令sudo apt-get update && sudo apt-get install git cmake make gcc g++ clang libmysqlclient-dev libssl -dev libbz2- dev libreadline dev libncurses dev mysql-server libboost- all-dev

输入Y等待安装完成就行了输入clang --version 回车输入cmake - -version回车输入sudo apt-get install g++-8 gcc-8 回车到这一步我们用于编译魔兽服务端的框架就算安装完成了

(MySQL≥5.7.0、Boost≥1.74、OpenSSL≥1.0.x、CMake≥3.16、Clang≥1.0)核心安装:输入指令git clone xxxxs://github . com/ azerothcore/ azerothcore -wotlk. git --branch master --single-branch azerothcore (时间较长等待安装完成就好)

如果长时间没有下载安装完成的响应,那么到网站上去下载也是可以的

下载完成的文件上传到服务器上再手动解压出来输入指令unzip azerothcore-wotlk-master .zip

解压完成后就会有一个azerothcore-wotlk-master文件记得把文件名后缀-wotlk-master删掉

服务端编译:输入指令cd azerothcore (进入azerothcore文件夹)mkdir build(创建一个build文件夹)cd build (进入到build文件)输入指令:cmake ../

-DCMAKE_INSTALL_PREFIX=$HOME/azeroth-server/ -DCMAKE_C_COMPILER=/usr/bin/clang-DCMAKE_CXX_COMPILER=/usr/bin/clang++

-DWITH_WARNINGS=1 -DTOOLS_BUILD=all-DSCRIPTS=static -DMODULES=static(对整个需要编译的文件夹进行整理)nproc --all (可以看到我们需要编译的核心数量)

输入指令make -j 6 (开始编译时间较久耐心等待)

输入指令:make install 在我们文件目录就能看到azeroth-server文件服务器安装:直接准备一个客户端上传到服务器里

将azeroth-server目录bin文件内的map_extractor、mmaps_ generator、vmap4assembler、vmap4extractor 复制到游戏客户端文件内输入指令:

cp/home/ubuntu/azeroth-server/bin/map_ extractor /home /ubuntu/World\ of\ Warcraft\ 3.3.5\ (12340\)cp/home/ubuntu/azeroth-server/bin/mmaps_ generator /home /ubuntu/World\ of\ Warcraft\ 3.3.5\ (12340\)

cp/home/ubuntu/azeroth-server/bin/vmap4_assembler /home /ubuntu/World\ of\ Warcraft\ 3.3.5\ (12340\)cp/home/ubuntu/azeroth-server/bin/vmap4_extractor/home /ubuntu/World\ of\ Warcraft\ 3.3.5\ (12340\)

完成后输入指令./map_extractor输入指令./vmap4_extractor输入指令./vmap4_assembler Buildings vmaps输入指令.mkdir mmaps输入指令./mmaps_generator

以上所有的加载完后会得到4个文件夹dbc,、maps、 vmaps 、mmaps将这四个文件夹全部移动到zaeroth-server文件配置数据库:/home/ubuntu/azeroth -server/etc/ 文件夹内的

authserver.conf.dist(管理用户数据)worldserver .conf.dist(游戏相关配置文件夹)双击authserver.conf.dist文件用Visual Studio程序打开

怎么找到我们mysql的用户名和密码呢?在服务器里输入指令sudo vim /etc/mysql/ debian. cnf

将我们得到的用户名和密码填入下图Visual Studio程序打开的acore位置

修改完后保存,然后打开worldserver .conf.dist文件一样的将acore改为用户名和密码

创建数据库:输入sudo mysql(进入mysql管理界面)输入命令:source /home/ubuntu/ azerothcore/ data/sql/create/create_ mysql.sql

完成输入quit那么到了这里后我们尝试启动一下auth-server和world-server程序 这两个程序需要一直开启运行的,我们可以输入命令单独创建窗口启动screen - s authscreen - s world

在这两个窗口单独输入命令运行:cd /home /ubuntu/azeroth- server/bin/~/azeroth-server/bin$ . /authservercd /home /ubuntu/azeroth- server/bin/

~/azeroth-server/bin$ . /worldserver

运行worldserver程序时出现 Map file . /maps /0004331.map: does not exist! 报错打开worldserver .conf.dist用vs程序打开 搜索data将下图箭头所指位置填入我们的地图路径

/home/ubuntu/azeroth-server/data/(就是我们生成的dbc,、maps、 vmaps 、mmaps文件,你们自己在操作的时候这几个文件如果没有放到data文件目录下,那就根据自己说填写的路径去改一下,我这边演示所在的地图路径在

/home/ubuntu/azeroth-server/data/)

再次运行~/azeroth-server/bin$ . /worldserver 就成功跑起来了

最后就是进行服务器IP配置输入指令$ sudo mysql输入指令use acore_ auth;输入指令UPDATE realmlist SET address = [your_ip] WHERE id = 1;

[your_ip]改为你的服务器IP我这边的是 103.219.xxx.xxx 那么我输入的指令就是UPDATE realmlist SET address = [103.219.xxx.xxx] WHERE id = 1;

在/home/ubuntu/World of Warcraft 3.3.5(12340)目录下的realmlist.wtf文件双击进去用vs打开将表格内的127.0.0.0 改为你的服务器IP即可最后输入exie 到这里我们所有的就算完成了

点击wow.exe文件开始和小伙伴一起进入游戏体验测试吧补注:无法启动网络问题:如果出现网络问题,无法启动,可参考以下内容修改[root@localhost azerothcore-wotlk]# cat docker-compose.yml

version: 3.2services:ac-database:image: azerothcore/databaserestart: unless-stoppedbuild:context: .dockerfile: ./docker/database/Dockerfile

networks:proxy:ipv4_address: xxx.xxx.xxx.xxx(即你服务器IP地址)ports:- ${DB_EXTERNAL_PORT:-3306}:3306environment:

- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD:-password}volumes:- type: volumesource: ac-databasetarget: /var/lib/mysql

ac-worldserver:stdin_open: truetty: trueimage: azerothcore/worldserverrestart: unless-stoppedprivileged: true

build:context: ./docker/worldserverdockerfile: Dockerfilenetworks:proxy:ipv4_address: xxx.xxx.xxx.xxx(即你服务器IP地址)

ports:- ${WORLD_EXTERNAL_PORT:-8085}:8085- ${SOAP_EXTERNAL_PORT:-7878}:7878volumes:- type: bindsource: ./docker/worldserver/bin

target: /azeroth-server/bin- type: bindsource: ${WORLDSERVER_ETC:-./docker/worldserver/etc}target: /azeroth-server/etc

- type: bindsource: ${WORLDSERVER_LOGS:-./docker/worldserver/logs}target: /azeroth-server/logs- type: bind

source: ${WORLDSERVER_DATA:-./docker/worldserver/data}target: /azeroth-server/datadepends_on:- ac-database

ac-authserver:image: azerothcore/authserverrestart: unless-stoppedbuild:context: ./docker/authserverdockerfile: Dockerfile

networks:proxy:ipv4_address: xxx.xxx.xxx.xxx(即你服务器IP地址)ports:- ${AUTH_EXTERNAL_PORT:-3724}:3724volumes:

- type: bindsource: ./docker/authserver/bintarget: /azeroth-server/bin- type: bindsource: ${AUTHSERVER_ETC:-./docker/authserver/etc}

target: /azeroth-server/etc- type: bindsource: ${AUTHSERVER_LOGS:-./docker/authserver/logs}target: /azeroth-server/logs

depends_on:- ac-databasevolumes:ac-database:networks:proxy:ipam:config:- subnet: xxx.xxx.xxx.xxx(即你服务器IP地址)/24

2.时区问题如果因为时区问题,无法启动,参考如下修改[root@localhost azerothcore-wotlk]# cat docker/authserver/DockerfileFROM ubuntu:20.04

# List of timezones: xxxx://en.wikipedia.org/wiki/List_of_tz_database_time_zones# set timezone environment variable

ENV TZ=Asia/Shanghai# set noninteractive mode so tzdata doesnt ask to set timezone on installENV DEBIAN_FRONTEND=noninteractive

# install the required dependencies to run the authserverRUN apt update && apt install -y libmysqlclient-dev libssl-dev libace-6.4.5 libace-dev net-tools tzdata;

# change timezone in containerRUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata

HEALTHCHECK --interval=5s --timeout=15s --start-period=30s --retries=1 CMD netstat -lnpt | grep :3724 || exit 1

# run the authserver located in the directory "docker/authserver/bin" of the host machineCMD ["/azeroth-server/bin/authserver"]

[root@localhost azerothcore-wotlk]# cat docker/database/DockerfileFROM alpine:3.9 as builder# install bash

RUN apk add --no-cache bash# copy the sources from the host machineCOPY apps /azerothcore/appsCOPY bin /azerothcore/bin

COPY conf /azerothcore/confCOPY data /azerothcore/dataCOPY deps /azerothcore/depsCOPY acore.json /azerothcore/acore.json

# run the AzerothCore database assemblerRUN ./azerothcore/bin/acore-db-asm 1FROM mysql:5.7# List of timezones: xxxx://en.wikipedia.org/wiki/List_of_tz_database_time_zones

# set timezone environment variableENV TZ=Asia/ShanghaiENV LANG C.UTF-8# copy files from the previous build stage - see: xxxxs://docs.docker.com/develop/develop-images/multistage-build/

COPY --from=builder /azerothcore/env/dist/sql /sql# adding the "generate-databases.sh" to the directory "/docker-entrypoint-initdb.d"

# because all scripts included in that directory will automatically be executed when the docker container starts

COPY docker/database/generate-databases.sh /docker-entrypoint-initdb.dHEALTHCHECK --interval=5s --timeout=15s --start-period=30s --retries=1 CMD mysqladmin -uroot -p$MYSQL_ROOT_PASSWORD ping -h localhost

[root@localhost azerothcore-wotlk]# cat docker/worldserver/DockerfileFROM ubuntu:20.04# List of timezones: xxxx://en.wikipedia.org/wiki/List_of_tz_database_time_zones

# set timezone environment variableENV TZ=Aisa/Shanghai# set noninteractive mode so tzdata doesnt ask to set timezone on install

ENV DEBIAN_FRONTEND=noninteractive# install the required dependencies to run the authserverRUN apt update && apt install -y libmysqlclient-dev libssl-dev libace-6.4.5 libace-dev libreadline-dev net-tools tzdata;

# change timezone in containerRUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata

HEALTHCHECK --interval=5s --timeout=15s --start-period=30s --retries=1 CMD netstat -lnpt | grep :8085 || exit 1

# run the worldserver located in the directory "docker/worldserver/bin" of the host machineCMD ["/azeroth-server/bin/worldserver"]

数据库表修改进入容器,连接数据库[root@localhost azerothcore-wotlk]# docker exec -it azerothcore-wotlk_ac-database_1 bash

bash-4.2# mysql -uroot -pEnter password:Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 1416

Server version: 5.7.41 MySQL Community Server (GPL)Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respective

owners.Type help; or \h for help. Type \c to clear the current input statement.mysql>打开 acore_auth数据库, realmlist 数据表

mysql> use acore_auth;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -A

Database changedmysql> show tables;+----------------------+| Tables_in_acore_auth |+----------------------+

| account || account_access || account_banned || account_muted || autobroadcast || ip2nation || ip2nationCountries |

| ip_banned || logs || logs_ip_actions || realmcharacters || realmlist || uptime || version_db_auth |

+----------------------+14 rows in set (0.00 sec)mysql> select * from realmlist;+----+-------------+---------------+--------------+-----------------+------+------+------+----------+----------------------+------------+-----------+

| id | name | address | localAddress | localSubnetMask | port | icon | flag | timezone | allowedSecurityLevel | population | gamebuild |

+----+-------------+---------------+--------------+-----------------+------+------+------+----------+----------------------+------------+-----------+

| 1 | AzerothCore | xxx.xxx.xxx.xxx(即你服务器IP地址) | 127.0.0.1 | 255.255.255.0 | 1001 | 0 | 0 | 1 | 0 | 0 | 12340 |

+----+-------------+---------------+--------------+-----------------+------+------+------+----------+----------------------+------------+-----------+

1 row in set (0.00 sec)address 修改为服务器ip或者域名,port 修改为 1001update realmlist set address=xxx.xxx.xxx.xxx(即你服务器IP地址),port=1001;

重启服务器游戏测试创建GM账户进入服务器容器,并创建gm账号docker attach azerothcore-wotlk_ac-worldserver_1account create admin 123456

account set gmlevel admin 3 -1创建完成,quit退出客户端登录游戏在客户端中,创建 login.bat 文件,并写入如下内容:@echo y | rd /s "Cache"

echo SET realmlist "xxx.xxx.xxx.xxx(即你服务器IP地址):1002"> realmlist.wtfecho SET realmList "xxx.xxx.xxx.xxx(即你服务器IP地址):1002"> Data/zhCN/realmlist.wtf

echo SET realmList "xxx.xxx.xxx.xxx(即你服务器IP地址):1002"> Data/zhTW/realmlist.wtfren Data\commoo.MPQ common.MPQ

ren Data\expansioo.MPQ expansion.MPQstart wow.exegoto end:end我是艾西,今天魔兽世界服务端AzerothCore核心Centos系统编译教程就到这里啦,希望对有需要的小伙伴有帮助

拥有一台服务器可以做很多很酷的事情respect !

免责声明:本站所有信息均搜集自互联网,并不代表本站观点,本站不对其真实合法性负责。如有信息侵犯了您的权益,请告知,本站将立刻处理。联系QQ:1640731186