diff --git a/TShockAPI/ConfigFile.cs b/TShockAPI/ConfigFile.cs index a5178cd7..64c9fabb 100644 --- a/TShockAPI/ConfigFile.cs +++ b/TShockAPI/ConfigFile.cs @@ -159,8 +159,6 @@ namespace TShockAPI [Description("Time, in milliseconds, to disallow discarding items after logging in when ServerSideInventory is ON.")] public int LogonDiscardThreshold=250; - [Description("Disables reporting of playercount to the stat system.")] public bool DisablePlayerCountReporting; - [Description("Disables clown bomb projectiles from spawning.")] public bool DisableClownBombs; [Description("Disables snow ball projectiles from spawning.")] public bool DisableSnowBalls; @@ -242,8 +240,6 @@ namespace TShockAPI [Description("Displays chat messages above players' heads, but will disable chat prefixes to compensate.")] public bool EnableChatAboveHeads = false; - [Description("Hide stat tracker console messages.")] public bool HideStatTrackerDebugMessages = true; - [Description("Force Christmas only events to occur all year.")] public bool ForceXmas = false; [Description("Allows groups on the banned item allowed list to spawn banned items.")] public bool AllowAllowedGroupsToSpawnBannedItems = false; diff --git a/TShockAPI/StatTracker.cs b/TShockAPI/StatTracker.cs deleted file mode 100644 index 248236f3..00000000 --- a/TShockAPI/StatTracker.cs +++ /dev/null @@ -1,100 +0,0 @@ -/* -TShock, a server mod for Terraria -Copyright (C) 2011-2013 Nyx Studios (fka. The TShock Team) - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -using System; -using System.IO; -using System.Net; -using System.Threading; -using Terraria; - -namespace TShockAPI -{ - public class StatTracker - { - private Utils Utils = TShock.Utils; - public DateTime lastcheck = DateTime.MinValue; - private readonly int checkinFrequency = 5; - - public void CheckIn() - { - if ((DateTime.Now - lastcheck).TotalMinutes >= checkinFrequency) - { - ThreadPool.QueueUserWorkItem(CallHome); - lastcheck = DateTime.Now; - } - } - - private void CallHome(object state) - { - string fp; - string lolpath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/.tshock/"; - if (!Directory.Exists(lolpath)) - { - Directory.CreateDirectory(lolpath); - } - if (!File.Exists(Path.Combine(lolpath, Netplay.serverPort + ".fingerprint"))) - { - fp = ""; - int random = Utils.Random.Next(500000, 1000000); - fp += random; - - fp = Utils.HashPassword(Netplay.serverIP + fp + Netplay.serverPort + Netplay.serverListenIP); - TextWriter tw = new StreamWriter(Path.Combine(lolpath, Netplay.serverPort + ".fingerprint")); - tw.Write(fp); - tw.Close(); - } - else - { - fp = ""; - TextReader tr = new StreamReader(Path.Combine(lolpath, Netplay.serverPort + ".fingerprint")); - fp = tr.ReadToEnd(); - tr.Close(); - } - - using (var client = new WebClient()) - { - client.Headers.Add("user-agent", - "TShock (" + TShock.VersionNum + ")"); - try - { - string response; - if (TShock.Config.DisablePlayerCountReporting) - { - response = - client.DownloadString("http://tshock.co/tickto.php?do=log&fp=" + fp + "&ver=" + TShock.VersionNum + "&os=" + - Environment.OSVersion + "&mono=" + Main.runningMono + "&port=" + Netplay.serverPort + - "&plcount=0"); - } - else - { - response = - client.DownloadString("http://tshock.co/tickto.php?do=log&fp=" + fp + "&ver=" + TShock.VersionNum + "&os=" + - Environment.OSVersion + "&mono=" + Main.runningMono + "&port=" + Netplay.serverPort + - "&plcount=" + TShock.Utils.ActivePlayers()); - } - if (!TShock.Config.HideStatTrackerDebugMessages) - Log.ConsoleInfo("Stat Tracker: " + response); - } - catch (Exception e) - { - Log.Error(e.ToString()); - } - } - } - } -} \ No newline at end of file diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index e16f385f..f45262f4 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -69,7 +69,6 @@ namespace TShockAPI public static SecureRest RestApi; public static RestManager RestManager; public static Utils Utils = Utils.Instance; - public static StatTracker StatTracker = new StatTracker(); /// /// Used for implementing REST Tokens prior to the REST system starting up. /// @@ -545,7 +544,6 @@ namespace TShockAPI Regions.ReloadAllRegions(); Lighting.lightMode = 2; - StatTracker.CheckIn(); FixChestStacks(); @@ -575,7 +573,6 @@ namespace TShockAPI private void OnUpdate() { UpdateManager.UpdateProcedureCheck(); - StatTracker.CheckIn(); if (Backups.IsBackupTime) Backups.Backup(); //call these every second, not every update diff --git a/TShockAPI/TShockAPI.csproj b/TShockAPI/TShockAPI.csproj index 94909ef4..ab4c32bf 100644 --- a/TShockAPI/TShockAPI.csproj +++ b/TShockAPI/TShockAPI.csproj @@ -134,7 +134,6 @@ - @@ -192,7 +191,7 @@ - +