Skip to main content

Introducing libwsmeta

I would like to speak about a new project : libwsmeta, a C metaserver library intended to be used for several projects including rainbrurpg and rainbrurph.

This library will have to search for a server list. I've designed it to be included in cmake-based project.

The design

The library will use a  peer to peer approach to find and propagate new game servers.
  1. The server download the entry-point and contact it. The entry-point is the main server(s) of the game. Its IP:port pair is publicly available from a public URL;
  2. The server directly contact the entry-point server and add itself to the server list before it returns the new list;
  3. It will then contact next server in the list with the same effects.

Using libwsmeta as a git submodule

As a developper

If you want to add this library in the ext/ directory :
mkdir ext
cd ext
git submodule add
and add this line to the top-level CMakeFiles.txt
Now, you have to use two variables, defined by the included CMakeLists.txt file : LIBWSM_INCLUDES and LIBWSM_LIBRARIES.
Now, to update the subrepository, go to ext/libwsmeta and update it :
git checkout master
git pull

As a user

The user will have to perform two more step before being able to build the repository that uses this library :
git submodule init
git submodule update
The library will be built as a shared library along with the main project. No undefined references should occur.


Popular posts from this blog

How to make a map of variant in C++

This code is used by RainbruRPG to store any scalar types in a single class instance. It's already in use since revision 254 to save game states values when switching fullscreen or changing screen resolution.
The map class It's basically a map of boost::variant using std::string as map key. I decided to use function template setter and getter to have a standardized exception-based error handling, but you could have multiple parameter-based specialized getter/setter (void set(bool), void set(int)...).