Added /debug-config

Added Version codename
Added version tick early
Closes #15
This commit is contained in:
Shank 2011-06-04 21:56:24 -06:00
parent 30a200b6e0
commit b786c80bb0
3 changed files with 40 additions and 4 deletions

View file

@ -56,11 +56,41 @@ namespace TShockAPI
TShock.admincommandList.Add("slap", new CommandDelegate(Slap));
TShock.admincommandList.Add("off-nosave", new CommandDelegate(OffNoSave));
TShock.admincommandList.Add("protectspawn", new CommandDelegate(ProtectSpawn));
TShock.admincommandList.Add("debug-config", new CommandDelegate(DebugConfiguration));
TShock.commandList.Add("help", new CommandDelegate(Help));
TShock.commandList.Add("kill", new CommandDelegate(Kill));
}
#region Command Methods
public static void DebugConfiguration(CommandArgs args)
{
int ply = args.PlayerID;
var commands = TShock.commandList;
if (TShock.players[ply].IsAdmin())
commands = TShock.admincommandList;
Tools.SendMessage(ply, "TShock Config:");
string lineOne = "";
lineOne += "KickCheater : " + ConfigurationManager.kickCheater + ", ";
lineOne += "BanCheater : " + ConfigurationManager.banCheater + ", ";
lineOne += "KickGriefer : " + ConfigurationManager.kickGriefer + ", ";
lineOne += "BanGriefer : " + ConfigurationManager.banGriefer;
Tools.SendMessage(ply, lineOne, new float[] { 255f, 255f, 0f });
string lineTwo = "";
lineTwo += "BanTnt : " + ConfigurationManager.banTnt + ", ";
lineTwo += "KickTnt : " + ConfigurationManager.kickTnt + ", ";
lineTwo += "BanBoom : " + ConfigurationManager.banBoom + ", ";
lineTwo += "KickBoom : " + ConfigurationManager.kickBoom;
Tools.SendMessage(ply, lineTwo, new float[] { 255f, 255f, 0f });
string lineThree = "";
lineThree += "InvMultiplier : " + ConfigurationManager.invasionMultiplier + ", ";
lineThree += "SpawnProtect : " + ConfigurationManager.spawnProtect + ", ";
lineThree += "SpawnProtectR : " + ConfigurationManager.spawnProtectRadius + ", ";
lineThree += "DefaultMaxSpawns : " + ConfigurationManager.defaultMaxSpawns + ", ";
lineThree += "SpawnRate: " + ConfigurationManager.defaultSpawnRate + ", ";
Tools.SendMessage(ply, lineThree, new float[] { 255f, 255f, 0f});
}
public static void Kick(CommandArgs args)
{
string plStr = args.Message.Remove(0, 5).Trim();

View file

@ -31,6 +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 enum NPCList : int
{
@ -44,6 +45,8 @@ namespace TShockAPI
TextReader tr = new StreamReader(FileTools.SaveDir + "config.json");
ConfigFile cfg = JsonConvert.DeserializeObject<ConfigFile>(tr.ReadToEnd());
tr.Close();
config = cfg;
invasionMultiplier = cfg.InvasionMultiplier;
defaultMaxSpawns = cfg.DefaultMaximumSpawns;

View file

@ -15,7 +15,9 @@ namespace TShockAPI
public static string saveDir = "./tshock/";
public static Version VersionNum = new Version(1, 6, 0, 0);
public static Version VersionNum = new Version(1, 7, 0, 0);
public static string VersionCodename = "Bugless Beast";
public static bool shownVersion = false;
@ -111,6 +113,7 @@ namespace TShockAPI
{
Console.WriteLine(ex.ToString());
}
Console.WriteLine("TShock Version " + Version.Major + "." + Version.Minor + "." + Version.Build + "." + Version.Revision + " (" + VersionCodename + ") now running.");
Log.Initialize(FileTools.SaveDir + "log.txt", LogLevel.All, true);
Log.Info("Starting...");
GameHooks.OnPreInitialize += OnPreInit;
@ -372,11 +375,11 @@ namespace TShockAPI
}
}
}
<<<<<<< HEAD
<<<<<<< HEAD
else if (e.MsgID == 0x22) // Client only KillTile
e.Handled = true; // Client only uses it for chests, but sends regular 17 as well.
=======
>>>>>>> master
=======
>>>>>>> master
}
catch (Exception ex)
{