xtreme8000 / BetterSpades

BetterSpades, an Ace of Spades client targeted at low end systems (GL/ES 1.1). Runs on your grandmother's rig!
https://aos.party/jenkins/job/BetterSpades/
GNU General Public License v3.0
243 stars 40 forks source link

network.c: Do not send Weapon input when sprinting #144

Closed Haxk20 closed 2 years ago

Haxk20 commented 2 years ago

BetterSpades was sending weapon inputs to server even when sprinting because it was checking only if the weapon input is different to previously sent one.

Fix this by checking if player is sprinting and not allowing such packet to be sent. (The packets cant do any harm really but players can spam the server with it when sprinting thus creating fake shots)

Haxk20 commented 2 years ago

@xtreme8000 Can you click that merge button ? I think it had enough time in review ? (Doubt it needs any)

xtreme8000 commented 2 years ago

Would it be better if the mouse button state was reset when starting to sprint, i.e. sending a 0x00 button state to the server?

Haxk20 commented 2 years ago

Would it be better if the mouse button state was reset when starting to sprint, i.e. sending a 0x00 button state to the server?

Hmmm. Thinking about it, it is true a user could be shooting and then without releasing shooting start sprinting. In which case when the user stops "shooting" it would not send it.

But then again OpenSpades does it the way this PR is currently and afaik we do not experience any issues from that. And still people would be able to spam the server with mouse events if we were to modify the PR to send 0x00 (0) on mouse event when sprinting.