I would like server to broadcast some message from one client between other clients, without the original client sender receiving again.
I know i could just simply loop through all connected and skip the sender, but i also know that RakNet has this feature (sending to everyone except one) and that it would be probably more effective.
1 Answer
1To be honest this is a stupid question, that could be answered by just taking a look at the Unity Docs, but nevertheless here is the answer ![]()
networkView.RPC("MyFunction", RPCMode.Others, myvariable);
The RPCMode allows you to regulate who receives the RPC. This includes only the server, everyone, and everyone except the sender. Some of these can also be buffered.
More info here; http://docs.unity3d.com/Documentation/ScriptReference/RPCMode.html
And here: http://docs.unity3d.com/Documentation/Components/net-RPCDetails.html
Hope this helps :D
Sorry, you didn't understand. I don't want to exclude the sender of this RPC, but other chosen peer (peer who sent an RPC to the server and now server broadcasts this message to other peers except for the peer that sent it to the server.) RakNet does have this option, but i can't see it in Unity
– PangaminiThanks for clearing that up :) that is possible in unity, but you would have to write it yourself!
– Benproductions1
Please choose a correct answer and rate it up...
– Benproductions1