mmotop100.net private server guide€¦ · ragnarok online [windows] this howto will cover setting...
TRANSCRIPT
MMOTOP100.NET
Private Server Guide
Ragnarok Online [Windows]
This HOWTO will cover setting up your very own Ragnarok
Online private server. If you have hands-on experience setting up a server of your own, for this or any other
category on the website, feel free to submit an article. Visit
us on mmotop100.net
C O V E R I N G P R I V A T E S E R V E R S E T - U P
F O R A L L C A T E G O R I E S O F
M M O R P G S .
TABLE OF CONTENTS
System Requirements ................................................................................... 2
To compile or not to compile? ....................................................................... 3
Compiling on Windows ...................................................................... 4
Compiling with Visual Studio Express Edition C++ ......................... 7
Setting up MySQL ......................................................................................... 9
Configuration Files ...................................................................................... 22
First Start! ................................................................................................... 26
2
System Requirements
If you are serious about setting up a server for other players to join, the
requirements vary. Depending on the amount of players and the type of
emulator you are using, you will have to expand your server‟s resources.
Finding out if your server is good enough for your player base is a matter of
trial and error. If you players are experiencing lag or other kinds of glitches, you will have to investigate. I will not discuss hardware requirements here.
You will need a few applications installed on your server if you want to use eAthena.
SVN
Subversion is a version control system that lets you retrieve files for eAthena
(in this case) in a quick and orderly fashion. We will be using TortoiseSVN for our cause of downloading eAthena to our Windows platform.
MySQL
While eAthena covers a txt and MySQL version of its emulator, we will be
using the MySQL version. For the purpose of building our server, we will download WAMP (Windows, Apache, MySQL, PHP). With this application we
have a complete webserver at our disposal. More about this will be explained
later.
Visual Studio Express Edition (only download if you want to compile)
In the next chapter, you will have the choice to either download a .rar file that has everything needed for eAthena, or if you are rather adventurous,
you can compile eAthena from svn yourself. If you want to compile, download VSEE here. (You will need C++).
3
To compile or not to compile?
When using pre compiled eAthena, you don't have to worry about
installing dependencies on your system.
Also, you won‟t have to worry about going through the trouble of
compiling the download, as it is ready out of the box.
The disadvantage of using pre-compiled code is that you cannot customize
the eAthena emulator in the way you would like.
You can find precompiled versions in the following location on the eAthena
forums: http://www.eathena.ws/board/index.php?showforum=146
Under there, you can find precompiled versions for mostly Windows, but
there are some Linux ones as well. They are sorted by revision number,
with the latest revision number being at the top.
Source: eAthena.ws
The next chapter will cover compiling eAthena source code on a Windows
Platform. If you are going to download a pre-compiled version of eAthena,
please skip the following chapter.
4
Compiling on Windows
To compile eAthena on Windows, we will use TortoiseSVN to acquire the
eAthena source files, so we can use these to build our executables for the
different parts of the server.
After installing TortoiseSVN, create a folder on your hard drive (I will
name it eAthena) and right click it.
From the right-click menu, select “SVN Checkout” as displayed in the
following screenshot.
5
After selecting SVN Checkout, a new window will appear. In this window
we will need to enter the URL or Website address to download source code
from. In our case, we need the eAthena source code. We can choose
between 2 different types of source code:
Trunk
The Trunk source code has all the new functions and will be updated on a
regular basis, the Trunk code has not been tested on every platform and
may or may not contain bugs. If you want an up to date version of the
emulator, Trunk is the way to go.
Trunk source url is : http://svn.eathena.ws/svn/ea/trunk
Stable
The Stable source code has been tested fully to check for bug fixes and
problems. The stable code will probably work without any problems, but
this is not guaranteed.
Stable source url is : http://svn.eathena.ws/svn/ea/branches/stable/
You can read more about the differences and uses of the source code at the eAthena forum on
http://eAthena.ws.
6
For the purpose of our tutorial, we will use the Trunk source code. Here‟s
what to do:
In the SVN Checkout window, enter the url for the trunk source code and
click OK.
In the SVN Checkout window, enter the url for the trunk source code and
click OK.
When you click OK, the SVN software will download all files from the
repository. After the download is finished, you can click “OK”.
Next we will start the compilation process.
7
Compiling with Visual Studio Express Edition C++
We have now downloaded the necessary source code and will start
compiling it to produce the .exe files we have always been used to on a
windows environment.
The executable files we will be producing will be:
Char-server_sql.exe
The character server handles all character selection and loading the
characters for the map server. It also handles the loading and saving of
the character data.
Login-server_sql.exe
The login server handles all login packets from the client. Clients will first
connect to the login server, where it reads its data from the login table in
our sql database. The login server will then connect to the character
server.
Map-server_sql.exe
The map server works hardest of them all. All map functions like npc
loading, processing, mob functions etc. will be done by the map server.
Now that you know what each individual process will do, we can start
compiling.
8
First, open the eAthena map and run the eAthena-9.sln file, this is a
“solution” file that contains all the information necessary to start building
your server files. You can doubleclick the .sln file is you have Visual Studio
installed. After opening, you will see the following screen:
On the left side you can see the projects that can be built with this
solution file. We can build char-server, login and map server in SQL or
TXT form, plus a few other executables like ladmin, mapcache and txt-
converter.
We could right click every individual project in the list and select “Build” to
start creating the executable, but we will create all of them at once for
convenience.
On the left side, right click “Solution „eAthena-9‟ (10 projects)” and
select “Build Solution” from the right-click menu.
The building begins…. (This took approx. 10 minutes on my laptop).
As a result of the build, you will now have a few new executable files in
your eAthena folder.
9
Setting up MySQL
Before even thinking of starting up our new executable files and running
the server, things will need to be configured.
Like I said before, we will be using an SQL version of eAthena, this means
every little detail will get stored inside a database, we can easily retrieve
data from it and insert new data into the tables of the database, but we
won‟t be doing much advanced work on it in this tutorial.
The database will contain all information about player characters, mob
information, login details, command use (@go etc.) and much more.
You can easily edit attributes to make monsters harder to kill, or change
player levels. Anything is possible.
Most servers have a website, and with that website they will mostly use
PHPMyAdmin to configure and maintain the database (or not, it‟s a matter
of preference).
The above mentioned tool is easy to install on your web server and will
allow you to create a new database and edit its contents.
10
Because we want to keep things easy, we will be using WAMP server for
our tutorial. This handy piece of software contains Apache, MySQL and
PHP.
Apache is the probably the most popular web server, we will need it to run
phpmyadmin, as well as PHP itself. If you have not already downloaded
and installed WAMP, we will describe the process now, I have added a
sequence of images that will guide you through the installation process.
11
The above mentioned directory will be used to install wampserver and its
contents. Our website will be placed in c:\wamp\www in this example.
Select “launch WampServer now” and click Finish.
12
Easy, wasn‟t it?
Now, because wampserver is started, we have our own little website on
the computer. You can check it out at http://127.0.0.1 or http://localhost
As you can see in the above example, in the Tools section “phpmyadmin”
is already available.
13
We will now start creating our database with phpmyadmin. If you have
opened your little website at http://localhost , please click the
phpmyadmin link or go to http://localhost/phpmyadmin/.
The above picture shows the welcome screen for phpmyadmin.
We will now create a new database within the Actions menu. (see above
picture).
The database name can be anything you want, but its best to make it
descriptive, I would recommend using your server name or just naming it
ragnarok.
14
After you type your database name into the field, you can click the
“create” button to start the process:
After I click create, the following screen pops up. As you can see I have
named my database ro_mmotop, and it has been successfully created.
15
Since our database needs to have a user and a password, we will start
adding “privileges”. (I have added a red rectangle around the option we
need). Now, click the “privileges” tab.
As you can see we already have a „root‟ user with all privileges. This is the
standard account used for mysql within wamp and it does not contain a
password.
16
We will however; create a new user that contains a password. Click the
“Add a new user” link.
We will need a name for our user, in the above example I have called
mine mmodbusr.
I have chosen to allow mmodbusr to connect through any host, that
means not only from this computer, but from any computer on the
internet, given the password is provided of course.
My password will be mmodbpass, you will have to come up with
something more complex if you want security. Best way to do this is have
phpmyadmin generate a password, but obviously it wouldn‟t be easy to
remember.
Under the “database for user” section I have selected (default) “grant all
privileges on database “ro_mmotop”. This means the user I create now,
will have full privileges on the database, as needed.
We do not have to select any other privileges under the “global privileges”
section, so you can click “Go” in the lower right corner.
17
If all went well, you can see that “You have added a new user”.
Now that we have a user that can communicate with the database, we
need to fill it up with some data. On the left menu, select your database
(ro_mmotop in this case).
We will now insert all sql tables needed to run the server (char info, log
info, mob info, item info, etc.) We will do this by selecting “IMPORT” as
shown below.
18
The developers of eAthena have blessed us with the necessary files to fill
the database. These can be found in your eAthena folder, which we downloaded earlier. To import files into the database, click the “Browse”
button, as shown below. Browse to the eAthena folder, and look for the
“sql-files” map.
First, select main.sql and click Open. You will now see the file path next to
the Browse button. To start importing, click the “Go” button. Importing
might take some time.
19
If the import is successful, you will see a few tables appearing on the left
side menu.
Now, import the rest of the sql files: item_db, item_db2, logs.sql,
mob_db2, mob_db
Now we have a full Ragnarok Online private server database, filled with
mobs, items and the entire splendor we will need to run our server.
In order for the different parts of the server to communicate with
eachother, we will need to set a communication password. The default
communication username is s1 and its password is p1. This MUST be
changed.
20
Here‟s how we do this. Inside phpmyadmin, open your database
(ro_mmotop in my case). And select the login table.
Since we do not have any registered users at this point, we can see that
the account id (1) has s1 and p1 inserted into the table.
We will need to change the userid and user_pass fields in the database.
Next to the account_id, you can see a small pencil icon, to edit the row,
click it.
21
Clicking the pencil will result in the following page.
You need to change userid (s1) and user_pass (p1). Use a complex name
and password here. If you do not change these parameters, you‟re server
will have a big security risk, so do not forget.
The next chapter will cover the configuration files, here we will set
everything up, resulting in our very first start-up. Yaay!
22
Configuration Files
eAthena contains a configuration file for almost everything. We will
discuss the most important changes in this tutorial.
Conf/char_athena.conf
The character configuration file covers the server name, the way
characters are created, maximum users allowed to connect and more.
First we will need to set the server communication password.
Change
// Server Communication username and password.
userid: s1
passwd: p1
To
// Server Communication username and password.
userid: <ENTER YOUR USERID HERE>
passwd: <ENTER YOUR PASSWORD HERE>
Just insert the same information we put inside the login table in the
previous chapter.
You can now change the server name to anything you wish. The rest of
the file is pretty self-explanatory.
We need not forget to change the IP section; this is where we set how the
servers will interact.
Usually, eAthena will auto-detect your external and internal IP if the IP
fields are commented out, but let's go ahead and remove the two slashes
(//) from login_ip and char_ip. The login_ip will point to the IP address
where the login server will be running. Usually this is the localhost, or
127.0.0.1. Sometimes this is not always the case. If the login-server is to
be located on the same network as the char-server, use the LAN IP or the
login server's machine. If you are running a dedicated machine in a
datacenter, or you know your IP is not going to change, you can set this
to your WAN IP. The char_ip paramter is the same way. The char_ip
parameter will ALWAYS be your WAN IP, no exceptions. This is the IP
that the char-server will accept connections with.
Source: eathena.ws
23
Here‟s an example for char_athena.conf:
login_ip: 127.0.0.1
//bind_ip: 127.0.0.1
login_port: 6900
char_ip: x.x.x.x (we need to add our external ip here, if you need to know
what your external ip is, find out on http://whatismyipaddress.com/ ).
char_port: 6121
Conf/map_athena.conf
The map config sets parameters for the map server to read. We will again
need to change the server communication password (s1 and p1).
Change
// Server Communication username and password.
userid: s1
passwd: p1
To
// Server Communication username and password.
userid: <ENTER YOUR USERID HERE>
passwd: <ENTER YOUR PASSWORD HERE>
We need to set the char_ip parameter to the internal IP that the char-
server is using (127.0.0.1 in our case). If you find that using the internal
IP is not working correctly for you, you can also use the external ip here.
The map_ip will require the external ip.
An example:
// Character Server IP
// The map server connects to the character server using this IP address.
// NOTE: This is useful when you are running behind a firewall or are on
// a machine with multiple interfaces.
char_ip: 127.0.0.1
// The map server listens on the interface with this IP address.
// NOTE: This allows you to run multiple servers on multiple interfaces
// while using the same ports for each server.
//bind_ip: 127.0.0.1
// Character Server Port
char_port: 6121
// Map Server IP
// The IP address which clients will use to connect.
// Set this to what your server's public IP address is.
map_ip: x.x.x.x (external ip here)
// Map Server Port
map_port: 5121
24
Conf/inter_athena.conf
This file will contain your SQL settings. We need to set these accordingly.
Here‟s our example:
sql.db_hostname: 127.0.0.1
sql.db_port: 3306
sql.db_username: mmodbuser
sql.db_password: mmodbpass <- change these lines to match your settings
sql.db_database: ro_mmotop
sql.codepage:
// MySQL Character SQL server
char_server_ip: 127.0.0.1
char_server_port: 3306
char_server_id: mmodbuser
char_server_pw: mmodbpass <- change these lines to match your settings
char_server_db: ro_mmotop
// MySQL Map SQL Server
map_server_ip: 127.0.0.1
map_server_port: 3306
map_server_id: mmodbuser
map_server_pw: mmodbpass <- change these lines to match your settings
map_server_db: ro_mmotop
// MySQL Log SQL Database
log_db_ip: 127.0.0.1
log_db_port: 3306
log_db_id: mmodbuser
log_db_pw: mmodbpass <- change these lines to match your settings
log_db_db: ro_mmotop
25
Conf/grf-files.txt
This file contains information about your grf files, these files contain all
game data, player sprites, hair colors, mob looks etc. We will not discuss
customization in this tutorial.
The txt file looks like this:
//-----------------------------------------
// GRF List
//-----------------------------------------
// grf: C:\path\to\RO\data.grf
// You may add more in this format
// grf: <data file path>
//------ Others ---------------------------
// Data Directory (without the actual data\ though)
// the below example would use C:\path\to\RO\data\
//data_dir: C:\path\to\RO\
I have changed it to:
//-----------------------------------------
// GRF List
//-----------------------------------------
// grf: C:\path\to\RO\data.grf
// You may add more in this format
// grf: <data file path>
grf: C:\eAthena\data.grf
grf: C:\eAthena\sdata.grf
You can get the grf files from any Ragnarok Online installation. If you do
not have one, please check out http://ragray.net
26
First Start!
Now, all of our hard work has paid off and we are ready to test if we can
start the server without errors.
U can start login-server_sql.exe, char-server_sql.exe and map-
server_sql.exe or use runserver-sql.bat which will do previous
mentioned starting for you.
The result will be something like this:
Above picture shows login, char and map server within command screens.
That‟s all there is to it to start a default Ragnarok Online private server.
Next, I will be creating a new article that covers setting up your Ragnarok
Online client, this will cover creating an installer you can give to your
players, and so they can easily install and run it, and eventually play on
your server.
Feel free to comment, mail, write etc. if you think something needs to be
changed, added or removed.
If you have any questions about setting up your server by using this
document, you can add a comment to the article on the howto section or
write in our forums.
Thank you for reading .