SERVER


How to Set up an L2J Server

Lineage II is an MMORPG developed by NCsoft. L2j is an emulator for Lineage II written in Java, which allows anyone to host his/her own private server legally. This how-to outlines the steps needed to set up your own L2j server on a remote server running Ubuntu Server. Other distributions work in a similar fashion, so it is perfectly possible that this guide suffices for numerous other distributions.

Contents


<a href="http://cf15ekq7v35fo8c--d-jqs6vfs.hop.clickbank.net/?tid=63RDK7WZ" target="_top">Click Here!</a>

Steps

Getting the files
  1. Open up your favorite browser. Visit http://www.l2jserver.com/nightly/ and download both L2J_DataPack-unstable.zip and L2J_Server-unstable.zip.
  2. Locate the downloaded ZIPs, extract them and rename them "dp" and "server" in order to access them more easily.
  3. Upload "dp" and "server" to the remote server. If you do not know how to upload the files, read Filezilla's Uploading Manual. Other FTP clients work in the same fashion; consult your client's manual for further information.
Server Preconditions
  1. Make sure that JRE, JDK, MySQL and phpMyAdmin are installed on your server machine. In most circumstances, they will be, but if they aren't, type the following commands and follow the instructions on your screen to install them.
    • sudo apt-get install mysql-client mysql-server
    • sudo apt-get install phpmyadmin
    • sudo apt-get install default-jdk default-jre
  2. When both MySQL and phpMyAdmin are installed (don't forget JRE and JDK!), you can manage your SQL database through phpMyAdmin. Log in and create 2 databases named l2jdb and l2jcb.
  3. Copy all files located on ~/dp/gameserver/data to ~/server/gameserver/data. "~" indicates your home path, which you can access by typing cd. If you use an FTP client, upload all files located in /dp/gameserver/data in your local machine to /server/gameserver/data in the remote machine (the server that will host your l2j server).
  4. Your host provides you with a terminal in which you can type various commands. Type the following commands, following the order shown below:
    • cd ~/dp/tools
    • chmod +x database_installer.sh
    • ./database_installer.sh
  5. Follow the instructions on your screen and add all the tables that are necessary for your server to the SQL database.
  6. Once the tables have been added, type the following commands:
    • cd ~/server/login
    • chmod +x startLoginServer.sh LoginServer_loop.sh
    • nano LoginServer_loop.sh
  1. A text file should have opened.
    • Change nice -n -2 java -Xms128m -Xmx128m -cp ./../libs/*:l2jlogin.jar com.l2jserver.loginserver.L2LoginServer > log/stdout.log 2>&1 to nice -n 2 java -Xms128m -Xmx128m -cp ./../libs/*:l2jlogin.jar com.l2jserver.loginserver.L2LoginServer > log/stdout.log 2>&1.
      • (Remove the dash in front of "2")
    • Look at -Xms128m -Xmx128m (on GameServer_loop.sh, "128" is replaced with "1024"). "128" indicates the maximum amount of RAM that is allocated to loginserver or gameserver. Unfortunately, this article cannot indicate an exact number to place there; consult your host to determine the amount of RAM available to you. It is certain, however, that both 128 and 1024 are too low for your login and game servers.
  2. Press Ctrl+X. Now press y to save the file and then press Return (a.k.a. the "Enter" button).
Server setup
  1. Once again, type the following commands:
    • chmod +x RegisterGameServer.sh
    • ./RegisterGameServer.sh
  2. Follow the instructions on your screen. You have now registered a game server.
  3. Another round of commands!
    • cp hexid.txt ../gameserver/config/hexid.txt
    • cd ..
    • chmod +x startGameServer.sh
    • chmod +x GameServer_loop.sh
  4. Your server is almost ready. You now need to configure some files in order to connect properly. Visit this page and follow the instructions under "Editing the Configuration Files".
  5. Once the files are edited, it's time to launch the server! Type:
    • cd ../login
    • ./startLoginServer.sh
    • cd ../gameserver
    • ./startGameServer.sh
  1. That's it! Both the login and the game servers are launched! It is advisable to type the following commands before launching the gameserver in order to ensure that the login server is indeed up and running. If you do type those commands, you will need to type cd ../../gameserver instead of cd ../gameserver:
    • cd log
    • cat stdout.log
  2. You can type the same commands to ensure that your gameserver is up and running too (cd log and cat stdout.log) while you are on the gameserver directory.
Connecting to your server
  1. In order to connect, you need to alter your hosts file located (usually) in C:\Windows\system32\drivers\etc. Open it with a text editor and add the following lines (xxx.xxx.xxx.xxx indicates the IP of your host):

    • xxx.xxx.xxx.xxx L2authd.lineage2.com
    • 216.107.250.194 nProtect.lineage2.com
  2. Download http://forum.ragezone.com/f328/patched-system-gracia-epilogue-protocol-152-a-681657/. The only file you will need from it is dsetup.dll since version 152 is not supported by the current L2j files. You may copy dsetup.dll to your desktop and discard the rest of the content.
  3. Copy dsetup.dll to your Lineage II system folder, replacing the other dll.
  4. Delete your GameGuard folder located inside your Lineage II system folder.
  5. Copy L2.bin to your desktop.
  6. Rename the L2.bin on your desktop to l2.exe.
  7. Cut and Paste l2.exe to your L2 system folder.
  8. Run l2.exe. If both your login server and gameserver are up, you should be able to connect to your server.
  9. If you want others to be able to connect to your server, you should zip and upload your L2 system folder so that others can download it and replace their own L2 system folder with yours. The hosts file belonging to anyone who wants to join should also be changed.

Tips

  • CSDB, LSDB and GSDB refer to community server database, login server database and gameserver database respectively.
  • Be extremely careful when you are typing the commands shown here, as they are case sensitive; ./startLoginServer.sh will work, while ./startloginserver.sh will not.
  • To find your L2 revision number easily, follow these steps:
    • Create a new text file on your desktop and name it protocol.bat.
    • Right-click the file and click Edit.
    • Add this line: l2.exe -L2ProtocolVersion.
    • Save the file.
    • Cut and Paste the bat to your Lineage II system folder and run it.
  • You can type cd log and cat stdout.log to ensure that your gameserver is up and running too (cd log and cat stdout.log) while you are on the gameserver directory (or just cat stdout.log while you are on the gameserver/log directory).
  • Always ensure that your login server is up and running before launching the gameserver, as your gameserver cannot operate without the login server.
  • Should you wish to terminate your server, type ps -A. You will see the list of the processes that are currently running. Locate LoginServer_loop.sh, GameServer_loop.sh and Java. Terminate all 3 of them by typing kill xxxx, where "xxxx" is the ID of the process.
  • Lineage II requires that the TCP ports 2009, 2106 and 7777 are fully accessible.

Warnings

  • Ensure that your l2j version matches your Lineage II version; otherwise, your server will malfunction and some features will not work properly. Your L2 client must match the L2j files too; server files that are designed for Gracia Epilogue won't work if your client is Freya!
  • If you use a password for your MySQL database (which is highly recommended), don't forget to edit server.properties and loginserver.properties to include the password; otherwise you will not be able to connect, as the server won't be able to access your database.
  • REMEMBER: Client modding is an illegal act and a major no-no.

No comments:

Post a Comment