One of the things I’m working on right now is a weapon ammo system. Pretty standard stuff – you have a number of shots in your magazine and when that’s empty, you take some time to reload your magazine from your extra ammo supply.
The “problem” I’m running into is programming this in a way that it can’t be easily bypassed by exploiters but without making it too affected by latency. The placeholder system I’ve been using is having the wait being done entirely on the clientside – when the player reloads, the client waits the reloading time then sends a request to the server to instantly actually enact the effects of the reloading. But as the wait is clientside, an exploiter could pretty easily have their weapon instantly reload.
Does anyone have any recommended ways of approaching this? To have the client reload their weapon without completely trusting the client or being too affected by latency. Or should I just accept the consequences of trusting the client here?