This page will guide you through all the required steps to compile the server core on Ubuntu or Arch. Compiling VMaNGOS on Linux is much easier than doing it on Windows, since you can install all dependencies through the terminal.
- g++ Compiler
- CMake
- Git
- ACE
- TBB
- MySQL Connector/C or MariaDB
- OpenSSL
- Zlib
First we need to install the compiler.
sudo apt install g++
sudo pacman -S gcc
The ACE library is essential, since it's used for Networking, Threading and File System access.
sudo apt install -qq libace-dev
export ACE_ROOT=/usr/include/ace
On Arch we have to use AUR
mkdir libace && cd libace
curl -L -O https://aur.archlinux.org/cgit/aur.git/snapshot/ace.tar.gz
makepkg -si
cd .. && rm -rf libace
The TBB library is used to provide better performance and scalability for memory allocation/deallocation operations in multithreaded applications, compared to the default allocator. This dependency is optional and can be skipped if you specify the USE_STD_MALLOC option when configuring with CMake.
sudo apt install -y libtbb-dev
export TBB_ROOT_DIR=/usr/include/tbb
sudo pacman -S tbb
export TBB_ROOT_DIR=/usr/include/tbb
To download the source code for VMaNGOS, you should install Git. This can be avoided if you choose to manually download the zip archive from the website, but it's better to use Git, as it makes pulling updates from the main repository much easier.
sudo apt install git
sudo pacman -S git
Since this is a cross-platform project, we use CMake to generate the appropriate solution files for every environment.
sudo apt install cmake
sudo pacman -S cmake
Account, character and game data is stored inside the database, so we need the MySQL connector library to read and write data to it.
sudo apt-get install libmysqlclient-dev
On Arch good option is to use MariaDB instead of libmysqlclient since it is available in official repositories.
sudo pacman -S mariadb
Communication between the game client and server needs to be encrypted, which requires a cryptography library.
sudo apt-get install openssl
sudo apt-get install libssl-dev
OpenSSL is provided as part of coreutils and there is no need to install it.
In order to reduce network traffic, a number of packets sent from the server are compressed, so we need a library for that too.
sudo apt install build-essential checkinstall zlib1g-dev -y
sudo pacman -S zlib
Make a new folder called vmangos, and use Git to download the latest core revision:
mkdir vmangos
cd vmangos
git clone -b development https://github.com/vmangos/core
Now let's configure our project. Make another directory called build next to the newly created core folder, and call CMake from there to generate the Makefiles.
mkdir build
cd build
cmake ~/vmangos/core -DDEBUG=0 -DSUPPORTED_CLIENT_BUILD=5875 -DUSE_EXTRACTORS=0 -DCMAKE_INSTALL_PREFIX=~/vmangos
As you can see, you'll need to set a couple of settings when calling CMake. Here is what each of these means.
This setting lets you choose if you want to compile in Debug or Release mode. The server will run much smoother in Release mode, so set Debug to 0.
Since this is a progressive emulator, you can specify the exact client version to support. The build number of the final Vanilla patch 1.12.1 is 5875. You can see your client's build number in the lower left corner of the login screen. Only the final version of each major patch is supported. That means you can play with 1.8.4, but not 1.8.0 for example.
The server needs the map terrain data in order to know where anything is located. This data is extracted from the game client using several tools, which you can choose to build with this setting. If you already have the map files from somewhere else, then you can set this to 0.
This setting lets you choose where to copy the binaries after compilation finishes.
Now that we have all the dependencies, and the project files have been properly configured, we can go ahead and compile the core. This can take quite a while, depending on the computer you are using.
make -j4
make install
Congratulations! You should now be able to find the compiled binaries inside the vmangos directory.
Go to the next tutorial to learn how to setup your database.