Purpose of CryLobby
CryLobby is a collection of modules abstracting away platform specific Lobby and Matchmaking services. Crytek currently implemented support for the following services:
- Playstation Network
- Xbox Live
- ICryLobby: Central access point for lobby services, retrievable via gEnv->pNetwork->GetLobby().
- ICryMatchmaking: Handles session based tasks. E.g. Creating/Searching/Joining rooms.
- ICryVoice: Wraps up VOIP - at present used primarily for muting player groups.
- ICryStats: Handles persistent stats and leader board types of operations.
- ICryReward: Handles achievements.
- ICryTCPService: Basic TCP implementation (used for telemetry).
- ICryFriends: Friends list management - list friends, send game invite.
- ICryLobbyUI: Access to xmb - show gamercards, show friends list, set rich presence.
A service is either eCLS_LAN or eCLS_Online. At present you can only have 1 of each.
LAN only provides the ICryMatchMaking interface.
Online provides a more complete set.
In general all lobby functions expect a callback and return a task identifier.
Due to differences in 3rd party functionality, an additional callback may be executed at any time.
CryLobbyConfigurationCallback is used to provide details about your game that are not exposed via the normal API.
Game can register as being interested in events. In example the Player connected to LIVE, ethernet cable removed, game invite received.
Most functions in CryLobby and subsystems return an error code.
- eCLE_Success = 0
These error codes also returned in callback functions. A full list can be found in ICryLobby.h
This happens for example when your listener class is being destroyed.
taskId is an out parameter in any lobby function that also takes a callback.
Avoid where possible, especially on certain tasks like SessionCreate, SessionJoin or SessionDelete. This may not stop the task from running (could be too late to abort), but it will stop the callback from firing.
- Maximum of 4 sessions (MAX_MATCHMAKING_SESSIONS)
- Up to 64 players (MAX_LOBBY_CONNECTIONS)
Connections limit is an overall limit - shared between sessions.
Most functions require a session handle, this is returned by SessionCreate or SessionJoin.
The users pointer along with the numUsers count parameters pass an array of user indexes and correspond to the pad index.
The flags parameter can be one of the following:
The Data argument represents the advertised/synched values which can be changed using SessionUpdate.
The function is similar to SessionCreate. It takes a CrySessionID as argument. Provided by either a search callback, an invite callback or from a game packet in another session.
CrySessionHandle is provided by either SessionCreate or SessionJoin callback.
Send arbitrary packets. Doesn't use a fixed format.
Here is an example:
Also look at SendToClient and SendToServer.
Handled through same mechanism as CryLobbyEvents.
MatchMaking events will have a sessionHandle as part of the data in the callback, check this against the current session since you don't register for events on a specific session.