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.
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.
thnx