Ban before disconnecting client

This commit is contained in:
juanjp600
2016-09-02 22:49:40 -03:00
parent 03948d5f58
commit 4b10ca21c4
2 changed files with 21 additions and 21 deletions

View File

@@ -102,9 +102,9 @@ namespace Barotrauma.Networking
if (unauthClient.failedAttempts > 3)
{
//disconnect and ban after too many failed attempts
banList.BanPlayer("Unnamed", unauthClient.Connection.RemoteEndPoint.Address.ToString());
unauthClient.Connection.Disconnect("Too many failed login attempts. You have been automatically banned from the server.");
unauthenticatedClients.Remove(unauthClient);
banList.BanPlayer("Unnamed", unauthClient.Connection.RemoteEndPoint.Address.ToString());
unauthClient = null;
return;
}