Interface IRealTimeMultiplayerListener
Real-Time multiplayer listener. The methods of this listener will be called to notify you of real-time room events.
Namespace: EasyMobile
Assembly: cs.temp.dll.dll
Syntax
public interface IRealTimeMultiplayerListener
Methods
OnLeftRoom()
Notifies that the local player has left the room. This may have happened because you called LeaveRoom(), or because an error occurred and the player was dropped from the room. You should react by stopping your game and possibly showing an error screen (unless the player requested to leave the room, naturally).
Declaration
void OnLeftRoom()
OnParticipantLeft(Participant)
Notifies that a participant has left during room setup. This is called during room setup if a player declines an invitation or leaves. The status of the participant can be inspected to determine the reason. If all players have left, the room is closed automatically.
Declaration
void OnParticipantLeft(Participant participant)
Parameters
Type | Name | Description |
---|---|---|
Participant | participant | The participant that left. |
OnPeersConnected(String[])
Notifies that peer players have connected to the room.
Declaration
void OnPeersConnected(string[] participantIds)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | participantIds | Identifiers of the connected participants. |
OnPeersDisconnected(String[])
Notifies that peer players have disconnected from the room.
Declaration
void OnPeersDisconnected(string[] participantIds)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | participantIds | Identifiers of the disconnected participants. |
OnRealTimeMessageReceived(String, Byte[])
Notifies that a real-time message has been received.
Declaration
void OnRealTimeMessageReceived(string senderId, byte[] data)
Parameters
Type | Name | Description |
---|---|---|
System.String | senderId | Sender identifier. |
System.Byte[] | data | Data. |
OnRoomConnected(Boolean)
Notifies that room setup is finished (all participants have joined).
If success == true
, you should
react by starting to play the game; otherwise, you may show an error screen.
Declaration
void OnRoomConnected(bool success)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | success | Whether room setup was successful. |
OnRoomSetupProgress(Single)
Called during room setup to notify of room setup progress.
Declaration
void OnRoomSetupProgress(float percent)
Parameters
Type | Name | Description |
---|---|---|
System.Single | percent | The room setup progress in percent (0.0 to 100.0). |
ShouldReinviteDisconnectedPlayer(Participant)
[Game Center only] Notifies that a player in a two-player match was disconnected.
Declaration
bool ShouldReinviteDisconnectedPlayer(Participant participant)
Parameters
Type | Name | Description |
---|---|---|
Participant | participant | The participant that disconnected. |
Returns
Type | Description |
---|---|
System.Boolean | Your game should return true if it wants Game Center to attempt to reconnect the player, otherwise it should return false. |
Remarks
The method is available on Game Center only, it's never called on Google Play Games platform.