This commit is contained in:
Lucas Nicodemus 2011-12-22 12:16:19 -07:00
parent 1f08ee5281
commit 26afe92648
4 changed files with 10 additions and 50 deletions

View file

@ -177,7 +177,10 @@ namespace TShockAPI
[Description("Enable Server Side Inventory checks, EXPERIMENTAL")]
public bool ServerSideInventory = false;
public static ConfigFile Read(string path)
[Description("Disables reporting of playercount to the stat system.")]
public bool DisablePlayerCountReporting = false;
public static ConfigFile Read(string path)
{
if (!File.Exists(path))
return new ConfigFile();

View file

@ -35,6 +35,5 @@ using System.Runtime.InteropServices;
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.4.1.1222")]
[assembly: AssemblyFileVersion("3.4.1.1222")]

View file

@ -71,7 +71,7 @@ namespace TShockAPI
public static SecureRest RestApi;
public static RestManager RestManager;
public static Utils Utils = new Utils();
public static StatTracker StatTracker = new StatTracker();
/// <summary>
/// Called after TShock is initialized. Useful for plugins that needs hooks before tshock but also depend on tshock being loaded.
/// </summary>
@ -226,49 +226,7 @@ namespace TShockAPI
}
private void callHome()
{
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 (" + VersionNum + ")");
try
{
string response = client.DownloadString("http://tshock.co/tickto.php?do=log&fp=" + fp + "&ver=" + VersionNum + "&port=" + Netplay.serverPort);
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("\nRegistered with stat tracker: " + response + "\n");
Console.ForegroundColor = ConsoleColor.Gray;
}
catch (Exception e)
{
Log.Error(e.ToString());
}
}
}
RestObject RestApi_Verify(string username, string password)
{
@ -455,8 +413,7 @@ namespace TShockAPI
if (Config.RestApiEnabled)
RestApi.Start();
Thread t = new Thread(callHome);
t.Start();
StatTracker.checkin();
}
@ -466,7 +423,7 @@ namespace TShockAPI
private void OnUpdate()
{
UpdateManager.UpdateProcedureCheck();
StatTracker.checkin();
if (Backups.IsBackupTime)
Backups.Backup();

View file

@ -125,6 +125,7 @@
<Compile Include="Rest\RestObject.cs" />
<Compile Include="Rest\RestVerbs.cs" />
<Compile Include="Rest\SecureRest.cs" />
<Compile Include="StatTracker.cs" />
<Compile Include="Utils.cs" />
<Compile Include="TShock.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
@ -181,7 +182,7 @@
</PropertyGroup>
<ProjectExtensions>
<VisualStudio>
<UserProperties BuildVersion_UpdateAssemblyVersion="True" BuildVersion_UpdateFileVersion="True" BuildVersion_BuildAction="Both" BuildVersion_BuildVersioningStyle="None.None.None.MonthAndDayStamp" BuildVersion_StartDate="2011/6/17" BuildVersion_IncrementBeforeBuild="False" />
<UserProperties BuildVersion_IncrementBeforeBuild="False" BuildVersion_StartDate="2011/6/17" BuildVersion_BuildVersioningStyle="None.None.None.MonthAndDayStamp" BuildVersion_BuildAction="Both" BuildVersion_UpdateFileVersion="True" BuildVersion_UpdateAssemblyVersion="True" />
</VisualStudio>
</ProjectExtensions>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.