Closed anonymous-d0z42ujxuog5 closed 6 years ago
Under investigation.
You know what, I think that client-server sync is fine. It occasionally logs a desync but it's mostly fixed within 10 seconds. It happens on round end a bunch, when the server is too busy probably to manage that type of sync. It would be good to analyze the server process during similar peaks and potentially lower some of the MTA server sync settings.
I now think that the desync occurs from client-to-client. Might I suggest a client-side script that detects if other nearby clients are punching the air, and log every instance of that on the server, and request peer-reviews from other nearby players to see if someone is actually punching the air or is wielding a weapon.
Also reported on MTA https://bugs.mtasa.com/view.php?id=9482 Page contains a script to re-sync the weapon state. Could just run that and see if and how the problem persists.
Another guy writes:
I had this bug everytime I spawned a player immediately after he got killed with weapons in hand. Fixed it by triggering the weapon to server on first shot after weapon switch (clientsided onClientPlayerWeaponFire) and on weapon switch (clientsided) and giving it to him with 0 ammo.
Implemented, need to see if it works in production. During test did not cause anything unexpected.
Sometimes it looks like players are punching the air, while on their screen they are firing a gun. Would it be possible to make the sync better, like added an extra resource that'd be checking clientside what weapon a player is holding and syncing that to the server. It kinda happens like all the time, and it's hard to tell when it happens to yourself. Especially me because I'm swapping weapons like all the time.
Look at the stripper cop behind the counter, the one on my right: https://www.youtube.com/watch?v=QVPIVgQJDCc&feature=youtu.be&t=40s