My situation is this:
- Client performs action.
- Client sends command to server.
- Server receives command and performs action.
- Server sends RPC to all clients.
- All clients perform action.
In step 5, I believe the localPlayer (in the case of a host) is performing the action even though it was performed in step 3 (as the server). This can be avoided by returning if (isServer) in the RPC.
However, is there a way to exclude the client who made the command from receiving the serialized RPC to save bandwidth? I’d prefer to only have to send the client a cancellation message if the server rejects the commands.
I thought of returning on if (isLocalPlayer) in the RPC, but I think the network data would have already been sent at that point.
My suspicion is there is no way to do this and I’ll have to create my own messages for this, but I’d like to confirm before I commit to that path. If my assumption is correct, are there any plans for such a feature?
Thanks.