OnMasterClientSwitched description misleading?

Options
Hi:
I read the description about OnMasterClientSwitched on Public API
It read that "The former already got removed from the player list."

When I actually check with PhotonNetwork.playerList, it tells a different story.
It seems OnPhotonPlayerDisconnected fired after OnMasterClientSwitched.

void OnMasterClientSwitched(PhotonPlayer newMasterClient) 
    {
        Debug.LogError(PhotonNetwork.playerList.Length); // will be 2
        Debug.LogError("OnMasterClientSwitched");
    }
    void OnPhotonPlayerDisconnected(PhotonPlayer otherPlayer)
    {
        Debug.LogError(PhotonNetwork.playerList.Length); // now it become 1
        Debug.LogError(otherPlayer.ID + " left");
    }

Comments

  • vadim
    Options
    Hi,

    You are right.
    First, OnMasterClientSwitched message fires. Then player list updated. And finally OnPhotonPlayerDisconnected sent.
    I'm not sure whether code or documentation is erroneous. Will check it. Thanks.