Skip to content
This repository has been archived by the owner on May 8, 2019. It is now read-only.
Arves100 edited this page Nov 29, 2018 · 4 revisions

MasterServer is an cross-platform extensible server container, that aims to simplify the creation of multiple servers in one machine.

WARNING: Each module MUST BE CREATED with MDK otherwise they will not be loaded.

Features

  • Cross-platform. Works with Windows and POSIX systems.
  • Automaticly read the module configuration using an unified INI file and sends it's data to the module.
  • Automaticly connects to a database and passes the connection to all the modules. You only need to setup the connection once.
  • Module-based system. You can run everything in one machine or multiple modules in different machines.

How a module is being loaded?

It simply loads this int MDKModule(void* data) function in an exported dynamic library.

the data parametra is a pointer to a ModuleMain structure.

Due to the thread entrypoint design, you have to fetch the parametra manually.

typedef struct SModuleMain { char *ip; int port; ModuleConfigMap cfg; mdk_database db; } ModuleMain;

ip is the recommended ip that the program should use. port is the recommended port that the program should use. cfg is a map containing the module configuration. It can be used to fetch any specific configuration from the INI. db is a pointer to a database connection. KEEP IN MIND that the connection could be a null pointer.

There are also some error codes used in MDK to determine the error code, see MasterServerMDK.h for more information.

Configuring MasterServer

See this page for more information

Avaiable commands

Type 'help' to see a list of the avaiable commands with a description.

Clone this wiki locally