My favorites | Sign in
Project Logo
                
Search
for
Updated Jan 15, 2009 by retrib
Labels: Featured
SetupGuide  
How to setup your own server

Server Setup Guide

Last updated: Nov 4, 2008 (in progress)

Introduction

This document is a platform-independent guide to setting up and installing your own local instance of the L1J-En Lineage server.

Some words of caution:

With those formalities out of the way, follow the steps here to get your server up with minimal effort.

Choosing an Update Method

The L1J-En team realizes that not everyone is patient or skilled enough to follow this guide to completion. If you consider yourself a novice or have trouble at some point following the steps here, then you have the option of using a pre-built version of the server and a pre-packaged database that is associated with it. This will spare you multiple, potentially-confusing steps in this process. We will try to release milestones at points where either significant progress has been made on our part and/or a large amount of new features have been merged in from the Asian L1J teams.

To use a milestone build, grab the latest pre-built server binary from the Downloads tab and check out the full repository from ONLY the revision in which it is noted to be associated with. Then use the l1jdb_mX.sql file (where X is the number of the milestone) to build your database in MySQL. Once you've done this, jump to the configuration section below for the rest of the setup process.

If you want to run a permanent server that gets updated regularly or if you just want to keep up with the latest changes, then ignore the previous text in this section and follow the remaining instructions below.

Accessing the Repository

To download the files contained in this repository, follow the instructions already provided by Google on the Source tab. You'll need an SVN client to create a local target for the repository, and the options provided by each vary per client. On this tab, you can also follow the latest changes or browse individual files remotely.

Some recommendations: The command line Subversion client is best for shell scripts, TortoiseSVN is popular for Windows users, Subclipse allows for integrated SVN access from the Eclipse IDE, and psvn.el is a full-featured Emacs SVN module.

Setting up your Environment

Like most MMOs, Lineage operates on a client-server, or n-tiered architecture (where n=3). These tiers consist of the presentation layer: the client, the application layer: the server, and the data layer: the database. The official Lineage 1 servers, as run by NCSoft, break out the server into components including the NPC server and login server. Here, these are all handled by a single, monolithic server.

You probably already have the game client installed. If not, see our Best Client Guide.

The server is written in Java. If using a pre-built milestone, you'll only need a JRE installation of v1.6 or greater. Most Windows and OSX users will already have this installed. You may need to set system/user environmental variables to ensure that your PATH includes the directory for the JRE executables. If you intend to compile the latest source, you'll need the Java SE Development Kit (or JDK). Compilation of the source can be done without an IDE, but an Eclipse-compatible .project file and an Ant build directive are already provided to make this much easier. Simply install Eclipse and load the project, then run the Ant build. Alternatively, if you want the latest source but don't feel like installing a huge IDE, just install the Apache Ant build manager and run the build from the command line. Other IDEs can also be used, and project files for these may be provided later (if you create one for your favorite IDE, feel free to send it in).

The database requires an installation of MySQL. The community edition of MySQL is free, so download and install it. MySQL comes with a full-featured command line interface, from which you can perform any task relevant to working on the database. There are also several graphical interfaces to MySQL with varying subsets of the functionality of the CLI. Navicat is probably the most popular among Windows users and is reasonably priced and several exist of varying quality for UNIX-variants. However, these aren't necessary and you can complete any database task using the prepackaged client.

Installing

If using the provided Ant build, this will by default generate output in the form of a file named l1jen.jar. The server should compile without any errors. Some warnings may be generated, depending on your IDE's warning level setting. Most of these are unused variable declarations and log instances in packet classes, and are left in intentionally at the moment. You can suppress or ignore these if you want.

Log into your database instance and execute the base database installation script, l1jdb_mX.sql (where X is the current milestone build number). The base database creation script is the latest complete database from the time of the last milestone build. To convert this to the latest L1J-En database, you should then apply any update scripts to this milestone. The update currently being worked on will have a "-pending" appended to its filename. This means the queries within this update are still in progress and have not yet been finalized. Developers will try to keep additions to this as stable as possible, but it is only until after this update has been released that these are considered finished. You can tell that an update has finished when a new pending update is created. It may be the case that some server code change depends on a pending update change. If you've updated to a repository in this state, you can either apply the pending updates, or use an older revision. If a genuine error occurs, you can fix it yourself or let us know by submitting an issue with the file, line number, error returned, and the sequence of scripts executed up to that point.

With these tasks complete, you can now create a directory for your server to execute from and copy over the startup script, the build .jar file, and the config, data, maps, and lib subdirectories to it. If you plan to do development on the server, you'll want a separate execution folder for the server, separate from your local copy of the repository.

Configuration

All configurable options are present in the config subdirectory. Any new feature that has been deemed as something other servers might want to deactivate or adjust has been left as a config setting. Most of these settings should be self-explanatory. If not, you can easily check references to it within the code to see how it is used.

With the config settings tweaked to your liking, you are now ready to host your own server. In Windows, unless you changed some filenames from their default, serverstart-console.bat should run the server without any further effort on your part. In Unix variants, you may need to modify the directory bash is in (e.g. on BSD, the default is /usr/local/bin/bash) or JRE flags in the provided shell scripts.

Making Modifications

So, you now have your own server up and running. If you did everything correctly, you should have a clean slate copy of what is currently in production on the live LinDC server (minus any player data, of course). If you used a pre-built milestone distribution, you'll have a snapshot of how it was at some point in the recent past.

Whether you're just a normal Lineage player you or have ambitions to host your own server, if you want to make modifications, you'll probably want to follow the latest source code. Bugs are fixed and features added on practically a daily basis, so make sure you understand the update process thoroughly before changing anything. If not, you may make changes that conflict with the current state of the codebase, which equals wasted effort. If you aren't sure what to change, take a look at the Issues tab on this site, which is an up to date listing of the things that need to be addressed. If you know about an issue not listed, go ahead and add it. You do not need to be a project member to add an issue to this list.

Once you've identified something you want to change, do so, and let us know about it! The popularity of this codebase is growing, and many people follow its progress and use it for their own servers. If you fix something or add a feature, not only will many people appreciate it now, but all future servers that derive their code from here will owe you thanks. See the main page of this project to get the full details.

Getting Further Help

If you run into problems setting the server up, feel free to post on the LinDC forums. There you can get help from the core L1J-En userbase and other people following the latest code. If you've found what you're sure is a bug with the project itself, don't hesitate to add it to the Issues tab.

A new setup guide is now available here. This guide is in more of a walkthrough format and attempts to provide a sequence of install steps for multiple platforms.

If you're only interested in milestone builds, and only use Windows, see this very detailed step-by-step Windows setup guide. Note that this is somewhat outdated and refers to the old project site.

While you do not need to know how to program or know anything about databases or networks to setup the server, it certainly doesn't hurt. You'll also want to have at least some basic programming skills if you plan to make meaningful contributions back to the project, as it is very easy to make a modification that will make the server unstable. There's no shortage of great tutorials online, and if you're starting from nothing, search for ones related to Java, SQL, or MySQL.

Hopefully, this document demystifies server setup for those who are almost there but couldn't quite figure it out on their own. Literally anyone should be able to follow the steps here and have their own server up and running within an hour or two. Have fun, and let us know how it goes.


Comment by d2d-ja...@hotmail.com, Mar 06, 2009

id like to help ur project ,i have been doing l1j-jp for 6 yrs and i dont see much english server so id like to put some of my time and effort on the english community,feel free to email or let me join ur team to help


Sign in to add a comment
Hosted by Google Code