Difference between revisions of "User:Revenant"

From HeRO Wiki
Jump to: navigation, search
(New page: =How To Set Up a Local Test Server= ==Step 1: Compiling your Server== In order to compile (set-up) an eAthena server, you will need 2 things; *The eAthena base code. *A program to actua...)
 
Line 10: Line 10:
 
Before you can actually attempt to compile the code, you're going to have to obtain it - Which we will be doing via a program called [http://tortoisesvn.net/downloads Tortoise SVN]. You're going to want the 32 bit installer - If you have to ask the difference, then you don't need to worry about it anyway. When installing, the only thing you need is the actual program, but registering .diff files can be useful later on.
 
Before you can actually attempt to compile the code, you're going to have to obtain it - Which we will be doing via a program called [http://tortoisesvn.net/downloads Tortoise SVN]. You're going to want the 32 bit installer - If you have to ask the difference, then you don't need to worry about it anyway. When installing, the only thing you need is the actual program, but registering .diff files can be useful later on.
  
Once you've installed TortoiseSVN, you will be able to download the eAthena code from the official SVN. First off, find create a folder somewhere on your computer, and create a repository within it using TortoiseSVN's right-click menu, as seen in the image to the right. [[File:TortoiseSVN 1.jpg|thumb|The name of the folder doesn't matter.|212px]] Once you've done this, click 'SVN Checkout', and choose the options 'HEAD revision' & fully recursive, putting in <nowiki>http://svn.eathena.ws/svn/ea/stable/</nowiki> as the URL. What this does is download the SVN files directly from eAthena's repository, ensuring that you've got the absolute latest files, including updates & bug-fixes.
+
Once you've installed TortoiseSVN, you will be able to download the eAthena code from the official SVN. First off, find create a folder somewhere on your computer, and create a repository within it using TortoiseSVN's right-click menu, as seen in the image to the right. [[Image:TortoiseSVN 1.jpg|thumb|The name of the folder doesn't matter.|212px]] Once you've done this, click 'SVN Checkout', and choose the options 'HEAD revision' & fully recursive, putting in <nowiki>http://svn.eathena.ws/svn/ea/stable/</nowiki> as the URL. What this does is download the SVN files directly from eAthena's repository, ensuring that you've got the absolute latest files, including updates & bug-fixes.
  
 
heRO currently runs on '''Stable''', but you can have multiple SVNs; I'd recommend working with '''Trunk''', too.
 
heRO currently runs on '''Stable''', but you can have multiple SVNs; I'd recommend working with '''Trunk''', too.
Line 16: Line 16:
 
Now that you have the actual code on your computer, you need to download a compiler to actually manufacture the raw code into the base of your test server. The compiler many people use is [http://www.microsoft.com/express/vc/ Microsoft's Visual C++ 2008 Express Edition]. This is free with online registration, and it is recommended you do such straight away just to save yourself the time later on. You will also have to use this to re-compile your server later on should you do any degree of source-editing.
 
Now that you have the actual code on your computer, you need to download a compiler to actually manufacture the raw code into the base of your test server. The compiler many people use is [http://www.microsoft.com/express/vc/ Microsoft's Visual C++ 2008 Express Edition]. This is free with online registration, and it is recommended you do such straight away just to save yourself the time later on. You will also have to use this to re-compile your server later on should you do any degree of source-editing.
  
[[File:Visual C++ 1.jpg|left|thumb|As shown|163px]]
+
[[Image:Visual C++ 1.jpg|left|thumb|As shown|163px]]
 
Once you've gotten VC++ installed, head to your test server folder and look for the file labeled 'eAthena-9', and double-click it. The window on the left will show up - right click 'Batch Build', and select all of them, then 'Build'. It'll probably take a while, so you may want to start on the next step. Congratulations! Assuming you've followed this guide properly, you've just compiled your first test server. Now you need to prepare the database for your server to store data in. The two types of database to choose from are TXT and MySQL - Technically, if you use TXT, you're done setting up entirely - But we're not using TXT, nope. It's just not as good as MySQL, and is looked down upon by many due to how simplistic it is in comparison. MySQL offers a number of things that TXT cannot such as script integration and automated back-ups.
 
Once you've gotten VC++ installed, head to your test server folder and look for the file labeled 'eAthena-9', and double-click it. The window on the left will show up - right click 'Batch Build', and select all of them, then 'Build'. It'll probably take a while, so you may want to start on the next step. Congratulations! Assuming you've followed this guide properly, you've just compiled your first test server. Now you need to prepare the database for your server to store data in. The two types of database to choose from are TXT and MySQL - Technically, if you use TXT, you're done setting up entirely - But we're not using TXT, nope. It's just not as good as MySQL, and is looked down upon by many due to how simplistic it is in comparison. MySQL offers a number of things that TXT cannot such as script integration and automated back-ups.
  
Line 25: Line 25:
 
*[http://dev.mysql.com/downloads/gui-tools/5.0.html MySQL GUI Tools]
 
*[http://dev.mysql.com/downloads/gui-tools/5.0.html MySQL GUI Tools]
  
[[File:MySQL Administrator 1.jpg|thumb|Self-explanatory|163px]]
+
[[Image:MySQL Administrator 1.jpg|thumb|Self-explanatory|163px]]
  
 
Installation should be fairly straightforward - I made a little bit more complicated for myself because I had to choose custom installation directories due to the fact I organize my computer rather meticulously via partitions. When installing the server, at some stage you should be asked to enter a password for the root account of the server - Note this down, as you'll need it. Once everything's been installed, boot up the MySQL Administrator program, located in your MySQL directory. By default, the Server Host should be 'localhost' (your computer), and the Username 'root' (Whose password you defined earlier). Put in the password, and click OK.  
 
Installation should be fairly straightforward - I made a little bit more complicated for myself because I had to choose custom installation directories due to the fact I organize my computer rather meticulously via partitions. When installing the server, at some stage you should be asked to enter a password for the root account of the server - Note this down, as you'll need it. Once everything's been installed, boot up the MySQL Administrator program, located in your MySQL directory. By default, the Server Host should be 'localhost' (your computer), and the Username 'root' (Whose password you defined earlier). Put in the password, and click OK.  
Line 32: Line 32:
  
 
What you've done so far is:
 
What you've done so far is:
[[File:MySQL Query Browser 1.jpg|thumb|left|I know it's scary|163px]]
+
[[Image:MySQL Query Browser 1.jpg|thumb|left|I know it's scary|163px]]
 
#Create a new MySQL user.
 
#Create a new MySQL user.
 
#Create a new MySQL database.
 
#Create a new MySQL database.

Revision as of 06:44, 15 April 2010

How To Set Up a Local Test Server

Step 1: Compiling your Server

In order to compile (set-up) an eAthena server, you will need 2 things;

  • The eAthena base code.
  • A program to actually compile the above code.

Before you can actually attempt to compile the code, you're going to have to obtain it - Which we will be doing via a program called Tortoise SVN. You're going to want the 32 bit installer - If you have to ask the difference, then you don't need to worry about it anyway. When installing, the only thing you need is the actual program, but registering .diff files can be useful later on.

Once you've installed TortoiseSVN, you will be able to download the eAthena code from the official SVN. First off, find create a folder somewhere on your computer, and create a repository within it using TortoiseSVN's right-click menu, as seen in the image to the right.
The name of the folder doesn't matter.
Once you've done this, click 'SVN Checkout', and choose the options 'HEAD revision' & fully recursive, putting in http://svn.eathena.ws/svn/ea/stable/ as the URL. What this does is download the SVN files directly from eAthena's repository, ensuring that you've got the absolute latest files, including updates & bug-fixes.

heRO currently runs on Stable, but you can have multiple SVNs; I'd recommend working with Trunk, too.

Now that you have the actual code on your computer, you need to download a compiler to actually manufacture the raw code into the base of your test server. The compiler many people use is Microsoft's Visual C++ 2008 Express Edition. This is free with online registration, and it is recommended you do such straight away just to save yourself the time later on. You will also have to use this to re-compile your server later on should you do any degree of source-editing.

As shown

Once you've gotten VC++ installed, head to your test server folder and look for the file labeled 'eAthena-9', and double-click it. The window on the left will show up - right click 'Batch Build', and select all of them, then 'Build'. It'll probably take a while, so you may want to start on the next step. Congratulations! Assuming you've followed this guide properly, you've just compiled your first test server. Now you need to prepare the database for your server to store data in. The two types of database to choose from are TXT and MySQL - Technically, if you use TXT, you're done setting up entirely - But we're not using TXT, nope. It's just not as good as MySQL, and is looked down upon by many due to how simplistic it is in comparison. MySQL offers a number of things that TXT cannot such as script integration and automated back-ups.

Step 2: Installing and Configuring MySQL

As mentioned in the previous step of this guide, MySQL is vastly superior to use compared a plain TXT database, and is nowhere near as complicated to use as people think. While it's true that MySQL can be difficult and complex at times, when using it with eAthena servers, you rarely if ever have to touch it at all, past initial configuration and use, aside from perhaps when manually registering accounts via script query (Command line). Since this is a local server, you will probably be just using an easier method for test accounts. You need the following two things; the first of which is absolutely neccesary, as it is your actual server, the second being although optional, I consider absolutely essential, as it makes everything much easier.

Self-explanatory

Installation should be fairly straightforward - I made a little bit more complicated for myself because I had to choose custom installation directories due to the fact I organize my computer rather meticulously via partitions. When installing the server, at some stage you should be asked to enter a password for the root account of the server - Note this down, as you'll need it. Once everything's been installed, boot up the MySQL Administrator program, located in your MySQL directory. By default, the Server Host should be 'localhost' (your computer), and the Username 'root' (Whose password you defined earlier). Put in the password, and click OK.

First of all, we have to create a new user. While we COULD use the root MySQL account for this, it's unneccesary and could be considered unsafe. Click 'User Administration' and then 'Add a New User' (As shown in the right picture). You may notice the additional tab at the top called 'Schema Priviledges' - We'll get to that in a moment. Click the 'Catalogs' option in the left bar. A listing of schemata will come up (There will probably be 3 default ones; you don't have to worry about those). Schemata is basically a fancy way of saying 'This is a particular database for something'. It's kind of like a folder, except with data. Right click the white space at the bottom left of the screen, under the pre-existing schemata, and click 'Create New Schema', naming it whatever you want. Note this name down. Head back to User Administration, click on the user you created earlier, and then the 'Schema Priviledges'. From there, click on your newly created database, then the '<<' button in the middle of your screen, and then finally apply changes.

What you've done so far is:

I know it's scary
  1. Create a new MySQL user.
  2. Create a new MySQL database.
  3. Link the MySQL user with the MySQL database.

You can close MySQL Administrator now. Open up MySQL Query Browser, and put in the details for the user you created; the host is still 'localhost'. For the default schema, use the name of the one you'd created earlier, which for me was 'eAthena'. The screen on your left will show up. Most of this, you can actually disregard - Just hit 'File', then 'Open Script'. Navigate to your eAthena folder from Step 1 of this guide, and look for the folder named 'sql-files'. Choose main.sql, then hit the now-highlighted 'Execute' button at the top of your screen. This is populating your database/schema with the tables neccesary for eAthena to function properly. Repeat this with item_db.sql, item_db2.sql, mob_db.sql, mob_db2.sql and finally logs.sql. You're done here! It's time for the final step - Configuring eAthena to use the SQL information.

Step 3: Editing Your .Conf Files

Unfortunately, I won't be able to add any shiny images for sake of ease in this section, as you're more or less just editing text files. That said, I recommend you get Notepad++ for editing said files. Once you've gotten it installed (Assuming you've chosen to do so), you'll be able to right-click most files to choose 'Edit with Notepad++', which you will be doing for this entire section. What we're going to be doing is editing specific values in the configuration files in order to link the actual game-servers (Which I don't really need to explain) and the MySQL database (& its tables) that we set-up previously. While I encourage you to look at all of the .conf files (Especially the ones in the /battle/ folder), the particular ones we need to edit are as follows;

  • inter_athena.conf
  • login_athena.conf

Due to the repetition involved in editing each of these two files, I'm not going to elaborate on absolutely each one but instead explain the five things which are going to come up in each file that you have to change. If something doesn't work properly upon start-up of your server, chances are you simply missed a setting you were meant to have edited. These five variables are;

  • Hostname - 127.0.0.1 by default. Leave this alone; you don't need to edit it
  • Port - 3306 by default. Leave this alone too, you also don't need to edit it.
  • Username - This is the name of the new user account you created during step 2's MySQL database set-up.
  • Password - This is the password corresponding to the above account.
  • Database - And finally, this is the name of the database/schema you'd created earlier, linked to the username.

Once you're confident that you've done all of this correctly, there's one last thing to do - click 'runserver-sql.bat'. Cross your fingers! If you get an error pertaining to .txt files, simply rename the 'import-tmpl' folder to 'import'.

Step 4: Connecting to Your Server

This is the easiest step. Since you're emulating heRO's environment for the most concise development & testing, all you need to do is add your local host IP (127.0.0.1) to your sclientinfo.xml; which should connect to both the live server and the test server at this stage. Once you've done that, edit conf/battle/client.conf to add in the correct number of hairstyles & palletes.