PhotonNetwork.CloseConnection(PhotonPlayer _player)

I have a question about this function. It works as expected, but I cannot figure out one thing. How can I determine on the client of the kicked player that it was a kick from Master Client and not any another reason?... Thanks for help!

Comments

  • [Deleted User]
    edited May 2018
    Hi @FoxyShadow,

    as far as I know you are currently not able to without modifying PUN's source code. Modifying parts of the code is possible (you can find the relevant code for this scenario in the NetworkingPeer class in line 2634), the problem is that those changes will be overwritten each time you update PUN and support will be really difficult for custom solutions in PUN's source code.

    Edit: If a client gets kicked from a room, he is not disconnected from Photon, means that only OnLeftRoom gets called. If a client however gets disconnected from Photon (e.g. internet outage) OnConnectionFail(DisconnectCause cause) and OnDisconnectedFromPhoton() get called.
  • That's kind of strange... Not even thinking about kicking a player with a custom message.. Thanks anyway. I have already thought about trying to use that OnConnectionFail is not called in this situation :)