Clone wiki

L2J_Server / Home

Welcome to L2J Server Project

L2J Server is an open-source server emulator fully written in Java for the famous Korean MMORPG.

This page only gives very basic information, for the detailed information about building and developing L2J Server, please visit the developers forums.

Get Git

You need Git to download the source code, you can install the Git command line or a GUI.

OS Command
Debian/Ubuntu $ apt-get install git-core
CentOS $ yum install git
Fedora (up to Fedora 21) $ yum install git
Fedora (Fedora 22 and later) $ dnf install git
Windows Download and install from https://git-scm.com/download/win

Setting up Java

L2J is developed in Java, to compile the source code you need the JDK.

Debian

Edit /etc/apt/sources.list and add:

deb http://ftp.debian.org/debian jessie-backports main

Run:

$ apt-get update
$ apt-get install openjdk-8-jdk

Windows

Download the latest "Java SE Development Kit" 64b edition.

http://www.oracle.com/technetwork/java/javase/downloads/index.html

Double-click the installer and follow the instructions.

Setting the JAVA_HOME Variable

Windows

  1. Find your JDK installation, it will be something like: C:\Program Files\Java\jdk1.8.0_xxx
  2. Win + R and run: rundll32 sysdm.cpl,EditEnvironmentVariables
  3. Click New in System Variables Variable name: JAVA_HOME Variable value: C:\Progra~1\Java\jdk1.8.0_xxx
  4. Apply and OK.

Get the source code

Clone Core and Datapack repositories, say in folder l2j.

If you don't have Git installed check "Get Git" step.

L2J Server (Core)

$ git clone https://bitbucket.org/l2jserver/l2j_server.git

L2J Datapack

$ git clone https://bitbucket.org/l2jserver/l2j_datapack.git

Compile the files

To compile the server files go to l2j\l2j_datapack and run gradle wrapper.

$ gradlew build
Build in build/distributions/L2J_DataPack_2016-10-28.zip
Build in build/distributions/L2J_Server_2016-10-28.zip
:L2J_Server:compileJava UP-TO-DATE
:L2J_Server:processResources UP-TO-DATE
:L2J_Server:classes UP-TO-DATE
:L2J_Server:jar
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:jar
:assemble
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test UP-TO-DATE
:check UP-TO-DATE
:build
:zip UP-TO-DATE
:L2J_Server:configuratorJar
:L2J_Server:dbInstGsJar
:L2J_Server:dbInstLsJar
:L2J_Server:distTar UP-TO-DATE
:L2J_Server:distZip UP-TO-DATE
:L2J_Server:loginJar
:L2J_Server:assemble
:L2J_Server:compileTestJava UP-TO-DATE
:L2J_Server:processTestResources UP-TO-DATE
:L2J_Server:testClasses UP-TO-DATE
:L2J_Server:test
:L2J_Server:check
:L2J_Server:build
:L2J_Server:zip

BUILD SUCCESSFUL

Total time: 21.762 secs

Setting up the IDE

An IDE is the best option when it comes to develop software, it manages dependencies and has syntax highlight and compile checks.

We have worked with Eclipse for over 10 years, recently we decided to give a try to JetBrain's IntelliJ IDEA IDE and they have been kind enough to give us licenses for the Ultimate version.

We will continue to support Eclipse, but also give support for IntelliJ IDEA users.

Getting Eclipse

Eclipse

Download the latest "Eclipse IDE for Java EE Developers" 64bit edition.

Make sure you download the latest version.

http://www.eclipse.org/downloads/eclipse-packages/

Unzip the downloaded zip and start Eclipse.

Setting up Eclipse

Depending on the Eclipse version you download, we recommend Eclipse IDE for Java Developers 64 bits edition, you may need to download "Buildship Integration for 1.0".

To download "Buildship Integration for 1.0" go to Help -> Eclipse Marketplace... -> Search for Gradle -> Install.

Debug from Eclipse

Debug from project files

<TODO>

Debug remotely

<TODO>

Getting IntelliJ IDEA

IntelliJ IDEA

Download the latest "IntelliJ IDEA" Community edition.

You are invited to buy the Ultimate edition, but we recommend you to try the Community, then the free tril for the Ultimate version before deciding to buy.

Make sure you download the latest version.

https://www.jetbrains.com/idea/#chooseYourEdition

Run and install it.

Setting up IntelliJ IDEA

<TODO>

How To

Installing the Database

L2J Server currently supports MySQL and MariaDB.

MySQL

Download "MySQL Installer" from https://dev.mysql.com/downloads/

Install as server, you don't need JDBC connectors nor other tools.

Configure the server as development machine.

You can set up root password as toor (a password is mandatory) and you will not require configuration changes in L2J Server.

MariaDB

<TODO>

Database GUI/Tool

We recommend HeidiSQL as it's open source and it supports MySQL and MariaDB out-of-the-box.

Download and install it from https://www.heidisql.com/download.php

Installing the Database

L2J Server uses two databases, one for login server and other for game server.

Login server database has the game servers and accounts, the game server has all the game data.

<TODO>

Geodata

L2J Server requieres Geodata in order to prevent exploits and bugs related to positioning.

To enable Geodata you must download http://l2jserver.com/files/geodata/L2J_Geodata_Hi5-master-09-27-2015.zip

Unzip it in SERVER_ROOT\data\geodata

The .l2j files are named by their regions #_#.l2j, if you believe there is no Geodata in an specific region you can use the //geodata command in game.


Web Site | Forums | Live Support | Downloads | Documentation | @l2jserver

Updated