This is C#, not javascript!
This commit is contained in:
parent
966735ec2e
commit
43beb99cb7
5 changed files with 127 additions and 127 deletions
|
|
@ -225,7 +225,7 @@ namespace TShockAPI
|
|||
commands.Add(new Command("p", "", PartyChat));
|
||||
commands.Add(new Command("rules", "", Rules));
|
||||
commands.Add(new Command("antibuild", "editspawn", ToggleAntiBuild));
|
||||
if (ConfigurationManager.distributationAgent != "terraria-online")
|
||||
if (ConfigurationManager.DistributationAgent != "terraria-online")
|
||||
{
|
||||
commands.Add(new Command("kill", "kill", Kill));
|
||||
commands.Add(new Command("butcher", "cheat", Butcher));
|
||||
|
|
@ -246,12 +246,12 @@ namespace TShockAPI
|
|||
public static void ToggleAntiBuild(CommandArgs args)
|
||||
{
|
||||
Tools.SendMessage(args.PlayerID, "Toggled world anti-build.");
|
||||
if (ConfigurationManager.disableBuild)
|
||||
if (ConfigurationManager.DisableBuild)
|
||||
{
|
||||
ConfigurationManager.disableBuild = false;
|
||||
ConfigurationManager.DisableBuild = false;
|
||||
} else
|
||||
{
|
||||
ConfigurationManager.disableBuild = true;
|
||||
ConfigurationManager.DisableBuild = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -296,21 +296,21 @@ namespace TShockAPI
|
|||
int ply = args.PlayerID;
|
||||
Tools.SendMessage(ply, "TShock Config:");
|
||||
string lineOne = string.Format("BanCheater : {0}, KickCheater : {1}, BanGriefer : {2}, KickGriefer : {3}",
|
||||
ConfigurationManager.banCheater, ConfigurationManager.kickCheater,
|
||||
ConfigurationManager.banGriefer, ConfigurationManager.kickGriefer);
|
||||
ConfigurationManager.BanCheater, ConfigurationManager.KickCheater,
|
||||
ConfigurationManager.BanGriefer, ConfigurationManager.KickGriefer);
|
||||
Tools.SendMessage(ply, lineOne, Color.Yellow);
|
||||
string lineTwo = string.Format("BanTnt : {0}, KickTnt : {1}, BanBoom : {2}, KickBoom : {3}",
|
||||
ConfigurationManager.banTnt, ConfigurationManager.kickTnt,
|
||||
ConfigurationManager.banBoom, ConfigurationManager.kickBoom);
|
||||
ConfigurationManager.BanTnt, ConfigurationManager.KickTnt,
|
||||
ConfigurationManager.BanBoom, ConfigurationManager.KickBoom);
|
||||
Tools.SendMessage(ply, lineTwo, Color.Yellow);
|
||||
string lineThree = string.Format("RangeChecks : {0}, DisableBuild : {1}, ProtectSpawn : {2}, ProtectRadius : {3}",
|
||||
ConfigurationManager.rangeChecks, ConfigurationManager.disableBuild,
|
||||
ConfigurationManager.spawnProtect, ConfigurationManager.spawnProtectRadius);
|
||||
ConfigurationManager.RangeChecks, ConfigurationManager.DisableBuild,
|
||||
ConfigurationManager.SpawnProtect, ConfigurationManager.SpawnProtectRadius);
|
||||
Tools.SendMessage(ply, lineThree, Color.Yellow);
|
||||
string lineFour = string.Format("MaxSlots : {0}, SpamChecks : {1}, InvMultiplier : {2}, DMS : {3}, SpawnRate {4}",
|
||||
ConfigurationManager.maxSlots, ConfigurationManager.spamChecks,
|
||||
ConfigurationManager.invasionMultiplier, ConfigurationManager.defaultMaxSpawns,
|
||||
ConfigurationManager.defaultSpawnRate);
|
||||
ConfigurationManager.MaxSlots, ConfigurationManager.SpamChecks,
|
||||
ConfigurationManager.InvasionMultiplier, ConfigurationManager.DefaultMaxSpawns,
|
||||
ConfigurationManager.DefaultSpawnRate);
|
||||
Tools.SendMessage(ply, lineFour, Color.Yellow);
|
||||
}
|
||||
|
||||
|
|
@ -596,12 +596,12 @@ namespace TShockAPI
|
|||
|
||||
public static void AuthToken(CommandArgs args)
|
||||
{
|
||||
if (ConfigurationManager.authToken == 0)
|
||||
if (ConfigurationManager.AuthToken == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int givenCode = Convert.ToInt32(args.Parameters[0]);
|
||||
if (givenCode == ConfigurationManager.authToken)
|
||||
if (givenCode == ConfigurationManager.AuthToken)
|
||||
{
|
||||
TextWriter tw = new StreamWriter(FileTools.UsersPath, true);
|
||||
tw.Write("\n" +
|
||||
|
|
@ -609,7 +609,7 @@ namespace TShockAPI
|
|||
Convert.ToString(Netplay.serverSock[args.PlayerID].tcpClient.Client.RemoteEndPoint)) +
|
||||
" superadmin");
|
||||
Tools.SendMessage(args.PlayerID, "SuperAdmin authenticated. Please re-connect using the same IP.");
|
||||
ConfigurationManager.authToken = 0;
|
||||
ConfigurationManager.AuthToken = 0;
|
||||
tw.Close();
|
||||
}
|
||||
}
|
||||
|
|
@ -881,7 +881,7 @@ namespace TShockAPI
|
|||
int amount = Convert.ToInt32(args.Parameters[0]);
|
||||
int.TryParse(args.Parameters[0], out amount);
|
||||
NPC.defaultMaxSpawns = amount;
|
||||
ConfigurationManager.defaultMaxSpawns = amount;
|
||||
ConfigurationManager.DefaultMaxSpawns = amount;
|
||||
Tools.Broadcast(string.Format("{0} changed the maximum spawns to: {1}", Tools.FindPlayer(adminplr), amount));
|
||||
}
|
||||
|
||||
|
|
@ -898,7 +898,7 @@ namespace TShockAPI
|
|||
int amount = Convert.ToInt32(args.Parameters[0]);
|
||||
int.TryParse(args.Parameters[0], out amount);
|
||||
NPC.defaultSpawnRate = amount;
|
||||
ConfigurationManager.defaultSpawnRate = amount;
|
||||
ConfigurationManager.DefaultSpawnRate = amount;
|
||||
Tools.Broadcast(string.Format("{0} changed the spawn rate to: {1}", Tools.FindPlayer(adminplr), amount));
|
||||
}
|
||||
|
||||
|
|
@ -1056,9 +1056,9 @@ namespace TShockAPI
|
|||
|
||||
public static void ProtectSpawn(CommandArgs args)
|
||||
{
|
||||
ConfigurationManager.spawnProtect = (ConfigurationManager.spawnProtect == false);
|
||||
ConfigurationManager.SpawnProtect = (ConfigurationManager.SpawnProtect == false);
|
||||
Tools.SendMessage(args.PlayerID,
|
||||
string.Format("Spawn is now {0}.", (ConfigurationManager.spawnProtect ? "protected" : "open")));
|
||||
string.Format("Spawn is now {0}.", (ConfigurationManager.SpawnProtect ? "protected" : "open")));
|
||||
}
|
||||
|
||||
public static void UpdateNow(CommandArgs args)
|
||||
|
|
|
|||
|
|
@ -28,32 +28,32 @@ namespace TShockAPI
|
|||
{
|
||||
//Add default values here and in ConfigFile.cs
|
||||
//Values written here will automatically be pulled into a config file on save.
|
||||
public static int invasionMultiplier = 1;
|
||||
public static int defaultMaxSpawns = 4;
|
||||
public static int defaultSpawnRate = 700;
|
||||
public static int serverPort = 7777;
|
||||
public static bool enableWhitelist = false;
|
||||
public static bool infiniteInvasion = false;
|
||||
public static bool permaPvp = false;
|
||||
public static int killCount;
|
||||
public static bool kickCheater = true;
|
||||
public static bool banCheater = true;
|
||||
public static bool kickGriefer = true;
|
||||
public static bool banGriefer = true;
|
||||
public static bool banTnt = true;
|
||||
public static bool kickTnt = true;
|
||||
public static bool banBoom = true;
|
||||
public static bool kickBoom = true;
|
||||
public static bool spawnProtect = true;
|
||||
public static bool rangeChecks = true;
|
||||
public static int spawnProtectRadius = 5;
|
||||
public static string distributationAgent = "facepunch";
|
||||
public static int authToken;
|
||||
public static int maxSlots = 8;
|
||||
public static bool spamChecks = false;
|
||||
public static bool disableBuild = false;
|
||||
public static float[] adminChatRGB = {255, 0, 0};
|
||||
public static string adminChatPrefix = "(Admin) ";
|
||||
public static int InvasionMultiplier = 1;
|
||||
public static int DefaultMaxSpawns = 4;
|
||||
public static int DefaultSpawnRate = 700;
|
||||
public static int ServerPort = 7777;
|
||||
public static bool EnableWhitelist = false;
|
||||
public static bool InfiniteInvasion = false;
|
||||
public static bool PermaPvp = false;
|
||||
public static int KillCount;
|
||||
public static bool KickCheater = true;
|
||||
public static bool BanCheater = true;
|
||||
public static bool KickGriefer = true;
|
||||
public static bool BanGriefer = true;
|
||||
public static bool BanTnt = true;
|
||||
public static bool KickTnt = true;
|
||||
public static bool BanBoom = true;
|
||||
public static bool KickBoom = true;
|
||||
public static bool SpawnProtect = true;
|
||||
public static bool RangeChecks = true;
|
||||
public static int SpawnProtectRadius = 5;
|
||||
public static string DistributationAgent = "facepunch";
|
||||
public static int AuthToken;
|
||||
public static int MaxSlots = 8;
|
||||
public static bool SpamChecks = false;
|
||||
public static bool DisableBuild = false;
|
||||
public static float[] AdminChatRGB = {255, 0, 0};
|
||||
public static string AdminChatPrefix = "(Admin) ";
|
||||
|
||||
public enum NPCList
|
||||
{
|
||||
|
|
@ -68,60 +68,60 @@ namespace TShockAPI
|
|||
ConfigFile cfg = JsonConvert.DeserializeObject<ConfigFile>(tr.ReadToEnd());
|
||||
tr.Close();
|
||||
|
||||
invasionMultiplier = cfg.InvasionMultiplier;
|
||||
defaultMaxSpawns = cfg.DefaultMaximumSpawns;
|
||||
defaultSpawnRate = cfg.DefaultSpawnRate;
|
||||
serverPort = cfg.ServerPort;
|
||||
enableWhitelist = cfg.EnableWhitelist;
|
||||
infiniteInvasion = cfg.InfiniteInvasion;
|
||||
permaPvp = cfg.AlwaysPvP;
|
||||
kickCheater = cfg.KickCheaters;
|
||||
banCheater = cfg.BanCheaters;
|
||||
kickGriefer = cfg.KickGriefers;
|
||||
banGriefer = cfg.BanGriefers;
|
||||
banTnt = cfg.BanKillTileAbusers;
|
||||
kickTnt = cfg.KickKillTileAbusers;
|
||||
banBoom = cfg.BanExplosives;
|
||||
kickBoom = cfg.KickExplosives;
|
||||
spawnProtect = cfg.SpawnProtection;
|
||||
spawnProtectRadius = cfg.SpawnProtectionRadius;
|
||||
distributationAgent = cfg.DistributationAgent;
|
||||
maxSlots = cfg.MaxSlots;
|
||||
rangeChecks = cfg.RangeChecks;
|
||||
spamChecks = cfg.SpamChecks;
|
||||
disableBuild = cfg.DisableBuild;
|
||||
NPC.maxSpawns = defaultMaxSpawns;
|
||||
NPC.defaultSpawnRate = defaultSpawnRate;
|
||||
adminChatRGB = cfg.AdminChatRGB;
|
||||
adminChatPrefix = cfg.AdminChatPrefix;
|
||||
InvasionMultiplier = cfg.InvasionMultiplier;
|
||||
DefaultMaxSpawns = cfg.DefaultMaximumSpawns;
|
||||
DefaultSpawnRate = cfg.DefaultSpawnRate;
|
||||
ServerPort = cfg.ServerPort;
|
||||
EnableWhitelist = cfg.EnableWhitelist;
|
||||
InfiniteInvasion = cfg.InfiniteInvasion;
|
||||
PermaPvp = cfg.AlwaysPvP;
|
||||
KickCheater = cfg.KickCheaters;
|
||||
BanCheater = cfg.BanCheaters;
|
||||
KickGriefer = cfg.KickGriefers;
|
||||
BanGriefer = cfg.BanGriefers;
|
||||
BanTnt = cfg.BanKillTileAbusers;
|
||||
KickTnt = cfg.KickKillTileAbusers;
|
||||
BanBoom = cfg.BanExplosives;
|
||||
KickBoom = cfg.KickExplosives;
|
||||
SpawnProtect = cfg.SpawnProtection;
|
||||
SpawnProtectRadius = cfg.SpawnProtectionRadius;
|
||||
DistributationAgent = cfg.DistributationAgent;
|
||||
MaxSlots = cfg.MaxSlots;
|
||||
RangeChecks = cfg.RangeChecks;
|
||||
SpamChecks = cfg.SpamChecks;
|
||||
DisableBuild = cfg.DisableBuild;
|
||||
NPC.maxSpawns = DefaultMaxSpawns;
|
||||
NPC.defaultSpawnRate = DefaultSpawnRate;
|
||||
AdminChatRGB = cfg.AdminChatRGB;
|
||||
AdminChatPrefix = cfg.AdminChatPrefix;
|
||||
}
|
||||
|
||||
public static void WriteJsonConfiguration()
|
||||
{
|
||||
ConfigFile cfg = new ConfigFile();
|
||||
cfg.InvasionMultiplier = invasionMultiplier;
|
||||
cfg.DefaultMaximumSpawns = defaultMaxSpawns;
|
||||
cfg.DefaultSpawnRate = defaultSpawnRate;
|
||||
cfg.ServerPort = serverPort;
|
||||
cfg.EnableWhitelist = enableWhitelist;
|
||||
cfg.InfiniteInvasion = infiniteInvasion;
|
||||
cfg.AlwaysPvP = permaPvp;
|
||||
cfg.KickCheaters = kickCheater;
|
||||
cfg.BanCheaters = banCheater;
|
||||
cfg.KickGriefers = kickGriefer;
|
||||
cfg.BanGriefers = banGriefer;
|
||||
cfg.BanKillTileAbusers = banGriefer;
|
||||
cfg.KickKillTileAbusers = kickGriefer;
|
||||
cfg.BanExplosives = banBoom;
|
||||
cfg.KickExplosives = kickBoom;
|
||||
cfg.SpawnProtection = spawnProtect;
|
||||
cfg.SpawnProtectionRadius = spawnProtectRadius;
|
||||
cfg.MaxSlots = maxSlots;
|
||||
cfg.RangeChecks = rangeChecks;
|
||||
cfg.SpamChecks = spamChecks;
|
||||
cfg.DisableBuild = disableBuild;
|
||||
cfg.AdminChatRGB = adminChatRGB;
|
||||
cfg.AdminChatPrefix = adminChatPrefix;
|
||||
cfg.InvasionMultiplier = InvasionMultiplier;
|
||||
cfg.DefaultMaximumSpawns = DefaultMaxSpawns;
|
||||
cfg.DefaultSpawnRate = DefaultSpawnRate;
|
||||
cfg.ServerPort = ServerPort;
|
||||
cfg.EnableWhitelist = EnableWhitelist;
|
||||
cfg.InfiniteInvasion = InfiniteInvasion;
|
||||
cfg.AlwaysPvP = PermaPvp;
|
||||
cfg.KickCheaters = KickCheater;
|
||||
cfg.BanCheaters = BanCheater;
|
||||
cfg.KickGriefers = KickGriefer;
|
||||
cfg.BanGriefers = BanGriefer;
|
||||
cfg.BanKillTileAbusers = BanGriefer;
|
||||
cfg.KickKillTileAbusers = KickGriefer;
|
||||
cfg.BanExplosives = BanBoom;
|
||||
cfg.KickExplosives = KickBoom;
|
||||
cfg.SpawnProtection = SpawnProtect;
|
||||
cfg.SpawnProtectionRadius = SpawnProtectRadius;
|
||||
cfg.MaxSlots = MaxSlots;
|
||||
cfg.RangeChecks = RangeChecks;
|
||||
cfg.SpamChecks = SpamChecks;
|
||||
cfg.DisableBuild = DisableBuild;
|
||||
cfg.AdminChatRGB = AdminChatRGB;
|
||||
cfg.AdminChatPrefix = AdminChatPrefix;
|
||||
string json = JsonConvert.SerializeObject(cfg, Formatting.Indented);
|
||||
TextWriter tr = new StreamWriter(FileTools.ConfigPath);
|
||||
tr.Write(json);
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ namespace TShockAPI
|
|||
ConfigurationManager.ReadJsonConfiguration();
|
||||
}
|
||||
|
||||
Netplay.serverPort = ConfigurationManager.serverPort;
|
||||
Netplay.serverPort = ConfigurationManager.ServerPort;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -91,7 +91,7 @@ namespace TShockAPI
|
|||
/// <returns>true/false</returns>
|
||||
public static bool OnWhitelist(string ip)
|
||||
{
|
||||
if (!ConfigurationManager.enableWhitelist)
|
||||
if (!ConfigurationManager.EnableWhitelist)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ namespace TShockAPI
|
|||
|
||||
private void NpcHooks_OnStrikeNpc(NpcStrikeEventArgs e)
|
||||
{
|
||||
if (ConfigurationManager.infiniteInvasion)
|
||||
if (ConfigurationManager.InfiniteInvasion)
|
||||
{
|
||||
IncrementKills();
|
||||
if (Main.invasionSize < 10)
|
||||
|
|
@ -298,7 +298,7 @@ namespace TShockAPI
|
|||
int plyY = Math.Abs((int)Main.player[e.Msg.whoAmI].position.Y / 16);
|
||||
int tileX = Math.Abs(x);
|
||||
int tileY = Math.Abs(y);
|
||||
if (size > 5 || (ConfigurationManager.rangeChecks && (Math.Abs(plyX - tileX) > 32 || Math.Abs(plyY - tileY) > 32)))
|
||||
if (size > 5 || (ConfigurationManager.RangeChecks && (Math.Abs(plyX - tileX) > 32 || Math.Abs(plyY - tileY) > 32)))
|
||||
{
|
||||
Log.Debug(string.Format("SendTileSquare(PlyXY:{0}_{1}, TileXY:{2}_{3}, Result:{4}_{5}, Size:{6})",
|
||||
plyX, plyY,
|
||||
|
|
@ -328,7 +328,7 @@ namespace TShockAPI
|
|||
return Tools.Kick(e.Msg.whoAmI, "Using dirt rod");
|
||||
}
|
||||
|
||||
if (ConfigurationManager.rangeChecks && ((Math.Abs(plyX - tileX) > 32) || (Math.Abs(plyY - tileY) > 32)))
|
||||
if (ConfigurationManager.RangeChecks && ((Math.Abs(plyX - tileX) > 32) || (Math.Abs(plyY - tileY) > 32)))
|
||||
{
|
||||
Log.Debug(string.Format("TilePlaced(PlyXY:{0}_{1}, TileXY:{2}_{3}, Result:{4}_{5}, Type:{6})",
|
||||
plyX, plyY,
|
||||
|
|
@ -339,7 +339,7 @@ namespace TShockAPI
|
|||
return Tools.HandleGriefer(e.Msg.whoAmI, "Placing impossible to place blocks.");
|
||||
}
|
||||
}
|
||||
if (ConfigurationManager.disableBuild)
|
||||
if (ConfigurationManager.DisableBuild)
|
||||
{
|
||||
if (!Players[e.Msg.whoAmI].Group.HasPermission("editspawn"))
|
||||
{
|
||||
|
|
@ -348,7 +348,7 @@ namespace TShockAPI
|
|||
return true;
|
||||
}
|
||||
}
|
||||
if (ConfigurationManager.spawnProtect)
|
||||
if (ConfigurationManager.SpawnProtect)
|
||||
{
|
||||
if (!Players[e.Msg.whoAmI].Group.HasPermission("editspawn"))
|
||||
{
|
||||
|
|
@ -384,7 +384,7 @@ namespace TShockAPI
|
|||
Main.player[e.Msg.whoAmI].hostile = pvp;
|
||||
if (id != e.Msg.whoAmI)
|
||||
Main.player[e.Msg.whoAmI].hostile = true;
|
||||
if (ConfigurationManager.permaPvp)
|
||||
if (ConfigurationManager.PermaPvp)
|
||||
Main.player[e.Msg.whoAmI].hostile = true;
|
||||
NetMessage.SendData(30, -1, -1, "", e.Msg.whoAmI);
|
||||
return true;
|
||||
|
|
@ -520,7 +520,7 @@ namespace TShockAPI
|
|||
));
|
||||
return Tools.HandleGriefer(e.Msg.whoAmI, "Manipulating liquid without bucket."); ;
|
||||
}
|
||||
if (ConfigurationManager.rangeChecks && ((Math.Abs(plyX - tileX) > 32) || (Math.Abs(plyY - tileY) > 32)))
|
||||
if (ConfigurationManager.RangeChecks && ((Math.Abs(plyX - tileX) > 32) || (Math.Abs(plyY - tileY) > 32)))
|
||||
{
|
||||
Log.Debug(string.Format("Liquid(PlyXY:{0}_{1}, TileXY:{2}_{3}, Result:{4}_{5}, Amount:{6})",
|
||||
plyX, plyY,
|
||||
|
|
@ -531,7 +531,7 @@ namespace TShockAPI
|
|||
return Tools.HandleGriefer(e.Msg.whoAmI, "Placing impossible to place liquid."); ;
|
||||
}
|
||||
|
||||
if (ConfigurationManager.spawnProtect)
|
||||
if (ConfigurationManager.SpawnProtect)
|
||||
{
|
||||
if (!Players[e.Msg.whoAmI].Group.HasPermission("editspawn"))
|
||||
{
|
||||
|
|
@ -577,12 +577,12 @@ namespace TShockAPI
|
|||
{
|
||||
Tools.HandleCheater(who, "Hacked health.");
|
||||
}
|
||||
if (ConfigurationManager.permaPvp)
|
||||
if (ConfigurationManager.PermaPvp)
|
||||
{
|
||||
Main.player[who].hostile = true;
|
||||
NetMessage.SendData(30, -1, -1, "", who);
|
||||
}
|
||||
if (Players[who].Group.HasPermission("causeevents") && ConfigurationManager.infiniteInvasion)
|
||||
if (Players[who].Group.HasPermission("causeevents") && ConfigurationManager.InfiniteInvasion)
|
||||
{
|
||||
StartInvasion();
|
||||
}
|
||||
|
|
@ -602,7 +602,7 @@ namespace TShockAPI
|
|||
|
||||
if (Players[ply].Group.HasPermission("adminchat") && !text.StartsWith("/"))
|
||||
{
|
||||
Tools.Broadcast(ConfigurationManager.adminChatPrefix + "<" + Main.player[ply].name + "> " + text, (byte)ConfigurationManager.adminChatRGB[0], (byte)ConfigurationManager.adminChatRGB[1], (byte)ConfigurationManager.adminChatRGB[2]);
|
||||
Tools.Broadcast(ConfigurationManager.AdminChatPrefix + "<" + Main.player[ply].name + "> " + text, (byte)ConfigurationManager.AdminChatRGB[0], (byte)ConfigurationManager.AdminChatRGB[1], (byte)ConfigurationManager.AdminChatRGB[2]);
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
|
@ -662,7 +662,7 @@ namespace TShockAPI
|
|||
Players[ply] = new TSPlayer(ply);
|
||||
Players[ply].Group = Tools.GetGroupForIP(ip);
|
||||
|
||||
if (Tools.ActivePlayers() + 1 > ConfigurationManager.maxSlots &&
|
||||
if (Tools.ActivePlayers() + 1 > ConfigurationManager.MaxSlots &&
|
||||
!Players[ply].Group.HasPermission("reservedslot"))
|
||||
{
|
||||
Tools.ForceKick(ply, "Server is full");
|
||||
|
|
@ -683,7 +683,7 @@ namespace TShockAPI
|
|||
}
|
||||
}
|
||||
|
||||
Netplay.serverSock[ply].spamCheck = ConfigurationManager.spamChecks;
|
||||
Netplay.serverSock[ply].spamCheck = ConfigurationManager.SpamChecks;
|
||||
}
|
||||
|
||||
private void OnPostInit()
|
||||
|
|
@ -691,9 +691,9 @@ namespace TShockAPI
|
|||
if (!File.Exists(Path.Combine(SavePath, "auth.lck")))
|
||||
{
|
||||
var r = new Random((int)DateTime.Now.ToBinary());
|
||||
ConfigurationManager.authToken = r.Next(100000, 10000000);
|
||||
ConfigurationManager.AuthToken = r.Next(100000, 10000000);
|
||||
Console.WriteLine("TShock Notice: To become SuperAdmin, join the game and type /auth " +
|
||||
ConfigurationManager.authToken);
|
||||
ConfigurationManager.AuthToken);
|
||||
Console.WriteLine("This token will only display ONCE. This only works ONCE. If you don't use it and the server goes down, delete auth.lck.");
|
||||
FileTools.CreateFile(Path.Combine(SavePath, "auth.lck"));
|
||||
}
|
||||
|
|
@ -773,13 +773,13 @@ namespace TShockAPI
|
|||
public static void StartInvasion()
|
||||
{
|
||||
Main.invasionType = 1;
|
||||
if (ConfigurationManager.infiniteInvasion)
|
||||
if (ConfigurationManager.InfiniteInvasion)
|
||||
{
|
||||
Main.invasionSize = 20000000;
|
||||
}
|
||||
else
|
||||
{
|
||||
Main.invasionSize = 100 + (ConfigurationManager.invasionMultiplier * Tools.ActivePlayers());
|
||||
Main.invasionSize = 100 + (ConfigurationManager.InvasionMultiplier * Tools.ActivePlayers());
|
||||
}
|
||||
|
||||
Main.invasionWarn = 0;
|
||||
|
|
@ -795,30 +795,30 @@ namespace TShockAPI
|
|||
|
||||
public static void IncrementKills()
|
||||
{
|
||||
ConfigurationManager.killCount++;
|
||||
ConfigurationManager.KillCount++;
|
||||
Random r = new Random();
|
||||
int random = r.Next(5);
|
||||
if (ConfigurationManager.killCount % 100 == 0)
|
||||
if (ConfigurationManager.KillCount % 100 == 0)
|
||||
{
|
||||
switch (random)
|
||||
{
|
||||
case 0:
|
||||
Tools.Broadcast(string.Format("You call that a lot? {0} goblins killed!", ConfigurationManager.killCount));
|
||||
Tools.Broadcast(string.Format("You call that a lot? {0} goblins killed!", ConfigurationManager.KillCount));
|
||||
break;
|
||||
case 1:
|
||||
Tools.Broadcast(string.Format("Fatality! {0} goblins killed!", ConfigurationManager.killCount));
|
||||
Tools.Broadcast(string.Format("Fatality! {0} goblins killed!", ConfigurationManager.KillCount));
|
||||
break;
|
||||
case 2:
|
||||
Tools.Broadcast(string.Format("Number of 'noobs' killed to date: {0}", ConfigurationManager.killCount));
|
||||
Tools.Broadcast(string.Format("Number of 'noobs' killed to date: {0}", ConfigurationManager.KillCount));
|
||||
break;
|
||||
case 3:
|
||||
Tools.Broadcast(string.Format("Duke Nukem would be proud. {0} goblins killed.", ConfigurationManager.killCount));
|
||||
Tools.Broadcast(string.Format("Duke Nukem would be proud. {0} goblins killed.", ConfigurationManager.KillCount));
|
||||
break;
|
||||
case 4:
|
||||
Tools.Broadcast(string.Format("You call that a lot? {0} goblins killed!", ConfigurationManager.killCount));
|
||||
Tools.Broadcast(string.Format("You call that a lot? {0} goblins killed!", ConfigurationManager.KillCount));
|
||||
break;
|
||||
case 5:
|
||||
Tools.Broadcast(string.Format("{0} copies of Call of Duty smashed.", ConfigurationManager.killCount));
|
||||
Tools.Broadcast(string.Format("{0} copies of Call of Duty smashed.", ConfigurationManager.KillCount));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -893,7 +893,7 @@ namespace TShockAPI
|
|||
Vector2 tile = new Vector2(x, y);
|
||||
Vector2 spawn = new Vector2(Main.spawnTileX, Main.spawnTileY);
|
||||
var distance = Vector2.Distance(spawn, tile);
|
||||
if (distance > ConfigurationManager.spawnProtectRadius)
|
||||
if (distance > ConfigurationManager.SpawnProtectRadius)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -306,22 +306,22 @@ namespace TShockAPI
|
|||
|
||||
public static bool HandleCheater(int ply, string reason)
|
||||
{
|
||||
return HandleBadPlayer(ply, "ignorecheatdetection", ConfigurationManager.banCheater, ConfigurationManager.kickCheater, reason);
|
||||
return HandleBadPlayer(ply, "ignorecheatdetection", ConfigurationManager.BanCheater, ConfigurationManager.KickCheater, reason);
|
||||
}
|
||||
|
||||
public static bool HandleGriefer(int ply, string reason)
|
||||
{
|
||||
return HandleBadPlayer(ply, "ignoregriefdetection", ConfigurationManager.banGriefer, ConfigurationManager.kickGriefer, reason);
|
||||
return HandleBadPlayer(ply, "ignoregriefdetection", ConfigurationManager.BanGriefer, ConfigurationManager.KickGriefer, reason);
|
||||
}
|
||||
|
||||
public static bool HandleTntUser(int ply, string reason)
|
||||
{
|
||||
return HandleBadPlayer(ply, "ignoregriefdetection", ConfigurationManager.banTnt, ConfigurationManager.kickTnt, reason);
|
||||
return HandleBadPlayer(ply, "ignoregriefdetection", ConfigurationManager.BanTnt, ConfigurationManager.KickTnt, reason);
|
||||
}
|
||||
|
||||
public static bool HandleExplosivesUser(int ply, string reason)
|
||||
{
|
||||
return HandleBadPlayer(ply, "ignoregriefdetection", ConfigurationManager.banBoom, ConfigurationManager.kickBoom, reason);
|
||||
return HandleBadPlayer(ply, "ignoregriefdetection", ConfigurationManager.BanBoom, ConfigurationManager.KickBoom, reason);
|
||||
}
|
||||
|
||||
private static bool HandleBadPlayer(int ply, string overridePermission, bool ban, bool kick, string reason)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue