Hark
This commit is contained in:
parent
1f08ee5281
commit
26afe92648
4 changed files with 10 additions and 50 deletions
|
|
@ -177,7 +177,10 @@ namespace TShockAPI
|
||||||
[Description("Enable Server Side Inventory checks, EXPERIMENTAL")]
|
[Description("Enable Server Side Inventory checks, EXPERIMENTAL")]
|
||||||
public bool ServerSideInventory = false;
|
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))
|
if (!File.Exists(path))
|
||||||
return new ConfigFile();
|
return new ConfigFile();
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,5 @@ using System.Runtime.InteropServices;
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
|
||||||
|
|
||||||
[assembly: AssemblyVersion("3.4.1.1222")]
|
[assembly: AssemblyVersion("3.4.1.1222")]
|
||||||
[assembly: AssemblyFileVersion("3.4.1.1222")]
|
[assembly: AssemblyFileVersion("3.4.1.1222")]
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ namespace TShockAPI
|
||||||
public static SecureRest RestApi;
|
public static SecureRest RestApi;
|
||||||
public static RestManager RestManager;
|
public static RestManager RestManager;
|
||||||
public static Utils Utils = new Utils();
|
public static Utils Utils = new Utils();
|
||||||
|
public static StatTracker StatTracker = new StatTracker();
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called after TShock is initialized. Useful for plugins that needs hooks before tshock but also depend on tshock being loaded.
|
/// Called after TShock is initialized. Useful for plugins that needs hooks before tshock but also depend on tshock being loaded.
|
||||||
/// </summary>
|
/// </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)
|
RestObject RestApi_Verify(string username, string password)
|
||||||
{
|
{
|
||||||
|
|
@ -455,8 +413,7 @@ namespace TShockAPI
|
||||||
if (Config.RestApiEnabled)
|
if (Config.RestApiEnabled)
|
||||||
RestApi.Start();
|
RestApi.Start();
|
||||||
|
|
||||||
Thread t = new Thread(callHome);
|
StatTracker.checkin();
|
||||||
t.Start();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -466,7 +423,7 @@ namespace TShockAPI
|
||||||
private void OnUpdate()
|
private void OnUpdate()
|
||||||
{
|
{
|
||||||
UpdateManager.UpdateProcedureCheck();
|
UpdateManager.UpdateProcedureCheck();
|
||||||
|
StatTracker.checkin();
|
||||||
if (Backups.IsBackupTime)
|
if (Backups.IsBackupTime)
|
||||||
Backups.Backup();
|
Backups.Backup();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -125,6 +125,7 @@
|
||||||
<Compile Include="Rest\RestObject.cs" />
|
<Compile Include="Rest\RestObject.cs" />
|
||||||
<Compile Include="Rest\RestVerbs.cs" />
|
<Compile Include="Rest\RestVerbs.cs" />
|
||||||
<Compile Include="Rest\SecureRest.cs" />
|
<Compile Include="Rest\SecureRest.cs" />
|
||||||
|
<Compile Include="StatTracker.cs" />
|
||||||
<Compile Include="Utils.cs" />
|
<Compile Include="Utils.cs" />
|
||||||
<Compile Include="TShock.cs" />
|
<Compile Include="TShock.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
|
@ -181,7 +182,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ProjectExtensions>
|
<ProjectExtensions>
|
||||||
<VisualStudio>
|
<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>
|
</VisualStudio>
|
||||||
</ProjectExtensions>
|
</ProjectExtensions>
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue