Skip to content

How to compile custom OT server source

Daniel Speichert edited this page Nov 22, 2016 · 2 revisions

The server already has all required libraries and packages to compile any popular OTS engine, including:

  • TFS 0.2/0.3/0.4/1.X
  • theotxserver
  • otserv

Compiling TFS 1.X

Your server is preinstalled with latest TFS 1.X already.

If you want to know how to do that manually, please see the official guide.

Compiling old/unsupported versions (e.g. r3884)

See this guide.

Compiling TFS 0.X/theotxserver

Important: Do not perform any of these steps as root! Use the otsmanager user.

The general workflow to compile the server is as follows:

  1. Unpack/upload the source to a directory in your home, e.g. to /home/otsmanager/ots
  2. Enter the directory: cd ~/ots
  3. Run autogen.sh: chmod +x autogen.sh; ./autogen.sh
    Note: it's possible this file doesn't exist, then it's not necessary to run it.
  4. Run configure: chmod +x configure; ./configure --enable-mysql --enable-server-diag
    Note: it's possible this file doesn't exist, then it's not necessary to run it.
  5. Run make: make

After the compilation is complete, you should figure out what is the name of the executable.
You will then need to adjust the service file properly to start your executable file.

Troubleshooting

My TFS 0.3/0.4 source is complaining about deprecated it->leaf() function calls

Try running the following commands to automatically fix your code:

sed -i 's/it->leaf()/it->path().filename().string()/g' *.cpp
sed -i 's/#define BOOST_FILESYSTEM_VERSION 2/#define BOOST_FILESYSTEM_VERSION 3/g' definitions.h
sed -i 's/  -lxml2$/ -lxml2 -lpthread/' Makefile

Then proceed to configure and make your binary.