Lobby Server |
Datbase support friends, rooms, emails, ranking, and more The Lobby Server is split into two classes. LobbyServer itself solely provides networking functionality, calling interfaces to a generic database via virtual functions.LobbyServerPostgreSQL, found at DependentExtensions\Lobby\LobbyServer_PostgreSQL\LobbyServer_PostgreSQL.h is an implementation of LobbyServer that uses PostgreSQL to power the database. The basic class has functions to connect to the database, and create and destroy the basic required tables. The sample found at Samples/LobbyServerTest/LobbyServerTest.cpp, in the project LobbyServer, demonstrates this fairly clearly. One additional requirement is the use of the Functor class. A functor is a class in RakNet that implements a specific unit of functionality that is run asynchronously in a FunctionThread, another utility class that is part of RakNet. For the most part you don't have to care about this - however, there is one functor you do have to care about, which is the one to add new titles (games/applications) to the database. How to do this is illustrated in the sample /// This functor asynchronously adds a title to the database. Full sample in LobbyDB_PostgreSQLTest This adds a title to the database with various properties indicating what types of operations are allowed for this title. See the class declaration AddTitle_Data in DependentExtensions\Lobby\TitleValidationDBSpec.h for a complete explanation of each parameter. Many other functors are available to perform various database operations. The directories found at DependentExtensions/*_PostgreRepository contain these implementations, while DependentExtensions\Lobby\*DBSpec.h contain the data members and documentation for this functionality. Test applications and demos for the various functors can be found in the projects TitleValidationDB_PostgreSQLTest, RankingServerDB_PostgreSQLTest, and LobbyDB_PostgreSQLTest See LobbyServerTest for a console application that will run the LobbyServer. Required files (using PostgreSQL):
Dependencies (using PostgreSQL): PostgreSQL 8.2 or newer, installed at C:\Program Files\PostgreSQL\8.2. Change the project property paths should your installation directory be different. Do not forget to check development tools in the PostgreSQL installer or the headers and libs will not be installed.
|
Lobby Client (PC) |
User interface to the database Quick start:
For a complete list of functions, with documented parameters, see DependentExtensions\Lobby\LobbyClientPC.h. Required files
|
See Also |
|