From 8ac7e08aaca99e3509d75dcc279ba441192b91b2 Mon Sep 17 00:00:00 2001 From: Evil Factory <36804725+evilfactory@users.noreply.github.com> Date: Mon, 7 Feb 2022 18:14:27 -0300 Subject: [PATCH] fix clients not getting correctly banned if this hook is present --- .../Networking/Primitives/Peers/Server/ServerPeer.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Barotrauma/BarotraumaServer/ServerSource/Networking/Primitives/Peers/Server/ServerPeer.cs b/Barotrauma/BarotraumaServer/ServerSource/Networking/Primitives/Peers/Server/ServerPeer.cs index ebe1a4ac5..e249c0e8a 100644 --- a/Barotrauma/BarotraumaServer/ServerSource/Networking/Primitives/Peers/Server/ServerPeer.cs +++ b/Barotrauma/BarotraumaServer/ServerSource/Networking/Primitives/Peers/Server/ServerPeer.cs @@ -211,12 +211,6 @@ namespace Barotrauma.Networking if (result.Bool()) goto ignore; - if (IsPendingClientBanned(pendingClient, out string banReason)) - { - RemovePendingClient(pendingClient, DisconnectReason.Banned, banReason); - return; - } - if (connectedClients.Count >= serverSettings.MaxPlayers) { RemovePendingClient(pendingClient, DisconnectReason.ServerFull, ""); @@ -224,6 +218,12 @@ namespace Barotrauma.Networking ignore: + if (IsPendingClientBanned(pendingClient, out string banReason)) + { + RemovePendingClient(pendingClient, DisconnectReason.Banned, banReason); + return; + } + if (pendingClient.InitializationStep == ConnectionInitialization.Success) { NetworkConnection newConnection = pendingClient.Connection;