Merge branch 'master' of git://github.com/TShock/TShock

This commit is contained in:
Twitchy 2011-06-25 01:43:52 +12:00
commit b2271f980e
3 changed files with 9 additions and 1 deletions

View file

@ -144,6 +144,7 @@ namespace TShockAPI
ChatCommands.Add(new Command("me", "", ThirdPerson));
ChatCommands.Add(new Command("p", "", PartyChat));
ChatCommands.Add(new Command("rules", "", Rules));
ChatCommands.Add(new Command("displaylogs", "logs", Rules));
if (ConfigurationManager.DistributationAgent != "terraria-online")
{
ChatCommands.Add(new Command("kill", "kill", Kill));
@ -429,6 +430,12 @@ namespace TShockAPI
}
}
public static void DisplayLogs(CommandArgs args)
{
args.Player.DisplayLogs = (!args.Player.DisplayLogs);
args.Player.SendMessage("You now " + (args.Player.DisplayLogs ? "receive" : "stopped receiving") + " logs");
}
#endregion Player Management Commands
#region Server Maintenence Commands

View file

@ -38,6 +38,7 @@ namespace TShockAPI
public Rectangle TempArea = new Rectangle();
public DateTime LastExplosive { get; set; }
public bool InitSpawn = false;
public bool DisplayLogs = true;
public bool RealPlayer
{

View file

@ -132,7 +132,7 @@ namespace TShockAPI
TSPlayer.Server.SendMessage(log, color);
foreach (TSPlayer player in TShock.Players)
{
if (player != null && player.Active && player.Group.HasPermission("logs"))
if (player != null && player.Active && player.Group.HasPermission("logs") && player.DisplayLogs)
player.SendMessage(log, color);
}
}