GPGRealTimeRoom Class Reference

GPGRealTimeRoom Class Reference

Overview

An object that represents a real-time room.

This encapsulates all the data relating to how the room was created, who is invited, who is connected, and the current state of the match.

Public Member Functions

(GPGRealTimeParticipant *) - findParticipantById:
 Gets the GPGRealTimeParticipant for the given participant ID.
(void) - enumerateParticipantsUsingBlock:
 Iterates over the participants in the room.
(void) - enumerateOtherParticipantsUsingBlock:
 Iterates over all the room's participants, excluding the local participant.
(void) - enumerateConnectedParticipantsUsingBlock:
 Iterates over only the participants who are connected and can be sent data.
(int) - sendReliableData:toParticipants:
 Sends reliable data to an array of participants.
(void) - sendUnreliableData:toParticipants:
 Sends unreliable data to an array of participants.
(int) - sendReliableDataToAll:
 Broadcasts reliable data to all participants.
(void) - sendUnreliableDataToAll:
 Broadcasts unreliable data to all participants.
(int) - sendReliableDataToOthers:
 Broadcasts reliable data to all participants except for the local participant.
(void) - sendUnreliableDataToOthers:
 Broadcasts unreliable data to all participants except for the local participant.
(void) - leave
 Leaves the room and disconnects from the server and all other peers.

Properties

GPGMultiplayerConfigconfig
 Criteria for adding participants into this room via auto-match and/or playerId.
NSArray * participants
 All participants in the room regardless of status.
NSArray * connectedParticipants
 All participants who are connected in the room.
GPGRealTimeParticipantlocalParticipant
 The GPGRealTimeRoomParticipant that corresponds to the logged-in player.
NSString * roomDescription
 This short description is automatically generated and worded relative to the player requesting the room.
NSString * roomID
 Globally unique ID for a room.
BOOL inConnectedSet
 YES if the localPlayer is in the room's group of connected participants.
GPGRealTimeRoomModifyDetailscreationDetails
 The timestamp object for the creation of the room.
GPGRealTimeRoomStatus status
 The status of the current room.
NSNumber * waitEstimateSeconds
 An estimate for the amount of time (in seconds) that auto-matching is expected to take to complete.

Member Function Documentation

- (GPGRealTimeParticipant *) findParticipantById: (NSString *)  participantId

Gets the GPGRealTimeParticipant for the given participant ID.

Parameters:
participantIdThe participant's ID.
Returns:
The participant looked up. Nil if the participant doesn't exist.
- (void) enumerateParticipantsUsingBlock: (GPGRealTimeParticipantIterator)  iterator

Iterates over the participants in the room.

Parameters:
iteratorA block used to iterate a list of participants, of the form: ^(GPGRealTimeParticipant *participant).
- (void) enumerateOtherParticipantsUsingBlock: (GPGRealTimeParticipantIterator)  iterator

Iterates over all the room's participants, excluding the local participant.

Parameters:
iteratorA block used to iterate a list of participants, of the form: ^(GPGRealTimeParticipant *participant).
- (void) enumerateConnectedParticipantsUsingBlock: (GPGRealTimeParticipantIterator)  iterator

Iterates over only the participants who are connected and can be sent data.

Parameters:
iteratorA block used to iterate a list of participants, of the form: ^(GPGRealTimeParticipant *participant).
- (int) sendReliableData: (NSData *)  data
toParticipants: (NSArray *)  participants 

Sends reliable data to an array of participants.

Parameters:
dataThe raw data to send.
participantsThe participants to send the data to. Items in the array can be either of type GPGRealTimeParticipant or NSString for GPGRealTimeParticipant.participantId values.
Returns:
The identifier of the batch operation, or kGPGRealTimeInvalidReliableSendId if there was an error sending. The room delegate room:didSendReliableId:results: is called on success or failure of all sends atomically.
- (void) sendUnreliableData: (NSData *)  data
toParticipants: (NSArray *)  participants 

Sends unreliable data to an array of participants.

Parameters:
dataThe raw data to send.
participantsThe participants, GPGRealTimeParticipant or participantIds, to send the data to.
- (int) sendReliableDataToAll: (NSData *)  data

Broadcasts reliable data to all participants.

Parameters:
dataThe raw data to send.
Returns:
The identifier of the batch operation, or kGPGRealTimeInvalidReliableSendId if there was an error during message transmission. The room delegate room:didSendReliableId:results: is called on success or failure of all message transmissions atomically.
- (void) sendUnreliableDataToAll: (NSData *)  data

Broadcasts unreliable data to all participants.

Parameters:
dataThe raw data to send.
- (int) sendReliableDataToOthers: (NSData *)  data

Broadcasts reliable data to all participants except for the local participant.

Parameters:
dataThe raw data to send.
Returns:
The identifier of the batch operation, or kGPGRealTimeInvalidReliableSendId if there was an error during message transmission. The room delegate room:didSendReliableId:results: is called on success or failure of all message transmissions atomically.
- (void) sendUnreliableDataToOthers: (NSData *)  data

Broadcasts unreliable data to all participants except for the local participant.

Parameters:
dataThe raw data to send.
- (void) leave

Leaves the room and disconnects from the server and all other peers.

The room will still exist for other players.


Property Documentation

- (GPGMultiplayerConfig*) config [read, assign]

Criteria for adding participants into this room via auto-match and/or playerId.

- (NSArray *) participants [read, copy]

All participants in the room regardless of status.

The local participant is included. Type: GPGRealTimeRoomParticipant

- (NSArray *) connectedParticipants [read, copy]

All participants who are connected in the room.

Type: GPGRealTimeRoomParticipant

The GPGRealTimeRoomParticipant that corresponds to the logged-in player.

- (NSString*) roomDescription [read, copy]

This short description is automatically generated and worded relative to the player requesting the room.

It is intended to be displayed when the room is shown in a list (for example, an invitation to a room.)

- (NSString*) roomID [read, copy]

Globally unique ID for a room.

- (BOOL) inConnectedSet [read, assign]

YES if the localPlayer is in the room's group of connected participants.

The timestamp object for the creation of the room.

- (GPGRealTimeRoomStatus) status [read, assign]

The status of the current room.

- (NSNumber*) waitEstimateSeconds [read, copy]

An estimate for the amount of time (in seconds) that auto-matching is expected to take to complete.

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

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