edubart / otclient

An alternative tibia client for otserv written in C++11 and Lua, made with a modular system that uses lua scripts for ingame interface and functionality, making otclient flexible and easy to customize
Other
652 stars 399 forks source link

Missing delay for some actions #903

Open andersonfaaria opened 6 years ago

andersonfaaria commented 6 years ago

There's some cases where we definitely should have a delay to control the actions, principally if the player isn't a game master. One of the things that always piss me off is the CTRL + ARROW key to change direction. tibia This happens because the game is too sensible with the arrow keys and when you press CTRL + -> it interprets hundreds of commands instead of pressing one time and adding a delay to the next action;

Before creating an issue, please ensure:

Steps to reproduce (include any configuration/script required to reproduce)

  1. Hold Ctrl + /\ (up arrow key)
  2. While still holding Ctrl Switch to -> (left arrow key)
  3. If you do this rapidly or hold for enough time, the movement won't be fluid and a glitch will occur.

Expected behaviour

The game should have a way to filtering when you are holding a key. Perhaps ignoring holding for most of the actions except hotkey and for the hotkeys we should have at least a safe delay like 100ms or something like that.

Actual behaviour

No delay at all, if you hold a button you are catched on the maxPacketsPerSecond configuration of tfs and the server disconnects you.

soul4soul commented 6 years ago

This seems related to issue #564

andersonfaaria commented 6 years ago

this one was specific about hotkeys, but definitely related. I think we should have a class that filters every action of the game and decide if the action should pass or be filtered. This would be a huge improvement. Something like 'processAction'