Collection of "in room" callbacks for the Realtime Api to cover: Players entering or leaving, property updates and Master Client switching. More...
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... | |
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
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.
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.
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.
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.
targetPlayer | Contains Player that changed. |
changedProps | Contains the properties that changed. |
Implemented in Photon.Realtime.SupportLogger.
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.
propertiesThatChanged |
Implemented in Photon.Realtime.SupportLogger.