-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.
This commit is contained in:
CoderCow 2013-07-22 11:28:12 +02:00
parent 512ec24b57
commit d1f1e422a0
3 changed files with 9 additions and 8 deletions

View file

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

View file

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

View file

@ -218,18 +218,19 @@ namespace TShockAPI
}
/// <summary>
/// Sends message to all users with 'logs' permission.
/// Sends message to all players with 'logs' permission.
/// </summary>
/// <param name="log">Message to send</param>
/// <param name="color">Color of the message</param>
public void SendLogs(string log, Color color)
/// <param name="color">Color of the message</param>
/// <param name="excludedPlayer">The player to not send the message to.</param>
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);
}
}