fix clients not getting correctly banned if this hook is present

This commit is contained in:
Evil Factory
2022-02-07 18:14:27 -03:00
parent ffe544d406
commit 8ac7e08aac

View File

@@ -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;