Photon .NET Client API 4.1.4.8

Public Member Functions | List of all members
Photon.Realtime.IInRoomCallbacks Interface Reference

Collection of "in room" callbacks for the Realtime Api to cover: Players entering or leaving, property updates and Master Client switching. More...

Inheritance diagram for Photon.Realtime.IInRoomCallbacks:
Photon.Realtime.SupportLogger

Public Member Functions

void OnPlayerEnteredRoom (Player newPlayer)
 Called when a remote player entered the room. This Player is already added to the playerlist. More...
 
void OnPlayerLeftRoom (Player otherPlayer)
 Called when a remote player left the room or became inactive. Check otherPlayer.IsInactive. More...
 
void OnRoomPropertiesUpdate (Hashtable propertiesThatChanged)
 Called when a room's custom properties changed. The propertiesThatChanged contains all that was set via Room.SetCustomProperties. More...
 
void OnPlayerPropertiesUpdate (Player targetPlayer, Hashtable changedProps)
 Called when custom player-properties are changed. Player and the changed properties are passed as object[]. More...
 
void OnMasterClientSwitched (Player newMasterClient)
 Called after switching to a new MasterClient when the current one leaves. More...
 

Detailed Description

Collection of "in room" callbacks for the Realtime Api to cover: Players entering or leaving, property updates and Master Client switching.

Classes that implement this interface must be registered to get callbacks for various situations.

To register for callbacks, call LoadBalancingClient.AddCallbackTarget and pass the class implementing this interface To stop getting callbacks, call LoadBalancingClient.RemoveCallbackTarget and pass the class implementing this interface

Member Function Documentation

◆ OnMasterClientSwitched()

void Photon.Realtime.IInRoomCallbacks.OnMasterClientSwitched ( Player  newMasterClient)

Called after switching to a new MasterClient when the current one leaves.

This is not called when this client enters a room. The former MasterClient is still in the player list when this method get called.

Implemented in Photon.Realtime.SupportLogger.

◆ OnPlayerEnteredRoom()

void Photon.Realtime.IInRoomCallbacks.OnPlayerEnteredRoom ( Player  newPlayer)

Called when a remote player entered the room. This Player is already added to the playerlist.

If your game starts with a certain number of players, this callback can be useful to check the Room.playerCount and find out if you can start.

Implemented in Photon.Realtime.SupportLogger.

◆ OnPlayerLeftRoom()

void Photon.Realtime.IInRoomCallbacks.OnPlayerLeftRoom ( Player  otherPlayer)

Called when a remote player left the room or became inactive. Check otherPlayer.IsInactive.

If another player leaves the room or if the server detects a lost connection, this callback will be used to notify your game logic.

Depending on the room's setup, players may become inactive, which means they may return and retake their spot in the room. In such cases, the Player stays in the Room.Players dictionary.

If the player is not just inactive, it gets removed from the Room.Players dictionary, before the callback is called.

Implemented in Photon.Realtime.SupportLogger.

◆ OnPlayerPropertiesUpdate()

void Photon.Realtime.IInRoomCallbacks.OnPlayerPropertiesUpdate ( Player  targetPlayer,
Hashtable  changedProps 
)

Called when custom player-properties are changed. Player and the changed properties are passed as object[].

Changing properties must be done by Player.SetCustomProperties, which causes this callback locally, too.

Parameters
targetPlayerContains Player that changed.
changedPropsContains the properties that changed.

Implemented in Photon.Realtime.SupportLogger.

◆ OnRoomPropertiesUpdate()

void Photon.Realtime.IInRoomCallbacks.OnRoomPropertiesUpdate ( Hashtable  propertiesThatChanged)

Called when a room's custom properties changed. The propertiesThatChanged contains all that was set via Room.SetCustomProperties.

Since v1.25 this method has one parameter: Hashtable propertiesThatChanged.
Changing properties must be done by Room.SetCustomProperties, which causes this callback locally, too.

Parameters
propertiesThatChanged

Implemented in Photon.Realtime.SupportLogger.


The documentation for this interface was generated from the following file: