Change Bouncer initialization to a more permanent home

This commit is contained in:
Lucas Nicodemus 2017-12-16 01:06:41 -07:00
parent 1bee289daf
commit 0260530848
2 changed files with 6 additions and 3 deletions

View file

@ -33,12 +33,12 @@ using Terraria.Localization;
namespace TShockAPI
{
/// <summary>Bouncer is the TShock anti-hack and build guardian system</summary>
/// <summary>Bouncer is the TShock anti-hack and anti-cheat system.</summary>
internal sealed class Bouncer
{
/// <summary>Constructor call initializes Bouncer and related functionality.</summary>
/// <returns>A new Bouncer.</returns>
internal Bouncer(TerrariaPlugin pluginInstance)
internal Bouncer()
{
// Setup hooks

View file

@ -138,6 +138,9 @@ namespace TShockAPI
/// </summary>
public static Dictionary<string, SecureRest.TokenData> RESTStartupTokens = new Dictionary<string, SecureRest.TokenData>();
/// <summary>The TShock anti-cheat/anti-exploit system.</summary>
internal Bouncer Bouncer;
/// <summary>
/// Called after TShock is initialized. Useful for plugins that needs hooks before tshock but also depend on tshock being loaded.
/// </summary>
@ -322,6 +325,7 @@ namespace TShockAPI
RestApi = new SecureRest(Netplay.ServerIP, Config.RestApiPort);
RestManager = new RestManager(RestApi);
RestManager.RegisterRestfulCommands();
Bouncer = new Bouncer();
var geoippath = "GeoIP.dat";
if (Config.EnableGeoIP && File.Exists(geoippath))
@ -379,7 +383,6 @@ namespace TShockAPI
Log.ConsoleInfo("TShock comes with no warranty & is free software.");
Log.ConsoleInfo("You can modify & distribute it under the terms of the GNU GPLv3.");
Bouncer b = new Bouncer(this);
}
catch (Exception ex)
{