Skip to content

Commit

Permalink
netplay: Fix old clients check in PendingInitialConnect handling
Browse files Browse the repository at this point in the history
The check to refuse old clients (2.3.7) joining doesn't trigger
`if (connectFailed)` case to remove the failed connection
immediately because of the missing `else` in the initial
version check `if-else` clause, but instead falls through
to the `continue` statement.

Signed-off-by: Pavel Solodovnikov <pavel.al.solodovnikov@gmail.com>
  • Loading branch information
ManManson authored and past-due committed Jun 19, 2024
1 parent 2548b41 commit 5134fb5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/netplay/netplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4034,8 +4034,7 @@ static void NETallowJoining()
NETaddSessionBanBadIP(tmp_connectState[i].ip);
connectFailed = true;
}

if (tmp_connectState[i].usedBuffer >= 8)
else if (tmp_connectState[i].usedBuffer >= 8)
{
// New clients send NETCODE_VERSION_MAJOR and NETCODE_VERSION_MINOR
// Check these numbers with our own.
Expand Down

0 comments on commit 5134fb5

Please sign in to comment.