RakNet::RoomsPlugin Class Reference
[RoomsPlugin]
Used to create rooms for players where they can matchmake A room is similar to the rooms you see in other lobby systems, where groups of players can join together in order to start a game match Each player can be in at most one room Each player name must be unique Each room has one moderator, which can perform operations on the room such as kicking out members This plugin networks the AllGamesRoomsContainer class, which performs the actual functionality.
More...
#include <RoomsPlugin.h>
List of all members.
Detailed Description
Used to create rooms for players where they can matchmake A room is similar to the rooms you see in other lobby systems, where groups of players can join together in order to start a game match Each player can be in at most one room Each player name must be unique Each room has one moderator, which can perform operations on the room such as kicking out members This plugin networks the AllGamesRoomsContainer class, which performs the actual functionality.
To use as a client: 1. Connect to the server and attach the plugin as normal. 2. Call SetServerAddress to tell the system where the server is. 3. Call RoomsPlugin::SetRoomsCallback() with a pointer to a callback structure 4. Fill in the input parameters of the desired structure(s) 5. Call RoomsPlugin::ExecuteFunc with a pointer to the structure. 6. Process the callback, which will contain the original input parameters, plus the new output parameters. All structures contain resultCode, which indicates if the operation was successful (REC_SUCCESS) or not (Anything else)
To use as a server: 1. Start RakNet as usual, accepting connections and attaching the plugin 2. Call RoomsPlugin::SetProfanityFilter() with the ProfanityFilter class, if desired 3. Call RoomsPlugin::AddTitle() for each title (game) you want to support 4. If you want other systems to be able to call RoomsPlugin::LoginRoomsParticipant(), call RoomsPlugin::AddLoginServerAddress() with the addresses of those systems 5. As users go online, call RoomsPlugin::LoginRoomsParticipant(). Login and Logoff is up to you to implement (or rely on other systems, such as Lobby2) 6. As users go offline, call RoomsPlugin::LogoffRoomsParticipant();
- See also:
- AllGamesRoomsContainer
Member Function Documentation
void RoomsPlugin::AddLoginServerAddress |
( |
SystemAddress |
systemAddress |
) |
|
Add a participant to the system Only participants can perform operations
- Parameters:
-
[in] | userName | A unique string identifying the user |
[in] | roomsParticipantAddress | The address of the user |
[in] | loginServerAddress | The server adding this user. Use UNASSIGNED_SYSTEM_ADDRESS for not applicable. Otherwise, the address must previously have been added using AddLoginServerAddress() or the function will fail. |
Removes a participant from the system
- Parameters:
-
[in] | userName | A unique string identifying the user |
[in] | loginServerAddress | The server removing. Use UNASSIGNED_SYSTEM_ADDRESS for not applicable. Otherwise, the address must previously have been added using AddLoginServerAddress() or the function will fail. |
Called when the interface is attached
- Parameters:
-
[in] | peer | the instance of RakPeer that is calling Receive |
Reimplemented from PluginInterface.
Called when a connection is dropped because the user called RakPeer::CloseConnection() for a particular system
- Parameters:
-
[in] | peer | the instance of RakPeer that is calling Receive |
[in] | systemAddress | The system whose connection was closed |
Reimplemented from PluginInterface.
Called when the interface is detached
- Parameters:
-
[in] | peer | the instance of RakPeer that is calling Receive |
Reimplemented from PluginInterface.
OnReceive is called for every packet.
- Parameters:
-
[in] | peer | the instance of RakPeer that is calling Receive |
[in] | packet | the packet that is being returned to the user |
- Returns:
- True to allow the game and other plugins to get this message, false to absorb it
Reimplemented from PluginInterface.
void RoomsPlugin::RemoveLoginServerAddress |
( |
SystemAddress |
systemAddress |
) |
|
void RoomsPlugin::SetProfanityFilter |
( |
ProfanityFilter * |
pf |
) |
|
Sets the profanity filter for the system to use (optional) If set, room names and player handles will be checked for profanity. Room invitations and other messages are not checked.
- Parameters:
-
[in] | pf | An instance of a profanity filter |
void RoomsPlugin::SetServerAddress |
( |
SystemAddress |
systemAddress |
) |
|
Sets the remote server address that is running RoomsPlugin. Send calls will go to this function
- Parameters:
-
[in] | systemAddress | The remote system, which should be connected while calling client functions |
Update is called every time a packet is checked for .
- Parameters:
-
[in] | peer | - the instance of RakPeer that is calling Receive |
Reimplemented from PluginInterface.
Member Data Documentation
Only used on the server. Locally perform any desired functions, such as logging off players Use AllGamesRoomsContainer::AddTitle() to add titles
The documentation for this class was generated from the following files:
- C:/RakNet/DependentExtensions/Lobby2/Rooms/RoomsPlugin.h
- C:/RakNet/DependentExtensions/Lobby2/Rooms/RoomsPlugin.cpp