Server Architecture - Kyoril/mmo GitHub Wiki

Server applications

There are currently three server applications to run the game itself, which are:

  • Auth Server
  • Char Server
  • World Server

Architecture

Auth Server

The auth server handles player authentication from the game clients and creates session keys which can be used to authenticate players on realm servers later on. The login server also communicates with realm servers to exchange data. Realm servers never ever have direct access to the login server database.

Char Server

A char server stores character data and represents a persistent world. It connects to an auth server (and needs to authenticate itself there) to verfiy connecting game clients use valid session keys on login. A char server hosts multiple world servers which are connected as clients to the char server as well and handle the actual gameplay. World servers need character data from the char server and may update character data.

World Server

A world server hosts one or multiple map instances. There are at least two map instance types: Persistent and Inpersistent. Persistent maps are things like continents, whereas inpersistent maps are dungeons and stuff like that. The world server doesn't accept player connections directly but uses the char server as proxy server for the game clients. A world server may connect to multiple realms to allow for serving multiple realms and technically even allows for cross-realm gameplay features if those are needed.

Databases

Account DB

This database stores account data and everything that is linked directly to an account. In case of a commercial project, this might also contain data about prepaid game time and stuff like that. It is only every accessed by an Auth Server application and nothing else.

Although in theory there could be multiple auth servers, there will always only be one Account DB which is shared by all Auth Servers.

Char DB

This database exists once per Char Server or realm. This database contains everything related to player characters, such as their location, level, stats, inventory etc. Everything is stored in here and only accessed by the linked Char Server.

World DB

There is only one World DB. This database stores map instances, which means info about what npcs are currently despawned, what their respawn timer was etc.. This is especially important for dungeons and maps like these. This database should not be accessed very often, as the state of an instance is kept in RAM of a World Server as long as the map is active, and is only serialized once the map instance becomes inactive (to save RAM and allow other map instances to be activated on a world server).