Quantcast
Viewing all articles
Browse latest Browse all 65

How to validate client input on authoritative server? (preventing speedhack or networtk send rate manipulation)

I am using [this repo][1] as my base. I made some changes (e.g. removed position from command and not resending already send inputs), but principle is the same. Everything important is in [this file][2]. Also i decreased fixedTimeStep to 0.02f and set networkSendRate to 0.04-6f (i'm not decided yet). Inputs send to server are capped by sbyte (see CharacterInput), so there is no need to validate them. inputHorizontal = (sbyte)(value * 127); Here are my problems: If client increases input send rate he will move faster than he should. If client decreases input rate (or packets get delayed) player can get stuck in air while gravity should drag him down. So my first idea was to queue inputs from client and execute them in FixedUpdate function. Also when no inputs are in queue server would execute empty input for gravity/environment. As you can guess queue start growing fast and inputs from client were not processed because of delayed inputs (network simulator). Also i got ideas about player's system time etc., but that feels gimmicky and unreliable. How to properly validate client inputs on authoritative server without losing prediction? Thanks [1]: https://github.com/atrakeur/unity-unet-authoritative-networking [2]: https://github.com/atrakeur/unity-unet-authoritative-networking/blob/master/Assets/Scripts/Character/CharacterNetworkInput.cs

Viewing all articles
Browse latest Browse all 65

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>