Option to set becomeInactive to false when master kick a player using CloseConnection


I've upgraded the PUN to V1.88 and acknowledged there's an update about becomeInactive parameter on LeaveRoom method, and it helped me a lot! However I found that when a player kicked by master (using PhotonNetwork.CloseConnection) he/she was still on the room. After some crawling on the code I found the method itself called by NetworkingPeer.cs line 2614 and it's calling PhotonNetwork.LeaveRoom() without a parameter.

I suggest the CloseConnection method also provide a parameter whether targeted player become inactive or not.

Thanks in advance.


  • JohnTubeJohnTube mod
    edited January 11
    Hi @igrir,

    Thank you for choosing Photon and for your suggestion!

    I personally think it's a good idea and it may make sense.

    Although CloseConnection was meant as a "fake" kick.
    It should not be abused.
    Adding the parameter may make it more "dangerous" as you may force another player to "abandon a room for good".
    Well, technically he can still join the room with a new actor number.

    Anyway, @jeanfabre should know better.
  • Hi,

    Good point , I have raised a ticket internally, I am going to study this and implement it so that indeed when you kick a player from the room it doesn't become inactive, that doesn't make sense.


  • Hi,

    Ok, the next version of PUN will feature a fix for this, meanwhile, you can simply implement in the code, it's easy.

    go to NetworkingPeer.cs and locate line 2614

    change " PhotonNetwork.LeaveRoom();" to " PhotonNetwork.LeaveRoom(false);"

    and then when the closeconnection is called, the player will leave the room without becoming inactive ( default behaviour, of the leaveRoom() call...)


Sign In or Register to comment.