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 https://github.com/rainbru/libwsmeta
and add this line to the top-level CMakeFiles.txt
include("${PROJECT_SOURCE_DIR}/ext/libwsmeta/src/lib/CMakeLists.txt")
Now, you have to use two variables, defined by the included CMakeLists.txt file : LIBWSM_INCLUDES and LIBWSM_LIBRARIES.
include_directories(${LIBWSM_INCLUDES})
TARGET_LINK_LIBRARIES(YOUT_PROJECT ${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.

Comments

Popular posts from this blog

Building openmw on Debian Jessie

How to make a clickable label in Gtk2/ruby