- Home /
List clients connected?
When running a server and client setup, I can check the number of connections to me, and they have names assigned to them, from login, but how do I make a list of clients connected to me, either from IP, or from running an @RPC from server to client asking for name from their login script, and then making a list of the returned names.
Answer by -hiTo- · Aug 24, 2013 at 03:56 PM
void OnConnectedToServer()
{
networkView.RPC("AddPlayerToList", RPCMode.Server, playerLoginName);
}
[RPC]
void AddPlayerToList(string loginName)
{
listOfNames.Add(loginName);
}
Something along those lines?
Of course, you could send along anything you wanted with that RPC-call. Not just a string (well, not anything, but not just a string). A NetworkPlayer, for example.
How can I loop through all clients (local connections) and see their isReady
flag? I am using UNET. Thanks
I haven't fiddled with UNET at all yet, but I suspect this might be what you are looking for: http://docs.unity3d.com/ScriptReference/Networking.NetworkServer.SetClientReady.html
@-hiTo- Thanks. But I gave up on UNET. The documentations are not enough. Thinking to move to Photon.
Answer by ankurpatel · Aug 26, 2013 at 05:05 AM
thnx
$$anonymous$$ake this a comment, and use the vote function to vote the answer up ins$$anonymous$$d, thanks :)
Your answer
![](https://koobas.hobune.stream/wayback/20220613074614im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Get RPC senders ID, or IP? 1 Answer
RPC Call Mix Up Issues 0 Answers
RPC replace the existing list on all players 0 Answers