#include <RoomsPlugin.h>
Public Member Functions | |
void | SetOrderingChannel (char oc) |
Ordering channel to send messages on. | |
void | SetSendPriority (PacketPriority pp) |
Send priority to send messages on. | |
void | SetRoomsCallback (RoomsCallback *_roomsCallback) |
Set the callback to get notification and ExecuteFunc() results. | |
void | AddRoomsCallback (RoomsCallback *_roomsCallback) |
Add a callback to get notification and ExecuteFunc() results. | |
void | RemoveRoomsCallback (RoomsCallback *_roomsCallback) |
Remove a callback to get notification and ExecuteFunc() results. | |
void | ExecuteFunc (RoomsPluginFunc *func) |
Execute a function, using the system address passed to SetServerAddress();. | |
void | ExecuteFunc (RoomsPluginFunc *func, SystemAddress remoteAddress) |
Execute a function, with a specific address. | |
void | SetServerAddress (SystemAddress systemAddress) |
Sets the remote server address that is running RoomsPlugin. Send calls will go to this function. | |
bool | LoginRoomsParticipant (RakNet::RakString userName, SystemAddress roomsParticipantAddress, RakNetGUID guid, SystemAddress loginServerAddress) |
Add a participant to the system. | |
bool | LogoffRoomsParticipant (RakNet::RakString userName, SystemAddress loginServerAddress) |
Removes a participant from the system. | |
void | ClearRoomMembers () |
Clear all users. | |
void | ChangeHandle (RakNet::RakString oldHandle, RakNet::RakString newHandle) |
Change the handle a user. | |
void | AddLoginServerAddress (SystemAddress systemAddress) |
Add a SystemAddress to a list that will be checked when LoginRoomsParticipant() and LogoffRoomsParticipant() is called. | |
void | RemoveLoginServerAddress (SystemAddress systemAddress) |
Remove a SystemAddress from a list that will be checked when LoginRoomsParticipant() and LogoffRoomsParticipant() is called. | |
void | ClearLoginServerAdddresses (void) |
Remove all addresses added with AddLoginServerAddress(). | |
void | SetProfanityFilter (ProfanityFilter *pf) |
Sets the profanity filter for the system to use (optional). | |
virtual void | OnDetach (void) |
Called when the interface is detached. | |
virtual void | Update (void) |
Update is called every time a packet is checked for . | |
virtual PluginReceiveResult | OnReceive (Packet *packet) |
virtual void | OnClosedConnection (const SystemAddress &systemAddress, RakNetGUID rakNetGUID, PI2_LostConnectionReason lostConnectionReason) |
Static Public Member Functions | |
static void | SerializeLogin (RakNet::RakString userName, SystemAddress userAddress, RakNetGUID guid, RakNet::BitStream *bs) |
Used for Lobby2. Serializes the same data that the plugin itself uses to login. | |
static void | SerializeLogoff (RakNet::RakString userName, RakNet::BitStream *bs) |
Used for Lobby2. Serializes the same data that the plugin itself uses to logoff. | |
static void | SerializeChangeHandle (RakNet::RakString oldHandle, RakNet::RakString newHandle, RakNet::BitStream *bs) |
Used for Lobby2. Serializes the same data that the plugin itself uses to change handles. | |
Public Attributes | |
AllGamesRoomsContainer | roomsContainer |
Only used on the server. Locally perform any desired functions, such as logging off players. |
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:
void RakNet::RoomsPlugin::AddLoginServerAddress | ( | SystemAddress | systemAddress | ) |
Add a SystemAddress to a list that will be checked when LoginRoomsParticipant() and LogoffRoomsParticipant() is called.
[in] | systemAddress | The address to add |
void RakNet::RoomsPlugin::AddRoomsCallback | ( | RoomsCallback * | _roomsCallback | ) |
Add a callback to get notification and ExecuteFunc() results.
[in] | _roomsCallback | Class instance to get callbacks on. Should remain a valid pointer for the duration of the plugin execution. |
void RakNet::RoomsPlugin::ChangeHandle | ( | RakNet::RakString | oldHandle, | |
RakNet::RakString | newHandle | |||
) |
Change the handle a user.
[in] | oldHandle | The handle previously known by the system |
[in] | newHandle | The new handle to use |
void RakNet::RoomsPlugin::ExecuteFunc | ( | RoomsPluginFunc * | func, | |
SystemAddress | remoteAddress | |||
) |
Execute a function, with a specific address.
[in] | func | Pointer to a base class of RoomsPluginFunc to execute |
[in] | remoteAddress | Address to send the command to. The remote system should also be running RoomsPlugin |
void RakNet::RoomsPlugin::ExecuteFunc | ( | RoomsPluginFunc * | func | ) |
Execute a function, using the system address passed to SetServerAddress();.
[in] | func | Pointer to a base class of RoomsPluginFunc to execute |
bool RakNet::RoomsPlugin::LoginRoomsParticipant | ( | RakNet::RakString | userName, | |
SystemAddress | roomsParticipantAddress, | |||
RakNetGUID | guid, | |||
SystemAddress | loginServerAddress | |||
) |
Add a participant to the system.
Only participants can perform operations
[in] | userName | A unique string identifying the user |
[in] | roomsParticipantAddress | The address of the user |
[in] | guid | The guid of the user |
[in] | loginServerAddress | The server adding this user. Use RakNet::UNASSIGNED_SYSTEM_ADDRESS for not applicable. Otherwise, the address must previously have been added using AddLoginServerAddress() or the function will fail. |
bool RakNet::RoomsPlugin::LogoffRoomsParticipant | ( | RakNet::RakString | userName, | |
SystemAddress | loginServerAddress | |||
) |
Removes a participant from the system.
[in] | userName | A unique string identifying the user |
[in] | loginServerAddress | The server removing. Use RakNet::UNASSIGNED_SYSTEM_ADDRESS for not applicable. Otherwise, the address must previously have been added using AddLoginServerAddress() or the function will fail. |
virtual void RakNet::RoomsPlugin::OnClosedConnection | ( | const SystemAddress & | systemAddress, | |
RakNetGUID | rakNetGUID, | |||
PI2_LostConnectionReason | lostConnectionReason | |||
) | [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 RakNet::PluginInterface2.
virtual PluginReceiveResult RakNet::RoomsPlugin::OnReceive | ( | Packet * | packet | ) | [virtual] |
OnReceive is called for every packet.
[in] | packet | the packet that is being returned to the user |
Reimplemented from RakNet::PluginInterface2.
void RakNet::RoomsPlugin::RemoveLoginServerAddress | ( | SystemAddress | systemAddress | ) |
Remove a SystemAddress from a list that will be checked when LoginRoomsParticipant() and LogoffRoomsParticipant() is called.
[in] | systemAddress | The address to remove |
void RakNet::RoomsPlugin::RemoveRoomsCallback | ( | RoomsCallback * | _roomsCallback | ) |
Remove a callback to get notification and ExecuteFunc() results.
[in] | _roomsCallback | Class instance to no longer get callbacks on. |
void RakNet::RoomsPlugin::SetOrderingChannel | ( | char | oc | ) |
Ordering channel to send messages on.
[in] | oc | The ordering channel |
void RakNet::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.
[in] | pf | An instance of a profanity filter |
void RakNet::RoomsPlugin::SetRoomsCallback | ( | RoomsCallback * | _roomsCallback | ) |
Set the callback to get notification and ExecuteFunc() results.
[in] | _roomsCallback | Class instance to get callbacks on. Should remain a valid pointer for the duration of the plugin execution. |
void RakNet::RoomsPlugin::SetSendPriority | ( | PacketPriority | pp | ) |
Send priority to send messages on.
[in] | pp | The packet priority |
void RakNet::RoomsPlugin::SetServerAddress | ( | SystemAddress | systemAddress | ) |
Sets the remote server address that is running RoomsPlugin. Send calls will go to this function.
[in] | systemAddress | The remote system, which should be connected while calling client functions |
AllGamesRoomsContainer RakNet::RoomsPlugin::roomsContainer |
Only used on the server. Locally perform any desired functions, such as logging off players.