From 85123a4db3f7363ac05ba875fd42e1b6ad412b12 Mon Sep 17 00:00:00 2001 From: Deathmax Date: Sun, 4 Dec 2011 17:38:30 +0800 Subject: [PATCH] Option to send player IPs to admins. --- TShockAPI/ConfigFile.cs | 3 +++ TShockAPI/TShock.cs | 2 ++ 2 files changed, 5 insertions(+) diff --git a/TShockAPI/ConfigFile.cs b/TShockAPI/ConfigFile.cs index 5021743f..fc579a72 100644 --- a/TShockAPI/ConfigFile.cs +++ b/TShockAPI/ConfigFile.cs @@ -202,6 +202,9 @@ namespace TShockAPI [Description("Disable tombstones for all players.")] public bool DisableTombstones = true; + [Description("Displays a player's IP on join to everyone who has the log permission")] + public bool DisplayIPToAdmins = false; + public static ConfigFile Read(string path) { if (!File.Exists(path)) diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 11ecd871..3e3cf740 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -693,6 +693,8 @@ namespace TShockAPI player.Teleport((int)pos.X, (int)pos.Y); player.SendTileSquare((int)pos.X, (int)pos.Y); } + if (Config.DisplayIPToAdmins) + Utils.SendLogs(string.Format("{0} has joined. IP: {1}", player.Name, player.IP), Color.Blue); e.Handled = true; }