How to kick players?

Options
So i know that you use PhotonNetwork.CloseConnection(PhotonPlayer kick) to kick players. But how do you kick players using their player name.

Comments

  • mau
    mau
    edited October 2016
    Options
    If I understand what you want I think you're looking for something like this?

    public static void kick(string name) { foreach (PhotonPlayer player in PhotonNetwork.playerList) { string s = player.customProperties["name"]; if (s != null && s == name) { PhotonNetwork.CloseConnection(player); break; } } }
    Sorry about the formatting, I can't get it to work properly.