Darkan World Server

All your clients are belong to me

First thing to note, the Darkan world server is the brains of how each world works. Every world can have completely different functionality because of how versatile server side programming can be with this framework. In addition worlds can share player files and Grand Exchange offers but we choose for it not to in order for each world to have its own economy.

For Darkan developers the most important thing to learn is server-side programming. This will enable you to have maximal ability to create content and change how Runescape is played.

About World Server

We will start going over the Darkan server by limiting our observations to directory src/main/java/com/rs/*.

Our directories in February 2023(bug Jesse if the structure changed and we need to rewrite this) are:

  • cores: Threading for the server, I hardly ever touched it
  • db: This directory contains the code which manages the MongoDB.
  • game: This is where you will spend most of your time. The actual content of the game is located here. It is a great idea to learn how the java code here works by consistent practice.
  • net: These are higher level packet structures than those that exist in Darkan Core. It is beneficial to look over these packet decoders and packet encoders.
  • plugin: Contains all the handlers for inserting code which works in any part of the server source contained in a class with the annotation "@PluginEventHandler". You will be able to read about this in the "Modular Plugins" section in essentials.
    However know you will be able to insert code anywhere in the server source which is triggered from a wide variety of events brought by the player in the world.
  • tools: Contains a list of tools which aide in things like looking at cache data, finding ids, getting interface information, getting drop chances from NPCs, testing combat/item/object/npc definitions and just general decision making.
    None of these are used in the actual server. These are sometimes used to do very specific tasks or for finding niche or unknown parts of the cache.
  • utils: Generally you use utils to do math or specific tasks, some of which you will probably not use. However, both Darkan Core and Darkan Server have a utils folder from which the server code highly references.
    Highly frequented utilities include WorldUtil, Ticks, NPCExamines, ItemConfig, spawns/, shop/, music/* and more in Darkan core. Casually I recommend learning these utilities over time to improve your prowess.
  • web: This is how a world server can be manipulated remotely using an API which is directly jacked in.