openmultiplayer / open.mp

Open Multiplayer, a multiplayer mod fully backwards compatible with SA-MP
https://open.mp
Mozilla Public License 2.0
453 stars 92 forks source link

Handle internal immediate forced disconnects #908

Closed AmyrAhmady closed 6 months ago

AmyrAhmady commented 6 months ago

This PR is basically doing what https://github.com/openmultiplayer/RakNet/pull/21 does but properly by handling forced closed connections/disconnects

Quoted explanation from the said PR:

If a player exceeds a network limit (e.g. messageholelimit), the player's IP is banned and the connection is immediately closed by RakNet internally. The open.mp server is by design not notified of connections closed internally by RakNet. This causes three issues. First, the player concerned will remain connected in open.mp as a zombie player. Second, once all player IDs are taken, new players are assigned player ID -1. Third, due to missing array boundary checks in the open.mp server at several places, the server will crash when trying to access an array at index -1. This commit fixes all issues by banning the IP only, which results in a connection time out, of which the open.mp server is notified, which deletes the player accordingly.

AmyrAhmady commented 6 months ago

Fixes #882 and #801

Hual commented 6 months ago

Any idea what the performance impact of attaching a plugin is? Did you test if the problem is fixed?

AmyrAhmady commented 6 months ago

Closing this, since we found a better solution, available in here: https://github.com/openmultiplayer/RakNet/pull/22