Setup Server

From L2J Wiki

Jump to: navigation, search

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:

# ---------------------------------------------------------------------------
# Login Server Settings
# ---------------------------------------------------------------------------
# This is the server configuration file. Here you can set up the connection information for your server.
# This was written with the assumption that you are behind a router.
# Dumbed Down Definitions...
# LAN (LOCAL area network) - typically consists of computers connected to the same router as you.
# WAN (WIDE area network) - typically consists of computers OUTSIDE of your router (ie. the internet).
# x.x.x.x - Format of an IP address. Do not include the x'es into settings. Must be real numbers.
# ---------------------------------------------------------------------------


# ---------------------------------------------------------------------------
# Networking
# ---------------------------------------------------------------------------
# ---------------------------------------------------------------------------
# This is transmitted to the clients connecting from an external network, so it has to be a public IP or resolvable hostname
# Common settings...
# 127.0.0.1 - If you are playing alone on a test server
# 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
# 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.
# ---------------------------------------------------------------------------
# Default: 127.0.0.1
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)

# ---------------------------------------------------------------------------
# This is transmitted to the client from the same network, so it has to be a local IP or resolvable hostname.
# This can be the internal IP such as 127.0.0.1 or the computer's IP such as 192.168.x.x.
# ---------------------------------------------------------------------------
# Default: 127.0.0.1
InternalHostname = 127.0.0.1 /////(THIS DOESN'T NEED TO BE CHANGED, UNLESS YOU KNOW WHAT YOU ARE DOING)

# Bind ip of the LoginServer, use * to bind on all available IPs
# Default: *
LoginserverHostname = *

# Default: 2106
LoginserverPort = 2106

# The address on which login will listen for GameServers, use * to bind on all available IPs
# Default: *
LoginHostname = *

# The port on which login will listen for GameServers
# Default: 9014
LoginPort = 9014

# The delay in minutes after which the login updates the gameservers IP's (usefull when their ip is dynamic)
# Default: 15
IpUpdateTime = 15


# ---------------------------------------------------------------------------
# Security
# ---------------------------------------------------------------------------
# Default: True
LogLoginController = True

# How many times you can provide an invalid account/pass before the IP gets banned.
# Default: 10
LoginTryBeforeBan = 10

# Time you won't be able to login back again after LoginTryBeforeBan tries to login.
# Default: 600 (10 minutes)
LoginBlockAfterBan = 600

# If set to True any GameServer can register on your login's free slots
# Default: False
AcceptNewGameServer = False

# Enforce GameGuard authorization from client?
# If True, login server will kick client if the client bypassed GameGuard authentication.
# Default: True
ForceGGAuth = True /////(DO YOU WANT TO FORCE GAMEGUARD?)

# Flood Protection. All values are in MILISECONDS.
# Default: True
EnableFloodProtection = True

# Default: 15
FastConnectionLimit = 15

# Default: 700
NormalConnectionTime = 700

# Default: 350
FastConnectionTime = 350

# Default: 50
MaxConnectionPerIP = 50


# ---------------------------------------------------------------------------
# Database
# ---------------------------------------------------------------------------
# Uncomment the appropriate driver and url for the database you're using. If you don't know what this is... www.google.com
Driver = com.mysql.jdbc.Driver
#Driver = org.hsqldb.jdbcDriver
#Driver = com.microsoft.sqlserver.jdbc.SQLServerDriver
URL = jdbc:mysql://localhost/l2jdb
#URL = jdbc:hsqldb:hsql://localhost/l2jdb
#URL = jdbc:sqlserver://localhost/database = l2jdb/user = sa/password = 
#Database user info (using root user is not recommended)
Login = root /////(PUT THE MYSQL PASSWORD HERE)
Password = /////(PUT YOUR PASSWORD FOR MYSQL HERE)

# Default: 10
MaximumDbConnections = 10

# Default: 0
MaximumDbIdleTime = 0


# ---------------------------------------------------------------------------
# Misc.
# ---------------------------------------------------------------------------
# If False, the license (after the login) will not be shown.
# Default: True
ShowLicence = False

# Default: True
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)
# ---------------------------------------------------------------------------
# Developer Settings
# ---------------------------------------------------------------------------
# Default: False
Debug = False

# Default: False
Assert = False

# Default: False
Developer = 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:

# ---------------------------------------------------------------------------
# Game Server Settings
# ---------------------------------------------------------------------------
# This is the server configuration file. Here you can set up the connection information for your server.
# This was written with the assumption that you are behind a router.
# Dumbed Down Definitions...
# LAN (LOCAL area network) - typically consists of computers connected to the same router as you.
# WAN (WIDE area network) - typically consists of computers OUTSIDE of your router (ie. the internet).
# x.x.x.x - Format of an IP address. Do not include the x'es into settings. Must be real numbers.
# ---------------------------------------------------------------------------


# ---------------------------------------------------------------------------
# Networking
# ---------------------------------------------------------------------------
# ---------------------------------------------------------------------------
# This is transmitted to the clients connecting from an external network, so it has to be a public IP or resolvable hostname
# Common settings...
# 127.0.0.1 - If you are playing alone on a test server
# 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
# 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.
# If this IP is resolvable by the Login Server, just leave *.
# ---------------------------------------------------------------------------
# Default: *
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)

# ---------------------------------------------------------------------------
# This is transmitted to the client from the same network, so it has to be a local IP or resolvable hostname.
# This can be the internal IP such as 127.0.0.1 or the computer's IP such as 192.168.x.x.
# If this IP is resolvable by the Login Server, just leave *.
# ---------------------------------------------------------------------------
# Default: *
InternalHostname = 127.0.0.1 or * /////(DONT NEED TO CHANGE UNLESS YOU KNOW WHAT YOU ARE DOING)

# Default: 127.0.0.1
LoginHost = 127.0.0.1 /////(IF THE LOGIN IS ON THE SAME COMPUTER DONT CHANGE IT)

# Default: 9014
LoginPort = 9014

# Default: *
GameserverHostname = *

# Default: 7777
GameserverPort = 7777


# ---------------------------------------------------------------------------
# Database
# ---------------------------------------------------------------------------
# Uncomment the appropriate driver and url for the database you're using. If you don't know what this is... www.google.com
Driver = com.mysql.jdbc.Driver
#Driver = org.hsqldb.jdbcDriver
#Driver = com.microsoft.sqlserver.jdbc.SQLServerDriver
URL = jdbc:mysql://localhost/l2jdb
#URL = jdbc:hsqldb:hsql://localhost/l2jdb
#URL = jdbc:sqlserver://localhost/database = l2jdb/user = sa/password = 
#Database user info (using root user is not recommended)
Login = root /////(MYSQL USERNAME GOES HERE)
Password =  /////(MYSQL PASSWORD GOES HERE)

# Default: 100
MaximumDbConnections = 100

# Default: 0
MaximumDbIdleTime = 0

# ---------------------------------------------------------------------------
# Misc Server Settings
# ---------------------------------------------------------------------------
# This is the server ID that the Game Server will request.
# Example: 1 = Bartz
# Default: 1
RequestServerID = 1

# True = The Login Server will give an other ID to the server if the requested ID is already reserved.
# Default: True
AcceptAlternateID = True

# Datapack root directory.
# Defaults to current directory from which the server is started unless the below line is uncommented.
#DatapackRoot = C:/Work/tmp/DataPack

# Define how many players are allowed to play simultaneously on your server.
# Default: 100
MaximumOnlineUsers = 100 /////(SET NUMBER OF USERS ON AT ONCE)

# Minimum and maximum protocol revision that server allow to connect.
# Warning: You must make sure that the minimum revision is always less than or equal to the maximum revision.
# Default: 12
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)

# Default: 17
MaxProtocolRevision = XXXX


# ---------------------------------------------------------------------------
# Misc Player Settings
# ---------------------------------------------------------------------------
# Character name template.
# Example: CnameTemplate = [A-Z][a-z]{3,3}[A-Za-z0-9]*
# The above setting will allow names with first capital letter, next three small letters, and any (capital or not) letter or number, like OmfgWTF1
# Most rational to have CnameTemplate = [A-Z][a-z]*
# The above setting will allow names only of letters with first one capital, like Omfgwtf
# Default .* (as many of any symbols)
CnameTemplate = .*
PetNameTemplate = .*

# Maximum number of characters per account.
# Default: 7 (client limit)
CharMaxNumber = 7

4.) Hit File then Save.


Opening Ports in your Router

Here are the ports you need to open:

1.) 7777 (Gameserver)

2.) 2106 (Loginserver)

3.) 3306 (MySQL)

4.) 9014 (Listening)

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!

X
Log in









Create an account
Personal tools