can i block specific player

my game use JoinRandomGame func
then user want to block specific player who swear word him
but i don't know how to block to connect specific player who they block

can i know how to block specific player in joinrandomgame with photonnetwork.playername

Comments

  • Hi @SungJinKang,

    I guess there are ways to do so, but if you don't use any kind of authentication and players are allowed to change their PhotonNetwork.playerName to whatever they want to, this won't work at all.
  • @Christian_Simon

    in my games cant chang playername

    please let me know how to block specific player

  • You actually can't block players (on the Photon Cloud), but you can try removing them after they have joined a room. If the MasterClient has a list with the players that should be removed, he can use the OnPhotonPlayerConnected(PhotonPlayer newPlayer) callback and check if the new player's name is on the list. If so, he can try to remove him by raising a specific event for the certain player that forces the user to leave the room again.
  • You actually can't block players (on the Photon Cloud), but you can try removing them after they have joined a room. If the MasterClient has a list with the players that should be removed, he can use the OnPhotonPlayerConnected(PhotonPlayer newPlayer) callback and check if the new player's name is on the list. If so, he can try to remove him by raising a specific event for the certain player that forces the user to leave the room again.

    This won't work as he will be rejected then try to find another random room which could lead to still the same room. it's looping..