Often it is usefull to call an RPC to all, so you receive it yourself as well and you can put all logic in one place.
Now I noticed that NetworkMessageInfo.sender.Ipadress is empty and the portnumber is 0 if the sender is yourself. Why is this? If this is on purpose, why isn’t it documented?
Also, why can’t you send an RPC to yourself as server explicitly??
When I call something like:
networkView.RPC("RPC_StartGame", Network.player, vecSpawnPoint);
I get an error saying this player is not connected.
Calling
networkView.RPC("RPC_StartGame", RPCMode.Server, vecSpawnPoint);
Just doesn’t do anything.
But calling
networkView.RPC("RPC_StartGame", RPCMode.All, vecSpawnPoint);
DOES call the RPC function locally.
Now… this doesn’t make any sense to me.
Yeah, I have feature requested it and it will be fixed.
This problem, and others, are included in my network document. Reading it could save you some time on similar problems.
Hi Leepo, thanks for your reply! I hope they fix it soon.
You wouldn’t have a solution to create a NetworkMessageInfo object so I can pass it when manually calling the function, would you? I can of course create one, but I can’t change it’s values as they are ‘properties’ that only let me read the values.
Yeah I don’t think we can create an info object…so we need to add two functions.
Yeah I thought so. Allright then thanks alot!
Is this bug / issue solved?
I am using Unity 4.1.2. and getting the same issue.
Is anybody still facing this problem?
Still an issue. This problem alone already made me decide to not use Unity in any future projects.