This guide was originally posted by "pushedx" but got removed for some reason...Well here it is again.
Originally Posted by pushedx
Here is my current work-in-progress text guide for Windows. I'll be adding images into a document later and be adding more info as time goes on. This is just for people to get an idea of how to setup if you have not already.
Cfg's & Bat's
Spoiler:
Attached is a copy of my current bat and cfg needed for running the server. You can overwrite yours with these and then modify them. Otherwise, you will have to update the bat files yourself, as some have errors in them.
NOTE: You should edit the bat's and take a look at the Java settings before running. Likewise, edit the cfg's to see what settings you can change. Some host/ip cannot be changed without causing an error, so be sure to check the "out" folder in the server folders to know what went wrong.
These files represent a single server setup. In my "server\server_bin\shard\cfg\maps.cfg" file, I have enabled only the first two instanced starting zones for League and Empire. You should be able to start a server with 2+ GB ram and java will not run out of memory.
However, you will need to edit "server\server_bin\shard\startServerDefault.bat" and change the "16384" to something smaller, such as "1024", which is the max memory Java can use.
If you do have a lot of ram, then you can delete the "maps.cfg" file and rename the "all_maps.cfg" to "maps.cfg".
Prerequisite Links:
Spoiler:
Official:
WAMP 32-bit
WAMP 64-bit
PostgreSQL 32-bit
PostgreSQL 64-bit
JDK 32-bit
JDK 64-bit
* JDK requires a free account to download.
Mirrors:
Mediafire
1 - Prerequisites.txt
Spoiler:
[Prerequisites]
Notepad++ - a very handy text editor.
Hex Workshop - a great (paid) hex editor.
Anti-WPA is a great Anti-WPA tool for VMs if you are using Server 2k3.
Chew-WGA is a great Anti-WGA tool for VMs if you are using Server 2K8-R2.
[== Java ==]
1. We will now install the 6u18 JDK.
- You must use this specific version of the JDK!
- All you have to do is click through the installer without changing anything.
- If you are using 32-bit windows, install: jdk-6u18-windows-i586.exe
- If you are using 64-bit windows, install: jdk-6u18-windows-x64.exe
2. We will now locate the folder of our JDK install.
- Typically, this will be:
- 32-bit OS / 32-bit JDK: C:\Program Files\Java\jdk1.6.0_18
- 64-bit OS / 64-bit JDK: C:\Program Files\Java\jdk1.6.0_18
- 64-bit OS / 32-bit JDK: C:\Program Files (x86)\Java\jdk1.6.0_18
3. We will now set our Java home path in the system.
- Right click on My Computer (on the desktop) / Computer (on the start menu) and go to Properties.
- Choose the Advanced / Advanced System Settings tab.
- Click on the "Environment Variables button.
- Click the "New" button in the "System variables" group box.
- The "Variable name" should be set to: "JAVA_HOME" (without the quotes).
- The "Variable value" should be set to your JDK path (in the format shown in Step 2).
- Click OK to close out all of the dialogs.
Java is now installed and ready to use.
[== PostgreSQL ==]
1. We will now install the latest PostgreSQL.
- You may use any modern version.
- If you are using 32-bit windows, install: postgresql-9.1.2-1-windows.exe
- If you are using 64-bit windows, install: postgresql-9.1.2-1-windows-x64.exe
- Make note of the password you choose. You will need it to setup the server.
- You may keep the default pgsql port.
- You may want to set the locale to "English, United States" (that's what I did on mine).
- After installation is complete, make sure there is a checkmark for the "Launch Stack Builder at exit" (default checked).
2. We will now use Stack Builder to install the connectors.
- Choose your newly created database from the first dialog. Click Next.
- Expand "Database Drivers" and choose "pgJDBC" and "psqlODBC". Click Next.
- Click Next to start downloading the drivers, then click through the installations.
3. We will now login to the database to make sure it is working.
- Start the "pgAdmin3" tool from the start menu.
- Double click on the PostgreSQL server to connect to it.
- Enter your password. If all is well, you should login to the database.
- We will setup game specific stuff later.
PostgreSQL is now installed and ready to use.
[== WAMP Server ==]
1. We will now install the latest WAMP Server.
- NOTE: You don't have to use WAMP, but for this guide I am.
- You may use any modern version.
- If you are using 32-bit windows, install: wampserver2.2c-x32.exe
- If you are using 64-bit windows, install: wampserver2.2c-x64.exe
- The install is pretty much a click through.
- NOTE: If you are installing on a machine that already has a web server, you will run into port conflicts, so either uninstall the old one or read up on changing ports for WAMP.
WAMP Server is now installed and ready to use.
2 - AccountServer.txt
Spoiler:
[AccountServer]
1. We will now add the account database to the database server.
- Start the "pgAdmin3" program.
- Login to the database server using your password.
- Double click on the server to connect to it (if it has a red marker on it).
- Right click on the "Databases" tree view item and choose "New Database...".
- Enter a name of "ao_account_trunk16" and click OK.
- Double click on the new "ao_account_trunk16" database to connect to it.
2. We will now configure the AccountServer.
- Edit "server_bin\accountServer\cfg\shard_local.xml" and change the db's user and password values.
- Later, you can mess with the host/ips.
- Make sure to save your changes before continuing.
3. We will now start the AccountServer.
- Execute the "server_bin\accountServer\startAccountServer.bat" file.
- If all is well, you will see an output like this
Code:
C:\Users\pushedx\Desktop\Server\AccountServer>startAccountServer.bat
C:\Users\pushedx\Desktop\Server\AccountServer>call startAccountServerCustom.bat
cfg/shard_local.xml jars
C:\Users\pushedx\Desktop\Server\AccountServer>call startAccountServerCommon.bat
cfg/shard_local.xml jars
C:\Users\pushedx\Desktop\Server\AccountServer>call ../scripts/startServer.bat 64
256 ../jars accountserver.AccountServerMain.jar 5006 ../cfg/shard_local.xml
C:\Users\pushedx\Desktop\Server\AccountServer>REM 64 - permanent memory size (MB
)
C:\Users\pushedx\Desktop\Server\AccountServer>REM 256 - memory min/max size (MB)
C:\Users\pushedx\Desktop\Server\AccountServer>REM ../jars, ... - other params
C:\Users\pushedx\Desktop\Server\AccountServer>REM pushedx: Taking this out since
we will set var ourselves
C:\Users\pushedx\Desktop\Server\AccountServer>REM call ../../vendors/defineJavaH
ome.bat
C:\Users\pushedx\Desktop\Server\AccountServer>cd cfg
C:\Users\pushedx\Desktop\Server\AccountServer\cfg>"C:\Program Files\Java\jdk1.6.
0_18/bin/java.exe" -server -XX:MaxPermSize=64m -Xmx256M -Xms256M -XX:+UseConcMar
kSweepGC -XX:+CMSIncrementalMode -Xdebug -Xrunjdwp:transport=dt_socket,server=y,
suspend=n,address=5006 -jar ../../jars/accountserver.AccountServerMain.jar ../cf
g/shard_local.xml
Listening for transport dt_socket at address: 5006
log4j:WARN No appenders could be found for logger (launch.main.LauncherMain).
log4j:WARN Please initialize the log4j system properly.
[01-26 22:53:49,982, 125] main - INFO launch.main.LauncherMain : loading confi
g from ../cfg/shard_local.xml
[01-26 22:53:50,434, 577] main - INFO launch.main.LauncherMain : loading from
cfg "../cfg/shard_local.xml", server "accountServer", deploy = 127.0.0.1
[01-26 22:53:50,434, 577] main - INFO launch.main.LauncherMain : Server type i
s "accountServer"
[01-26 22:53:50,450, 593] main - INFO tools.reflection.ClassesLoader : loading
classess from [server\bin, \jars\, \jars_local\]...
[01-26 22:53:51,526, 1669] main - INFO tools.reflection.ClassesLoader : 2435 c
lasses loaded in 1.076 seconds
[01-26 22:53:52,508, 2651] main - INFO accountserver.AccountServerStarter : st
arting account server...
[01-26 22:53:52,508, 2651] main - INFO accountserver.AccountServerStarter : lo
ading build from builds/standard.xml
[01-26 22:53:52,571, 2714] main - INFO accountserver.AccountServerStarter : co
nfiguration loaded
[01-26 22:53:52,711, 2854] main - INFO DatabaseService : Database "jdbc:postgr
esql://127.0.0.1/ao_account_trunk16" is used.
[01-26 22:53:53,039, 3182] main - INFO databaseServer : Database structure che
cked
[01-26 22:53:53,085, 3228] main - INFO DatabaseService : Database "jdbc:postgr
esql://127.0.0.1/ao_account_trunk16" is used.
[01-26 22:53:53,226, 3369] main - INFO databaseServer : Database structure che
cked
[01-26 22:53:53,273, 3416] main - INFO accountserver.authenticator.Authenticato
r : Using "accountserver.authenticator.nivalimpl.AuthenticatorNivalImpl" authen
ticator.
[01-26 22:53:53,288, 3431] main - INFO accountserver.AccountServerHelper : Sta
rting account api at 127.0.0.1:9337
[01-26 22:53:53,288, 3431] main - INFO tools.commons.logs.LogToLog4jHandler :
Redirecting java.util.logging to Log4J...
[01-26 22:53:53,288, 3431] main - INFO tools.commons.logs.LogToLog4jHandler :
Redirection of java.util.logging to Log4J started
2012-01-26 22:53:53.351::INFO: Logging to STDERR via org.mortbay.log.StdErrLog
2012-01-26 22:53:53.382::INFO: jetty-6.1.3
2012-01-26 22:53:53.429::INFO: Started SelectChannelConnector @ 127.0.0.1:9337
[01-26 22:53:53,429, 3572] main - INFO accountserver.AccountServerHelper : Acc
ount api started
[01-26 22:53:53,429, 3572] main - INFO accountserver.AccountServerHelper : ini
tializing RSA keys...
[01-26 22:53:55,705, 5848] main - INFO accountserver.AccountServerHelper : rsa
keys initialized
[01-26 22:53:55,737, 5880] main - INFO accountserver.AccountServerHelper : cre
ating server for client authentification 127.0.0.1:9317
[01-26 22:53:56,282, 6425] main - INFO accountserver.AccountServerHelper : cli
ent authentification server created
[01-26 22:53:56,282, 6425] main - INFO accountserver.AccountServerHelper : cre
ating server for session approvement 127.0.0.1:9318
[01-26 22:53:56,298, 6441] main - INFO accountserver.AccountServerHelper : ses
sion approvement server created
[01-26 22:53:56,298, 6441] main - INFO accountserver.AccountServerHelper : acc
ount server started, client <-> account server version = 22, shard <-> account s
erver version = 13
The AccountServer is now setup and running.
3 - WebAccountServer.txt
Spoiler:
[WebAccountServer]
1. We will now setup the web based account server interfaces.
- Open your WAMP root folder (typically C:\wamp).
- Create a new folder "Allods" here.
- Move the contents of the "server_bin\server_api\" folder into the "Allods" folder.
- I.e., after you are done, your "C:\wamp\allods" folder should have 5 folders:
hessian, hessianPhpPatch, j2php, java, and php.
2. We will now configure PHP to use these files.
- Left click on the WAMP tray icon, choose PHP, then choose php.ini.
- In the "php.ini" file, ctrl + f to find "; Paths and Directories ;" without the quotes.
- Under the banner in the next blank line, add in the following line as-is:
- NOTE: If your path is different, then you will need to update it so it's correct.
- Save the php.ini file and close it when you are done.
- Now, left click on the WAMP tray icon and choose "Restart All Services".
3. We will now test account creation.
- Move the "php" folder from the "C:\wamp\allods" folder into the "C:\wamp\www" folder.
- Edit the file "C:\wamp\www\php\accountExample.php".
- NOTE: The $url should match what the AccountServer says. For example, the AccountServer console reads:
- You will not have to change the URL now, but when you do change things in the future, keep this in mind.
- Scroll down and replace the "AccountStatus::Inactive()" with "AccountStatus::Active()".
- Scroll down and you may replace "pushedx" with your account name as well as the "123456" password with your own choice.
- Save all the changes then close the file.
- Access the "http://localhost/php/accountExample.php" file to create the account.
- If all goes well, you should see something like this at the bottom of the page:
Code:
URL = http://127.0.0.1:9337 Path = /api Created! DEBUG ExecuteResult::__set_state(array(
'reason' => 'OK', 'status' => APIResult::__set_state(array( 'name' => 'SUCCESS', )), ))
DEBUG AccountStatusResult::__set_state(array( 'accountStatus' => AccountStatus::__set_state
(array( 'name' => 'Active', )), 'reason' => '', 'status' => APIResult::__set_state(array
( 'name' => 'SUCCESS', )), )) DEBUG AccountStatusResult::__set_state(array(
'accountStatus' => AccountStatus::__set_state(array( 'name' => 'Active', )),
'reason' => '', 'status' => APIResult::__set_state(array( 'name' => 'SUCCESS', )), ))
- NOTE: There will be warnings at the top of the page, you will have to setup WAMP to turn those off later.
At this point, your AccountServer is working and you have your first account!
4 - ServerConsole.txt (Optional, using it to just test AccountServer right now before you start Shard)
Spoiler:
[ServerConsole]
1. We will now configure and test the ServerConsole.
- Edit the "server_bin\serverConsole\cfg\console.cfg".
- Update the "accountServerHost" and "accountServerPort" fields as necessary.
- To enable autologin, uncomment the "accountSrvLogin" and "accountSrvPassword" fields.
- Save and close the file.
- Start the "startConsole.bat" file.
- If all goes well, your console should read something like this:
Code:
C:\Users\pushedx\Desktop\Server\ServerConsole>REM pushedx: setting path ourself
C:\Users\pushedx\Desktop\Server\ServerConsole>REM pushedx: Changed it to use: "C
:\Program Files\Java\jdk1.6.0_18/bin/java.exe" for spaces
C:\Users\pushedx\Desktop\Server\ServerConsole>REM pushedx: Added -cfg params to
load
C:\Users\pushedx\Desktop\Server\ServerConsole>REM pushedx: Removed extra console
Alias.cfg entry
C:\Users\pushedx\Desktop\Server\ServerConsole>REM call ../../vendors/defineJavaH
ome.bat
C:\Users\pushedx\Desktop\Server\ServerConsole>cd cfg
C:\Users\pushedx\Desktop\Server\ServerConsole\cfg>"C:\Program Files\Java\jdk1.6.
0_18/bin/java.exe" -server -Xmx256M -jar ../../jars/serverConsole.ConsoleMain.j
ar -cfg console.cfg
[01-26 23:29:22,313, 0] main - INFO tools.reflection.ClassesLoader : loading c
lassess from [server\bin, \jars\, \jars_local\]...
[01-26 23:29:23,123, 810] main - INFO tools.reflection.ClassesLoader : 2145 cl
asses loaded in 0.81 seconds
login: pushedx
password:
connecting to account server...
[01-26 23:29:30,205, 7892] net_worker_0 - INFO serverConnector.accountServer.im
pl.AuthorizationPipe : Client id = 1 recieve cmd: class accountServerMsgs.toCli
ent.ProblemMsg (1327642170205)
[01-26 23:29:30,907, 8594] net_worker_1 - INFO serverConnector.accountServer.im
pl.AuthorizationPipe : Client id = 1 recieve cmd: class accountServerMsgs.toCli
ent.ValidationRequest (1327642170907)
[01-26 23:29:31,718, 9405] net_worker_1 - INFO serverConnector.accountServer.im
pl.AuthorizationPipe : Client id = 1 recieve cmd: class accountServerMsgs.toCli
ent.PositionInQueueMsg (1327642171718)
[01-26 23:29:33,308, 10995] net_worker_3 - INFO serverConnector.accountServer.i
mpl.AuthorizationPipe : Client id = 1 recieve cmd: class accountServerMsgs.toCl
ient.RSAEncryptedMsg (1327642173308)
[01-26 23:29:34,462, 12149] net_worker_0 - INFO serverConnector.accountServer.i
mpl.AuthorizationPipe : Client id = 1 recieve cmd: class accountServerMsgs.toCl
ient.RSAEncryptedMsg (1327642174462)
[01-26 23:29:34,462, 12149] net_worker_0 - INFO serverConnector.accountServer.i
mpl.AuthorizationPipe : Client id = 1 recieve cmd: class accountServerMsgs.toCl
ient.CertificateResponse (1327642174462)
[01-26 23:29:35,211, 12898] net_worker_2 - INFO serverConnector.accountServer.i
mpl.AuthorizationPipe : Client id = 1 recieve cmd: class accountServerMsgs.toCl
ient.RSAEncryptedMsg (1327642175211)
[01-26 23:29:35,928, 13615] net_worker_1 - INFO serverConnector.accountServer.i
mpl.AuthorizationPipe : Client id = 1 recieve cmd: class accountServerMsgs.toCl
ient.ShardListMsg (1327642175928)
logged in account server
shards:
shard_name population
enter shard name:
Since we don't have a Shard setup yet, you cannot connect to it, but your AccountServer and account are working!
5 - MasterServer.txt
Spoiler:
[MasterServer]
1. We will now setup and configure the MasterServer.
- Left click on the WAMP tray icon and choose "phpMyAdmin".
- Click on the "Databases" button and create a new database:
"allods_online_masterserver_trunk" (without quotes)
- For any other updates later on, check out the
"Server\MasterServer\cfg\shard_local.xml" file.
2. We can now run the MasterServer.
- Run the "server_bin\masterServer\startMasterServer.bat" file.
- If all goes well, your console output should look something like this:
Code:
C:\Users\pushedx\Desktop\Server\MasterServer>startMasterServer.bat
C:\Users\pushedx\Desktop\Server\MasterServer>call startMasterServerCustom.bat cf
g/shard_local.xml
C:\Users\pushedx\Desktop\Server\MasterServer>call ../scripts/startServer.bat 64
512 ../jars masterServer.MasterServerMain.jar -maps ../cfg/shard_local.xml
C:\Users\pushedx\Desktop\Server\MasterServer>REM 64 - permanent memory size (MB)
C:\Users\pushedx\Desktop\Server\MasterServer>REM 512 - memory min/max size (MB)
C:\Users\pushedx\Desktop\Server\MasterServer>REM ../jars, ... - other params
C:\Users\pushedx\Desktop\Server\MasterServer>REM pushedx: Taking this out since
we will set var ourselves
C:\Users\pushedx\Desktop\Server\MasterServer>REM call ../../vendors/defineJavaHo
me.bat
C:\Users\pushedx\Desktop\Server\MasterServer>cd cfg
C:\Users\pushedx\Desktop\Server\MasterServer\cfg>"C:\Program Files\Java\jdk1.6.0
_18/bin/java.exe" -server -XX:MaxPermSize=64m -Xmx512M -Xms512M -XX:+UseConcMark
SweepGC -XX:+CMSIncrementalMode -Xdebug -Xrunjdwp:transport=dt_socket,server=y,s
uspend=n,address=-maps -jar ../../jars/masterServer.MasterServerMain.jar ../cfg/
shard_local.xml
Listening for transport dt_socket at address: 49679
log4j:WARN No appenders could be found for logger (launch.main.LauncherMain).
log4j:WARN Please initialize the log4j system properly.
[01-26 23:42:01,646, 125] main - INFO launch.main.LauncherMain : loading confi
g from ../cfg/shard_local.xml
[01-26 23:42:01,771, 250] main - INFO launch.main.LauncherMain : loading from
cfg "../cfg/shard_local.xml", server "masterServer", deploy = 127.0.0.1
[01-26 23:42:01,771, 250] main - INFO launch.main.LauncherMain : Server type i
s "masterServer"
[01-26 23:42:01,787, 266] main - INFO tools.reflection.ClassesLoader : loading
classess from [server\bin, \jars\, \jars_local\]...
[01-26 23:42:02,691, 1170] main - INFO tools.reflection.ClassesLoader : 2152 c
lasses loaded in 0.904 seconds
[01-26 23:42:02,925, 1404] main - INFO DatabaseService : Database "jdbc:mysql:
//127.0.0.1/allods_online_masterserver_trunk?useUnicode=yes&characterEncoding=UT
F-8&rewriteBatchedStatements=false&allowMultiQueries=false&connectTimeout=500000
&socketTimeout=500000" is used.
[01-26 23:42:03,253, 1732] main - INFO resourceSystem : update /DefaultFactory
.xdb
[01-26 23:42:04,313, 2792] main - INFO masterServer.main.MasterServer : starti
ng hessian api at 127.0.0.1:10500/masterServer
2012-01-26 23:42:04.329::INFO: Logging to STDERR via org.mortbay.log.StdErrLog
2012-01-26 23:42:04.360::INFO: jetty-6.1.3
2012-01-26 23:42:04.391::INFO: Started SelectChannelConnector @ 127.0.0.1:10500
[01-26 23:42:04,391, 2870] main - INFO masterServer.main.MasterServer : hessia
n api at 127.0.0.1:10500/masterServer is started
[01-26 23:42:04,391, 2870] main - INFO masterServer.MasterServerMain : master
server is started at 127.0.0.1:9500
At this point, the master server is up and running!
6 - Shard.txt
Spoiler:
[Shard]
1. We will now setup and configure the Shard.
- Left click on the WAMP tray icon and choose "phpMyAdmin".
- Click on the "Databases" button and create a new database:
"allods_online_mail_RC_1_1_02" (without quotes)
"allods_online_guild_trunk_6" (without quotes)
"allods_online_RC_1_1_02" (without quotes)
"allods_online_auction_trunk_10" (without quotes)
2. We will now setup the MySQL access permissions.
- Left click on the WAMP tray icon and choose "MySQL -> MySQL Console".
- Hit Enter, as there is no default password.
- Execute the following commands as-is:
3. We will now start the Shard.
- Edit the "server_bin\shard\cfg\shard.xml" file.
- Change the frontEnd's "externalHost" value to your LAN IP if you are going to connect
from another PC (You cannot run the Allods client in a VM!).
- Save the changes and close the file.
- Execute the "server_bin\shard\startServerDefault.bat" file.
- NOTE: Starting the shard might take some time, if the window closes, there was an error.
- NOTE: In my simple config, I have removed all maps but the starting instanced zones for more rapid testing.
- If all is well, you should see an ASCII art Allods Online logo show up in the console window.
The server is now completely setup!
Please remember, this guide is still a work in progress, but those were the exact steps I followed when setting up the server on my VM.
Once you have the server setup, you can move on to testing it with the client. Basically, you want to copy the "AOGame.exe" from the "Helper\Unprotected\Gamers_bin" folder into the "Client\bin" folder. Then, copy the "protect.exe", "protect.x86", and "protect.dll" files from "Helper\Release_bin" folder into the "Client\bin" folder.
You should be able to launch AOGame.exe directly now, but before you do, you need to edit the "Client\Profiles\accountServer.cfg" file to point to your account server. If you used my cfgs, my port is 9317, but you can check your AccountServer cfg to be sure.
At this point, if you ran the server on the same PC you are connecting from, without using a VM, then you can connect to your server via localhost and you should be able to login, create a character, and play. However, if you used a VM, the server was setup to use localhost, so you cannot connect.
To get around this, I'm using a small TCP proxy to route connections from the opened VM ports into the localhost server ports. It's great for testing and it works well. The source code is available here. Minor modifications are needed, but attached in the compiled version and source. This program requires .Net 4.0!
Once you get the AllodsProxy, edit the "proxy.bat" file and replace the 192 address with the LAN address of the VM/PC you are running the server on. Simply execute the "proxy.bat" on the server PC and it will route incoming connections on the listed ports to the localhost ports. If you use a different port range, then you will need to add all of the ports needed. Don't forget to open the ports in your firewall!
With a proper cfg setup, the proxy should not be needed, but I wasn't able to get all the ips changed to the ones I needed without breaking it. I'll spend some more time later playing with it to figure out where I was messing it up. For now, I'm just using the proxy.
That's it for now, more will come later!