Added DistributionAgent to configuration file. Default is facepunch. Change it to terraria-online for cheat removal.

This commit is contained in:
Shank 2011-06-04 22:28:13 -06:00
parent df7fee1cb5
commit 549728b510
3 changed files with 12 additions and 7 deletions

View file

@ -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

View file

@ -25,5 +25,6 @@ namespace TShockAPI
public bool KickExplosives = true;
public bool SpawnProtection = true;
public int SpawnProtectionRadius = 5;
public string DistributationAgent = "facepunch";
}
}

View file

@ -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<ConfigFile>(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;
}