mtasa-blue
mtasa-blue copied to clipboard
Kicked players receive timeout error instead of kick notification
Describe the bug
When a player joins a game and server decides to kick the player on onPlayerJoin event, server kicks him and drops connection, however client doesnt recognize it being kicked, rather receive a timeout error message.
Note: This only happens on clients with very low specs, likely GTA/MTA process being busy loading while server drops the connection.
Using onPlayerResourceStart reduces the amount of clients affected by this issue, however it still occurs.
Steps to reproduce
Very dificult to reproduce since you need a very low system which barely runs GTA/MTA. Usually the affected clients are from third world countries using 20 years old hardware and trimmed down GTA versions.
Version
Any
Additional context
No response
Relevant log output
No response
Security Policy
- [X] I have read and understood the Security Policy and this issue is not security related.
You shouldn't kick players in onPlayerJoin, rather you should use onPlayerConnect with cancelEvent()
Cant use cancelEvent inside onPlayerConnect since I use async SQL query before kicking someone.
Cant use cancelEvent inside onPlayerConnect since I use async SQL query before kicking someone.
Could you just refactor your system to not depend on database queries on connect in this specific system?
Cant use cancelEvent inside onPlayerConnect since I use async SQL query before kicking someone.
Could you just refactor your system to not depend on database queries on connect in this specific system?
I've added a delay to my system for some time now, > 6 months ago. I use onPlayerResourceStart and afterwards kick the player once the main gamemode resource was loaded. This helped the issue to some degree but some players still receive a timeout error.
Note that those players run MTA on very weak hardware, my guess is the game process takes too long to handle the disconnect properly, the internet connection could also be a potential issue.