RPC calls to a specific client?

Now I understand for the most part how RPC’s work. The only issue i’m having is singling out a specific client. I think this code does that:

networkView.RPC("comeFunction", Network.connections[i]);

@RPC
someFunction() { }

But I’m not sure how exactly to get the id for a specific client. How do I find the right connection?

Sorry if this isn’t in the right section. It was Multiplayer Networking specific, so I figured it’d be better suited here than in the coding section.

you can use the NetworkPlayer object you get pushed through for targeting an RPC too (see further down the script ref page on RPC)

Do you mean the the NetworkPlayer.ToString()? Will that give me the specified connection so that I can send from the server back to a specific client?

EDIT: changed “ToScript()” to “ToString()” lol. My bad. >_<

ToScript does not exist.
I really mean the network player you get passed in by the other user as he talks to you.

You must have some structure in place to know who a player is, what avatars he owns etc, in there you also stored his network player for unique iditifcation.

If that doesn’t make sense to you I would recommend looking at the networking example in resources - examples as well as looking at the m2h zero to hero guide on networking

It does make sense. I’m trying simply to find the way to communicate with a specific client. I thought Network.connections[ ] specified the certain client. I"m sorry, I meant .ToString(). I’m just having issues with the server replying to the client to tell it whether or not the Log In is valid. I can’t seem to find where it allocates the ID. I see it in the Network Player, but I wasn’t sure whether or not that was the connection I could use to connect to a specific client.

EDIT: I also thought that Unity automatically declared a client ID. I was trying to access that one instead of assigning my own. I’m making a system that only uses the Unity network resources with no backend.

EDIT EDIT:
I’ve used NetworkMessageInfo.sender, too. The problem with that is that I get a “-1” for that. I tried NetworkPlayer.ToString() and I think I got a “0.” I’ll try it again real quick and let you know.

Well I don’t know what I was doing wrong, but info.sender is working for me now. Thanks so much for helping me.

Here is the code (in js):
@RPC
function someFunction( info : NetworkMessageInfo)
{
networkView.RPC(“someOtherFunction”, info.sender);
}