Page 1 of 3

[Guide] So you want a L2J Server

Posted: Sun Nov 23, 2014 12:24 am
by canislupus
This basic guide is meant for testing, and NOT for a Live server.


Briefing


Every L2J server you have played on has 2 main things.

L2J_SERVER files and L2J_DATAPACK files.

L2J_SERVER would be the mechanical part of your server. This part loads the datapack and allows connections.

L2J_DATAPACK would be the content part of your server. This part defines all aspects of the emulation.

A good analogy,
L2J_DATAPACK are the books in a library.
L2J_SERVER is the librarian who handles the books.



Software list



1.-Java



2.-Eclipse



3.-Xampp

NOTE: If you have set a root mysql password then write it down. You will have to put it into the LoginServer and GameServer configuration file, so that they can access to the MySql database.



4.-Heidi SQL
If you want any other client like Navicat, you can do so.


Repository Files


The Repository system allows easy simultaneous modification of the files from the developers.

More information about git

The current repository location is in: https://github.com/L2J

The Git system has something called "Branches". And the purpose is to separate different code versions.
Just to name a few there are C4, Gracia, Freya, Hi5 branches.
If you want to set up a Freya server, then you would have to get the Freya branch.
In this example i will be using the Hi5 Stable branch.



So you want a L2J Server?


-> Start Eclipse
-> Select a Workspace, it can be anywhere.
-> Go to Window
-> Show View
-> Project Explorer


Cloning Datapack


-> Copy this : https://github.com/L2J/L2J_DataPack.git
-> Inside the Project Explorer Window Right-Click
-> Import
-> Git
-> Projects From Git
-> Next
-> Clone URI
-> Paste inside URI
-> Next
-> Select the Branch you want
-> Finish


Cloning Serverpack


- >Copy this : https://github.com/L2J/L2J_Server.git
-> Inside the Project Explorer Window Right-Click
-> Import
-> Git
-> Projects From Git
-> Next
-> Clone URI
-> Paste inside URI
-> Next
-> Select Desired Branch
-> Finish

Compiling Datapack


-> Inside Project Explorer
-> Expand L2J_Datapack
-> Right-Click Build.xml
-> Run As
-> Ant Build


Compiling Serverpack


-> Inside Project Explorer
-> Expand L2J_Server
-> Right-Click Build.xml
-> Run As
-> Ant Build


Setting Up Files


-> Navigate to your L2J_DATAPACK file
-> Look for the build folder
-> Inside the build folder extract the compressed file
-> Copy all the content into a new folder you can call it how you want.

-> Navigate to your L2J_SERVER file
-> Look for the build folder
-> Inside the build folder extract the compressed file
-> Copy all the content into the folder you created. It will ask to overwrite. This is normal, press yes.



Installing Database



-> Run Xampp Control Panel
-> Press Start in MySQL
-> Run HeidiSQL
-> Log into your local Mysql Server
-> Create Databases: l2jls , l2jgs and l2jcs (use utf8-general_ci encoding)
-> Browse to yourserverfolder/tools
-> Run Dbinst_cs.jar (Community Server)
-> Fill in with your Mysql information.
-> Select Full Install
-> Repeat the process for Dbinst_ls.jar (Login Server) and Dbinst_gs.jar (Game Server), thanks to Unafraid

NOTE: If you have set a root mysql password then write it down. You will have to put it into the LoginServer and GameServer configuration file, so that they can access to the MySql database.


Optional: If you have set a root password for your MySql server then follow these steps:

-> Open yourserverfolder\login\L2J_Configurator.jar
-> Under LoginServer tab find "Password"
-> Type your MySql root password
-> Save and Close

-> Open yourserverfolder\game\L2J_Configurator.jar
-> Under Server tab find "Password"
-> Type your MySql root password
-> Save and Close

Starting the Server

-> Run yourserverfolder\game\StartGameServer ------------------ A Command Prompt Window will open, let it load

-> Run yourserverfolder\login\StartLoginServer ------------------ A Command Prompt Window will open, let it load


Logging in


Now that we have got our server up and running, its time to test it.

To play in the server, from the same pc, you need to edit your hosts file.
Located inside C:\Windows\System32\drivers\etc
Copy the file in your desktop, edit it with notepad adding these lines:

[pastebin]2pL4AN8K[/pastebin]


Save the file, copy from desktop and paste inside the C:\Windows\System32\drivers\etc directory.

I suggest you do it this way because sometimes windows will not allow you to edit and save the files when they are inside the operating system directory. E.g windows/system32/xxxx

Once you have saved the file. Start your Lineage 2 Client and test. (Accounts are auto create by default)


Do not edit the Lineage 2 Client because it is illegal


I hope you enjoyed the guide, if you are a seasoned L2J Developer and found any error or have a suggestion, submit a comment.
Happy testing!

UPDATE 29/12/14 ----> Changed DatabaseInstaller.bat/sh method to Dbinst_(ls,gs,cs) method.

Re: So you want a L2J Server

Posted: Sun Nov 23, 2014 12:32 am
by St3eT
Awesome, good job!

Re: So you want a L2J Server

Posted: Wed Nov 26, 2014 10:28 pm
by Sequentiality
Thanks for guide. Can't find when wiki will be avaliable?

Re: So you want a L2J Server

Posted: Wed Dec 03, 2014 5:57 pm
by Chickenmelon
Edit: Nevermind, I downloaded modified system folder of lineage high five and it works now :D
Now, I need to figure out how to invite my friends to play with me...

Re: So you want a L2J Server

Posted: Fri Dec 12, 2014 6:01 am
by canislupus
Thank you, will modify it tomorrow.
St3eT wrote:Awesome, good job!
I guess pretty soon viewtopic.php?f=81&t=30493&p=182898&hilit=wiki#p182898
Sequentiality wrote:Thanks for guide. Can't find when wiki will be avaliable?
Updated to eclipse guide.

Re: [Guide] So you want an L2J Server

Posted: Sun Dec 28, 2014 5:50 pm
by Ardirion
This guide is very useful with the wikis gone and many of the guides elsewhere on the web being dodgy at best.

I have some questions:

Other guides say to copy the L2J_DataPack files into the folder that has the L2J_Server files. This guide says to copy the server files over the DataPack files. Does it make a difference?

Is it no longer necessary to run the login/RegisterGameServer.bat (or .sh) file and copy the resulting hexid.txt file into the game/config folder?

You say this is not a suitable guide for a live server. What would change if that were the case?

Re: [Guide] So you want a L2J Server

Posted: Sun Dec 28, 2014 7:02 pm
by UnAfraid
I'd suggest using dbinst_gs.jar, dbinst_ls.jar instead of databaseinstaller.bat/sh

Re: [Guide] So you want an L2J Server

Posted: Mon Dec 29, 2014 7:51 pm
by canislupus
Ardirion wrote:This guide is very useful with the wikis gone and many of the guides elsewhere on the web being dodgy at best.

I have some questions:

Other guides say to copy the L2J_DataPack files into the folder that has the L2J_Server files. This guide says to copy the server files over the DataPack files. Does it make a difference?

Is it no longer necessary to run the login/RegisterGameServer.bat (or .sh) file and copy the resulting hexid.txt file into the game/config folder?

You say this is not a suitable guide for a live server. What would change if that were the case?
I believe that merging the files from either L2J_Datapack or L2J_Server to another directory, will have the exact same output.
Datapack and Server have same folders. But they have different components that need to be together.

Yes, you should add the HexId if you want a custom server name, this is usually not necessary for a test server. Because if no HexId file is detected, the system will assign the default name "Bartz". But it is worth mentioning.

I made this guide for newcomers mostly.
This will happen to you if you run a live server as a newb
https://www.youtube.com/watch?v=2m-42ek85G4

Nobody wants to lose their time in a server where the Gm/Admin has less than a week of experience.

What do i think you need to run a live server? I am not an expert, just to name a few..


Standalone sql installation. No apache, No php.

Focus on security
1, secure the sql with a custom user and password.
2, only allow sql access from localhost.
3, create firewall rules to allow only sql access from your IP.
4, create firewall rules and block everything that doesnt use login or game ports.

It also depends if your server runs on Linux or Windows.

Get used to working with Eclipse and Git.
I will try to add more content to the guide so that you dont end like Simba. and more like :
https://www.youtube.com/watch?v=YxFPE8xjzpI

Re: [Guide] So you want a L2J Server

Posted: Mon Dec 29, 2014 7:55 pm
by canislupus
UnAfraid wrote:I'd suggest using dbinst_gs.jar, dbinst_ls.jar instead of databaseinstaller.bat/sh
Thanks for the suggestion. Why is it better with the jars?

Re: [Guide] So you want a L2J Server

Posted: Tue Dec 30, 2014 4:55 am
by UnAfraid
canislupus wrote:
UnAfraid wrote:I'd suggest using dbinst_gs.jar, dbinst_ls.jar instead of databaseinstaller.bat/sh
Thanks for the suggestion. Why is it better with the jars?
Its really simple to use, small amount of data to type, and it has GUI (and console for linux)

Re: [Guide] So you want a L2J Server

Posted: Tue Dec 30, 2014 5:06 am
by canislupus
Updated, thanks Unafraid!

Re: [Guide] So you want a L2J Server

Posted: Wed Dec 31, 2014 2:37 pm
by kope93
a

Re: [Guide] So you want a L2J Server

Posted: Wed Dec 31, 2014 2:54 pm
by UnAfraid
Are you sure you used the correct branch.
If u haven't builded login server from Ertheia branch that can happen.

Re: [Guide] So you want a L2J Server

Posted: Thu Jan 01, 2015 11:46 am
by Attila
All work fine

but i se you changed community bord.
if i click on favorite link it don't work.
how can i make it as it was so you canse who is online ans server info.
And at L2J_Configurator i don't get l2jdp-version and l2jdp-version is that normal ?

sorry for my bad english

thanks

Re: [Guide] So you want a L2J Server

Posted: Thu Jan 01, 2015 2:42 pm
by UnAfraid
Attila wrote:All work fine

but i se you changed community bord.
if i click on favorite link it don't work.
how can i make it as it was so you canse who is online ans server info.
And at L2J_Configurator i don't get l2jdp-version and l2jdp-version is that normal ?

sorry for my bad english

thanks
Yes since we use git there is no revision numbers anymore so we don't have *-version files anymore.
Community board is not entirely implemented yet.