mtasa-blue icon indicating copy to clipboard operation
mtasa-blue copied to clipboard

Kicked players receive timeout error instead of kick notification

Open ffsPLASMA opened this issue 3 years ago • 2 comments

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.

ffsPLASMA avatar Jun 05 '22 19:06 ffsPLASMA

You shouldn't kick players in onPlayerJoin, rather you should use onPlayerConnect with cancelEvent()

PlatinMTA avatar Jun 05 '22 23:06 PlatinMTA

Cant use cancelEvent inside onPlayerConnect since I use async SQL query before kicking someone.

ffsPLASMA avatar Jun 06 '22 08:06 ffsPLASMA

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?

patrikjuvonen avatar Jan 02 '23 14:01 patrikjuvonen

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.

ffsPLASMA avatar Jan 02 '23 17:01 ffsPLASMA