Open Sceptero opened 10 years ago
I'm pretty sure that cipbia currently sends packet onKeyDown and if given time passes onKeyUp, this was used to reduce dummies abuse
Code to limit hotkey (not packets per second of whole client). In source src\framework\luafunctions.cpp add new function (we need high precision time in LUA):
g_lua.bindGlobalFunction("timeMillis", []() { return (int) stdext::millis(); });
In modules game_hotkeys\hotkeys_manager.lua before:
function doKeyCombo(keyCombo)
Add:
local lastHotkeyUse = 0
After:
if hotKey.autoSend then
Add:
if timeMillis() - lastHotkeyUse < 100 then return end
lastHotkeyUse = timeMillis()
Simple limit until we get source fix for it. 100 = 100 miliseconds (0.1 sec) between hotkeys actions. Tested on newest sources.
Many new servers use "maxPacketsPerSecond = 25". Holding down a hotkey button pressed results in a kick from those servers. Cipsoft's tibia client must be limiting number of packets which are sent while holding down a hotkey because you can do it and not get kicked out of the server. Maybe adding some configurable delay between each packet of the same type would solve the problem.