User:Roadapathy

From ArcEmu-Wiki
Jump to: navigation, search

Contents

How to compile Arcemu with Ubuntu Linux (64 bit Maverick 10.10)

Ubuntu Linux is based upon the Debian Linux operating system. Ubuntu has become the most popular Linux distro as of the time of this writing. This guide was written from the experience of a fresh installation of the Ubuntu Linux Maverick 64 bit (Version 10.10). However, the guide should work without any serious problems using other Ubuntu versions. Other versions of Ubuntu Linux may cause dependency problems. It's advised to be aware of the apt-get CLI (command line input) and the Synaptic Package Manager.


Copy the entire World of Warcraft

This tutorial assumes you will put your World of Warcraft game folder into /home/arcemu/WoW. Data files will be extracted from the client data and used by the Arcemu.


CLI commands to be familiar with

If problems arise during compiling of the Arcemu, or any other software, and an error received involves some sort of software dependancy, that can be solved with the apt-get install command. This and a handful of other commands will help users complete the Arcemu compilation, installation and configuration process.


apt-get (install, clean, purge, update)
apt-cache (search)
git (rev-parse HEAD,clone)
mysql (you will need to learn how to insert and modify data using GLI or GUI tools)
vim or any other CLI editor that you choose. If you use Ubuntu GUI editor, it must have root access to save.

Launching the CLI window in super user mode

If you want to operate the CLI terminal in super user mode on Ubuntu, simple type the following;


passwd

Next, simply update your password.


Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully

Use the command "su" to enter super user mode when using the CLI.

In addition, you can add a terminal launch icon on the Gnome panel to enter super user mode automatically. Add the prefix gksu to the properties of the launch icon in the command box.

gksu.jpg

Software repositories

Make sure the correct repositories are selected by the system so that the system can find all of the necessary tools.

Click on the top pull-down menu: System->Administration->Synaptic Package Manager

The Synaptic Package Manager window will appear. Click on Settings->Repositories.

Software Sources. Check the following boxes;

Community-maintained Open Source Software (universe)
Software restricted by copyright or legal issues (multiverse)

S1repositories-1.jpg


Open the terminal window (Applications->Accessories->Terminal) and type the following commands;


sudo apt-get update


Now all software sources are updated and cached. This should prevent software from failing to be located.


Download necessary tools

Basic tools needed to compile the Arcemu.

sudo apt-get install -y build-essential unzip zlib1g-dev libssl-dev libtool libstdc++6 libgd2-xpm libpcre3-dev cmake g++ git-core git


Basic tools needed to uncompress the database file such as NCDB or WhyDB as well as a simple CLI editor.

sudo apt-get install p7zip-rar p7zip-full vim


Downloading Mysql and adding a password

The following command will download and install Mysql. It will ask for a password that is needed later to access the database.
The Mysql daemon will be running after the installation.

sudo apt-get install -y mysql-server mysql-client libmysqlclient16-dev


NOTE:
Remember the password! Pay attention to caps lock!

The Password is used later when importing a world database - Whydb, NCDB, Etc.

Create a new user named arcemu

Type the following commands in order to create the new user, password and the arcemu home directory;

sudo useradd -m arcemu
sudo passwd arcemu


NOTE:
The new arcemu user will keep all of the emulator files together in; /home/arcemu

This will also allow the emulator to run as user arcemu. Running arcemu as root would be a security risk!

Make sure to create a password that you will remember!


cd /home/arcemu


Create the directories for the Arcemu source files and compiled server;

sudo mkdir src
sudo mkdir server


Change into the directory where the source files will be contained.

cd /home/arcemu/src



Download the source files using GIT

Now the server is ready to begin the downloading of the most recent version of the Arcemu
server. It would be very useful to learn a bit more about the GIT tool
for the inexperienced.

git clone git://github.com/arcemu/arcemu.git code


gitclone.png


Compile Arcemu source files and installing

It is recommended to create a build directory.

cd /home/arcemu/src/code/cmake/
sudo mkdir build
cd build
sudo cmake -DCMAKE_INSTALL_PREFIX=/home/arcemu/server -DBUILD_LUAENGINE=TRUE -DBUILD_LUABRIDGE=FALSE -DBUILD_TOOLS=TRUE ..


If you don't require the server stat plugin, use the following command

sudo cmake -DCMAKE_INSTALL_PREFIX=/home/arcemu/server -DBUILD_LUAENGINE=TRUE -DBUILD_LUABRIDGE=FALSE -DBUILD_TOOLS=TRUE -DBUILD_SERVERSTATUSPLUGIN=FALSE ..


cmake.jpg


NOTE:
Do not enable both LUABRIDGE and LUAENGINE within the same build as they are redundant.


Check for errors. Disregard any warnings as there may be a few.
Notice the parameter that is passed on to cmake: -DCMAKE_INSTALL_PREFIX=/home/arcemu/server
This will be where your compiled Arcemu server will be installed. The default is /usr/local/bin.

NOTE:
More cmake options:

-DBUILD_EVENTSCRIPTS=true/false
-DBUILD_INSTANCESCRIPTS=true/false
-DBUILD_EXTRASCRIPTS=true/false 
-DBUILD_GOSSIPSCRIPTS=true/false
-DBUILD_QUESTSCRIPTS=true/false
-DBUILD_MISCSCRIPTS=true/false
-DBUILD_SERVERSTATUSPLUGIN=true/false
-DBUILD_ARCEMUSCRIPTS=true/false


Depending on the speed of your computer, compiling time may take over twenty minutes.

sudo make -j `getconf _NPROCESSORS_ONLN`

make.jpg

Using the -j feature of make. While this may put more CPU cores to work, this could also cause your computer to over-heat.
Try adding the CPU Scaler Applet to the Gnome panel and reduce the CPU to 2/3 power.}}


Installing the Arcemu binaries

Command to install the compiled binaries;

sudo make install


Change directory to where the Arcemu binary files should now be located.

cd /home/arcemu/server


You should see the following directory: bin To look inside the bin directory, you can see now if the build was successful;

ls -l
 
root@hpdv5:/home/arcemu/server# ls -l
total 14500
-rwxr-xr-x 1 root root    13538 2011-05-10 22:55 arcemu-crashreport
-rwxr-xr-x 1 root root   690940 2011-05-10 22:38 logon
drwxr-xr-x 2 root root     4096 2011-09-16 13:13 modules
drwxr-xr-x 2 root root     4096 2011-09-16 13:13 tools
-rwxr-xr-x 1 root root 14138516 2011-05-10 22:55 world


Later, using the Arcemu tools which were compiled for Linux with the Arcemu, new directories will be added to the Arcemu server. Those include maps, vmaps, DBC (notice the upper case!), etc.



Copying the configuration files to /home/arcemu/server/config

While still in the /home/arcemu/server directory, do the following;

sudo mkdir etc

NOTE:
Some versions of Arcemu uses config/ instead of etc/

Copy over the configuration files.

 cp /home/arcemu/src/code/configs/*.conf /home/arcemu/server/etc/


Change ownership to user arcemu. Currently, everything has been modified under root.

sudo chown -R arcemu:arcemu /home/arcemu **


Editing the configuration files logon.conf, realms.conf and world.conf

Enter the configuration files directory;

cd etc


Run the following command and write down your host name.

hostname


NOTE:
Using VIM is very easy. Here are some quick tips; To begin editing, type the letter i for INSERT.
Edit as necessary hitting the ESC when you're done. Hitting ESC allows opens up editor commands

Pressing :qw = quit and write to file
Pressing :q! = quit but don't write to file
Pressing :qw! = quit and write even though file is write protected
     (Only a root user can do this. IE, sudo vim file.conf)

After pressing ESC, you can delete the entire line that the cursor is on by typing dd.


Edit the world.conf file

Use the CLI editor of your choice! This tutorial uses VIM but other Arcemu members prefer NANO. The GUI editor will not work unless you give it root access.

sudo vim world.conf


Check the default values and modify according to your own;

WorldDatabase Hostname = "host" Username = "username" Password = "passwd" Name = "database" Port = "3306"
CharacterDatabase Hostname = "host" Username = "username" Password = "passwd" Name = "database" Port = "3306"


KEY: host = name returned from hostname command, username/passwd is your choice


The following is an example of the values needed to be changed;

WorldDatabase Hostname = "ubuntupc" Username = "familyguy" Password = "brian" Name = "arc_world" Port = "3306"
CharacterDatabase Hostname = "ubuntupc" Username = "familyguy" Password = "brian" Name = "arc_characters" Port = "3306"


IMPORTANT! For the logon to authenticate world, you must change the following to match your password:

<LogonServer DisablePings = "0"
             RemotePassword = "your-password-goes-here">


Some other noteworthy changes include the MOTD (message of the day) and collisions. This tutorial includes collisions and vmaps.

<Server PlayerLimit = "100"
        Motd = "Welcome to Arcemu64 World of Warcraft!"  <--- change to something personal
        SendStatsOnJoin = "1"
        EnableBreathing = "1"
        SeperateChatChannels = "0"
        CompressionThreshold = "1000"
        QueueUpdateInterval = "5000"
        KickAFKPlayers = "0"
        ConnectionTimeout = "180"
        RealmType = "1"
        AdjustPriority = "0"
        RequireAllSignatures = "0"
        ShowGMInWhoList = "1"
        MapUnloadTime="300"
        LimitedNames="1"
        UseAccountData="0"
        AllowPlayerCommands="0"
        EnableLFGJoin="0"
        TimeZone="0"
        Collision="1"   <---- Change from 0 to 1. We will be using collisions/vmaps
        DisableFearMovement="0"
        SaveExtendedCharData="0">



Edit the logon.conf file

sudo vim logon.conf

Before changes;

<LogonDatabase Hostname = "host"
               Username = "username"
               Password = "Passwd"
               Name     = "database"
               Port     = "3306">

After changes;

<LogonDatabase Hostname = "ubuntupc"
               Username = "familyguy"
               Password = "brian"
               Name     = "arc_logon"
               Port     = "3306">


IMPORTANT! At the bottom of the file, change the remotepassword!

<LogonServer RemotePassword = "don't-forget-to-change-this!"
             AllowedIPs = "127.0.0.1/24"
             AllowedModIPs = "127.0.0.1/24">


Edit the realms.conf file

It is very important to first know what your IP address is before editing the realms.conf. If you change the address of the Arcemu server, it must match in the realms.conf so you will have to modify the file also.

sudo vim realms.conf

Now modify to reflect your LAN and WAN IP address.

<Realm1 Name = "My Realm Name"   -- change these as you like
        Address = "internet-url-or-ip:8129"  -- Choose the IP that whatsmyip.com reports + modify your router
        Icon = "PVP"
        Population = "1.0"
        TimeZone = "2">
 
<Realm2 Name = "Private"  -- change these as you like, maybe make it LAN WOW
        Address = "internal-ip-address-for-lan-access:8129"  -- this is your LAN. Eg. 192.168.1.100
        Icon = "PVP"
        Population = "1.0"
        TimeZone = "1">
 
<Realm3 Name = "Localhost"  -- change these as you like
        Address = "localhost:8129"   --leave this as it is.
        Icon = "PVP"
        Population = "1.0"
        TimeZone = "1">


Edit the options.conf file

This file is really all up to you. Some features can be modified such as the maximum number of player professions, level caps, Horde-Alliance communication, etc.


Adding the databases

Test your MySql access by using the following commands;

sudo mysql -u root -p
exit

The first thing to be done is to add the three crucial databases to the Arcemu server: arc_logon, arc_characters and arc_world. The arc_logon is necessary for the logon server to validate users. The world server uses the arc_characters and arc_world where all of the Warcraft game data is stored.

Begin by entering the following command to give access to the Mysql command line;

sudo mysql -u root -p -h your.hostname.here

At the command line, enter the following commands;

create database arc_logon;
create database arc_characters;
create database arc_world;

mysqldatabasecreateexit.jpg

Creating the arc_logon, arc_characters and arc_world database structure

Return now to the Arcemu code directory where the base SQL structure files are located.

cd /home/arcemu/src/code/sql
 
 
ubuntu@ubuntu:/home/arcemu/src/code/sql$ ls -l
total 480
-rw-r--r-- 1 arcemu arcemu   2146 2011-05-12 22:03 2834_logon_structure.sql
-rw-r--r-- 1 arcemu arcemu  36315 2011-05-12 22:03 3800_character_structure.sql
-rw-r--r-- 1 arcemu arcemu 421549 2011-05-12 22:03 3955_world_structure.sql
drwxr-xr-x 3 arcemu arcemu   4096 2011-05-12 22:03 character_updates
drwxr-xr-x 3 arcemu arcemu   4096 2011-05-12 22:03 extra_scripts
drwxr-xr-x 3 arcemu arcemu   4096 2011-05-12 22:03 logon_updates
drwxr-xr-x 3 arcemu arcemu   4096 2011-05-12 22:03 misc
drwxr-xr-x 4 arcemu arcemu   4096 2011-05-12 22:03 utilities
drwxr-xr-x 3 arcemu arcemu   4096 2011-05-12 22:03 world_updates
ubuntu@ubuntu:/home/arcemu/src/code/sql$

NOTE:
The arc_world database above is only a basic database structure. The arc_world will require a properly maintained database like WhyDB. WhyDB supplies a Linux tool (tool.sh) that makes importing the data simple. Other databases can be install as following:
sudo mysql -u root -p -h !!!hostname-here!!! arc_world < NCDBr102-ArcemuR3761.sql

The detailed instructions on how to add the WhyDB are found below.


In order to drop all of the tables in the database (clear all db), use the following CLI command. WARNING! This will delete your entire database!

for table in $(mysql -u root --password=mypass mydb -e "show tables;"); do mysql -u root --password=mypass mydb -e "DROP TABLE $table;"; done;

Add a users to the arc_logon

Before any users can enter the game, they must have a username and password. The user privileges can be specified (user, GM, etc).


First, add the admin account;

mysql -u root -p arc_logon

type the following.... INSERT INTO `accounts` (login, password, gm, flags, banned) VALUES ('your-login-name', 'your-password', 'az', '24', '0');

adminpass.jpg

Next add a GM account;

INSERT INTO `accounts` (login, password, gm, flags, banned) VALUES ('srinivas', 'namaste', 'bcehijlmnpqrtuv', '24', '0');


Finally, add the player's accounts;

INSERT INTO `accounts` (login, password, gm, flags, banned) VALUES ('player', 'mypassword', '0', '24', '0');

accounts.jpg


Extracting the DBC, MAP and VMAP files from the World of Warcraft 3.3.5a client

The Arcemu requires extracted data files from the World of Warcraft 3.3.5a game folder. Arcemu now compiles tools used to extract that data. It will be necessary to copy the entire World of Warcraft folder onto the same PC as where the Arcemu is located. After all of the files are extracted and processed the total amount of space needed will be around 900Mb.

Change directory to the Arcemu server tools. There should see all of the tools there for extraction.

cd /home/arcemu/server/tools
cp ** /home/arcemu/WoW

This is assuming your World of Warcraft game client has been put into /home/arcemu/WoW!

tools.jpg

Extracting the maps,dbc and vmaps data using the Arcemu tools

You will need the entire World of Warcraft 3.3.5a game to be somewhere that can be accessed from the CLI. This tutorial assumes your entire World of Warcraft game folder is stored in /home/arcemu/WoW. This next step extracts data files required by the Arcemu.


Assuming your World of Warcraft game directory is located /home/arcemu/WoW, for example (where you put this folder is entirely up to you);

cd /home/arcemu/WoW
./ad

Now the ad tool will be processing the WoW data files and extracting the files that the Arcemu world server will require.
adtool.jpg

After the ad tool is finished extracting the files from the WoW data directory, you will notice two new directories called dbc and maps. These must be moved (or copied if you have ample space) to /home/arcemu/server/

mv dbc /home/arcemu/server
mv maps /home/arcemu/server

WARNING: The Arcemu world searches only for DBC and not dbc. Linux is case sensitive. So you may have to rename dbc to DBC using the following command;

mv /home/arcemu/server/dbc /home/arcemu/server/DBC


DBC-1.png

The next step is to extract the vmaps. This is needed for collisions to work.

The data from the vmaps directory is necessary for the LoS (line of site) calculations when world.conf has Collisions = "1". To extract the vmaps files, use the following;

sh vmaps.sh

Now move the vmaps directory and it's contents to the Arcemu server directory;

mv vmaps /home/arcemu/server



Extracting the display_bounding_boxes.sql using creature_data

UNNECESSARY STEP! Only use this if your world database of choice does not contain the display_bounding_boxes.sql file!

Use the following command to extract the sql data.

./creature_data

Now there is a file in the WoW directory called display_bounding_boxes.sql. This is the file to be included into the arc_world database.

NOTE:
For users of the WhyDB, the display_bounding_boxes.sql file can be moved to the whydbsvn directory and added using the tool.sh along with the other .sql files from the WhyDB data.

mv display_bounding_boxes.sql /home/arcemu/whydbsvn/whydb-users/development/ascent_world/

When the WhyDB tool.sh is used, selecting 'i' will also insert the creature_data sql file data will be included.

Choosing a database and populating the arc_world database

There are a few World of Warcraft private database projects. Hopefully they will be all listed here.

  • WhyDb - Currently being maintained
  • NCDB - Not maintained but still used often
  • TDB - Trinity Database, currently being maintained
  • UDB - Unified Database, currently being maintained by Mangos


Adding the WhyDB project data to the arc_world structure

This is the last step before having a working Arcemu server. The world database (arc_world) must be filled with all of the world objects. This will be the weapons, armour, items, vendors, spells, everything! The WhyDB is currently the most up to-date world database and is maintained by the WhyDB team. The team continues their hard work with many new updates.

From the Bash window, follow the steps;

cd /home/arcemu
mkdir whydbsvn
cd whydbsvn

Before downloading the WhyDB, check the WhyDB version;

svn info http://svn.xp-dev.com/svn/whydb-users/


To begin downloading the WhyDB;

svn co http://svn.xp-dev.com/svn/whydb-users/


A directory should have been created called whydb-users. Type the following;

cd whydb-users


First, the tool.sh must be edited to include the database admins password. Otherwise it will fail to insert the data;
Modify the file to reflect the root username, password, and the three Arcemu databases; arc_logon, arc_characters, arc_world

Default settings to be modified;

edittool.jpg

Modified to look more like;

modtoolsh.jpg



Now the tool.sh will have access permissions to import the data

Simply execute the tool and select 'i' to import the new data. Ideally, this may be one of the last steps before running the Arcemu logon and world server. This is the process used to add all of the arc_world data necessary for a populated Warcraft world. However, it won't hurt anything to test this now.

./tool.sh


whydb.jpg

NOTE:
Something that administrators might find very useful is that the WhyDB tool.sh is very convenient and can be used to minimize the work involved in adding custom SQL data. All of those custom .sql data files can be added to the directory /home/arcemu/whydbsvn/whydb-users/development/ascent_world


Ready to run the server for the first time

The two files which must both be running in order for the server to be operational are logon and world. Both should be run while logged into user arcemu.
They can be run from two separate terminals using the following commands;

In Bash window 1, type the following;

./logon

After logon has finished loading, it may now authenticate world. In Bash window 2, type;

./world

NOTE:
If your world server halts with a old db error, you may need to add
some updates after installing the WhyDB. Those can be found in
/home/arcemu/code/sql/world_updates.



Your .sql file names will probably be different numbers so modify your command accordingly.

To update your arc_world datebase to satisfy any world db errors, use the following;

sudo mysql -u root -p -h !!!hostname-here!!! arc_characters < 2011-11-16_22-00_saved_mail.sql

To update your arc_world datebase to satisfy any world db errors, use the following;

sudo mysql -u root -p -h !!!hostname-here!!! arc_world < 2012-02-09_00-55_earth_shield.sql

Firewall and router considerations

Your router needs to forward all WAN traffic on ports 8129 and 3074 to your Arcemu server LAN IP.

Personal tools