Aegis & SQL Installation
Arranged by ut2k3
Edited by Riotz
v.5.0

Hi! So, you've decided to give the Aegis installation a try - but don't know where to start? Well, apparently you have certainly lucked out, for you've clicked on the right link, a deep and user-friendly Step-by-Step guide to setting up Aegis, including all of the Microsoft SQL Server aspects with visuals. So, what do you say? Let’s start!


Part 1 - Downloading:

First of all, you'll obviously need to obtain all of the things necessary to install and setup Aegis and SQL. The links to the files you need can be found at the Aegis forum.

For the aegis side of the setup you will need at a minimum the following parts:
accountserver_regeon_free.rar, zone2.5.rar, zone2.rar, aegis.rar, and mappack.rar.
Exact URL: Aegis Server Components

Once you've downloaded all the necessary Aegis components, you'll need to download SQL. Now as we all know SQL is a server based program and because of that it was not designed to run on any Windows 9x Operating Systems. SQL 2000 Standard Edition will only run on Windows Server Operating Systems. SQL 2000 Personal Edition will install on Windows Professional Operating Systems. (Note SQL Standard and Personal Editions have not been tested by this author for use with Aegis.). There is a Microsoft SQL 2000 Server Evaluation available for download (267MB). Microsoft SQL Server 2000 Evaluation Link

Part 2 – Extracting & Installing:

Now that you have collected the necessary components for setting up your new aegis server lets proceed to setting up the aegis folder. Make sure you have Rarsoft’s WinRAR for this step. You need it to extract the compressed aegis components. If you don't have WinRAR already, you can get here: Rarsoft’s WinRAR.

Step 1: Make a folder in you C:\ called “Aegis”.
Step 2: Extract the file called aegis.rar to the C:\Aegis folder you just made.
Step 3: Make a folder in C:\Aegis called “DB”.
Step 4: Extract the file called db.rar to your C:\Aegis\db folder.
Step 5: Extract the file zone2.rar to your C:\Aegis folder.
Step 6: Also extract inter.rar, character.rar, and account.rar into your C:\Aegis folder.
Step 7: Extract mappack.rar into the folder called mapfile in your zone folder.
Step 8: Now, extract accountserver_regeon_free.rar into your account folder.
Step 9: Finally extract zone2.5.rar into your Zone folder, and click Yes to overwrite files.

Excellent now you are finished setting up the folder structure for your Aegis server. Let’s proceed to the SQL 2000 Server installation process.
Assuming you've followed the directions above, you have downloaded Microsoft SQL 2000 Server Evaluation. Follow these steps to get SQL installed.

Step 1: Go to the place you've downloaded the SQL install file and run it. It will ask you to extract it somewhere. Extract it and take note of where it is being placed.
Step 2: Go to the folder where you extracted SQL and execute the autorun.exe file.
Step 3: Follow the visuals below to get SQL installed properly.

Click on SQL Server 2000 Components.

Click on Install Database Server.

Click on Next.

Click on Next.

Click on Next.

Fill in Name and Company.

Click on Yes.

Choose Server and Client Tools then click on Next.

Click on Next.

Choose Typical and click on Next.

Choose Use the local System account then click on Next.

MAKE SURE AND CHOOSE MIXED MODE then click on Next.

Click on Next.

Click Finish & Restart your computer.

 

 

Part 3 – Setting up Databases and Users in Microsoft SQL 2000 Server:

Now that we have all the neccessary components and programs in place, lets bring them together. In this part you will be linking you newly made SQL server to the databases of the Aegis Server and its components. Pay very close attention so as not to make mistakes and have to back track.

Step 01: Click Start Menu > Programs > Microsoft SQL Server > Enterprise Manager.
Step 02: Once Enterprise Manager loads up, maximize Microsoft SQL Servers > SQL Server Group > (Local)(Windows NT). Your System will then try to connect to the server.
Step 03: Once you're connected, you'll need to attach the Aegis Databases. To do this, right click on Database Icon and click Attach Database.
Step 04: Click the button that says ' ... ' and browse to C:\Aegis\DB and attach them one by one by clicking on the .MDF files, since those are the ones you'll really only need and then click OK.
Step 05: Once you're done attaching all the .MDF files (Databases), you'll need to create the Database Users (NO, NOT RAGNAROK ACCOUNTS!)
Step 06: You must make user accounts for the GlobalInfo, User, IPInfo, Character, nLogin, Script, Account and ItemLog Databases.
Step 07: To do this, maximize the particular Database tree on the left and click Users. If there is a User there by the name of that particular Database, delete it.
Step 08: Do this for nLogin, IPInfo, GobalInfo, User, Character, Account, and Script Databases.
Step 09: Click on Security > Logins in the left tree. Right click Logins and select New Login.
Step 10: In the Name field, enter either GlobalInfo, User, IPInfo, Character, nLogin, Script, Account or Loger.
Step 11: Then click SQL Server Authentication and enter "tai" for the password. (Yes, without the "s).
Step 12: Click the Database drop-down menu and select the particular Database you're assigning the Database user to.
Step 13: Click the Database Access tab check the Default Database you just assigned. In the field that just appeared below, check DB_Owner and then click OK.
Step 14: When the prompt asking you to enter in your password pops up, enter it again (tai) and click OK again.
Step 15: Repeat (Creating the users) for each Database. Here is what it should look like when its finished.


Part 4 – Merging ODBC and Setting IPs and Ports:

You're almost done! Now we are going to set SQL drivers and ODBC as well as set server IPs and Ports. Follow closely.

Step 01: Open up Enterprise Manager and go to the GlobalInfo DB > Tables.
Step 02: Right-click on ServerInfo tables, select Open Tables > Return all rows.
Step 03: Change all the default IPs to your current Internet IP.
Step 04: Change the test zone port to 4501 to prevent any future loading problems, and if Zone isn't set to use port 4500, change it to that.
Step 05: Minimize Enterprise Manager or close it if you'd like, and go to your zone folder in the DBInfo.txt.
Step 06: Change the default IP to your IP and then do the same for your Inter Folder and your Character Folder.
Step 07: Go to your Aegis Root folder, and right click on the file called ODBC.REG and go to edit.
Step 08: If you are running windows XP, changed WINNT to WINDOWS and change 127.0.0.1 to your SQL server IP.
Step 09: Double click on it, and if a prompt pops up saying "Are you sure you want to merge ODBC to your registry?" or something similar, click Yes. If another prompt pops up, click Yes.

Note: If you would like to name your Aegis Server then you can rename the "Test" in GlobalInfo > ServerInfo to what ever you want (the 4th item in ServerInfo).

 

Part 5 – Starting up your Aegis Servers:

So, now that you've installed Aegis, you most likely need to know how to run the servers if you don't know how to already, so that's the next step. This part of the Guide will explain how to do things beyond just installing Aegis, and setting it up, but making accounts, starting them up, how to add scripts, and more.

Step 01: Open up Task Manager (CTRL+ALT+DEL) and click the 'Processes' tab. Minimize task manager.
Step 02: Go to your Account folder and run 'accountserver regeon free.exe.' Let that load for a few minutes, and when the text says it's ready to accept connections, you know it's done loading.
Step 03: Go to your 'Character' folder and open 'Characterserver', maximize Task Manager.
Step 04: Find CharacterServer on the list of programs and right click on CharacterServer, then to priority > below normal. If a prompt pops up after that, click OK.
Step 05: Let CharacterServer load for about 5 minutes, it'll stay white, so wait a full 5 minutes.
Step 06: After the 5 mins, load 'InterServer' in your Inter Folder and set priority to low. Let it load for 5 minutes also, it'll stay white.
Step 07: After that, go to your Zone Folder and load 'ZoneProcess'. Set priority to Below Normal. Let it load until you see text on it, and the text means it's done loading.

And, voila! Your servers are now running. Oh, and don't forget, they have to be loaded up in this SAME EXACT ORDER, or they won't cooperate and won't work. The order is:

1st Load accountserver regeon free.exe. Leave priority at normal.
2nd Load Character Server. Set priority to Below Normal.
3rd Run Inter Server and set Priority to Low.
4th Run Zone, set priority to Below Normal.



Part 6 – Making Accounts for Play:

Okay, now I'll tell you how to create accounts. First open Query Analyzer (Start > SQL Server > Query Analyzer). If it asks you to connect, type 127.0.0.1 in the 'SQL Server' field, and check Windows Authentication, if it isn't checked already. Now click OK, and when you're connected, you should see an empty, white text box. Paste this query in it:


INSERT INTO login
(ID, passwd, grade, isConfirmed)
VALUES ('usernamehere','passwordhere',1,3)

Of course you must modify it to your desired username/password where it says 'usernamehere' and 'passwordhere'. Now, in the drop-down menu above in the Tool Bar, (It should read Master at this point), select nLogin. Now go to the Query Menu and select Execute. After Running that query, check the contents in the Login Table in the nLogin database (By opening the table, which I assume you know by now, since it was explained in a previous step) and note the AID number (The 6-Digit number that appears 2 cells before the Username), then run the following Query:

(This assumes the AID was 300016 but change it to what number you get from the Login Table if necessary)

For girl:

INSERT INTO account
(AID, Name, RegNum, zipcode, sex, Email, News, nation)
VALUES (300016, 'usernameusedinquerybeforethis', 1, '', 0, 'a@a.com', 0, '')

For boy:

INSERT INTO account
(AID, Name, RegNum, zipcode, sex, Email, News, nation)
VALUES (300016, 'usernameusedinquerybeforethis', 1, '', 1, 'a@a.com', 0, '')

And yes, obviously, in the 'usernameusedinquerybeforethis' place, replcace it witht he username you entered in the query you used before this, because the account isn't a completed account without knowing what gender to make the characters. Now execute it, and if you get a success message similar to the one before, that's an account created! ^_^

Sidenote: If you would like to make a GM account, make the username SerGM00x (x as in number 1-5. Only 5 GMs can be made)

 

Part 7 – Extra Setup Information:

Server Distribution:
To distribute servers is quite simple. follow these steps to accomplish a 2 PC server distribution.
Account Server is for accepting connections and saving data from Characters to database.
Character Server gets the character data from the database (selecting, making and deleting characters)
Inter Server controls all interactions in game; attacking, pickup, item log, skills, party, guild etc.
Zone Server is for loading maps, items, special things etc.
The Zone Server needs the most amount of memory to operate smoothly.

Optimal splitting:
SQL Server, Account Server, Character Server and Inter Server on 1st pc.
SQL Client and Zone Server on 2nd pc.

In enterprise manager under Databases > GlobalInfo > Server Info. Set your Account, Inter, and Test (or whatever you changed it to) to IP of 1st PC. Set the Test Zone to the IP of the 2nd PC. On the 2nd PC, edit ODBC to use the IP of the SQL server PC (1st PC) and make sure DBinfo.scp's IP is set to the SQL server IP. Thats it, now run the processes the way you normally do.

Running Aegis behind a Router:
This is how other people can connect to you when your server is behind Router.

Leave ServerInfo ip to Lan!
To setup Sock Server:
1) Download Socks Serv
2) Put the server on the other pc other then ro server pc (most important part)
3) Open Port in the Router 1080 and forward to that PC's IP.
4) Start SockServer

To setup Socks Cap (done on pc of outside connector)
1) Download SocksCap
2) Install it
3) Socks Cap > Setting > Server IP put WAN IP of Router. 156.234.19.xxx
4) Put on Sock4
5) Hit OK
6) Open Clientinfo.txt with notepad and Change the IP to the server LAN IP Ie. 192.168.1.xxx
7) Make sure Lang is 4 and Version is 20
8) Save it
9) Make a new profile for the ragexe.exe to Socks Cap list and run RO from socks cap.