I started working with UE recently and now I’m diving into multiplayer systems. So my question: is it safe to pass the parameters from client to server when using “on server” events? Simple example: RTS game, I want to build a building. Of course, server does not know nothing about my cursor. So I’ve to pass the cursor location somehow. But player (read as cheater) can pass there anything he wants.
Or another example: player builds a turret. The turret shot down some target. To track who shot I can pass the reference from the player to turret → from turret to bullet actor (I know that it’s much better to “getOwner” from server event but anyway). But as I mention before: is it “safe”? I mean in theory player can pass a reference to another player?
What are good practices should I use? Should I avoid to pass params into the server events?
Basically nothing is safe when it originates from a client but the client still need to convey their intent to the server obviously.
The server needs to do its own sanity checks of the input it gets from the client and reject it if it doesn’t comply with the constraints you make.
Since you just started diving into multiplayer you have many other concerns to focus on first just to ensure things are in sync to begin with.
Fighting cheaters is a battle that is pretty much impossible to win if you don’t use dedicated servers or have a team of developers and testers to help you find holes in your programming.