# RakNet::LobbyClientPC Class Reference
[PluginInterface]

PC specific client side code to the lobby system Attach class as a plugin to RakNet as usual. Connect to the lobby server (as usual). Then use provided functions for specific functionality. More...

`#include <LobbyClientPC.h>`

Inheritance diagram for RakNet::LobbyClientPC:

List of all members.

## Public Member Functions
virtual void | Login (const char *userHandle, const char *userPassword, SystemAddress lobbyServerAddr)
virtual void | SetTitleLoginId (const char *_titleIdStr, const char *_titleLoginPW, int _titleLoginPWLength)
virtual void | Logoff (void)
virtual bool | IsConnected (void) const
virtual void | RegisterAccount (LobbyDBSpec::CreateUser_Data *input, SystemAddress lobbyServerAddr)
virtual void | UpdateAccount (LobbyDBSpec::UpdateUser_Data *input)
virtual void | ChangeHandle (const char *newHandle)
virtual LobbyUserStatus | GetLobbyUserStatus (void) const
virtual void | RetrievePasswordRecoveryQuestion (const char *userHandle, SystemAddress lobbyServerAddr)
virtual void | RetrievePassword (const char *userHandle, const char *passwordRecoveryAnswer, SystemAddress lobbyServerAddr)
virtual void | DownloadFriends (bool ascendingSortByDate)
virtual void | SendAddFriendInvite (const char *friendHandle, LobbyClientUserId *friendId, const char *messageBody, unsigned char language)
virtual void | AcceptAddFriendInvite (const char *friendHandle, LobbyClientUserId *friendId, const char *messageBody, unsigned char language)
virtual void | DeclineAddFriendInvite (const char *friendHandle, LobbyClientUserId *friendId, const char *messageBody, unsigned char language)
virtual const DataStructures::List < LC_Friend * > & | GetFriendsList (void) const
virtual bool | IsFriend (const char *friendHandle)
virtual bool | IsFriend (LobbyClientUserId *friendId)
virtual void | DownloadIgnoreList (bool ascendingSort)
virtual void | AddToOrUpdateIgnoreList (const char *userHandle, LobbyClientUserId *userId, const char *actionsStr)
virtual void | RemoveFromIgnoreList (LobbyClientUserId *userId)
virtual const DataStructures::List < LC_Ignored * > & | GetIgnoreList (void) const
virtual void | DownloadEmails (bool ascendingSort, bool inbox, unsigned char language)
virtual void | SendEmail (LobbyDBSpec::SendEmail_Data *input, unsigned char language)
virtual void | DeleteEmail (EmailId *emailId)
virtual void | UpdateEmailStatus (EmailId *emailId, int newStatus, bool wasOpened)
virtual const DataStructures::List < LobbyDBSpec::SendEmail_Data * > & | GetInboxEmailList (void) const
virtual const DataStructures::List < LobbyDBSpec::SendEmail_Data * > & | GetSentEmailList (void) const
virtual void | SendIM (const char *userHandle, LobbyClientUserId *userId, const char *chatMessage, unsigned char languageId, const char *chatBinaryData, int chatBinaryLength)
bool | IsInRoom (void) const
virtual void | CreateRoom (const char *roomName, const char *roomPassword, bool roomIsHidden, int publicSlots, int privateSlots, bool allowSpectators, DataStructures::Table *customProperties)
virtual void | DownloadRooms (DataStructures::Table::FilterQuery *inclusionFilters, unsigned numInclusionFilters)
virtual DataStructures::Table * | GetAllRooms (void)
virtual bool | IsDownloadingRoomList (void)
virtual void | LeaveRoom (void)
virtual const DataStructures::List < LobbyClientUserId * > & | GetAllRoomMembers (void) const
virtual const DataStructures::List < LobbyClientUserId * > & | GetOpenSlotMembers (void) const
virtual const DataStructures::List < LobbyClientUserId * > & | GetReservedSlotMembers (void) const
virtual const DataStructures::List < LobbyClientUserId * > & | GetSpectators (void) const
virtual LobbyClientUserId * | GetRoomModerator (void)
virtual LobbyClientRoomId * | GetRoomId (void)
virtual unsigned int | GetPublicSlotMaxCount (void) const
virtual unsigned int | GetPrivateSlotMaxCount (void) const
virtual LobbyClientTitleId * | GetTitleId (void) const
virtual const char * | GetRoomName (void) const
virtual const char * | GetTitleName (void) const
virtual bool | RoomIsHidden (void) const
virtual DataStructures::Table::Row * | GetRoomTableRow (void) const
virtual void | JoinRoom (LobbyClientRoomId *roomId, const char *roomName, const char *roomPassword, bool joinAsSpectator)
virtual void | JoinRoomByFilter (DataStructures::Table::FilterQuery *inclusionFilters, unsigned numInclusionFilters, bool joinAsSpectator)
virtual void | RoomChat (const char *chatMessage, unsigned char languageId, const char *chatBinaryData, int chatBinaryLength)
virtual bool | IsInReservedSlot (LobbyClientUserId *userId)
virtual bool | IsRoomModerator (LobbyClientUserId *userId)
virtual bool | IsUserInRoom (LobbyClientUserId *userId) const
virtual bool | RoomAllowsSpectators (void) const
virtual void | InviteToRoom (const char *userHandle, LobbyClientUserId *userId, const char *chatMessage, unsigned char languageId, const char *chatBinaryData, int chatBinaryLength, bool inviteToPrivateSlot)
virtual void | SetReadyToPlayStatus (bool isReady)
virtual void | KickRoomMember (LobbyClientUserId *userId)
virtual void | SetRoomIsHidden (bool roomIsHidden)
virtual void | SetRoomAllowSpectators (bool spectatorsOn)
virtual void | ChangeNumSlots (int totalSlots, int privateSlots)
virtual void | GrantModerator (LobbyClientUserId *userId)
virtual void | StartGame (void)
virtual void | SubmitMatch (RankingServerDBSpec::SubmitMatch_Data *input)
virtual void | DownloadRating (RankingServerDBSpec::GetRatingForParticipant_Data *input)
virtual RankingServerDBSpec::GetRatingForParticipant_Data * | GetRating (void)
virtual bool | IsWaitingOnQuickMatch (void)
virtual void | QuickMatch (int requiredPlayers, int timeoutInSeconds)
virtual void | CancelQuickMatch (void)
virtual void | DownloadActionHistory (bool ascendingSort)
virtual void | AddToActionHistory (LobbyDBSpec::AddToActionHistory_Data *input)
virtual const DataStructures::List < LobbyDBSpec::AddToActionHistory_Data * > & | GetActionHistoryList (void) const
virtual const DataStructures::List < LobbyUserClientDetails * > & | GetRecentlyMetUsersList (void) const
| Users recently played against.
virtual bool | GetUserDetails (LobbyClientUserId *userId, LobbyUserClientDetails *details)
virtual LobbyClientUserId * | GerUserIdFromName (const char *name)
virtual LobbyClientUserId * | GetMyId (void)
| Get my own ID.
virtual bool | EqualIDs (const LobbyClientUserId *userId1, const LobbyClientUserId *userId2)
| Are two IDs equal? For the PC this is not necessary to call, as LobbyClientUserId is an unsigned integer.
virtual void | SetCallbackInterface (LobbyClientInterfaceCB *cbi)
| Sets the class to get callbacks.
void | SetOrderingChannel (char oc)
| Ordering channel to use with RakPeer::Send().
void | SetSendPriority (PacketPriority pp)
| Send priority to use with RakPeer::Send().
## Protected Member Functions
void | OnAttach (RakPeerInterface *peer)
PluginReceiveResult | OnReceive (RakPeerInterface *peer, Packet *packet)
void | OnCloseConnection (RakPeerInterface *peer, SystemAddress systemAddress)
void | OnShutdown (RakPeerInterface *peer)

## Detailed Description

PC specific client side code to the lobby system Attach class as a plugin to RakNet as usual. Connect to the lobby server (as usual). Then use provided functions for specific functionality.

LobbyClient plugin for the PC

Note:
  Most function calls are asynchronous so use a callback to get the result. This callback is set with LobbyClientPC::SetCallbackInterface()

See also:
  LobbyServer

  LobbyServerPostgreSQL

## Member Function Documentation

void LobbyClientPC::AcceptAddFriendInvite | ( | const char * | friendHandle,
|  | LobbyClientUserId * | friendId,
|  | const char * | messageBody,
|  | unsigned char | language |
| ) |  |  | `[virtual]`

Accept a friend invite that you were notified of with LobbyClientInterfaceCB::FriendInvitation_Notify()

Parameters:

  `[in]` | friendHandle | Handle of potential friend, use if you don't have the Id, but less efficient
  `[in]` | friendId | ID of the potential friend, found at FriendInvitation_Notification::invitor
  `[in]` | messageBody | Optional message to reply with.
  `[in]` | language | Language to use for string encoding for the StringCompressor class. Use 0 if unsure.

Precondition:
  Must be logged in.

See also:
  StringCompressor

  LobbyClientInterfaceCB::AcceptAddFriendInvite_Result()

  LobbyClientInterfaceCB::FriendInvitation_Notify()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::AddToActionHistory | ( | LobbyDBSpec::AddToActionHistory_Data * | input | ) | `[virtual]`

Adds to the history of actions for yourself For security, defaultAllowClientsUploadActionHistory must be true in the titles table OR Your IP must be in the trustedIpList table

Parameters:

  `[in]` | input | Data corresponding to the action. See LobbyDBSpec.h for all parameters.

See also:
  LobbyClientInterfaceCB::AddToActionHistory_Result()

  GetActionHistoryList()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::AddToOrUpdateIgnoreList | ( | const char * | userHandle,
|  | LobbyClientUserId * | userId,
|  | const char * | actionsStr |
| ) |  |  | `[virtual]`

Add / update a user on the ignore list. If this user is not currently on the ignore list, they will be added. If this user IS currently on the ignore list, LC_Ignored::actionString will be updated.

Parameters:

  `[in]` | userHandle | Handle of the user on which to perform this action. If you know userId leave this at 0.
  `[in]` | userId | ID of the user on which to perform this action. Lookup is faster using ID. If you don't know it, specify userHandle instead.
  `[in]` | actionsStr | Arbitrary, user-defined string to store any extra data you wish (such as reason for the ignore)

Precondition:
  Must be logged in.

See also:
  LobbyClientInterfaceCB::AddToOrUpdateIgnoreList_Result()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::CancelQuickMatch | ( | void |  | ) | `[virtual]`

Cancel a prior call to QuickMatch() assuming timeoutInSeconds did not yet elapse.

See also:
  LobbyClientInterfaceCB::CancelQuickMatch_Result()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::ChangeHandle | ( | const char * | newHandle | ) | `[virtual]`

Change the handle associated with your user. Handle must be unique and not in the disallowedHandles table

Note:
  This may be disabled in the database TitleValidationDBSpec::AddTitle_Data::defaultAllowUpdateHandle

Precondition:
  Must be logged in

See also:
  LobbyClientInterfaceCB::ChangeHandle_Result()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::ChangeNumSlots | ( | int | totalSlots,
|  | int | privateSlots |
| ) |  |  | `[virtual]`

Changes the number of total and private slots for the room Other room members will get the callback RoomChangeNumSlots_Notify()

See also:
  LobbyClientInterfaceCB::ChangeNumSlots_Result()

  RoomChangeNumSlots_Notify

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::CreateRoom | ( | const char * | roomName,
|  | const char * | roomPassword,
|  | bool | roomIsHidden,
|  | int | publicSlots,
|  | int | privateSlots,
|  | bool | allowSpectators,
|  | DataStructures::Table * | customProperties |
| ) |  |  | `[virtual]`

Creates a room

Parameters:

  `[in]` | roomName | Name of the room (required)
  `[in]` | roomPassword | Password for the room (optional)
  `[in]` | roomIsHidden | Sets the DefaultTableColumns::TC_ROOM_HIDDEN column to true or false in the rooms table.
  `[in]` | publicSlots | Number of slots that anyone can join by calling DownloadRooms() to view your room, followed by JoinRoom() to join it.
  `[in]` | privateSlots | Number of slots that users can only join if they previously were invited by the current moderator with InviteToRoom(). Those users will join a public slot if all private slots are full when they join the room.
  `[in]` | allowSpectators | True to allow spectators. Spectators are normal room members, but there is (currently) no limit on the number of spectators.
  `[in]` | customProperties | A table with named columns and one row of properties to add to the server rooms table. Column names must not already be in defaultTableColumns in LobbyTypes.cpp

Precondition:
  You are in the lobby (the normal state after logging on)

  At least one prior successful call to SetTitleLoginId() to indicate what game to start. SetTitleLoginId() can be called multiple times to change games if desired.

See also:
  LobbyClientInterfaceCB::CreateRoom_Result()

  LobbyClientInterfaceCB::RoomDestroyed_Notify

  LobbyClientInterfaceCB::RoomMemberDrop_Notify

  LobbyClientInterfaceCB::RoomMemberJoin_Notify

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::DeclineAddFriendInvite | ( | const char * | friendHandle,
|  | LobbyClientUserId * | friendId,
|  | const char * | messageBody,
|  | unsigned char | language |
| ) |  |  | `[virtual]`

Decline a friend invite that you were notified of with LobbyClientInterfaceCB::FriendInvitation_Notify()

Parameters:

  `[in]` | friendHandle | Handle of the guy asking to be a friend, use if you don't have the Id, but less efficient
  `[in]` | friendId | ID of the guy asking to be a friend, found at FriendInvitation_Notification::invitor
  `[in]` | messageBody | Optional message to reply with.
  `[in]` | language | Language to use for string encoding for the StringCompressor class. Use 0 if unsure.

Precondition:
  Must be logged in.

See also:
  StringCompressor

  LobbyClientInterfaceCB::DeclineAddFriendInvite_Result()

  LobbyClientInterfaceCB::FriendInvitation_Notify()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::DeleteEmail | ( | EmailId * | emailId | ) | `[virtual]`

Deletes an email, from either your inbox or sent emails list.

Parameters:

  `[in]` | emailId | Found at LobbyDBSpec::SendEmail_Data::emailMessageID

Precondition:
  Must be logged in.

See also:
  GetInboxEmailList()

  GetSentEmailList()

  LobbyClientInterfaceCB::DeleteEmail_Result()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::DownloadActionHistory | ( | bool | ascendingSort | ) | `[virtual]`

Downloads the action history for yourself

Parameters:

  `[in]` | ascendingSort | Sort order, by upload date

See also:
  LobbyClientInterfaceCB::DownloadActionHistory_Result()

  GetActionHistoryList()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::DownloadEmails | ( | bool | ascendingSort,
|  | bool | inbox,
|  | unsigned char | language |
| ) |  |  | `[virtual]`

Downloads emails on the server. Currently (this may change) emails are purely intra-database, so the name is a bit misleading. A better name would be peristent database message.

Parameters:

  `[in]` | ascendingSort | Which direction to sort the resulting downloaded list, by creation date
  `[in]` | inbox | true to download mails sent to you. false to download mails that you have sent.
  `[in]` | language | Language to use for string encoding for the StringCompressor class. Use 0 if unsure.

Precondition:
  Must be logged in.

See also:
  LobbyClientInterfaceCB::DownloadEmails_Result()

  GetInboxEmailList()

  GetSentEmailList()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::DownloadFriends | ( | bool | ascendingSortByDate | ) | `[virtual]`

Downloads your friends from the database, and stores the list internally Results are contained in the LC_Friend structure. Friends do not have to be online, and you will get LobbyClientInterfaceCB::FriendStatus_Notify() indicating when your friends go online and offline.

Note:
  You will not get any friends information or notifications until calling DownloadFriends()

Parameters:

  `[in]` | ascendingSortByDate | Sort result by date, ascending or descending

Precondition:
  Must be logged in.

See also:
  GetFriendsList();

  LobbyClientInterfaceCB::DownloadFriends_Result()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::DownloadIgnoreList | ( | bool | ascendingSort | ) | `[virtual]`

Adds a user to the ignore list, stored in the database as well Will block room chat, room invites, and instant messages Does not currently block user from joining your room, but this may change depending on user requests

Parameters:

  `[in]` | ascendingSort | Which direction to sort the ignore list, sorted on date

Precondition:
  Must be logged in.

See also:
  LobbyClientInterfaceCB::DownloadIgnoreList_Result()

  GetIgnoreList()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::DownloadRating | ( | RankingServerDBSpec::GetRatingForParticipant_Data * | input | ) | `[virtual]`

Downloads the rating for a particular user

Parameters:

  `[in]` | input | Which user you are referring to. See RankingServerDBSpec.h for all parameters.

See also:
  LobbyClientInterfaceCB::DownloadRating_Result()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::DownloadRooms | ( | DataStructures::Table::FilterQuery * | inclusionFilters,
|  | unsigned | numInclusionFilters |
| ) |  |  | `[virtual]`

Downloads rooms, possibly based on filters

Parameters:

  `[in]` | inclusionFilters | Filters to apply to the search query. Use 0 to get all rooms.
  `[in]` | numInclusionFilters | Number of structures in the inclusionFilters array

Precondition:
  Must be logged in.

Note:
  In order to honor hidden rooms, you should set the DefaultTableColumns::TC_ROOM_HIDDEN column. Use GetAllRooms() to access the downloaded room list.

Example of setting DefaultTableColumns::TC_ROOM_HIDDEN to false, to not find hidden rooms

DataStructures::Table::FilterQuery inclusionFilters[1]; DataStructures::Table::Cell filterCells[1]; filterCells[0].Set(0); // 0 = integer value false inclusionFilters[0].cellValue=&filterCells[0]; inclusionFilters[0].columnIndex=DefaultTableColumnsTC_ROOM_HIDDEN; inclusionFilters[0].operation=DataStructuresTable::QF_EQUAL; lobbyClient.DownloadRooms(inclusionFilters, 1);

See also:
  LobbyClientInterfaceCB::DownloadRooms_Result()

Implements RakNet::LobbyClientInterface.

LobbyClientUserId * LobbyClientPC::GerUserIdFromName | ( | const char * | name | ) | `[virtual]`

Given the name of a user, return the id

Note:
  To get the name of a user given an id, use GetUserDetails()

Implements RakNet::LobbyClientInterface.

const DataStructures::List< LobbyDBSpec::AddToActionHistory_Data * > & LobbyClientPC::GetActionHistoryList | ( | void |  | ) | const`[virtual]`

Returns the results of a previous successful call to AddToActionHistory where AddToActionHistory_Result() returned success

Returns:
  The action history for your user

See also:
  DownloadActionHistory()

Implements RakNet::LobbyClientInterface.

const DataStructures::List< LobbyClientUserId * > & LobbyClientPC::GetAllRoomMembers | ( | void |  | ) | const`[virtual]`

Gets a list of pointers to room member identifiers. Use GetUserDetails() to get more information about each user. Pointers are valid until next call to this same function

Returns:
  All members in the room

Implements RakNet::LobbyClientInterface.

DataStructures::Table * LobbyClientPC::GetAllRooms | ( | void |  | ) | `[virtual]`

Returns a table of all downloaded rooms, since the last time DownloadRooms() was called. This list is reset to only your own room if you create a room. Pointers are guaranteed to remain valid until the next call to RakPeer::Receive()

Returns:
  Table of downloaded rooms

Implements RakNet::LobbyClientInterface.

const DataStructures::List< LC_Friend * > & LobbyClientPC::GetFriendsList | ( | void |  | ) | const`[virtual]`

Get the downloaded friends list. Pointers are guaranteed to remain valid until the next call to RakPeer::Receive()

Precondition:
  Must be logged in.

  Successful call to DownloadFriends

Returns:
  List of structures containing information about each friend. Cleared on logoff.

See also:
  LC_Friend

Implements RakNet::LobbyClientInterface.

const DataStructures::List< LC_Ignored * > & LobbyClientPC::GetIgnoreList | ( | void |  | ) | const`[virtual]`

Returns the internally stored list of ignored users. Pointers are guaranteed to remain valid until the next call to RakPeer::Receive()

Returns:
  List of structures containing information about each ignored users. Cleared on logoff.

Implements RakNet::LobbyClientInterface.

const DataStructures::List< LobbyDBSpec::SendEmail_Data * > & LobbyClientPC::GetInboxEmailList | ( | void |  | ) | const`[virtual]`

Gets emails downloaded with DownloadEmails(), for the inbox. Pointers are guaranteed to remain valid until the next call to RakPeer::Receive()

Note:
  It takes two calls to get all emails, one call to DownloadEmails only gets the inbox or sent list.

Precondition:
  Must be logged in.

Returns:
  The email

Implements RakNet::LobbyClientInterface.

LobbyUserStatus LobbyClientPC::GetLobbyUserStatus | ( | void |  | ) | const`[virtual]`

Returns the current action you are performing, if any.

Returns:
  Your action

Implements RakNet::LobbyClientInterface.

const DataStructures::List< LobbyClientUserId * > & LobbyClientPC::GetOpenSlotMembers | ( | void |  | ) | const`[virtual]`

Gets a list of pointers to room member identifiers. Use GetUserDetails() to get more information about each user. Pointers are valid until next call to this same function

Returns:
  All members occupying open slots

Implements RakNet::LobbyClientInterface.

unsigned int LobbyClientPC::GetPrivateSlotMaxCount | ( | void |  | ) | const`[virtual]`

Get number of private slots that can be filled.

Note:
  This may be lower than the actual number of members in the room if ChangeNumSlots() is called.

Implements RakNet::LobbyClientInterface.

unsigned int LobbyClientPC::GetPublicSlotMaxCount | ( | void |  | ) | const`[virtual]`

Get number of public slots that can be filled.

Note:
  This may be lower than the actual number of members in the room if ChangeNumSlots() is called.

Implements RakNet::LobbyClientInterface.

RankingServerDBSpec::GetRatingForParticipant_Data * LobbyClientPC::GetRating | ( | void |  | ) | `[virtual]`

Returns the rating that was most recently downloaded

Returns:
  A pointing to the rating structure

Implements RakNet::LobbyClientInterface.

const DataStructures::List< LobbyClientUserId * > & LobbyClientPC::GetReservedSlotMembers | ( | void |  | ) | const`[virtual]`

Gets a list of pointers to room member identifiers. Use GetUserDetails() to get more information about each user. Pointers are valid until next call to this same function

Returns:
  All members occupying reserved slots

Implements RakNet::LobbyClientInterface.

LobbyClientRoomId * LobbyClientPC::GetRoomId | ( | void |  | ) | `[virtual]`

Get ID of this room, used in some other functions Pointers are guaranteed to remain valid until the next call to RakPeer::Receive()

Returns:
  room id

Implements RakNet::LobbyClientInterface.

LobbyClientUserId * LobbyClientPC::GetRoomModerator | ( | void |  | ) | `[virtual]`

Get identifier of the moderator of this room The moderator will be one of the members in a public or priate slot Pointers are guaranteed to remain valid until the next call to RakPeer::Receive()

Returns:
  moderator id

Implements RakNet::LobbyClientInterface.

const char * LobbyClientPC::GetRoomName | ( | void |  | ) | const`[virtual]`

Returns:
  The name of the room we are currently in, or 0 if none.

Implements RakNet::LobbyClientInterface.

DataStructures::Table::Row * LobbyClientPC::GetRoomTableRow | ( | void |  | ) | const`[virtual]`

Convenience function. Calls GetAllRooms(), returning the row of the room that we are currently in This is necessary to access customProperties passed to CreateRoom()

Implements RakNet::LobbyClientInterface.

const DataStructures::List< LobbyDBSpec::SendEmail_Data * > & LobbyClientPC::GetSentEmailList | ( | void |  | ) | const`[virtual]`

Gets emails downloaded with DownloadEmails(), for sent emails. Pointers are guaranteed to remain valid until the next call to RakPeer::Receive()

Note:
  It takes two calls to get all emails, one call to DownloadEmails only gets the inbox or sent list.

Precondition:
  Must be logged in.

Returns:
  The email

Implements RakNet::LobbyClientInterface.

const DataStructures::List< LobbyClientUserId * > & LobbyClientPC::GetSpectators | ( | void |  | ) | const`[virtual]`

Gets a list of pointers to room member identifiers. Use GetUserDetails() to get more information about each user. Pointers are valid until next call to this same function

Returns:
  All spectators in the room

Implements RakNet::LobbyClientInterface.

LobbyClientTitleId * LobbyClientPC::GetTitleId | ( | void |  | ) | const`[virtual]`

Get unique identifier of the title (game). On the PC this corresponds to the database primary key.

Returns:
  title id

Implements RakNet::LobbyClientInterface.

const char * LobbyClientPC::GetTitleName | ( | void |  | ) | const`[virtual]`

Returns:
  The name of the game we are currently in, or 0 if none. Specified in the titles table as titleName

Implements RakNet::LobbyClientInterface.

bool LobbyClientPC::GetUserDetails | ( | LobbyClientUserId * | userId,
|  | LobbyUserClientDetails * | details |
| ) |  |  | `[virtual]`

Lookup extra details on a user specified by id Currently only users in your current room are downloaded.

Note:
  Only "safe" details are downloaded for other users. If you pass your own Id (GetMyId()) all fields are fully filled out.

Returns:
  True if the lookup succeeded

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::GrantModerator | ( | LobbyClientUserId * | userId | ) | `[virtual]`

Grants moderator to another room member. This room member cannot be a spectator. Changing moderators clears current private slot invitations Other room members will get the callback RoomNewModerator_Notify()

See also:
  LobbyClientInterfaceCB::GrantModerator_Result()

  LobbyClientInterfaceCB::RoomNewModerator_Notify

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::InviteToRoom | ( | const char * | userHandle,
|  | LobbyClientUserId * | userId,
|  | const char * | chatMessage,
|  | unsigned char | languageId,
|  | const char * | chatBinaryData,
|  | int | chatBinaryLength,
|  | bool | inviteToPrivateSlot |
| ) |  |  | `[virtual]`

Invite someone to join your room Invited users will join private slots if they exist, public slots if they do not or if the private slots are full Invitations are linked to the current moderator, so if the moderator leaves or changes via GrantModerator(), those invites are cleared.

Parameters:

  `[in]` | userHandle | Handle of the user on which to perform this action. If you know userId leave this at 0.
  `[in]` | userId | ID of the user on which to perform this action. Lookup is faster using ID. If you don't know it, specify userHandle instead.
  `[in]` | chatMessage | Body of the message to send
  `[in]` | languageId | Language to use for string encoding for the StringCompressor class. Use 0 if unsure.
  `[in]` | chatBinaryData | Any binary data you wish to send with the message (custom encoding, images, etc)
  `[in]` | chatBinaryLength | Length in bytes of chatBinaryData
  `[in]` | Invite | this member to an private slot. (If false, they will be under the same restrictions as normal members attempting to join the room).

Precondition:
  Must be currently in a room

See also:
  LobbyClientInterfaceCB::InviteToRoom_Result()

Implements RakNet::LobbyClientInterface.

bool LobbyClientPC::IsConnected | ( | void |  | ) | const`[virtual]`

Are we connected to the Lobby server?

Returns:
  true if connected, false otherwise.

See also:
  Login()

bool LobbyClientPC::IsDownloadingRoomList | ( | void |  | ) | `[virtual]`

Are we currently waiting for DownloadRooms() to finish?

Returns:
  true if DownloadRooms() is in progress. When complete, we will get the LobbyClientInterfaceCB::DownloadRooms_Result() callback.

Implements RakNet::LobbyClientInterface.

bool LobbyClientPC::IsFriend | ( | LobbyClientUserId * | friendId | ) | `[virtual]`

Is this user a friend?

Precondition:
  Must have downloaded the friends list, or will always be false

Parameters:

  `[in]` | friendId | ID of the friend

Returns:
  True if this user is a friend, false if not, or unknown

Implements RakNet::LobbyClientInterface.

bool LobbyClientPC::IsFriend | ( | const char * | friendHandle | ) | `[virtual]`

Is this user a friend?

Precondition:
  Must have downloaded the friends list, or will always be false

Parameters:

  `[in]` | friendHandle | Handle of the friend

Returns:
  True if this user is a friend, false if not, or unknown

Implements RakNet::LobbyClientInterface.

bool LobbyClientPC::IsInReservedSlot | ( | LobbyClientUserId * | userId | ) | `[virtual]`

Returns:
  If the specified userId is in a reserved slot in the room.

Implements RakNet::LobbyClientInterface.

bool LobbyClientPC::IsInRoom | ( | void |  | ) | const`[virtual]`

Returns if we are in a room or not.

Returns:
  True if we are in a room. False for any other state.

Implements RakNet::LobbyClientInterface.

bool LobbyClientPC::IsRoomModerator | ( | LobbyClientUserId * | userId | ) | `[virtual]`

Returns:
  If the specified userId is the moderator of the room

Implements RakNet::LobbyClientInterface.

bool LobbyClientPC::IsUserInRoom | ( | LobbyClientUserId * | userId | ) | const`[virtual]`

Returns:
  If the specified userId is in the room, in any capacity

Implements RakNet::LobbyClientInterface.

bool LobbyClientPC::IsWaitingOnQuickMatch | ( | void |  | ) | `[virtual]`

Returns:
  True if we called QuickMatch(), the game did not yet start, and QuickMatch::timeoutInSeconds did not yet elapsed

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::JoinRoom | ( | LobbyClientRoomId * | roomId,
|  | const char * | roomName,
|  | const char * | roomPassword,
|  | bool | joinAsSpectator |
| ) |  |  | `[virtual]`

Join an existing room

Parameters:

  `[in]` | roomId | Identifier of the room. Get this by calling DownloadRooms(). It is also specified with room invitation requests in the roomId member of LobbyClientInterfaceCB::RoomInvite_Notify
  `[in]` | roomName | Name identifier of the room. Can specify this or the roomId
  `[in]` | roomPassword | Password used to enter the room. If the room does not have a password, this field is ignored.
  `[in]` | joinAsSpectator | Spectators do not typically play in the room. There is currently no limit on the number of spectators that can be in a room

Precondition:
  Must be currently in a room

See also:
  LobbyClientInterfaceCB::JoinRoom_Result()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::JoinRoomByFilter | ( | DataStructures::Table::FilterQuery * | inclusionFilters,
|  | unsigned | numInclusionFilters,
|  | bool | joinAsSpectator |
| ) |  |  | `[virtual]`

Joins the first available room based on a search filter. The room must not have a password and if joinAsSpectator==false, must have an available open slot

Parameters:

  `[in]` | inclusionFilters | Filters to apply to the search query. Use 0 to get all rooms.
  `[in]` | numInclusionFilters | Number of structures in the inclusionFilters array
  `[in]` | joinAsSpectator | Spectators do not typically play in the room. There is currently no limit on the number of spectators that can be in a room

Precondition:
  Must be logged in and not in a room

Note:
  In order to honor hidden rooms, you should set the DefaultTableColumns::TC_ROOM_HIDDEN column.

See also:
  DownloadRooms();

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::KickRoomMember | ( | LobbyClientUserId * | userId | ) | `[virtual]`

Kick someone out of your room. Unfortunate recipient will get the callback KickedOutOfRoom_Notify()

Precondition:
  Must be the moderator of your room.

See also:
  LobbyClientInterfaceCB::KickRoomMember_Result()

  LobbyClientInterfaceCB::KickedOutOfRoom_Notify

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::LeaveRoom | ( | void |  | ) | `[virtual]`

Leave our current room. As with other asynchronous calls, this is not immediate, and you should wait for the callback for verification.

Precondition:
  Must be currently in a room

See also:
  LobbyClientInterfaceCB::LeaveRoom_Result()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::Login | ( | const char * | userHandle,
|  | const char * | userPassword,
|  | SystemAddress | lobbyServerAddr |
| ) |  |  | `[virtual]`

Logs into the lobby server with a given handle and password. All operations other than registering an account or Retrieving passwords require that you first login.

Parameters:

  `[in]` | userHandle | The handle used to register an account
  `[in]` | userPassword | The password used when registering the account
  `[in]` | lobbyServerAddr | SystemAddress of the lobby server. Must be currently connected.

Precondition:
  Must be connected to the lobby server, and have previously created an account (or had one directly created on the server or in the database)

See also:
  RegisterAccount()

  LobbyClientInterfaceCB::Login_Result()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::Logoff | ( | void |  | ) | `[virtual]`

Logs off the lobby system.

See also:
  LobbyClientInterfaceCB::Logoff_Result()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::OnAttach | ( | RakPeerInterface * | peer | ) | `[protected, virtual]`

Called when the interface is attached

Parameters:

  `[in]` | peer | the instance of RakPeer that is calling Receive

Reimplemented from PluginInterface.

void LobbyClientPC::OnCloseConnection | ( | RakPeerInterface * | peer,
|  | SystemAddress | systemAddress |
| ) |  |  | `[protected, virtual]`

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.

PluginReceiveResult LobbyClientPC::OnReceive | ( | RakPeerInterface * | peer,
|  | Packet * | packet |
| ) |  |  | `[protected, virtual]`

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 LobbyClientPC::OnShutdown | ( | RakPeerInterface * | peer | ) | `[protected, virtual]`

Called when RakPeer is shutdown

Parameters:

  `[in]` | peer | the instance of RakPeer that is calling Receive

Reimplemented from PluginInterface.

void LobbyClientPC::QuickMatch | ( | int | requiredPlayers,
|  | int | timeoutInSeconds |
| ) |  |  | `[virtual]`

A quick match automatically groups other users that have also called QuickMatch(). The only condition is that they are in the same game, and have at least the value of requiredPlayers When the game starts all members will get the callback StartGame_Notify() The moderator is chosen at random. If the timer elapses with not enough members to start the game, the callback QuickMatchTimeout_Notify() will be called.

Todo:
  This feature is currently hacked in and will start games but does not honor the requiredPlayers. In the near future I will have it working properly

Precondition:
  You must be in the lobby to start this function

See also:
  LobbyClientInterfaceCB::QuickMatch_Result()

  LobbyClientInterfaceCB::StartGame_Notify()

  LobbyClientInterfaceCB::QuickMatchTimeout_Notify()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::RegisterAccount | ( | LobbyDBSpec::CreateUser_Data * | input,
|  | SystemAddress | lobbyServerAddr |
| ) |  |  | `[virtual]`

Creates an account on the lobby server. Unlike most functions you do not have to be logged in to do this. LobbyDBSpec::CreateUser_Data::handle is required and must be unique in the database. It also cannot be in the disallowedHandles table LobbyDBSpec::CreateUser_Data::password is also required

Parameters:

  `[in]` | input | Data describing the new account. All fields optional but handle and password
  `[in]` | lobbyServerAddr | System address of the lobby server

Precondition:
  SetTitleLoginId() must have been successfully called. This is because titles can disallow account creation.

See also:
  LobbyClientInterfaceCB::RegisterAccount_Result()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::RemoveFromIgnoreList | ( | LobbyClientUserId * | userId | ) | `[virtual]`

Remove a user from the ignore list.

Parameters:

  `[in]` | userId | ID of the user on which to perform this action. You can get this through GetIgnoreList()

Precondition:
  Must be logged in.

See also:
  LobbyClientInterfaceCB::RemoveFromIgnoreList_Result()

  GetIgnoreList()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::RetrievePassword | ( | const char * | userHandle,
|  | const char * | passwordRecoveryAnswer,
|  | SystemAddress | lobbyServerAddr |
| ) |  |  | `[virtual]`

Recovers the user's password given the handle and password recovery answer

Parameters:

  `[in]` | userHandle | Current user's handle, specified when creating the account via RegisterAccount() or ChangeHandle()
  `[in]` | passwordRecoveryAnswer | Specified when creating or last updating the account
  `[in]` | lobbyServerAddr | System address of the lobby server

Note:
  Note the answer is currently not case sensitive, but is spacing sensitive (stricmp())

See also:
  LobbyClientInterfaceCB::RetrievePassword_Result()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::RetrievePasswordRecoveryQuestion | ( | const char * | userHandle,
|  | SystemAddress | lobbyServerAddr |
| ) |  |  | `[virtual]`

Gets the password recovery question entered when the account was last created or updated. The question should not ask what the password is, but should ask some specific question that only the user would know

Parameters:

  `[in]` | userHandle | Current user's handle, specified when creating the account via RegisterAccount() or ChangeHandle()
  `[in]` | lobbyServerAddr | System address of the lobby server

See also:
  LobbyClientInterfaceCB::RetrievePasswordRecoveryQuestion_Result()

Implements RakNet::LobbyClientInterface.

bool LobbyClientPC::RoomAllowsSpectators | ( | void |  | ) | const`[virtual]`

Returns:
  If the room allows spectators to join.

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::RoomChat | ( | const char * | chatMessage,
|  | unsigned char | languageId,
|  | const char * | chatBinaryData,
|  | int | chatBinaryLength |
| ) |  |  | `[virtual]`

Chat to all other members in a room Members which have you on ignore will not get your messages. There is no notification of this.

Parameters:

  `[in]` | chatMessage | Body of the message to send
  `[in]` | languageId | Language to use for string encoding for the StringCompressor class. Use 0 if unsure.
  `[in]` | chatBinaryData | Any binary data you wish to send with the message (custom encoding, images, etc)
  `[in]` | chatBinaryLength | Length in bytes of chatBinaryData

Precondition:
  Must be currently in a room

See also:
  LobbyClientInterfaceCB::RoomChat_Result()

Implements RakNet::LobbyClientInterface.

bool LobbyClientPC::RoomIsHidden | ( | void |  | ) | const`[virtual]`

Returns:
  The value of roomIsHidden passed to CreateRoom()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::SendAddFriendInvite | ( | const char * | friendHandle,
|  | LobbyClientUserId * | friendId,
|  | const char * | messageBody,
|  | unsigned char | language |
| ) |  |  | `[virtual]`

Invites someone to be your friend. They must be online at the time of the invite They will get the callback FriendInvitation_Notify indicating who the request is from, and can accept or deny it (or ignore it) If accepted, you will get notifications via FriendStatus_Notify of when they go on and offline

Parameters:

  `[in]` | friendHandle | Handle of the potential friend. If you know friendId leave this at 0.
  `[in]` | friendId | ID of the potential friend. Lookup is faster using ID. If you don't know it, specify friendHandle instead.
  `[in]` | messageBody | Optional message to send with the friend request.
  `[in]` | language | Language to use for string encoding for the StringCompressor class. Use 0 if unsure.

Precondition:
  Must be logged in.

See also:
  StringCompressor

  LobbyClientInterfaceCB::SendAddFriendInvite_Result()

  LobbyClientInterfaceCB::FriendInvitation_Notify()

  LobbyClientInterfaceCB::FriendStatus_Notify

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::SendEmail | ( | LobbyDBSpec::SendEmail_Data * | input,
|  | unsigned char | language |
| ) |  |  | `[virtual]`

Sends an email to one or more users For each recipient, two copies of the email are stored in the database. One is in your sent mailbox, one is in the recipient incoming mailbox.

Parameters:

  `[in]` | input | Data corresponding to the email. See LobbyDBSpec.h for all parameters.
  `[in]` | language | Language to use for string encoding for the StringCompressor class. Use 0 if unsure.

Precondition:
  Must be logged in.

See also:
  LobbyClientInterfaceCB::SendEmail_Result()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::SendIM | ( | const char * | userHandle,
|  | LobbyClientUserId * | userId,
|  | const char * | chatMessage,
|  | unsigned char | languageId,
|  | const char * | chatBinaryData,
|  | int | chatBinaryLength |
| ) |  |  | `[virtual]`

Sends a message to another user. Unlike emails, this is not stored in the database. The callback will indicate failure if the user is not online. If the user has ignored us, the callback will indicate this as well.

Note:
  It is valid to send an empty message with only binary data, or vice-versa

Parameters:

  `[in]` | userHandle | Handle of the user on which to perform this action. If you know userId leave this at 0.
  `[in]` | userId | ID of the user on which to perform this action. Lookup is faster using ID. If you don't know it, specify userHandle instead.
  `[in]` | chatMessage | Body of the message to send
  `[in]` | languageId | Language to use for string encoding for the StringCompressor class. Use 0 if unsure.
  `[in]` | chatBinaryData | Any binary data you wish to send with the message (custom encoding, images, etc)
  `[in]` | chatBinaryLength | Length in bytes of chatBinaryData

Precondition:
  Must be logged in.

See also:
  LobbyClientInterfaceCB::SendIM_Result()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::SetReadyToPlayStatus | ( | bool | isReady | ) | `[virtual]`

Rooms cannot start until all members first call SetReadyToPlayStatus(true) New members to a room have this set to false by default

Precondition:
  Must be currently in a room

See also:
  LobbyClientInterfaceCB::SetReadyToPlayStatus_Result()

  LobbyClientInterfaceCB::RoomMemberReadyStateChange_Notify()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::SetRoomAllowSpectators | ( | bool | spectatorsOn | ) | `[virtual]`

Sets if the room allows spectators Other room members will get the callback RoomSetAllowSpectators_Notify()

See also:
  LobbyClientInterfaceCB::SetRoomAllowSpectators_Result()

  LobbyClientInterfaceCB::RoomSetAllowSpectators_Notify()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::SetRoomIsHidden | ( | bool | roomIsHidden | ) | `[virtual]`

Sets the DefaultTableColumns::TC_ROOM_HIDDEN column to true or false in the rooms table. Other room members will get the callback RoomSetIsHidden_Notify()

See also:
  LobbyClientInterfaceCB::SetRoomIsHidden_Result()

  LobbyClientInterfaceCB::RoomSetIsHidden_Notify()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::SetTitleLoginId | ( | const char * | _titleIdStr,
|  | const char * | _titleLoginPW,
|  | int | _titleLoginPWLength |
| ) |  |  | `[virtual]`

Indicates to the system what title (game) you are playing. Games are identified by a unique key, specified in binary via _titleLoginPW and _titleLoginPWLength Games must have been already created on the server, or directly in the database. One way to add games is through the functor class AddTitle_PostgreSQLImpl . An example of this can be found in the LobbyServerTest project

Note:
  When the title was added to the server, if requireUserKeyToLogon==true, then you must first call ValidateUserKey() with the name of the title. Failure to do so will return the error LC_RC_USER_KEY_NOT_SET

Parameters:

  `[in]` | _titleIdStr | Actual name of the game. Not used at present, but may be used in the future.
  `[in]` | _titleLoginPW | Secret binary identifer assigned with the game. This should be kept secret so that people cannot submit scores for the wrong game, etc.
  `[in]` | _titleLoginPWLength | Length of _titleLoginPW

See also:
  LobbyClientInterfaceCB::SetTitleLoginId_Result()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::StartGame | ( | void |  | ) | `[virtual]`

Attempts to start the game. All members in the room must be ready, set by calling SetReadyToPlayStatus(true) All members, including spectators, will get the callback StartGame_Notify() if successful This callback contains a list of all members in the room, along with SystemAddresses and other pertinent information

See also:
  LobbyClientInterfaceCB::StartGame_Result()

  LobbyClientInterfaceCB::StartGame_Notify()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::SubmitMatch | ( | RankingServerDBSpec::SubmitMatch_Data * | input | ) | `[virtual]`

Submits the results of a match between two users This is typically a server command, not a user command For security, your IP must be in the trustedIpList table.

Parameters:

  `[in]` | input | Data corresponding to the match. See RankingServerDBSpec.h for all parameters.

See also:
  LobbyClientInterfaceCB::SubmitMatch_Result()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::UpdateAccount | ( | LobbyDBSpec::UpdateUser_Data * | input | ) | `[virtual]`

Updates details of a previously created account.

Parameters:

  `[in]` | input | Details on the account. See LobbyDBSpec::UpdateUser_Data for more details.

Precondition:
  Must be logged in

See also:
  RegisterAccount();

  LobbyClientInterfaceCB::UpdateAccount_Result()

Implements RakNet::LobbyClientInterface.

void LobbyClientPC::UpdateEmailStatus | ( | EmailId * | emailId,
|  | int | newStatus,
|  | bool | wasOpened |
| ) |  |  | `[virtual]`

Update the status flags associated with an email.

Parameters:

  `[in]` | emailId | Found at LobbyDBSpec::SendEmail_Data::emailMessageID
  `[in]` | newStatus | arbitrary integer stored alongside each email. Use to indicate user-defined fields (priority, etc).
  `[in]` | wasOpened | boolean field. Use to indicate if an email was opened. Sent emails take the field LobbyDBSpec::SendEmail_Data::wasOpened . Inbox has this always true until set off.

Precondition:
  Must be logged in.

See also:
  GetInboxEmailList()

  GetSentEmailList()

  LobbyClientInterfaceCB::UpdateEmailStatus_Result()

Implements RakNet::LobbyClientInterface.

The documentation for this class was generated from the following files:

- C:/RakNet/DependentExtensions/Lobby/LobbyClientPC.h
- C:/RakNet/DependentExtensions/Lobby/LobbyClientPC.cpp