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

Fixed: several connection logic issues #906

Closed uifdev closed 6 months ago

uifdev commented 6 months ago
  1. Clients weren't kicked if the client version doesn't match the server version.
  2. Clients were flagged as logged in to the game regardless of the result of OnPeerConnect, meaning they wouldn't be dropped in the event of a failure.
atomlin-git commented 6 months ago

I don't think these changes make any sense. A kick for an incorrect version will be executed one way or another due to the return of nullptr. Regarding the fact that clients were marked as entering the game, this does not pose any problem. One way or another, if the player does not take the necessary actions, he will be kicked lower.

uifdev commented 6 months ago

A kick for an incorrect version will be executed one way or another due to the return of nullptr.

No, it won't. This PR fixes precisely that bug. Don't comment if you can't read or understand the code.

@Hual Re-added kick calls as per your suggestion, so invalid clients get kicked ASAP.

AmyrAhmady commented 6 months ago

Syncing raknet here, since it's related. changes are from this PR: https://github.com/openmultiplayer/RakNet/pull/22