Build and Maintain a Private World of Warcraft Server on Linux

World of Warcraft is a vastly popular online computer game played by millions of people around the world. While the majority of game servers are maintained by the game's creators, Blizzard, a group of people have designed a server program of their own, named Trinity Core. This guide will walk you through the steps necessary to compile and update your very own private WoW server.

This guide often uses the terminal for configuring and installing. If you are unaware of how to use the terminal, locate a bash guide or search for a how-to here on wikiHow. Terminal commands will be highlighted in italics. Bold text is information that must be supplied by you.

Steps

  1. Begin by installing all of the packages required for compilation. These are easily installed with this command: sudo apt-get install build-essential cmake libace-dev libmysql++-dev subversion mercurial openssl libssl-dev zlib1g-dev libmysqlclient15-dev libtool mysql-client unrar.
  2. Accept the yes/no prompt. This will install the packages to your computer.
  3. Navigate to your home folder, cd /home/yourusername. Make three folders, named bin, src and db. The commands are mkdir bin, mkdir src and mkdir db.
  4. Now you must download the source code for the Trinity server. Go to the "src" directory with CD src and type the command hg clone http://www.bitbucket.org/KingPin/trinitycore/ For TC1 (2.4.3) or hg clone http://www.bitbucket.org/KingPin/trinitycore2/ for TC2 (3.0.9).
  5. Go to the new directory named "trinitycore" with cd trinitycore and create a new folder named "build" with mkdir build. Go to the build directory with cd build.
  6. Configure the build process with the cmake command. There are several ways to configure the process, but this guide will assume that you are using MySQL for the server's database needs and that you want the default configuration. Type the command cmake ../ -DPREFIX=/home/yourusername/bin.
  7. Begin the build process with the make command. If you want the build process to go faster, you can first type make genrev and then make -j3 or make -j5. This works best on dual-core processors and quad-core processors respectively.
  8. When the process is done, it should look like the image on the right.
  9. Type the command make install. This will copy the necessary executable files to the /home/yourusername/bin directory.
  10. Now that you have built the server program, you must retrieve the game data from World of Warcraft itself. There are a number of tools in the "src/trinitycore/contrib/" directory that serve this purpose.
  11. Go to the "extractor" directory and find "ad.exe". copy it to the WoW root directory (example: C:\Program Files\World of Warcraft\) and run it. Copy the two new directories, "dbc" and "maps" to the /home/yourusername/bin/bin/ directory on the Linux computer. Check your hard drive space before running ad.exe, however. The program requires at least 1.5GB of space before running.
  12. Go to the "vmap_extract_assembler_bin" directory and copy all the present files to the WoW root directory. Run the file "makevmaps_SIMPLE.bat" and copy the new directory "vmaps" to the /home/yourusername/bin/bin/ directory on the Linux computer. Remove the "buildings" directory. Remember, makevmaps takes even more hard drive space than ad.exe, it requires at least 2GB.
  13. Now that you have the server and the data, you need a database to store the players and creatures. Go to your home directory with cd /home/yourusername and type the command svn checkout http://svn.assembla.com/svn/trinitydatabase/ db.
  14. Go to the /home/yourusername/db/trunk directory. This directory contains SQL dumps that must be inserted into the MySQL database. This guide will not provide any examples of inserting SQL queries. You may, of course, use whatever MySQL interface you prefer.
  15. Create three new databases, "world", "characters" and "realmd". Execute the script "characters.sql" in the characters database and execute the script "realmd.sql" in the realmd database. Both of these can be obtained from the src/trinitycore/sql directory.
  16. Extract the "full_database/TDB0.0.2.rar(TC1) or TDB0.0.3(TC2)" and execute the "TDBlatestversion.sql" to the world database.
  17. Go to the /home/yourusername/src/trinitycore/sql/updates directory. These files are called core updates. They must be applied to their corresponding databases in the correct order from number 1098 and up(TC1) or 1733 and up(TC2).
  18. Add a new row to the table "realmlist" in the realmd database. Make the id 1, name servername, address externalipaddress, port 8085, icon 0, color 0, timezone 8, allowedSecurityLevel 0, population 0.
  19. Go to the /home/yourusername/bin/etc directory. The two files in here act as configuration files for the server. They must be renamed to work, so remove the trailing ".dist" at the end of the filename.(If they don't have the .dist extension, you need to turn off the "hide extensions for known filetypes" option (google it) Now open the file "trinitycore.conf".
  20. Scroll down a bit until you find the "RealmID" option. Make sure it is the same as you just put in the database.
  21. Find the "DatabaseInfo" options, a few rows down. These must be set to the username and password of your MySQL database. Replace the ";trinity;trinity;" with ";username;password;".
  22. Find, under "Performance Settings" the "vmap.enableLOS" and "vmap.enableHeight" options. These must be changed from 0 to 1.
  23. Open the "trinityrealm.conf" file. Fix the "DatabaseInfo" options as you did in the previous file.
  24. Explore the different options in the files, and set them to your liking.
  25. When you are done, open a terminal window to /home/yourusername/bin/bin and type the command ./trinity-core. Do the same again except type ./trinity-realm.
  26. You now have a working Trinity server! To connect with your WoW client, simply access the file "realmlist.wtf" in the WoW root directory (2.4.3) or World of Warcraft\Data\{locale} (enUS or enGB for example)(3.0.9) and change it's contents to "set realmlist computeripaddress". When you connect with your client, it should connect to the Trinity server!
  27. Now that your server is up and running, you will want to learn how to properly update it.
  28. Shut down the server by pressing CTRL+C in the terminal windows.
  29. Open a terminal, and go to the /home/yourusername/src/trinitycore directory. Type the command hg pull and then hg update.(This can also be done in one step by using hg pull -u) This will download the latest source code.
  30. Repeat steps 5-9.
  31. Go to the /home/yourusername/src/trinitycore/sql/updates directory, and apply all new sql files to their corresponding databases. If you were previously on revision 1312, and a file that begins with 1313 is present, apply it and everything above. It is advisable to keep note of the latest file before doing step 31.
  32. Go to the /home/yourusername/db/trunk/updates directory. Apply the new files named "updatepack" in ascending numerical order to the world database. Ignore the "corepatch" files.
  33. Now your server and database are updated. Simply start the binaries and enjoy.

Tips

  • In the top right corner of the Trinity Core website is a piece of text that says what client version is currently supported. When extracting files from WoW, this is the version that you must have installed.
  • The Trinity Core forums are open to everybody. If you encounter problems, ask for help there!
  • The Database part of this guide is obsolete for TC2 (TC1 part is mostly correct), you must use the procedure found at UDBforums.org to install the correct database for TC2.

Things You'll Need

  • A computer with a Linux distribution installed, preferably Debian or Ubuntu
  • MySQL Server
  • A Windows computer with World of Warcraft, version 2.4.3, regular and Burning Crusade expansion
  • An Internet connection

Related Articles

  • Use a Ret Pally in World of Warcraft
  • Stop Your Boyfriend from Playing World of Warcraft
  • "Ninja Loot" in World of Warcraft
  • Create a Good Strategy for Warcraft 1, 2, and 3
  • Create Your Own Emotes on World of Warcraft

Sources and Citations