#include <Lobby2Server.h>
Classes | |
struct | ConfigurationProperties |
Server configuration properties, to customize how the server runs specific commands. More... | |
Public Member Functions | |
virtual bool | ConnectToDB (const char *conninfo, int numWorkerThreads)=0 |
void | SendMessage (Lobby2Message *msg, SystemAddress recipient) |
void | ExecuteCommand (Lobby2ServerCommand *command) |
void | AddAdminAddress (SystemAddress addr) |
bool | IsAdminAddress (SystemAddress addr) |
If AddAdminAddress() was previously called with addr then this returns true. | |
void | RemoveAdminAddress (SystemAddress addr) |
Removes a system address previously added with AddAdminAddress(). | |
void | ClearAdminAddresses (void) |
Removes all system addresses previously added with AddAdminAddress(). | |
void | SetRoomsPlugin (RoomsPlugin *rp) |
void | SetRoomsPluginAddress (SystemAddress address) |
void | SetConfigurationProperties (ConfigurationProperties c) |
Set the desired configuration properties. This is read during runtime from threads. | |
const ConfigurationProperties * | GetConfigurationProperties (void) const |
Get the previously set configuration properties. | |
Protected Member Functions | |
void | Update (void) |
Update is called every time a packet is checked for . | |
PluginReceiveResult | OnReceive (Packet *packet) |
void | OnClosedConnection (SystemAddress systemAddress, RakNetGUID rakNetGUID, PI2_LostConnectionReason lostConnectionReason) |
void | OnShutdown (void) |
Called when RakPeer is shutdown. |
void Lobby2Server::AddAdminAddress | ( | SystemAddress | addr | ) |
If Lobby2Message::RequiresAdmin() returns true, the message can only be processed from a remote system if the sender's system address is first added() This is useful if you want to administrate the server remotely
virtual bool RakNet::Lobby2Server::ConnectToDB | ( | const char * | conninfo, | |
int | numWorkerThreads | |||
) | [pure virtual] |
Connect to the database numWorkerThreads times using the connection string
[in] | conninfo | See the postgre docs |
Implemented in RakNet::Lobby2Server_PGSQL.
void Lobby2Server::ExecuteCommand | ( | Lobby2ServerCommand * | command | ) |
Add a command, which contains a message and other data such as who send the message. The command will be processed according to its implemented virtual functions. Most likely it will be processed in a thread to run database commands
void Lobby2Server::OnClosedConnection | ( | SystemAddress | systemAddress, | |
RakNetGUID | rakNetGUID, | |||
PI2_LostConnectionReason | lostConnectionReason | |||
) | [protected, virtual] |
Called when a connection is dropped because the user called RakPeer::CloseConnection() for a particular system
[in] | systemAddress | The system whose connection was closed |
[in] | rakNetGuid | The guid of the specified system |
[in] | lostConnectionReason | How the connection was closed: manually, connection lost, or notification of disconnection |
Reimplemented from PluginInterface2.
PluginReceiveResult Lobby2Server::OnReceive | ( | Packet * | packet | ) | [protected, virtual] |
OnReceive is called for every packet.
[in] | packet | the packet that is being returned to the user |
Reimplemented from PluginInterface2.
void Lobby2Server::SendMessage | ( | Lobby2Message * | msg, | |
SystemAddress | recipient | |||
) |
Lobby2Message encapsulates a user command, containing both input and output data This will serialize and transmit that command
void Lobby2Server::SetRoomsPlugin | ( | RoomsPlugin * | rp | ) |
The rooms plugin does not automatically handle users logging in and logging off, or renaming users. You can have Lobby2Server manage this for you by calling SetRoomsPlugin() with a pointer to the rooms plugin, if it is on the local system. This will call RoomsPlugin::LoginRoomsParticipant() and RoomsPlugin::LogoffRoomsParticipant() as the messages L2MID_Client_Login and L2MID_Client_Logoff arrive This will use the pointer to RoomsPlugin directly. Setting this will disable SetRoomsPluginAddress()
void Lobby2Server::SetRoomsPluginAddress | ( | SystemAddress | address | ) |
This is similar to SetRoomsPlugin(), except the plugin is on another system. This will set the system address of that system to send the login and logoff commands to. For this function to work, you must first call RoomsPlugin::AddLoginServerAddress() so that RoomsPlugin will accept the incoming login and logoff messages.