Setup Server

In order to Setup the Server you must have downloaded and installed the required programs. Find them here: Setup Preconditions

Downloading the Files

In order to Setup the server, you must have the L2J Server and Datapack. You can either download the nightly builds or the source code from SVN using Eclipse.

-Guide for Eclipse/SVN -To get nightly builds: forum link

Setting up the Files

1.) Make a Folder named L2J Server or whatever you may like, this will host all of your files for the server.

2.) Extract the entire contents from the 2 .zip files (Server and Datapack) into the folder you just created. Open youre folder and you should have some sub-folders names login and gameserver, and some other files and folders.

Installing the Database

1.) You should have MySQL and Navicat installed. Open Navicat.

2.) Click on Connection, you will see a couple of text boxes, fill in your MySQL information and click OK.

The Defaults are:

Connection Name: localhost

Host Name/Ip Address: localhost

Port: 3306

User Name: root (change if you did not make root)

Password: none (fill in if you did make a password)

3.) You should now have connection named Localhost under the connections table. Double click it to open the connection.

4.) Right click on Localhost and click New Database. On Enter Database Name, put L2JDB. Click OK.

5.) Your database is now setup and ready for installing, and you may close Navicat.

Putting the Data into your Database

1.) Open your folder than contains your server files.

2.) Open the folder named "Tools" and open database_installer.bat or .sh (If you are doing this on Linux).

3.) Do a full install, enter your information, and if you want you can install custom tables.

4.) After its done press any key to close and the Data is in the Database.

Registering a Gameserver

1.) Go to the main directory of the folder that contains your files.

1.1) Edit your MySQL settings, in this file: login\config\loginserver.properties

2.) Open the folder "Login" and open RegisterGameServer.bat/.sh

3.) Choose a number for your server and hit enter.

4.) Now, copy the file hexid(server 1).txt

5.) Now go back to the Main Directory.

6.) Open the folder "Gameserver" and the open the folder "config".

7.) Paste the file hexid(server 1).txt and rename it to hexid.txt

8.) You have now registered the gameserver with the loginserver.

Editing the Configuration Files

Part 1: The Login Configuration

1.) Go to the main directory of your server.

2.) Open the folder "Login" then the folder "Config"

3.) Open Loginserver.properties and open it with notepad.

4.) Here is what you need to change:

ExternalHostname = x.x.x.x /////(PUT YOUR WAN IP HERE. IT IS RECOMMENDED IF YOU HAVE A DYNAMIC IP TO GET NO-IP OR DynDNS AND PUT THE WEB NAME HERE) InternalHostname = 127.0.0.1 /////(THIS DOESN'T NEED TO BE CHANGED, UNLESS YOU KNOW WHAT YOU ARE DOING) LoginserverHostname = * LoginserverPort = 2106 LoginHostname = * LoginPort = 9014 IpUpdateTime = 15 LogLoginController = True LoginTryBeforeBan = 10 LoginBlockAfterBan = 600 AcceptNewGameServer = False ForceGGAuth = True /////(DO YOU WANT TO FORCE GAMEGUARD?) EnableFloodProtection = True FastConnectionLimit = 15 NormalConnectionTime = 700 FastConnectionTime = 350 MaxConnectionPerIP = 50 Driver = com.mysql.jdbc.Driver URL = jdbc:mysql://localhost/l2jdb Login = root /////(PUT THE MYSQL PASSWORD HERE) Password = /////(PUT YOUR PASSWORD FOR MYSQL HERE) MaximumDbConnections = 10 MaximumDbIdleTime = 0 ShowLicence = False AutoCreateAccounts = True /////(DO YOU WANT ACCOUNTS TO BE MADE AT THE LOGIN SCREEN? IF FALSE, YOU MUST FIND A WAY TO HAVE USERS REGISTER ON THE DATABASE) /////(DON'T TOUCH ANYTHING UNDER HERE UNLESS YOU KNOW WHAT YOU ARE DOING) Debug = False Assert = False Developer = False
 * 1) Login Server Settings
 * 2) This is the server configuration file. Here you can set up the connection information for your server.
 * 3) This was written with the assumption that you are behind a router.
 * 4) Dumbed Down Definitions...
 * 5) LAN (LOCAL area network) - typically consists of computers connected to the same router as you.
 * 6) WAN (WIDE area network) - typically consists of computers OUTSIDE of your router (ie. the internet).
 * 7) x.x.x.x - Format of an IP address. Do not include the x'es into settings. Must be real numbers.
 * 1) WAN (WIDE area network) - typically consists of computers OUTSIDE of your router (ie. the internet).
 * 2) x.x.x.x - Format of an IP address. Do not include the x'es into settings. Must be real numbers.
 * 1) Networking
 * 2) This is transmitted to the clients connecting from an external network, so it has to be a public IP or resolvable hostname
 * 3) Common settings...
 * 4) 127.0.0.1 - If you are playing alone on a test server
 * 5) 192.168.x.x - This is if you are on a 192.168.x.x type network (behind a standard consumer router) and want other computers from JUST the internal network to be able to connect
 * 6) x.x.x.x - WAN IP obtained from http://www.whatismyip.com/. This is if you want people outside your internal network to be able to connect to your server.
 * 7) Default: 127.0.0.1
 * 1) 192.168.x.x - This is if you are on a 192.168.x.x type network (behind a standard consumer router) and want other computers from JUST the internal network to be able to connect
 * 2) x.x.x.x - WAN IP obtained from http://www.whatismyip.com/. This is if you want people outside your internal network to be able to connect to your server.
 * 3) Default: 127.0.0.1
 * 1) Default: 127.0.0.1
 * 1) This is transmitted to the client from the same network, so it has to be a local IP or resolvable hostname.
 * 2) This can be the internal IP such as 127.0.0.1 or the computer's IP such as 192.168.x.x.
 * 3) Default: 127.0.0.1
 * 1) Default: 127.0.0.1
 * 1) Default: 127.0.0.1
 * 1) Bind ip of the LoginServer, use * to bind on all available IPs
 * 2) Default: *
 * 1) Default: 2106
 * 1) The address on which login will listen for GameServers, use * to bind on all available IPs
 * 2) Default: *
 * 1) The port on which login will listen for GameServers
 * 2) Default: 9014
 * 1) The delay in minutes after which the login updates the gameservers IP's (usefull when their ip is dynamic)
 * 2) Default: 15
 * 1) Security
 * 2) Default: True
 * 1) Default: True
 * 1) Default: True
 * 1) How many times you can provide an invalid account/pass before the IP gets banned.
 * 2) Default: 10
 * 1) Time you won't be able to login back again after LoginTryBeforeBan tries to login.
 * 2) Default: 600 (10 minutes)
 * 1) If set to True any GameServer can register on your login's free slots
 * 2) Default: False
 * 1) Enforce GameGuard authorization from client?
 * 2) If True, login server will kick client if the client bypassed GameGuard authentication.
 * 3) Default: True
 * 1) Flood Protection. All values are in MILISECONDS.
 * 2) Default: True
 * 1) Default: 15
 * 1) Default: 700
 * 1) Default: 350
 * 1) Default: 50
 * 1) Database
 * 2) Uncomment the appropriate driver and url for the database you're using. If you don't know what this is... www.google.com
 * 1) Uncomment the appropriate driver and url for the database you're using. If you don't know what this is... www.google.com
 * 1) Uncomment the appropriate driver and url for the database you're using. If you don't know what this is... www.google.com
 * 1) Driver = org.hsqldb.jdbcDriver
 * 2) Driver = com.microsoft.sqlserver.jdbc.SQLServerDriver
 * 1) URL = jdbc:hsqldb:hsql://localhost/l2jdb
 * 2) URL = jdbc:sqlserver://localhost/database = l2jdb/user = sa/password =
 * 3) Database user info (using root user is not recommended)
 * 1) Default: 10
 * 1) Default: 0
 * 1) Misc.
 * 2) If False, the license (after the login) will not be shown.
 * 3) Default: True
 * 1) If False, the license (after the login) will not be shown.
 * 2) Default: True
 * 1) Default: True
 * 1) Developer Settings
 * 2) Default: False
 * 1) Default: False
 * 1) Default: False
 * 1) Default: False
 * 1) Default: False

5.) Hit File then Save.

Part 2: The Gameserver Configuration

1.) Go to your root directory and open the folder "Gameserver" then the folder "Config"

2.) Open server.properties and open it with Notepad.

3.) Here is what you need to change:

ExternalHostname = x.x.x.x or * /////(PUT YOUR WAN IP HERE. IT IS RECOMMENDED IF YOU HAVE A DYNAMIC IP TO GET NO-IP OR DynDNS AND PUT THE WEB NAME HERE) InternalHostname = 127.0.0.1 or * /////(DONT NEED TO CHANGE UNLESS YOU KNOW WHAT YOU ARE DOING) LoginHost = 127.0.0.1 /////(IF THE LOGIN IS ON THE SAME COMPUTER DONT CHANGE IT) LoginPort = 9014 GameserverHostname = * GameserverPort = 7777 Driver = com.mysql.jdbc.Driver URL = jdbc:mysql://localhost/l2jdb Login = root /////(MYSQL USERNAME GOES HERE) Password = /////(MYSQL PASSWORD GOES HERE) MaximumDbConnections = 100 MaximumDbIdleTime = 0 RequestServerID = 1 AcceptAlternateID = True MaximumOnlineUsers = 100 /////(SET NUMBER OF USERS ON AT ONCE) MinProtocolRevision = XXXX /////(THESE SETTINGS DETERMINE WHAT CLIENT CAN PLAY ON THE SERVER, KEEP TO DEFAULT OR FOR ALL CLIENTS TO PLAY DO MIN: 1 AND MAX 9999) MaxProtocolRevision = XXXX CnameTemplate = .* PetNameTemplate = .* CharMaxNumber = 7
 * 1) Game Server Settings
 * 2) This is the server configuration file. Here you can set up the connection information for your server.
 * 3) This was written with the assumption that you are behind a router.
 * 4) Dumbed Down Definitions...
 * 5) LAN (LOCAL area network) - typically consists of computers connected to the same router as you.
 * 6) WAN (WIDE area network) - typically consists of computers OUTSIDE of your router (ie. the internet).
 * 7) x.x.x.x - Format of an IP address. Do not include the x'es into settings. Must be real numbers.
 * 1) WAN (WIDE area network) - typically consists of computers OUTSIDE of your router (ie. the internet).
 * 2) x.x.x.x - Format of an IP address. Do not include the x'es into settings. Must be real numbers.
 * 1) Networking
 * 2) This is transmitted to the clients connecting from an external network, so it has to be a public IP or resolvable hostname
 * 3) Common settings...
 * 4) 127.0.0.1 - If you are playing alone on a test server
 * 5) 192.168.x.x - This is if you are on a 192.168.x.x type network (behind a standard consumer router) and want other computers from JUST the internal network to be able to connect
 * 6) x.x.x.x - WAN IP obtained from http://www.whatismyip.com/. This is if you want people outside your internal network to be able to connect to your server.
 * 7) If this IP is resolvable by the Login Server, just leave *.
 * 8) Default: *
 * 1) x.x.x.x - WAN IP obtained from http://www.whatismyip.com/. This is if you want people outside your internal network to be able to connect to your server.
 * 2) If this IP is resolvable by the Login Server, just leave *.
 * 3) Default: *
 * 1) Default: *
 * 1) This is transmitted to the client from the same network, so it has to be a local IP or resolvable hostname.
 * 2) This can be the internal IP such as 127.0.0.1 or the computer's IP such as 192.168.x.x.
 * 3) If this IP is resolvable by the Login Server, just leave *.
 * 4) Default: *
 * 1) Default: *
 * 1) Default: *
 * 1) Default: 127.0.0.1
 * 1) Default: 9014
 * 1) Default: *
 * 1) Default: 7777
 * 1) Database
 * 2) Uncomment the appropriate driver and url for the database you're using. If you don't know what this is... www.google.com
 * 1) Uncomment the appropriate driver and url for the database you're using. If you don't know what this is... www.google.com
 * 1) Uncomment the appropriate driver and url for the database you're using. If you don't know what this is... www.google.com
 * 1) Driver = org.hsqldb.jdbcDriver
 * 2) Driver = com.microsoft.sqlserver.jdbc.SQLServerDriver
 * 1) URL = jdbc:hsqldb:hsql://localhost/l2jdb
 * 2) URL = jdbc:sqlserver://localhost/database = l2jdb/user = sa/password =
 * 3) Database user info (using root user is not recommended)
 * 1) Default: 100
 * 1) Default: 0
 * 1) Misc Server Settings
 * 2) This is the server ID that the Game Server will request.
 * 3) Example: 1 = Bartz
 * 4) Default: 1
 * 1) Example: 1 = Bartz
 * 2) Default: 1
 * 1) True = The Login Server will give an other ID to the server if the requested ID is already reserved.
 * 2) Default: True
 * 1) Datapack root directory.
 * 2) Defaults to current directory from which the server is started unless the below line is uncommented.
 * 3) DatapackRoot = C:/Work/tmp/DataPack
 * 1) Define how many players are allowed to play simultaneously on your server.
 * 2) Default: 100
 * 1) Minimum and maximum protocol revision that server allow to connect.
 * 2) Warning: You must make sure that the minimum revision is always less than or equal to the maximum revision.
 * 3) Default: 12
 * 1) Default: 17
 * 1) Misc Player Settings
 * 2) Character name template.
 * 3) Example: CnameTemplate = [A-Z][a-z]{3,3}[A-Za-z0-9]*
 * 4) The above setting will allow names with first capital letter, next three small letters, and any (capital or not) letter or number, like OmfgWTF1
 * 5) Most rational to have CnameTemplate = [A-Z][a-z]*
 * 6) The above setting will allow names only of letters with first one capital, like Omfgwtf
 * 7) Default .* (as many of any symbols)
 * 1) The above setting will allow names only of letters with first one capital, like Omfgwtf
 * 2) Default .* (as many of any symbols)
 * 1) Maximum number of characters per account.
 * 2) Default: 7 (client limit)

4.) Hit File then Save.

Opening Ports in your Router

Here are the ports you need to open:

1.) 7777 (Gameserver)

2.) 2106 (Loginserver)

And you are done with ports.

Setting the PATH for Java

1.) Open Control Panel

2.) Open System and go to the Advanced tab.

3.) Click on Environment Variables

PATH

In order to run Java programs from anywhere, the files javac.exe java.exe need to be included in the path system.

REPLACE X.X.X With the Java JDK you Have.

Windows NT/2000/XP: path "C: \ JDKX.X.X \ BIN" for the PATH variable.

CLASSPATH

Java needs to find classes in Java, which is where CLASSPATH comes in.

Windows NT/2000/XP: classpath "."

4.) You are now done.

Congratulations!

Everything is now setup and ready to run! All you have to do now is:

1.) Go to your Main Directory, open folder "Login" and open startLoginServer.bat/.sh

2.) Go to your Main Directory, open folder "Gameserver" and open startGameServer.bat/.sh

Have fun Testing/Playing your new L2J Server!