Maintenance/Guidelines

Maintenance Guidelines

Repositories

The Source repository contains the sources of the Khrome server. Since the project relies on L2j, we define the following mirrors:

PathSource
/Source/mirror/l2jdp/trunkhttp://svn.l2jdp.com/trunk
/Source/mirror/l2jserver/trunkhttps://www.l2jserver.com/svn/trunk

The following paths are our working projects:

PathProject
/Source/trunk/L2_DataPackDatapack
/Source/trunk/L2_GameServerGameserver

SVK has been used on top of SVN in order to mirror and update the distributions.

Updating the L2j system

Updating mirrors

To update the L2j system, there are two steps. First the mirrors are brought to the desired revision.

$ svk sync -s %GSREV -t %GSREV /Source/mirror/l2jserver/trunk
$ svk sync -s %DPREV -t %DPREV /Source/mirror/l2jdp/trunk

Now the desired revisions are in the mirror path. The working project paths (those in /Source/trunk) are copies (branches) of the mirror paths, therefore branch merging can be performed.

Merging changes

In the second step we will merge the mirror branch to the working project branch. Update a working copy of the project (either Datapack or Gameserver, whichever you're updating) to the latest revision. Now use the branch merging feature to merge this working copy to the mirrored project. Once the merge is complete, resolve any conflicts and then commit the changes.

$ svn merge -r110:HEAD svn://khrome.ro/Source/mirror/l2jserver/trunk/L2_GameServer_It /path/to/L2_GameServer_It
$ svn merge -r110:HEAD svn://khrome.ro/Source/mirror/l2jdp/trunk/datapack_development /path/to/L2_DataPack
$ svn merge -r%FROM:%TO %MIRROR_REPO_PATH %WORKING_COPY_PATH

A little explanation here: This command merges the changes in the mirror branch (eg. svn://khrome.ro/Source/mirror/l2jserver/trunk/L2_GameServer_It) to the current working copy. We're merging from revision 110 to HEAD. Here, 110 is the revision before the mirror update, and HEAD is the revision after the update. Now all the changes will be found in the working copy, just as if they were put there by hand.

Updating configs

Configs are a special branch of the development config directory. Once you've commited the development branch, do a merge just like the above for the config branch. Once the merge is complete, resolve any conflicts and then commit the changes.

Upgrading the live server

Once the application is ready, has undergone testing and is approved, you can update the live server.

  1. Make sure a backup has been performed. After the server has been shutdown, perform a backup of the database and logs.
  2. Updating the database Checkout the svn and tools directory from the datapack somewhere on the server and perform the automatic update that L2j provides. It is recommended to manually execute any sql files in the updates directory.
  3. Run any custom database scripts Make sure any custom NPCs are in place, like the class masters and the event managers.
  4. Updating data for svn Run svn update on the following directories:
    • gameserver/configs
    • gameserver/data
    • libs
  5. Updating the application Copy the recently built l2jserver.jar file to the gameserver and loginserver directories.

Updating the website

For the website you'll need to update:

  • Recipes table (from rake script)
  • Extractable items table (from rake script)
  • Items and skill icons (when the client has also been updated)