From 549728b5105c874606da78139f2822145b7eca00 Mon Sep 17 00:00:00 2001 From: Shank Date: Sat, 4 Jun 2011 22:28:13 -0600 Subject: [PATCH] Added DistributionAgent to configuration file. Default is facepunch. Change it to terraria-online for cheat removal. --- TShockAPI/Commands.cs | 13 +++++++++---- TShockAPI/ConfigFile.cs | 1 + TShockAPI/ConfigurationManager.cs | 5 ++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 443c99d6..f0821396 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -44,14 +44,11 @@ namespace TShockAPI TShock.admincommandList.Add("tp", new CommandDelegate(TP)); TShock.admincommandList.Add("tphere", new CommandDelegate(TPHere)); TShock.admincommandList.Add("spawnmob", new CommandDelegate(SpawnMob)); - TShock.admincommandList.Add("item", new CommandDelegate(Item)); - TShock.admincommandList.Add("give", new CommandDelegate(Give)); - TShock.admincommandList.Add("heal", new CommandDelegate(Heal)); TShock.admincommandList.Add("butcher", new CommandDelegate(Butcher)); TShock.admincommandList.Add("maxspawns", new CommandDelegate(MaxSpawns)); TShock.admincommandList.Add("spawnrate", new CommandDelegate(SpawnRate)); TShock.admincommandList.Add("time", new CommandDelegate(Time)); - TShock.admincommandList.Add("kill", new CommandDelegate(Kill)); + TShock.admincommandList.Add("help", new CommandDelegate(Help)); TShock.admincommandList.Add("slap", new CommandDelegate(Slap)); TShock.admincommandList.Add("off-nosave", new CommandDelegate(OffNoSave)); @@ -59,6 +56,14 @@ namespace TShockAPI TShock.admincommandList.Add("debug-config", new CommandDelegate(DebugConfiguration)); TShock.commandList.Add("help", new CommandDelegate(Help)); TShock.commandList.Add("kill", new CommandDelegate(Kill)); + if (ConfigurationManager.distributationAgent != "terraria-online") + { + TShock.admincommandList.Add("kill", new CommandDelegate(Kill)); + TShock.admincommandList.Add("item", new CommandDelegate(Item)); + TShock.admincommandList.Add("give", new CommandDelegate(Give)); + TShock.admincommandList.Add("heal", new CommandDelegate(Heal)); + + } } #region Command Methods diff --git a/TShockAPI/ConfigFile.cs b/TShockAPI/ConfigFile.cs index 868bcb2b..3cc9ebc9 100644 --- a/TShockAPI/ConfigFile.cs +++ b/TShockAPI/ConfigFile.cs @@ -25,5 +25,6 @@ namespace TShockAPI public bool KickExplosives = true; public bool SpawnProtection = true; public int SpawnProtectionRadius = 5; + public string DistributationAgent = "facepunch"; } } diff --git a/TShockAPI/ConfigurationManager.cs b/TShockAPI/ConfigurationManager.cs index dc792931..5090e0e9 100644 --- a/TShockAPI/ConfigurationManager.cs +++ b/TShockAPI/ConfigurationManager.cs @@ -31,7 +31,7 @@ namespace TShockAPI public static bool kickBoom = true; public static bool spawnProtect = true; public static int spawnProtectRadius = 5; - public static ConfigFile config = null; + public static string distributationAgent = "facepunch"; public enum NPCList : int { @@ -46,8 +46,6 @@ namespace TShockAPI ConfigFile cfg = JsonConvert.DeserializeObject(tr.ReadToEnd()); tr.Close(); - config = cfg; - invasionMultiplier = cfg.InvasionMultiplier; defaultMaxSpawns = cfg.DefaultMaximumSpawns; defaultSpawnRate = cfg.DefaultSpawnRate; @@ -65,6 +63,7 @@ namespace TShockAPI kickBoom = cfg.KickExplosives; spawnProtect = cfg.SpawnProtection; spawnProtectRadius = cfg.SpawnProtectionRadius; + distributationAgent = cfg.DistributationAgent; Terraria.NPC.maxSpawns = defaultMaxSpawns; Terraria.NPC.defaultSpawnRate = defaultSpawnRate; }