Added /debug-config
Added Version codename Added version tick early
This commit is contained in:
parent
30a200b6e0
commit
3f3b1cc40e
3 changed files with 40 additions and 4 deletions
|
|
@ -56,11 +56,41 @@ namespace TShockAPI
|
||||||
TShock.admincommandList.Add("slap", new CommandDelegate(Slap));
|
TShock.admincommandList.Add("slap", new CommandDelegate(Slap));
|
||||||
TShock.admincommandList.Add("off-nosave", new CommandDelegate(OffNoSave));
|
TShock.admincommandList.Add("off-nosave", new CommandDelegate(OffNoSave));
|
||||||
TShock.admincommandList.Add("protectspawn", new CommandDelegate(ProtectSpawn));
|
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("help", new CommandDelegate(Help));
|
||||||
TShock.commandList.Add("kill", new CommandDelegate(Kill));
|
TShock.commandList.Add("kill", new CommandDelegate(Kill));
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Command Methods
|
#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)
|
public static void Kick(CommandArgs args)
|
||||||
{
|
{
|
||||||
string plStr = args.Message.Remove(0, 5).Trim();
|
string plStr = args.Message.Remove(0, 5).Trim();
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ namespace TShockAPI
|
||||||
public static bool kickBoom = true;
|
public static bool kickBoom = true;
|
||||||
public static bool spawnProtect = true;
|
public static bool spawnProtect = true;
|
||||||
public static int spawnProtectRadius = 5;
|
public static int spawnProtectRadius = 5;
|
||||||
|
public static ConfigFile config = null;
|
||||||
|
|
||||||
public enum NPCList : int
|
public enum NPCList : int
|
||||||
{
|
{
|
||||||
|
|
@ -44,6 +45,8 @@ namespace TShockAPI
|
||||||
TextReader tr = new StreamReader(FileTools.SaveDir + "config.json");
|
TextReader tr = new StreamReader(FileTools.SaveDir + "config.json");
|
||||||
ConfigFile cfg = JsonConvert.DeserializeObject<ConfigFile>(tr.ReadToEnd());
|
ConfigFile cfg = JsonConvert.DeserializeObject<ConfigFile>(tr.ReadToEnd());
|
||||||
tr.Close();
|
tr.Close();
|
||||||
|
|
||||||
|
config = cfg;
|
||||||
|
|
||||||
invasionMultiplier = cfg.InvasionMultiplier;
|
invasionMultiplier = cfg.InvasionMultiplier;
|
||||||
defaultMaxSpawns = cfg.DefaultMaximumSpawns;
|
defaultMaxSpawns = cfg.DefaultMaximumSpawns;
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,9 @@ namespace TShockAPI
|
||||||
|
|
||||||
public static string saveDir = "./tshock/";
|
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;
|
public static bool shownVersion = false;
|
||||||
|
|
||||||
|
|
@ -111,6 +113,7 @@ namespace TShockAPI
|
||||||
{
|
{
|
||||||
Console.WriteLine(ex.ToString());
|
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.Initialize(FileTools.SaveDir + "log.txt", LogLevel.All, true);
|
||||||
Log.Info("Starting...");
|
Log.Info("Starting...");
|
||||||
GameHooks.OnPreInitialize += OnPreInit;
|
GameHooks.OnPreInitialize += OnPreInit;
|
||||||
|
|
@ -372,11 +375,11 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
else if (e.MsgID == 0x22) // Client only KillTile
|
else if (e.MsgID == 0x22) // Client only KillTile
|
||||||
e.Handled = true; // Client only uses it for chests, but sends regular 17 as well.
|
e.Handled = true; // Client only uses it for chests, but sends regular 17 as well.
|
||||||
=======
|
=======
|
||||||
>>>>>>> master
|
>>>>>>> master
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue