How to recive rpc whether the player having only the player's name

Options

Hello! I'm trying to implement a private chat. I have an inputField in which I enter the name of the required player. While sending a message, I need to check whether this player is online, how do I do this? Thank you all!

I use:


var playerList = from p in PhotonNetwork.playerList select p; foreach (var player in playerList) { if (player.NickName == name) { PhotonView.Get(NEED HELP).photonView.RPC("givePrivateMessage", PhotonTargets.All, text, PhotonNetwork.playerName, false); } }


I do not know how to call rpc from the player I need...

Sorry my english...

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    edited June 2017
    Options
    Hi @AkaruZ,

    Thank you for choosing Photon!

    In order to know if your friends are online you should use FindFriends.
    There is a PUN demo for this. I think it's named "Custom Auth & Friends" or something like that.