From 9d6cf29c4e432752471185b740ad71226c6df4b4 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Fri, 1 Jul 2011 03:02:10 -0600 Subject: [PATCH] Eject a player from the server if they have 3+ invalid login attempts. --- TShockAPI/Commands.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 003e1718..29f98240 100755 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -289,6 +289,13 @@ namespace TShockAPI public static void AttemptLogin(CommandArgs args) { + + if (args.Player.LoginAttempts > 3) + { + Log.Warn(args.Player.IP + "(" + args.Player.Name + ") was had 3 or more invalid login attempts and was kicked automatically."); + Tools.Kick(args.Player, "Too many invalid login attempts."); + } + if (args.Parameters.Count != 2) { args.Player.SendMessage("Syntax: /login [username] [password]");