- Home /
Check if RPC was received or acknowledged by the client
I've looked through the questions on RPCs and scanned the documentation but couldn't find an answer to my question.
According to the documentation, RPCs are guaranteed to be delivered and in order. This obviously means that the sender of the RPC must get some kind of acknowledgement message back from the guest/client. Is it possible to check and see if an RPC has been acknowledged?
The purpose is to know all clients have acknowledged the message before proceeding with play, in real-time. As a workaround, right now I'm replying to RPCs with another "Acknowledge" RPC. I don't like this since it doubles the number of RPC calls that must be made.
Answer by tobiass · Jan 14, 2015 at 01:25 PM
It is not possible to check if some message was ACKd. However, if there is no ACK for anything sent reliably (like RPCs), then the connection will time out.
The timeout is several seconds, so that's not really of help immediately.
If you send updates regularly, each client could send regularly what the max (lock)step it got so far. Let's say a client got 1, 2, 4, it should include the two in updates. The step 3 will show up in a moment or someone will time out because the client does not get messages anymore.
Is it possible to know what the timeout is? If so, you could just keep track of the time since the packet was sent.
Thanks. Looks like I'm stuck sending extra packets regardless of what strategy I use :(
You can send then in-line with the normal steps. You have to send those regularly anyways, no?
You could, but your game would be more susceptible to lag. Let's say you send updates every 200 ms. If you got an update at the 201 ms you'd wait another 199 ms before sending AC$$anonymous$$. If there's a communication lag at that moment and the ping jumps to over 200, you now have to stop the game and wait for that AC$$anonymous$$. For me, latency is much more crucial than bandwidth so I'd rather double bandwidth than introduce additional delay. For someone else this might be acceptable.