I felt it was a little overkill, to submit a bugreport, but I love Unity, and bugs have to be mentioned, maybe it’s just my computer crashing… The case; I am getting an RPC call from a client, and I am trying to extract the IP address from this, using the following method on the server, recieving the RPC:
@RPC
function VersionCreate(Version : int, Info : NetworkMessageInfo)
{
//The sender of this RPC was:
Debug.Log(Network.connections[(Info.sender)].ipAddress);
}
Now, this way is a bit of jury-rigged, that I wanted to test. Info.sender returns the ID number of the client, not the actual IP, and Network.connections[ID].ipAdress returns the IP of a given ID, however, when combined in this way it explodes in an instant crash, at least for me. I tried on two machines, several times. First time I ever see a crash in Unity.
- Finally; I still need to resolve this, how do I then extract the IP of a recieved RPC call, without having to manually add it as a parameter of the send RPC, didn’t think that would be required, given the wonders of NetworkMessageInfo. Any ideas? Smart people, work your magic!
Thank you in advance.