NetworkMessageInfo sender.guid set to empty string "" or "0"?

I’m seeing weird behavior in an RPC.

My function looks something like this (simplified):

void AddPlayer( Vector3 position, Quaternion rotation, NetworkMessageInfo info )

This RPC is getting called from OnConnectedToServer.

Sometimes info.sender.guid is set to a correct looking guid.

Sometimes info.sender.guid is “0” which I think corresponds to the sender being the same as the receiver, which doesn’t seem to be a problem if that’s the case (but I can’t find that documented anywhere).

However at other times info.sender.guid is “”. This happens on the joining client but not the server. I’m not sure why this is happening or how to work around it (I need the guid for uniquely naming and identifying some objects).

I think the problem might be that the guid hasn’t been assigned at the time I call the RPC (I’m calling it from OnConnectedToServer), but can’t find any documentation about when the guid gets set.

  1. Does the sender.guid of “0” correspond to the receiver being the sender or is something else going wrong?
  2. Why is the guid blank for connecting clients (set to the empty string “”)?
  3. At what point does the NetworkPlayer guid get assigned in the connection process?

I’m working around it now by passing Network.player.guid as a parameter to my RPC (so it’s void AddPlayer( Vector3 position, Quaternion rotation, string netPlayerGuid, NetworkMessageInfo info ) ).

But I’m still curious why it doesn’t always come through correctly in NetworkMessageInfo.