Register for your free account! | Forgot your password?

You last visited: Today at 05:01

  • Please register to post and access all features, it's quick, easy and FREE!

 

Compiling Ascent Step-by-Step in Linux

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2006
Posts: 94
Received Thanks: 33
Talking Compiling Ascent Step-by-Step in Linux

1. Requirements / Pre-Setup
1.1 Required Software

To successfully compile Ascent on our Linux machine, we first need to install some additional packages. These are required for everything to work properly, so make sure you get all of these installed before continuing.

* gcc
* g++
* libstdc++ (and development/header files, this is often included in gcc)
* zlib (and development/header files) (zlib1g-dev)
* openssl (and development/header files) (libssl++-dev)
* mysql (and development/header files) (mysql++-dev)
* libpcre (and development/header files) (libpcre++-dev) (pcre-devel)
* libtool
* autoconf
* automake
* subversion
* cron
* phpmyadmin
* proftpd (or any other ftp server of your choice)
* nano (or any other text-based editor of your choice)
* screen
* unrar
* mc

Depending on you distro there are different ways on how to install packages. In Novell/SuSE you will want to use 'yast' and on GNU/Debian and Ubuntu 'apt-get'.

Novell/SuSE

yast

GNU/Debian
Code:
apt-get install PACKAGENAME    # note that if you get an error saying that the package could not be found try
apt-cache search PACKAGENAME   # You will get a list showing all related package names... use common sence / trial&error to find the correct ones
Ubuntu
Code:
sudo apt-get install PACKAGENAME    # note that if you get an error saying that the package could not be found try
sudo apt-cache search PACKAGENAME   # You will get a list showing all related package names... use common sence / trial&error to find the correct one
Also please note that additionally to the packages we need the developmet packages on some as well. These are commonly listed as PACKAGENAME-dev


1.2 Directory Structure

It always makes sence to have a logical directory structure to not get things messed up. First, create a user account for Ascent and create a home directory:

useradd ascent && mkdir /home/ascent/ && mkdir /home/ascent/realm_1/

In case you where not prompted to specify a password for this user just run:

passwd ascent

Also we need to make sure our new user has all permisions on his new home directory:

chown -R ascent:users /home/ascent/



This is the file structure I would suggest for a good overview and high flexibility for future extension:

/home/ascent/ # Your main Ascent folder... in here go all the realm subdirectories
|-realm_1/ # Our first realm subdirectory
| |-bin/ # In here go the binaries of the running Ascent server
| |-etc/ # Folder for our .conf files
| |-lib/ # Libraries
|

To do so copy+paste the following command line:

mkdir /home/ascent/realm_1/bin/ && mkdir /home/ascent/realm_1/etc/ && mkdir /home/ascent/realm_1/lib/

Good! Our system now meets alle the requirements to fetch the source and compile!


2. Optaining The Source
2.1 SVN Checkout

The source code of Ascent can be obtained through its SVN:

cd /home/ascent/realm_1/ && svn co

SVN will create a subfolder called /trunk/ and will download the source code in there. From now on, when you want to update you version to the latest release, just type:

cd /home/ascent/realm_1/trunk && svn up


2.2 Maps and DBC's

The Ascent server needs the latest enUS maps and DBC's. The DBC's can be seen as the games client database. They are all compressed and archived into an .mpq file in your WoW game directory. You can extract them with special programs, which Ackhole shall add and link here, shortly.

Once you have extracted all the files, rar them up and use an ftp client of your choice to upload them to your server. The ftp access data of your server is:

Server : YOUR.ASCENT.SERVER.IP
Username : ascent
Password : (whatever you set)
Port : 21

Once uploaded unrar them into directory structure as follows:
Code:
|-/home/
| |-ascent/
| | |-realm_1/
| | | |-bin
| | | | |-maps (please not this is case sensitive)
| | | |   |-all map files in here
| | | |
| | | | |-DBC (please not this is case sensitive)
| | | |   |- (all the DBC files in here)
| | | |
While this is uploading, we can go at it and run our first compile.


3. Compiling The Source
3.1 Configure

If this is your first-time compile on Ascent you want to do this. It is only for first time compile:
Code:
cd /home/ascent/realm_1/trunk/ && libtoolize --force
This will generate the scripts for automake. Now run a...
Code:
autoreconf -i -f
... to arrange for configure and..
Code:
./configure
... to configure the source for make. If you want to optimize the code for better performance you can specify ./configure as followes:
Code:
./configure --enable-optimize
This takes longer to compile but will enhance the execution performance. (I tend to do it)

Causing a very high load while comiling and executing collisions or usually not used on privat servers. However, they are responsible for auto-dismounting in houses and not being able to shoot through walls, etc. Collision support can be activated by adding:
Code:
./configure --enable-optimize --enable-collision
3.2 Compile

We first want to run...

sh make_precompiled_header.sh

... to write some header files and speed up the compile process. To now compile our source just invoke:

make

Sit back and relax... this will take some time. When done do a:

make install

This actually generates the binaries and libs, which now have to be moved into our executional directories:
Code:
mv /home/ascent/realm_1/trunk/bin/* /home/ascent/realm_1/bin/ && mv /home/ascent/realm_1/trunk/lib* /home/ascent/realm_1/lib && mv /home/ascent/realm_1/trunk/etc* /home/ascent/realm_1/etc
3.3 Configuration Files

These files lay in /home/ascent/realm_1/etc/

cd /home/ascent/realm_1/etc

Edit these files with 'nano'. The configuration files contain plenty of howto information, which I don't want to add to here.

nano ascent-logonserver.conf # just change filename for the other files


4. Database
4.1 Setup

In order for Ascent to function properly we need to create a game DB. Ascent basically just needs three tables - one for logonserver, one for characters and one for the world. You can manage your mySQL database by fireing up your prefered browser and navigating to:



Some people don't get along with phpmyadmin quite well, especially if they are native Windows users. In this case you might want to check out Navicat or SQLyog. These are Windows programs with nice GUI's for SQL database management. Connect to your Ascent server with this data:

Server : YOUR.ASCENT.SERVER.IP
Username : root or admin
Password : your root/admin password
Port : 3306

Once you have access to your database in what so ever way, create your three DB's. Even though you can basically name them whatever you want, I suggest something like:

alogon realm1_logon
acharacter or realm1_character
aworld Realm1_world

When completed this task, create a new mysql user named 'ascent' and make sure he has full read/write/administrate privilages for these three tables.

If you have done so, our basic database setup is complete and we can now import the table structures.


4.2 Table Structures

In our trunk folder is directory called 'sql'. In there you will find mysql dump files, which we are going to import to our db's now.

mysql --user=USERNAME --password=PASSWORD TABLE < FILENAME.sql

So e.g., it should look something like this:

mysql --user=ascent --password=secret alogon < 2785_logon_structure.sql


5. Starting The Server
5.1 The Program: Screen

I assume you are connected to your Ascent server through 'putty' or ssh in some other way. Even if not, you will find this lecture quite handy.

To run Ascent you basically just have to execute 'ascent-logonserver' and 'ascent-world'. However, these binaries run in foreground and output lots of information to the screen. You will run into the problem that you will have to start 'putty' twice and keep it open for as long the server runs, because all binaries executed in putty run as child processes of it. When 'putty' is closed, all child applications are terminated, as well.

This is where 'screen' kicks in. Screen is a program that fires up a 'virtual' shell, which you can attach to and detach from.

Try it out by starting...

screen

... and then starting...

top

... inside this screen session.

Now you can detach from the current screen session using this keystroke combination:

CTRL+a d - Note this is NOT CTRL+a CTRL+d

To reattach to a running screen session type:

screen -x

In case there is more than one screen session running, which will be the case in our scenario, just add the PTS or session name to the line e.g.:

screen -x 12345 | or | screen -x name_of_session

To read more information about 'screen' and it's extensive number of features type 'man screen' or 'screen --help'. There is a hole set of options, of which we are going to use some of now to write a neat and clean Re-/Starter shell script.


5.2 Basic Re-/Starter Shell Script

I've seen so many requests for restarter script in so many forums, that I figured, I should just include a copy+paste version in this Wiki. So here you go and have fun with it!

First we want to navigate to our binary directory:

cd /home/ascent/realm_1/bin/

Here we will just create and edit a new file called 'restarter.sh':

nano restarter.sh

Now paste this code into nano:
Code:
#!/bin/sh
# exit                                 # Comment this in if you are working on your server and don't want it to boot
cd /home/ascent/realm_1/bin            # Adjust this to the binary directory of the realm to be run

pidof ascent-logonserver >/dev/null    # Grap the process ID
PID1=$?
if [  -eq 1 ]                     # If not running boot the server in a dedicated screen session and log
    then
    echo "Re-/Starting the logonserver on "`date` >> ../restarter.log
    screen -A -m -d -S logon su ascent /home/ascent/realm_1/bin/ascent-logonserver 
fi

pidof ascent-world >/dev/null          # Grap the process ID
PID1=$?
if [  -eq 1 ]                     # If not running boot the server in a dedicated screen session and log
    then
    echo "Re-/Starting the realm_1 on "`date` >> ../restarter.log
    screen -A -m -d -S realm_1 su ascent /home/ascent/realm_1/bin/ascent-world 
fi
CTRL+x and 'y' to save and then just hit [RETURN]

Ok, now we have to tell Linux that this is an executable script and not just a text file.

chmod 755 restarter.sh

Now lets edit our cron shedule table for the root user account:

su
crontab -e

- or just -

sudo crontab-e

Add the following line and adjust it to the location of your script:

* * * * * /home/ascent/realm_1/bin/restarter.sh

Now cron will schedule to run the restarter.sh every 60 seconds.

that is all...enjoy!

One more thing if u wont type in english ... ur comments will be ignored... as u see my tutorial is in english...



ssl9 is offline  
Thanks
1 User
Old   #2
 
elite*gold: 0
Join Date: May 2008
Posts: 4
Received Thanks: 0
Hey thank you for a nice guide. Now everything works fine.
Can u give me some advise on maintenance for our server and how to back up data regularly? About anti hack, cheats, and about everything
If there is thread about all my questions can u put link please. But i'm keep looking through forum...


bilguun83 is offline  
Old   #3
 
elite*gold: 0
Join Date: May 2008
Posts: 2
Received Thanks: 0
I got some strange things :/
Code:
$ svn co http://mmoforge.org/svn/ascent
Authentication realm: <http://mmoforge.org:80> Document repository
Password for 'ascent': 
Authentication realm: <http://mmoforge.org:80> Document repository
Username: svn: PROPFIND request failed on '/svn/ascent'
svn: PROPFIND of '/svn/ascent': authorization failed (http://mmoforge.org)
wimpie16 is offline  
Old   #4
 
elite*gold: 0
Join Date: May 2008
Posts: 2
Received Thanks: 0
Nvm just found it

Anonymous Subversion (SVN) access

This project allows anonymous checkouts of its source code. Use the command below and use 'anonymous' as the username and a blank password to checkout the code.

svn checkout


wimpie16 is offline  
Old   #5
 
elite*gold: 0
Join Date: May 2008
Posts: 4
Received Thanks: 0
Hi ssl9 i have a couple of questions. CAn u help me out with it.

1st. CPU usage is about 99%. So What should i do to avoid overload?
2st. It seems many people Disconnects during the game. Saying Fatal Error. Is it DB, Core, or Client side?


bilguun83 is offline  
Reply



« Previous Thread | Next Thread »



All times are GMT +1. The time now is 05:01.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2017 elitepvpers All Rights Reserved.