What callback to expect on a kicked clients machine
Options
Hi!
I am implementing a (debug) system for checking clients - this is both available for masterclient and non-masterclients.
Only the masterclient can kick other players. I am using the CloseConnection method for this.
I would expect that the OnDisconnectedFromPhoton() would be called on the client that is being kicked. Instead it is OnLeftRoom(). Funnily enough the OnConnectedToMaster() is called instantly after it as well.
I would 'simply' like to kick a player which would be transfered back to a main menu (UI or scene) or whatever, by using the OnDisconnectedFromPhoton() or even better a OnKickedFromPhoton() callback so you could tell the client why.
Ofcourse, I might be able to use a RPC to call a disconnect with some information on the client, but what use is the CloseConnection then?
So, is this correct behavior? Kick client -> Client leaves room -> connects to master again?
Can anyone shed some light on this?
Cheers,
Pieter
I am implementing a (debug) system for checking clients - this is both available for masterclient and non-masterclients.
Only the masterclient can kick other players. I am using the CloseConnection method for this.
I would expect that the OnDisconnectedFromPhoton() would be called on the client that is being kicked. Instead it is OnLeftRoom(). Funnily enough the OnConnectedToMaster() is called instantly after it as well.
I would 'simply' like to kick a player which would be transfered back to a main menu (UI or scene) or whatever, by using the OnDisconnectedFromPhoton() or even better a OnKickedFromPhoton() callback so you could tell the client why.
Ofcourse, I might be able to use a RPC to call a disconnect with some information on the client, but what use is the CloseConnection then?
So, is this correct behavior? Kick client -> Client leaves room -> connects to master again?
Can anyone shed some light on this?
Cheers,
Pieter
0
Comments
-
Hi,
yes, the is is the correct behaviour. however if you choose to use lobby, then you'll get after the user left the room the callback that the user joined the lobby, so the final part varies.
It is indeed a misleading term to "closeConnection" when actually all it does it forcing the player target to leave the room. I guess here "connection" means connection to the room ( wich technically is how it works when you leave a room, but is misleading in terms as a result).
Bye,
Jean0 -
This is an old bump, but relevant --
Curious, why does this skip OnPhotonPlayerDisconnected(PhotonPlayer otherPlayer) when a player is disconnected? It seems inconsistent if it pops up LeaveRoom() but not OnPhotonPlayerDisconnected()0