From d1f1e422a0776f75b0251c884900a079d7e4eb1a Mon Sep 17 00:00:00 2001 From: CoderCow Date: Mon, 22 Jul 2013 11:28:12 +0200 Subject: [PATCH] -Ingame log messages are no longer shown to the player who caused them. -Changed ingame log message color to something more unique for better identification. --- TShockAPI/Commands.cs | 4 ++-- TShockAPI/GetDataHandlers.cs | 2 +- TShockAPI/Utils.cs | 11 ++++++----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index ac8cf231..9db26c72 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -282,7 +282,7 @@ namespace TShockAPI { if (!cmd.CanRun(player)) { - TShock.Utils.SendLogs(string.Format("{0} tried to execute /{1}.", player.Name, cmdText), Color.Red); + TShock.Utils.SendLogs(string.Format("{0} tried to execute /{1}.", player.Name, cmdText), Color.PaleVioletRed, player); player.SendErrorMessage("You do not have access to that command."); } else if (!cmd.AllowServer && !player.RealPlayer) @@ -292,7 +292,7 @@ namespace TShockAPI else { if (cmd.DoLog) - TShock.Utils.SendLogs(string.Format("{0} executed: /{1}.", player.Name, cmdText), Color.Red); + TShock.Utils.SendLogs(string.Format("{0} executed: /{1}.", player.Name, cmdText), Color.PaleVioletRed, player); cmd.Run(cmdText, player, args); } } diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index e8ff6d65..bd77b273 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -2922,7 +2922,7 @@ namespace TShockAPI break; } - TShock.Utils.SendLogs(string.Format("{0} summoned {1}", args.Player.Name, boss), Color.Red); + TShock.Utils.SendLogs(string.Format("{0} summoned {1}", args.Player.Name, boss), Color.PaleVioletRed, args.Player); return false; } } diff --git a/TShockAPI/Utils.cs b/TShockAPI/Utils.cs index f98cb284..5f0d8706 100644 --- a/TShockAPI/Utils.cs +++ b/TShockAPI/Utils.cs @@ -218,18 +218,19 @@ namespace TShockAPI } /// - /// Sends message to all users with 'logs' permission. + /// Sends message to all players with 'logs' permission. /// /// Message to send - /// Color of the message - public void SendLogs(string log, Color color) + /// Color of the message + /// The player to not send the message to. + public void SendLogs(string log, Color color, TSPlayer excludedPlayer = null) { Log.Info(log); TSPlayer.Server.SendMessage(log, color); foreach (TSPlayer player in TShock.Players) { - if (player != null && player.Active && player.Group.HasPermission(Permissions.logs) && player.DisplayLogs && - TShock.Config.DisableSpewLogs == false) + if (player != null && player != excludedPlayer && player.Active && player.Group.HasPermission(Permissions.logs) && + player.DisplayLogs && TShock.Config.DisableSpewLogs == false) player.SendMessage(log, color); } }