ReplicaNet and RNLobby  1
RNLobby

Introduction

The namespace RNLobby provides classes for lobby related functionality broadly related to these areas:

Components

Each component may use the RNLobby.com hosted services or custom user hosted services.
To use RNLobby NATUDP transports in XPURL, XPSession or ReplicaNet call RNLobby::RegisterDefaultTransports() before allocating any XPURL, XPSession or ReplicaNet instances. The Transport protocol is NATUDP@ and passing this to XPURL::FindTransport(), XPSession::Create() or ReplicaNet::SessionCreate() will cause this transport to be used.
To use the RNLobby.com hosted servers RNLobby::BackendClient must be used to verify the titleID and encryptionKey. This ensures each components connects to the correct server with the correct internally defined encryption key. When using BackendClient in your own development and test applications use TitleID 1002 and key "ngjfyt64ert" to access the rnlobby.com development server. The rnlobby.com development server is not built to handle many requests and is for small scale tests of less than 64 connections only. The development server may also be restarted for updates without warning. The service status report can be accessed from the following page ( http://www.rnlobby.com/RLSrvMonitor.html ). Larger scale tests using the RNLobby.com hosted servers must apply to technical support for a dedicated titleID and encryptionKey. User hosting of RNLobby components may also use RNLobby::BackendClient verification using RNLobby::BackendServer, but it is not mandatory to do so.
NOTE: When using the classes in this library the network stack will be initialised if not already started by other ReplicaNet classes. PlatformHeap::ForceFree() can be used to shutdown the network stack and other internally allocated memory. Using XPURL::ShutdownNetwork(true) or XPSock_Quit() can be used to only shutdown the XPURL or lower level network stack.
NOTE: This version of RNLobby is in the alpha stage of development and as such may be subject to substantial changes until beta.

Pre-built servers

The Windows pre-built RNLobby servers are available in ReplicaNetPublic. These applications are designed to to be installed as a Windows service or as a DOS command line application. Using a command line of '-?' will display the help for each server. Each application name starts with RLSrv and implements each major RNLobby server component. For example RLSrvAdvertise implements RNLobby::AdvertiseServer. The exception to this rule is RLSrvMonitor which can be configured to regularly create an HTML report of running services, the default output file is RLSrvMonitor although this can be changed by using the -file command line parameter. If these servers are installed as Windows services they are configured to automatically start when Windows starts and to restart if the service encounters a runtime error or exception.
For example, if a Windows server is using MySQL and has two IP addresses 1.0.0.1 and 1.0.0.2 then the following commands will configure the RNLobby servers to use their default address and port configurations and start as Windows services. (Two IP addresses are needed for the NATDetectServer to operate correctly.)

SQL Database

Some of the RNLobby server classes use an SQL database (check the class documentation to see if it uses a database) to store information and each class documents any tables used. RNlobby client classes do not require a database to be installed. The RNLobby DB can be prepared by using: RNSQL.exe <ReplicaNetPublic\RNLobby\SQL\CreateTables.sql The RNODBCSQL library is used for database access which implements a wrapper around the ODBC API. Configuring a database is beyond the scope of this documentation however the ODBC Data Source Name (DSN) to use is "RNLobby" (without the quotes). When using Windows the DSN should be a System DSN to allow access to server components that are installed as Windows services. RNLobby has been tested with MySQL Server 5.6.13 with Connector-ODBC 5.2.5 as well as PostgreSQL 9.1.5 with PostgreSQL ODBC Driver v09.02.0100-1. The RNLobby services will automatically detect which database is being used for their SQL queries.
For MySQL you will need the database and ODBC connector installs available from http://www.mysql.com/downloads/mysql/5.1.html and http://www.mysql.com/downloads/connector/odbc/
The MySQL GUI tools available from http://www.mysql.com/downloads/workbench/ are also useful.
For PostgreSQL download the software from http://www.postgresql.org/

Web integration

The RNLobby database can be integrated with a web reporting backend. The RLSrvUtility server is designed to be used by any web server side scripting host such as ASP.

GameLobby integration

The GameLobby (RLHub project and source code in the developer premier package) uses a local host TCP socket to communicate user information with other processes.

Thread safety

Most classes in this library use callbacks to exchange information with the user. During these callbacks the component class mutex may be locked and care must be taken to avoid deadlock situations when calling other user defined classes, especially when user defined classes access the same component class from a different thread.

Using RNLobby

RNLobby include files are in the Includes directory "RNLobby/Inc/".
To link follow the instructions at Using ReplicaNet