Added /displaylogs. Toggles log output to player who executed the command.
This commit is contained in:
parent
1e66e1a256
commit
679a28af0a
3 changed files with 9 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue