I've come across an issue where I struggle to find consistence in doing server side sanity checks for client side hitboxes when it comes to their timing. For context, my system sends two remotes: one intending the attack and another requesting the hitbox validation. The second remote (hitbox activation), relies on the intent remote being received on time. The server then checks the times recieved for both remotes to validate whether the hitbox remote was sent within reasonable time (the m1 hitbox is delayed.) after the intent. For example, if a hitbox is expected to activate 0.2 seconds after an animation, the intent is fired instantly and the hitbox is fired 0.2 seconds until its active frames end. However, due to the client having variable ping, the remotes can arrive at different timings which leads to the second remote arriving to early or too late (which is very rare though). A fix I've tried to implement is buffer that continuously does sanity checks for a short amount of time, but I was wondering if there was a more efficient way of resolving this issue.
Here my scripted implementation so far: https://pastebin.com/UcbkPeta
Unfortunately, it has an occasional situation where it fails, pushing me to consider a new system.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
