GPGRealTimeRoomMaker Class Reference

GPGRealTimeRoomMaker Class Reference

Overview

The object that creates and manages all GPGRealTimeRoom objects.

The following sample shows how to create a two player auto-matched game:

 GPGMultiplayerConfig *config = [[GPGMultiplayerConfig alloc] init];
 config.minAutoMatchingPlayers = config.maxAutoMatchingPlayers = 1;
 [GPGRealTimeRoomMaker createRoomFromConfig:config];

Static Public Member Functions

(GPGRealTimeRoomCreationResult) + createRoomFromConfig:
 Creates a room using a GPGMultiplayerConfig object.
(GPGRealTimeRoomCreationResult) + createRoomFromConfig:operationHandle:
 Creates a room using a GPGMultiplayerConfig object.
(GPGRealTimeRoomCreationResult) + joinRoomFromData:
 Joins a room using the roomData object provided in an invitation.
(GPGRealTimeRoomCreationResult) + joinRoomFromData:operationHandle:
 Joins a room using the roomData object provided in an invitation.
(void) + listRoomsWithMaxResults:completionHandler:
 Lists all room invitations.
(void) + getRoomWithId:completionHandler:
 Gets the latest room object from the network.
(void) + getRoomFromData:completionHandler:
 Gets the latest room object from the network.
(void) + declineRoomFromData:completionHandler:
 Declines an invitation to a room.
(void) + dismissRoomFromData:completionHandler:
 Dismisses an invitation to a room.
(GPGRealTimeRoom *) + activeRoom

Member Function Documentation

+ (GPGRealTimeRoomCreationResult) createRoomFromConfig: (GPGMultiplayerConfig *)  config

Creates a room using a GPGMultiplayerConfig object.

Parameters:
configThe configuration specifying the room's creation parameters.
Returns:
An enum indicating whether the operation succeeded or failed.
+ (GPGRealTimeRoomCreationResult) createRoomFromConfig: (GPGMultiplayerConfig *)  config
operationHandle: (GPGRealTimeRoomCreationHandle * __autoreleasing *)  handle 

Creates a room using a GPGMultiplayerConfig object.

Parameters:
configThe configuration specifying the room's creation parameters.
handleAn out-parameter used to return a handle to the current operation. This can cancel the operation before the room is actually created. Once the room is created, the handle becomes invalid, you should call the room object methods to shut down the room.
Returns:
An enum indicating whether the operation succeeded or failed.
+ (GPGRealTimeRoomCreationResult) joinRoomFromData: (GPGRealTimeRoomData *)  data

Joins a room using the roomData object provided in an invitation.

Parameters:
dataThe GPGRealTimeRoomData representing the invite.
Returns:
An enum indicating whether the operation succeeded or failed.
+ (GPGRealTimeRoomCreationResult) joinRoomFromData: (GPGRealTimeRoomData *)  data
operationHandle: (GPGRealTimeRoomCreationHandle * __autoreleasing *)  handle 

Joins a room using the roomData object provided in an invitation.

Parameters:
dataThe GPGRealTimeRoomData representing the invite.
handleAn out-parameter used to return a handle to the current operation. This can cancel the operation before the room is actually created. Once the room is created, the handle becomes invalid, you should call the room object methods to shut down the room.
Returns:
An enum indicating whether the operation succeeded or failed.
+ (void) listRoomsWithMaxResults: (int)  maxResults
completionHandler: (GPGListRoomsHandler)  completionHandler 

Lists all room invitations.

Parameters:
maxResultsThe maximum number of results to fetch.
completionHandlerThe completion handler called on operation end in the form: ^(NSArray *rooms, NSError *error).
+ (void) getRoomWithId: (NSString *)  roomId
completionHandler: (GPGRoomRequestHandler)  completionHandler 

Gets the latest room object from the network.

Parameters:
roomIdThe unique string that identifies the room.
completionHandlerThe completion handler called on operation end in the form: ^(GPGRealTimeRoomData *data, NSError *error)
+ (void) getRoomFromData: (GPGRealTimeRoomData *)  roomData
completionHandler: (GPGRoomRequestHandler)  completionHandler 

Gets the latest room object from the network.

Parameters:
roomDataThe GPGRealTimeRoomData instance associated with an existing room.
completionHandlerThe completion handler called on operation end in the form: ^(GPGRealTimeRoomData *data, NSError *error)
+ (void) declineRoomFromData: (GPGRealTimeRoomData *)  data
completionHandler: (GPGRoomRequestHandler)  completionHandler 

Declines an invitation to a room.

Parameters:
dataThe GPGRealTimeRoomData instance representing the invite.
completionHandlerThe completion handler called on operation end in the form: ^(GPGRealTimeRoomData *data, NSError *error)
+ (void) dismissRoomFromData: (GPGRealTimeRoomData *)  data
completionHandler: (GPGRoomDismissHandler)  completionHandler 

Dismisses an invitation to a room.

This does not change the status of the room; it only hides notifications on all other devices.

Parameters:
dataThe GPGRealTimeRoomData instance representing the invite.
completionHandlerThe completion handler called on operation end in the form: ^(NSError *error)
Returns:
The room which is currently active.

Оставить отзыв о...

Текущей странице
Play Games Services for iOS
Play Games Services for iOS