- Home /
Mirror networking: Validating information
I acknowledge in advance that I may be at a complete disjoint in my understanding of the Command/Rpc pattern. My experience is through sending buffers of information as packets, and deciphering them at the other end through message queues.
I'm trying to make my Mirror project server-authoritative. That is to say, the server will validate a client's command, and push back on unplausible ones.
Am I correct in my understanding that I am required to send through as a parameter the same kind of information that would prefix a packet? For some quick examples, a message ID, so that i can send an ACK message back to the client to tell me my request was fulfilled or denied; a timestamp on the message; a priority id.
The specific use case that I want to solve, is for example, a client sends a Command to the server requesting to move, with unplausible coordinates. The server should want to reject the request, and tell the client to set his state back to where he was. However, in the meantime, the client has sent a new Command, this time with plausible coordinates. The server needs to be smart enough to discard the first request, knowing that the second request is fine.
How I usually would achieve this, is by using message ids and timestamps, to know which message is the newer message, and the one I actually care about. So, am I expected to send all of this information through as parameters to the Command so that the server can parse it? Or does the Rpc protocol work on different expectations, or have this information available elsewhere?
As a bonus point: If it is the case that this kind of buffer information is not available elsewhere, then why is the Command/Rpc pattern so powerful? To me, it only seems powerful to the point of rapid prototyping and server/client code in the same script only. I'm sure I'm wrong though, otherwise not all game engines would be using this type of implementation! I'm just curious to understand so that I can make a robust implementation.
Thanks in advance!
Your answer
Follow this Question
Related Questions
A nontrivial question: Call server procedure by wamp protocol 0 Answers
How to sync networkViewIDs 0 Answers
rpc doesnt get called on client 1 Answer
Proper way to instantiate projectile in PUN 1 Answer
[Mirror Networking] NullReferenceException on player when trying to start server a second time 1 Answer