From 2169d455afb3c3b4792d19bcf3c38a44996859a2 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Thu, 24 May 2012 10:20:41 -0600 Subject: [PATCH] Fixed a potential issue surrounding silent kicks This should resolve any issues where a player being kicked prior to join has a mesasge sent to chat. If not, then the method calling the ForceKick function isn't specifying that it should be silent. --- TShockAPI/Utils.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/TShockAPI/Utils.cs b/TShockAPI/Utils.cs index 2a215a3e..f1209cb0 100644 --- a/TShockAPI/Utils.cs +++ b/TShockAPI/Utils.cs @@ -588,10 +588,13 @@ namespace TShockAPI player.Disconnect(string.Format("Kicked: {0}", reason)); Log.ConsoleInfo(string.Format("Kicked {0} for : {1}", playerName, reason)); string verb = force ? "force " : ""; - if (string.IsNullOrWhiteSpace(adminUserName)) - Broadcast(string.Format("{0} was {1}kicked for {2}", playerName, verb, reason.ToLower())); - else - Broadcast(string.Format("{0} {1}kicked {2} for {3}", adminUserName, verb, playerName, reason.ToLower())); + if (!silent) + { + if (string.IsNullOrWhiteSpace(adminUserName)) + Broadcast(string.Format("{0} was {1}kicked for {2}", playerName, verb, reason.ToLower())); + else + Broadcast(string.Format("{0} {1}kicked {2} for {3}", adminUserName, verb, playerName, reason.ToLower())); + } return true; } return false;