World of Warcraft server AzerothCore core Centos system compilation tutorial

World of Warcraft server AzerothCore core Centos system compilation tutorial

 

Hello everyone, I am Aixi and today I will share with you how to compile your own World of Warcraft server using the linux system

Preparations: one server, software installation, source code download, map file, configuration file modification

Modify file execution permissions, modify configuration files, compile and start, compile projects

Database table modification, game testing

(Creating a GM account, logging in to the game with a client, and GM commands are relatively simple and will not be introduced)

One 8H16G Centos7 system server of linux system server can access the external network

 

Install the software: Enter the code command 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

 

Enter Y and wait for the installation to complete.

Enter clang --version and press Enter

Enter cmake - -version and press Enter

Enter sudo apt-get install g++-8 gcc-8 and press Enter

At this point, the framework we use to compile the World of Warcraft server is installed.

(MySQL≥5.7.0、Boost≥1.74、OpenSSL≥1.0.x、CMake≥3.16、Clang≥1.0)

Core installation: Enter the command git clone xxxxs://github . com/ azerothcore/ zerothcore -wotlk. git --branch master --single-branch zerothcore (it takes a long time to wait for the installation to complete)

If there is no response that the download and installation are complete for a long time, it is also possible to go to the website to download

 

Upload the downloaded file to the server and manually decompress it and enter the command

unzip azerothcore-wotlk-master .zip

 

After the decompression is complete, there will be an azerothcore-wotlk-master file. Remember to delete the file name suffix -wotlk-master

 

Server-side compilation:

input command

cd zerothcore (enter the zerothcore folder)

mkdir build (create a build folder)

cd build (go to the build file)

Enter the command:

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 (organize the entire folder that needs to be compiled)

nproc --all (you can see the number of cores we need to compile)

Enter the command make -j 6 (it takes a long time to start compiling and wait patiently)

 

Enter the command: make install to see the zeroth-server file in our file directory

Server installation: directly prepare a client to upload to the server

 

Copy map_extractor, mmaps_ generator, vmap4assembler, vmap4extractor in the bin file of azeroth-server directory to the game client file

Enter the command:

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\)

 

After completion, enter the command ./map_extractor

Enter the command ./vmap4_extractor

Enter the command ./vmap4_assembler Buildings vmaps

Enter command.mkdir mmaps

Enter the command ./mmaps_generator

After all the above is loaded, you will get 4 folders

dbc,、maps、 vmaps 、mmaps

Move all four folders to the zaeroth-server file

Configuration database: in the /home/ubuntu/azeroth-server/etc/ folder

authserver.conf.dist (manage user data)

worldserver.conf.dist (game related configuration folder)

Double-click the authserver.conf.dist file to open it with the Visual Studio program

 

How to find our mysql username and password?

Enter the command sudo vim /etc/mysql/debian.cnf in the server

 

Fill in the user name and password we got into the acore location opened by the Visual Studio program in the figure below

 

Save after modification, then open the worldserver .conf.dist file and change acore to username and password

 

Create a database: enter sudo mysql (enter the mysql management interface)

Import instruction: source /home/ubuntu/ azerothcore/ data/sql/create/create_ mysql.sql

Finish typing quit

So when we get here, let's try to start the auth-server and world-server programs. These two programs need to be running all the time. We can enter the command to create a separate window to start

screen - s auth

screen - s world

Enter commands separately in these two windows to run:

cd /home /ubuntu/azeroth- server/bin/

~/azeroth-server/bin$ . /authserver

cd /home /ubuntu/azeroth- server/bin/

~/azeroth-server/bin$ . /worldserver

 

 

Map file ' ./maps /0004331.map': does not exist! error occurs when running the worldserver program

Open the worldserver.conf.dist and use the vs program to open the search data and fill in the location indicated by the arrow in the figure below into our map path /home/ubuntu/azeroth-server/data/

(That is the dbc, maps, vmaps, mmaps files we generated. If these files are not placed in the data file directory when you are operating, then change them according to the path you said to fill in. I will demonstrate here The map path is in /home/ubuntu/azeroth-server/data/)

 

Run ~/azeroth-server/bin$ ./worldserver again and it will run successfully

 

The last is to configure the server IP

Enter the command $ sudo mysql

Enter the command use acore_ auth;

Enter the command UPDATE realmlist SET address = '[your_ip]' WHERE id = 1;

Change '[your_ip]' to your server IP

My side is 103.219.xxx.xxx Then the command I entered is

UPDATE realmlist SET address = '[103.219.xxx.xxx]' WHERE id = 1;

Double-click the realmlist.wtf file in the /home/ubuntu/World of Warcraft 3.3.5 (12340) directory and open it with vs. Change the 127.0.0.0 in the table to your server IP.

Finally type exie to here we are all done

Click the wow.exe file to start the game experience test with your friends

Note:

Unable to start

 Internet problem:

If there is a network problem and cannot be started, please refer to the following content to modify

[root@localhost azerothcore-wotlk]# cat docker-compose.yml

version: '3.2'

services:

  ac-database:

    image: azerothcore/database

    restart: unless-stopped

    build:

      context: .

      dockerfile: ./docker/database/Dockerfile

    networks:

      proxy:

        ipv4_address: xxx.xxx.xxx.xxx (ie your server IP address)

    ports:

      - ${DB_EXTERNAL_PORT:-3306}:3306

    environment:

      - MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD:-password}

    volumes:

      - type: volume

        source: ac-database

        target: /var/lib/mysql

  ac-worldserver:

    stdin_open: true

    tty: true

    image: azerothcore/worldserver

    restart: unless-stopped

    privileged: true

    build:

      context: ./docker/worldserver

      dockerfile: Dockerfile

    networks:

      proxy:

        ipv4_address: xxx.xxx.xxx.xxx (ie your server IP address)

    ports:

      - ${WORLD_EXTERNAL_PORT:-8085}:8085

      - ${SOAP_EXTERNAL_PORT:-7878}:7878

    volumes:

      - type: bind

        source: ./docker/worldserver/bin

        target: /azeroth-server/bin

      - type: bind

        source: ${WORLDSERVER_ETC:-./docker/worldserver/etc}

        target: /azeroth-server/etc

      - type: bind

        source: ${WORLDSERVER_LOGS:-./docker/worldserver/logs}

        target: /azeroth-server/logs

      - type: bind

        source: ${WORLDSERVER_DATA:-./docker/worldserver/data}

        target: /azeroth-server/data

    depends_on:

      - ac-database

  ac-authserver:

    image: azerothcore/authserver

    restart: unless-stopped

    build:

      context: ./docker/authserver

      dockerfile: Dockerfile

    networks:

      proxy:

        ipv4_address: xxx.xxx.xxx.xxx (ie your server IP address)

    ports:

      - ${AUTH_EXTERNAL_PORT:-3724}:3724

    volumes:

      - type: bind

        source: ./docker/authserver/bin

        target: /azeroth-server/bin

      - type: bind

        source: ${AUTHSERVER_ETC:-./docker/authserver/etc}

        target: /azeroth-server/etc

      - type: bind

        source: ${AUTHSERVER_LOGS:-./docker/authserver/logs}

        target: /azeroth-server/logs

    depends_on:

      - ac-database

volumes:

  ac-database:

networks:

  proxy:

    ipam:

      config:

      - subnet: xxx.xxx.xxx.xxx (ie your server IP address) /24

2. Time zone issues

If it cannot be started due to time zone problems, refer to the following modification

[root@localhost azerothcore-wotlk]# cat docker/authserver/Dockerfile

FROM free: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 doesn't ask to set timezone on install

ENV DEBIAN_FRONTEND=noninteractive

# install the required dependencies to run the authserver

RUN apt update && apt install -y libmysqlclient-dev libssl-dev libace-6.4.5 libace-dev net-tools tzdata;

# change timezone in container

RUN 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 machine

CMD ["/azeroth-server/bin/authserver"]

[root@localhost azerothcore-wotlk]# cat docker/database/Dockerfile

FROM alpine:3.9 as builder

# install bash

RUN apk add --no-cache bash

# copy the sources from the host machine

COPY apps /azerothcore/apps

COPY bin /azerothcore/bin

COPY conf /azerothcore/conf

COPY data /azerothcore/data

COPY deps /azerothcore/deps

COPY acore.json /azerothcore/acore.json

# run the AzerothCore database assembler

RUN ./azerothcore/bin/acore-db-asm 1

FROM mysql:5.7

# List of timezones: xxxx://en.wikipedia.org/wiki/List_of_tz_database_time_zones

# set timezone environment variable

ENV TZ=Asia/Shanghai

ENV 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.d

HEALTHCHECK --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/Dockerfile

FROM free:20.04

# List of timezones: xxxx://en.wikipedia.org/wiki/List_of_tz_database_time_zones

# set timezone environment variable

ENV TZ=Aisa/Shanghai

# set noninteractive mode so tzdata doesn't ask to set timezone on install

ENV DEBIAN_FRONTEND=noninteractive

# install the required dependencies to run the authserver

RUN apt update && apt install -y libmysqlclient-dev libssl-dev libace-6.4.5 libace-dev libreadline-dev net-tools tzdata;

# change timezone in container

RUN 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 machine

CMD ["/azeroth-server/bin/worldserver"]

Database table modification

Enter the container and connect to the database

[root@localhost azerothcore-wotlk]# docker exec -it azerothcore-wotlk_ac-database_1 bash

bash-4.2# mysql -uroot -p

Enter 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 its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

Open acore_auth database, realmlist data table

mysql> use acore_auth;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

Database changed

mysql> 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 (your server IP address) | 127.0.0.1 | 255.255.255.0 | 1001 | 0 | 0 | 1 | 0 | 0 | 12340 |

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

1 row in set (0.00 sec)

Address is changed to server ip or domain name, port is changed to 1001

update realmlist set address='xxx.xxx.xxx.xxx (your server IP address)', port='1001';

restart server

game testing

Create a GM account

Enter the server container and create a gm account

docker attach azerothcore-wotlk_ac-worldserver_1

account create admin 123456

account set gmlevel admin 3 -1

The creation is complete, quit exits

Client login game

In the client, create a login.bat file and write the following content:

@echo y | rd /s "Cache"

echo SET realmlist "xxx.xxx.xxx.xxx (your server IP address): 1002"> realmlist.wtf

echo SET realmList "xxx.xxx.xxx.xxx (your server IP address): 1002"> Data/zhCN/realmlist.wtf

echo SET realmList "xxx.xxx.xxx.xxx (your server IP address): 1002"> Data/zhTW/realmlist.wtf

ren Data\commoo.MPQ common.MPQ

ren Data\expansioo.MPQ expansion.MPQ

start wow.exe

goto end

:end

I'm Aixi, today's World of Warcraft server AzerothCore core Centos system compilation tutorial is here, I hope it will be helpful to friends in need

There are a lot of cool things you can do with a server  respect  !

Guess you like

Origin blog.csdn.net/V13807970340/article/details/130530403