wiki:L2J_Install
Last modified 5 days ago Last modified on May 12, 2012 7:44:52 PM

How to set up LoginServer and GameServer

Preparation

Necessary software to download and install


Download L2J

From SVN (More Updated)

From Nightly Builds


Prepare L2J Server/DataPack Files

  • Extract the L2J_Server-unstable.zip to a new folder of your choice.
  • Extract the L2J_DataPack-unstable.zip to the same folder choosed for server.

Creating DataBase for L2J

  • Open HeidiSQL and click "New" button, and fill in the fields like shown on the picture.



When done click "Save", and then click "Open".

Now right click on your new localhost connection, and create 3 new databases with the following names:

  • l2jls
  • l2jcs
  • l2jgs

Installing L2J DataBase in your MySQL DataBase

Windows

  • Open database_installer.bat

Linux

  • Open database_installer.sh

and follow the steps in the screen.

  • To install a new L2J DataBase Choose FULL.
  • To upgrade a existing L2J DataBase Choose UPGRADE.

Note: You can use dbinst_cs.jar, dbinst_gs.jar, dbinst_ls.jar to install db more easily, but warning currently it have some issues applying sql updates (will be fixed in a future).


LoginServer & GameServer Setup

LoginServer Setup

  • Open login/config/loginserver.properties

Inside this file you will see the following things:

# Database user info (default is "root" but it's not recommended)
Login = HERE PUT YOUR MYSQL USERNAME OF THE MYSQL ACCOUNT THAT YOU WILL USE FOR L2J

# Database connection password
Password = HERE PUT YOUR MYSQL PASSWORD OF THE MYSQL ACCOUNT THAT YOU WILL USE FOR L2J

Note: You can use L2JConfig.exe (for Windows) or L2JConfig.sh (for Linux) for a more easy setup of config files.

GameServer Setup

  • Open game/config/server.properties

Inside this file you will see the following things:

# Database user info (default is "root" but it's not recommended)
Login = HERE PUT YOUR MYSQL USERNAME OF THE MYSQL ACCOUNT THAT YOU WILL USE FOR L2J

# Database connection password
Password = HERE PUT YOUR MYSQL PASSWORD OF THE MYSQL ACCOUNT THAT YOU WILL USE FOR L2J

Note: You can use L2JConfig.exe (for Windows) or L2JConfig.sh (for Linux) for a more easy setup of config files.


Setting Server IPs

  • open game/config/ipconfig.xml file.

by default L2J Server will run in localhost, but if you want to allow external players to play in your server, you will need to edit this file.

Inside the file are all the instructions that you need to set your Server IPs.


Registering GameServer

WARNING: Before use "RegisterGameServer" first make sure you have the proper MySQL settings in "loginserver.properties" file.

Windows

  • Open /login/RegisterGameServer.exe

or

  • Open /login/RegisterGameServer.bat

Linux

  • Open /login/RegisterGameServer.sh

and select the number you want to assign to the GameServer, then copy the "hexid(server-x).txt" file to the /game/config/ folder of the GameServer that you have registered, and rename it to "hexid.txt".

Note: You can use RegisterGameServer.exe (for Windows) or RegisterGameServer.sh (for Linux) for a more easy registration and management of regitered servers.


Running L2J Server

Windows

  • To start LoginServer open /login/startLoginServer.bat
  • To start GameServer open /game/startGameServer.bat

Linux

  • To start LoginServer open /login/startLoginServer.sh
  • To start GameServer open /game/startGameServer.sh

Notes

If any of your gameservers have the same WAN IP you must use different ports for those gameservers with the same WAN IP.
If you want to enable telnet for your loginserver and gameservers, you must use different ports that are not already in use for each one.
Your server is now ready to run.

Now start LoginServer and GameServer.

If you want to be absolutely sure it works, see if the output of the gameserver looks similiar to this:

Starting L2J Game Server.

loading gameserver config
MLog clients using java 1.4+ standard logging.
Initializing c3p0-0.9.0 [built 08-??????-2005 15:47:30 +0400; debug? false; trac
e: 5]
Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@5e179a [ conn
ectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@4aeb
52 [ acquireIncrement -> 5, acquireRetryAttempts -> 0, acquireRetryDelay -> 500,
 autoCommitOnClose -> true, automaticTestTable -> connection_test_table, breakAf
terAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> c
om.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation -> null, f
orceIgnoreUnresolvedTransactions -> false, identityToken -> 4aeb52, idleConnecti
onTestPeriod -> 60, initialPoolSize -> 3, maxIdleTime -> 0, maxPoolSize -> 10, m
axStatements -> 0, maxStatementsPerConnection -> 100, minPoolSize -> 1, nestedDa
taSource -> com.mchange.v2.c3p0.DriverManagerDataSource@cfec48 [ description ->
null, driverClass -> null, factoryClassLocation -> null, identityToken -> cfec48
, jdbcUrl -> jdbc:mysql://localhost/l2jdb2, properties -> {user=******, password
=******} ], preferredTestQuery -> null, propertyCycle -> 300, testConnectionOnCh
eckin -> true, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxi
es -> false ], factoryClassLocation -> null, identityToken -> 5e179a, numHelperT
hreads -> 3 ]

etc....

etc....

etc....

IdFactory: Free ObjectID's remaining: 1878992804
GameServer Started, free memory 175 Mb of 512 Mb
Connecting to login on 127.0.0.1:9014
Maximum Numbers of Connected Players: 100
Telnet server is currently disabled.
GameServer listening on all available IPs on Port 7777
Registered on login as Server 0 : Bartz

Now continue to Client, so that you can test the setup.

Attachments

Download all attachments as: .zip