Made functions uppercase, like all of terraria's functions, to keep it consistent
This commit is contained in:
parent
e599e985b3
commit
5e91f13916
6 changed files with 115 additions and 115 deletions
|
|
@ -384,7 +384,7 @@
|
|||
{
|
||||
this.graphics = new GraphicsDeviceManager(this);
|
||||
base.Content.RootDirectory = "Content";
|
||||
ShankShock.setupConfiguration();
|
||||
ShankShock.SetupConfig();
|
||||
}
|
||||
|
||||
public static double CalculateDamage(int Damage, int Defense)
|
||||
|
|
|
|||
|
|
@ -5946,7 +5946,7 @@
|
|||
}
|
||||
if (ShankShock.infinateInvasion)
|
||||
{
|
||||
ShankShock.incrementKills();
|
||||
ShankShock.IncrementKills();
|
||||
}
|
||||
}
|
||||
return dmg;
|
||||
|
|
|
|||
|
|
@ -67,15 +67,15 @@
|
|||
{
|
||||
if (Main.player[plr].statLifeMax > 400 || Main.player[plr].statManaMax > 200 || Main.player[plr].statLife > 400 || Main.player[plr].statMana > 200)
|
||||
{
|
||||
ShankShock.handleCheater(plr);
|
||||
ShankShock.HandleCheater(plr);
|
||||
}
|
||||
ShankShock.showmotd(plr);
|
||||
ShankShock.showUpdateMinder(plr);
|
||||
if (ShankShock.isAdmin(Main.player[plr].name))
|
||||
ShankShock.ShowMOTD(plr);
|
||||
ShankShock.ShowUpdateReminder(plr);
|
||||
if (ShankShock.IsAdmin(Main.player[plr].name))
|
||||
{
|
||||
if (!ShankShock.shownOneTimeInvasionMinder && ShankShock.infinateInvasion)
|
||||
{
|
||||
ShankShock.sendMessage(plr, "You must run /invade to start the infinite invasion.", new float[] { 255, 0, 0 });
|
||||
ShankShock.SendMessage(plr, "You must run /invade to start the infinite invasion.", new float[] { 255, 0, 0 });
|
||||
}
|
||||
}
|
||||
if (ShankShock.permaPvp)
|
||||
|
|
|
|||
|
|
@ -340,7 +340,7 @@
|
|||
{
|
||||
serverSock[k].statusText = string.Concat(new object[] { "(", serverSock[k].tcpClient.Client.RemoteEndPoint, ") ", serverSock[k].name, " requested world information" });
|
||||
String s = serverSock[k].tcpClient.Client.RemoteEndPoint.ToString();
|
||||
if (ShankShock.checkBanned(s) || ShankShock.checkCheat(s) || !ShankShock.onWhitelist(s) || ShankShock.checkGrief(s))
|
||||
if (ShankShock.CheckBanned(s) || ShankShock.CheckCheat(s) || !ShankShock.OnWhitelist(s) || ShankShock.CheckGreif(s))
|
||||
{
|
||||
serverSock[k].statusText = "b;ah";
|
||||
serverSock[k].statusText2 = "blah2";
|
||||
|
|
@ -359,10 +359,10 @@
|
|||
if (!(Main.player[i].breakTicks <= 0))
|
||||
{
|
||||
Main.player[i].breakTicks -= 1f;
|
||||
Console.WriteLine(ShankShock.findPlayer(i) + " breakTicks: " + Main.player[i].breakTicks);
|
||||
Console.WriteLine(ShankShock.FindPlayer(i) + " breakTicks: " + Main.player[i].breakTicks);
|
||||
if (Main.player[i].breakTicks >= 5)
|
||||
{
|
||||
ShankShock.handleGrief(i);
|
||||
ShankShock.HandleGrief(i);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,11 +37,11 @@ namespace Terraria
|
|||
SKELETRON=2
|
||||
}
|
||||
|
||||
public static void showUpdateMinder(int ply)
|
||||
public static void ShowUpdateReminder(int ply)
|
||||
{
|
||||
if (!shownVersion)
|
||||
{
|
||||
if (isAdmin(findPlayer(ply)))
|
||||
if (IsAdmin(FindPlayer(ply)))
|
||||
{
|
||||
WebClient client = new WebClient();
|
||||
client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705;)");
|
||||
|
|
@ -52,10 +52,10 @@ namespace Terraria
|
|||
float[] color = { 255, 255, 000 };
|
||||
if (Convert.ToDouble(changes[0]) > version)
|
||||
{
|
||||
sendMessage(ply, "This server is out of date. Version " + changes[0] + " is out.", color);
|
||||
SendMessage(ply, "This server is out of date. Version " + changes[0] + " is out.", color);
|
||||
for (int i = 1; i <= changes.Length; i++)
|
||||
{
|
||||
sendMessage(ply, changes[i], color);
|
||||
SendMessage(ply, changes[i], color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -68,7 +68,7 @@ namespace Terraria
|
|||
}
|
||||
}
|
||||
|
||||
public static void incrementKills()
|
||||
public static void IncrementKills()
|
||||
{
|
||||
killCount++;
|
||||
Random r = new Random();
|
||||
|
|
@ -78,35 +78,35 @@ namespace Terraria
|
|||
switch (random)
|
||||
{
|
||||
case 0:
|
||||
ShankShock.broadcast("You call that a lot? " + killCount + " goblins killed!");
|
||||
ShankShock.Broadcast("You call that a lot? " + killCount + " goblins killed!");
|
||||
break;
|
||||
case 1:
|
||||
ShankShock.broadcast("Fatality! " + killCount + " goblins killed!");
|
||||
ShankShock.Broadcast("Fatality! " + killCount + " goblins killed!");
|
||||
break;
|
||||
case 2:
|
||||
ShankShock.broadcast("Number of 'noobs' killed to date: " + killCount);
|
||||
ShankShock.Broadcast("Number of 'noobs' killed to date: " + killCount);
|
||||
break;
|
||||
case 3:
|
||||
ShankShock.broadcast("Duke Nukem would be proud. " + killCount + " goblins killed.");
|
||||
ShankShock.Broadcast("Duke Nukem would be proud. " + killCount + " goblins killed.");
|
||||
break;
|
||||
case 4:
|
||||
ShankShock.broadcast("You call that a lot? " + killCount + " goblins killed!");
|
||||
ShankShock.Broadcast("You call that a lot? " + killCount + " goblins killed!");
|
||||
break;
|
||||
case 5:
|
||||
ShankShock.broadcast(killCount + " copies of Call of Duty smashed.");
|
||||
ShankShock.Broadcast(killCount + " copies of Call of Duty smashed.");
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static bool onWhitelist(string ip)
|
||||
public static bool OnWhitelist(string ip)
|
||||
{
|
||||
if (!enableWhitelist) { return true; }
|
||||
if (!System.IO.File.Exists(saveDir +"whitelist.txt")) { createFile(saveDir + "whitelist.txt"); TextWriter tw = new StreamWriter(saveDir + "whitelist.txt"); tw.WriteLine("127.0.0.1"); tw.Close(); }
|
||||
if (!System.IO.File.Exists(saveDir +"whitelist.txt")) { CreateFile(saveDir + "whitelist.txt"); TextWriter tw = new StreamWriter(saveDir + "whitelist.txt"); tw.WriteLine("127.0.0.1"); tw.Close(); }
|
||||
TextReader tr = new StreamReader(saveDir + "whitelist.txt");
|
||||
string whitelist = tr.ReadToEnd();
|
||||
ip = getRealIP(ip);
|
||||
ip = GetRealIP(ip);
|
||||
if (whitelist.Contains(ip)) { return true; } else { return false; }
|
||||
}
|
||||
|
||||
|
|
@ -135,7 +135,7 @@ namespace Terraria
|
|||
|
||||
}
|
||||
|
||||
private static string getPlayers()
|
||||
private static string GetPlayers()
|
||||
{
|
||||
string str = "";
|
||||
for (int i = 0; i < 8; i++)
|
||||
|
|
@ -155,14 +155,14 @@ namespace Terraria
|
|||
return str;
|
||||
}
|
||||
|
||||
public static void showmotd(int ply)
|
||||
public static void ShowMOTD(int ply)
|
||||
{
|
||||
string foo = "";
|
||||
TextReader tr = new StreamReader(saveDir + "motd.txt");
|
||||
while ((foo = tr.ReadLine()) != null)
|
||||
{
|
||||
foo = foo.Replace("%map%", Main.worldName);
|
||||
foo = foo.Replace("%players%", getPlayers());
|
||||
foo = foo.Replace("%players%", GetPlayers());
|
||||
if (foo.Substring(0, 1) == "%" && foo.Substring(12, 1) == "%") //Look for a beginning color code.
|
||||
{
|
||||
string possibleColor = foo.Substring(0, 13);
|
||||
|
|
@ -177,7 +177,7 @@ namespace Terraria
|
|||
pC[0] = Clamp(Convert.ToInt32(pCc[0]), 255, 0);
|
||||
pC[1] = Clamp(Convert.ToInt32(pCc[1]), 255, 0);
|
||||
pC[2] = Clamp(Convert.ToInt32(pCc[2]), 255, 0);
|
||||
sendMessage(ply, foo, pC);
|
||||
SendMessage(ply, foo, pC);
|
||||
continue;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
@ -186,7 +186,7 @@ namespace Terraria
|
|||
}
|
||||
}
|
||||
}
|
||||
sendMessage(ply, foo);
|
||||
SendMessage(ply, foo);
|
||||
}
|
||||
tr.Close();
|
||||
}
|
||||
|
|
@ -202,12 +202,12 @@ namespace Terraria
|
|||
return result;
|
||||
}
|
||||
|
||||
private static void createFile(string file)
|
||||
private static void CreateFile(string file)
|
||||
{
|
||||
using (FileStream fs = File.Create(file)) { }
|
||||
}
|
||||
|
||||
private static void keepTilesUpToDate()
|
||||
private static void KeepTilesUpToDate()
|
||||
{
|
||||
TextReader tr = new StreamReader(saveDir + "tiles.txt");
|
||||
string file = tr.ReadToEnd();
|
||||
|
|
@ -215,42 +215,42 @@ namespace Terraria
|
|||
if (!file.Contains("0x3d"))
|
||||
{
|
||||
System.IO.File.Delete(saveDir + "tiles.txt");
|
||||
createFile(saveDir + "tiles.txt");
|
||||
CreateFile(saveDir + "tiles.txt");
|
||||
TextWriter tw = new StreamWriter(saveDir + "tiles.txt");
|
||||
tw.Write("0x03, 0x05, 0x14, 0x25, 0x18, 0x18, 0x20, 0x1b, 0x34, 0x48, 0x33, 0x3d, 0x47, 0x49, 0x4a, 0x35, 0x3d, 0x3e, 0x45, 0x47, 0x49, 0x4a,");
|
||||
tw.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public static void setupConfiguration()
|
||||
public static void SetupConfig()
|
||||
{
|
||||
if (!System.IO.Directory.Exists(saveDir)) { System.IO.Directory.CreateDirectory(saveDir); }
|
||||
if (!System.IO.File.Exists(saveDir + "tiles.txt"))
|
||||
{
|
||||
createFile(saveDir + "tiles.txt");
|
||||
CreateFile(saveDir + "tiles.txt");
|
||||
TextWriter tw = new StreamWriter(saveDir + "tiles.txt");
|
||||
tw.Write("0x03, 0x05, 0x14, 0x25, 0x18, 0x18, 0x20, 0x1b, 0x34, 0x48, 0x33, 0x3d, 0x47, 0x49, 0x4a, 0x35, 0x3d, 0x3e, 0x45, 0x47, 0x49, 0x4a,");
|
||||
tw.Close();
|
||||
}
|
||||
if (!System.IO.File.Exists(saveDir + "motd.txt")) {
|
||||
createFile(saveDir + "motd.txt");
|
||||
CreateFile(saveDir + "motd.txt");
|
||||
TextWriter tw = new StreamWriter(saveDir + "motd.txt");
|
||||
tw.WriteLine("This server is running TShock. Type /help for a list of commands.");
|
||||
tw.WriteLine("%255,000,000%Current map: %map%");
|
||||
tw.WriteLine("Current players: %players%");
|
||||
tw.Close(); }
|
||||
if (!System.IO.File.Exists(saveDir +"bans.txt")) { createFile(saveDir + "bans.txt"); }
|
||||
if (!System.IO.File.Exists(saveDir +"cheaters.txt")) { createFile(saveDir + "cheaters.txt"); }
|
||||
if (!System.IO.File.Exists(saveDir +"admins.txt")) { createFile(saveDir + "admins.txt"); }
|
||||
if (!System.IO.File.Exists(saveDir +"grief.txt")) { createFile(saveDir + "grief.txt"); }
|
||||
if (!System.IO.File.Exists(saveDir +"bans.txt")) { CreateFile(saveDir + "bans.txt"); }
|
||||
if (!System.IO.File.Exists(saveDir +"cheaters.txt")) { CreateFile(saveDir + "cheaters.txt"); }
|
||||
if (!System.IO.File.Exists(saveDir +"admins.txt")) { CreateFile(saveDir + "admins.txt"); }
|
||||
if (!System.IO.File.Exists(saveDir +"grief.txt")) { CreateFile(saveDir + "grief.txt"); }
|
||||
if (!System.IO.File.Exists(saveDir +"config.txt"))
|
||||
{
|
||||
createFile(saveDir + "config.txt");
|
||||
CreateFile(saveDir + "config.txt");
|
||||
TextWriter tw = new StreamWriter(saveDir + "config.txt");
|
||||
tw.WriteLine("true,50,4,700,true,true,7777,false,false,false,false,false");
|
||||
tw.Close();
|
||||
}
|
||||
keepTilesUpToDate();
|
||||
KeepTilesUpToDate();
|
||||
TextReader tr = new StreamReader(saveDir + "config.txt");
|
||||
string config = tr.ReadToEnd();
|
||||
config = config.Replace("\n", "");
|
||||
|
|
@ -285,7 +285,7 @@ namespace Terraria
|
|||
Netplay.serverPort = serverPort;
|
||||
}
|
||||
|
||||
public static bool tileOnWhitelist(byte tile)
|
||||
public static bool TileOnWhitelist(byte tile)
|
||||
{
|
||||
int _tile = (int)tile;
|
||||
TextReader tr2 = new StreamReader(saveDir + "tiles.txt");
|
||||
|
|
@ -299,23 +299,23 @@ namespace Terraria
|
|||
return tileWhitelist.Contains(hexValue);
|
||||
}
|
||||
|
||||
public static void setupJsonConfiguration()
|
||||
public static void SetupJsonConfig()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public static void handleGrief(int ply)
|
||||
public static void HandleGrief(int ply)
|
||||
{
|
||||
|
||||
if (banTnt) { _writeGrief(ply); }
|
||||
ShankShock.broadcast(findPlayer(ply) + " was " + (banTnt ? "banned " : "kicked ") + "for kill tile abuse.");
|
||||
if (kickTnt) { kick(ply); }
|
||||
ShankShock.Broadcast(FindPlayer(ply) + " was " + (banTnt ? "banned " : "kicked ") + "for kill tile abuse.");
|
||||
if (kickTnt) { Kick(ply); }
|
||||
}
|
||||
|
||||
private static void _writeGrief(int ply)
|
||||
{
|
||||
TextWriter tw = new StreamWriter(saveDir + "grief.txt", true);
|
||||
tw.WriteLine("[" + Main.player[ply].name + "] [" + getRealIP(Netplay.serverSock[ply].tcpClient.Client.RemoteEndPoint.ToString()) + "]");
|
||||
tw.WriteLine("[" + Main.player[ply].name + "] [" + GetRealIP(Netplay.serverSock[ply].tcpClient.Client.RemoteEndPoint.ToString()) + "]");
|
||||
tw.Close();
|
||||
}
|
||||
|
||||
|
|
@ -329,7 +329,7 @@ namespace Terraria
|
|||
}
|
||||
else
|
||||
{
|
||||
createFile(saveDir + "errors.txt");
|
||||
CreateFile(saveDir + "errors.txt");
|
||||
TextWriter tw = new StreamWriter(saveDir + "errors.txt", true);
|
||||
tw.WriteLine(err);
|
||||
tw.Close();
|
||||
|
|
@ -338,7 +338,7 @@ namespace Terraria
|
|||
|
||||
public static void _writeban(int ply)
|
||||
{
|
||||
string ip = ShankShock.getRealIP(Convert.ToString(Netplay.serverSock[ply].tcpClient.Client.RemoteEndPoint));
|
||||
string ip = ShankShock.GetRealIP(Convert.ToString(Netplay.serverSock[ply].tcpClient.Client.RemoteEndPoint));
|
||||
TextWriter tw = new StreamWriter(saveDir + "bans.txt", true);
|
||||
tw.WriteLine("[" + Main.player[ply].name + "] " + "[" + ip + "]");
|
||||
tw.Close();
|
||||
|
|
@ -346,7 +346,7 @@ namespace Terraria
|
|||
|
||||
public static void _writecheater(int ply)
|
||||
{
|
||||
string ip = ShankShock.getRealIP(Convert.ToString(Netplay.serverSock[ply].tcpClient.Client.RemoteEndPoint));
|
||||
string ip = ShankShock.GetRealIP(Convert.ToString(Netplay.serverSock[ply].tcpClient.Client.RemoteEndPoint));
|
||||
string cheaters = "";
|
||||
TextReader tr = new StreamReader(saveDir + "cheaters.txt");
|
||||
cheaters = tr.ReadToEnd();
|
||||
|
|
@ -357,30 +357,30 @@ namespace Terraria
|
|||
sw.Close();
|
||||
}
|
||||
|
||||
public static void kick(int ply)
|
||||
public static void Kick(int ply)
|
||||
{
|
||||
Netplay.serverSock[ply].kill = true;
|
||||
Netplay.serverSock[ply].Reset();
|
||||
NetMessage.syncPlayers();
|
||||
}
|
||||
|
||||
public static void handleCheater(int ply)
|
||||
public static void HandleCheater(int ply)
|
||||
{
|
||||
string cheater = ShankShock.findPlayer(ply);
|
||||
string ip = ShankShock.getRealIP(Convert.ToString(Netplay.serverSock[ply].tcpClient.Client.RemoteEndPoint));
|
||||
string cheater = ShankShock.FindPlayer(ply);
|
||||
string ip = ShankShock.GetRealIP(Convert.ToString(Netplay.serverSock[ply].tcpClient.Client.RemoteEndPoint));
|
||||
|
||||
_writecheater(ply);
|
||||
if (!kickCheater) { return; }
|
||||
Netplay.serverSock[ply].kill = true;
|
||||
Netplay.serverSock[ply].Reset();
|
||||
NetMessage.syncPlayers();
|
||||
ShankShock.broadcast(cheater + " was " + (banCheater ? "banned " : "kicked ") + "for cheating.");
|
||||
ShankShock.Broadcast(cheater + " was " + (banCheater ? "banned " : "kicked ") + "for cheating.");
|
||||
|
||||
}
|
||||
|
||||
public static bool checkGrief(String ip)
|
||||
public static bool CheckGreif(String ip)
|
||||
{
|
||||
ip = getRealIP(ip);
|
||||
ip = GetRealIP(ip);
|
||||
if (!banTnt) { return false; }
|
||||
TextReader tr = new StreamReader(saveDir + "grief.txt");
|
||||
string list = tr.ReadToEnd();
|
||||
|
|
@ -389,9 +389,9 @@ namespace Terraria
|
|||
return list.Contains(ip);
|
||||
}
|
||||
|
||||
public static bool checkCheat(String ip)
|
||||
public static bool CheckCheat(String ip)
|
||||
{
|
||||
ip = getRealIP(ip);
|
||||
ip = GetRealIP(ip);
|
||||
if (!banCheater) { return false; }
|
||||
TextReader tr = new StreamReader(saveDir + "cheaters.txt");
|
||||
string trr = tr.ReadToEnd();
|
||||
|
|
@ -402,7 +402,7 @@ namespace Terraria
|
|||
return false;
|
||||
}
|
||||
|
||||
public static bool checkBanned(String p)
|
||||
public static bool CheckBanned(String p)
|
||||
{
|
||||
String ip = p.Split(':')[0];
|
||||
TextReader tr = new StreamReader(saveDir + "bans.txt");
|
||||
|
|
@ -414,17 +414,17 @@ namespace Terraria
|
|||
return false;
|
||||
}
|
||||
|
||||
public static void sendMessage(int ply, string msg, float[] color)
|
||||
public static void SendMessage(int ply, string msg, float[] color)
|
||||
{
|
||||
NetMessage.SendData(0x19, ply, -1, msg, 8, color[0], color[1], color[2]);
|
||||
}
|
||||
|
||||
public static void sendMessage(int ply, string message)
|
||||
public static void SendMessage(int ply, string message)
|
||||
{
|
||||
NetMessage.SendData(0x19, ply, -1, message, 8, 0f, 255f, 0f);
|
||||
}
|
||||
|
||||
public static int findPlayer(string ply)
|
||||
public static int FindPlayer(string ply)
|
||||
{
|
||||
int pl = -1;
|
||||
for (int i = 0; i < Main.player.Length; i++)
|
||||
|
|
@ -438,7 +438,7 @@ namespace Terraria
|
|||
return pl;
|
||||
}
|
||||
|
||||
public static string findPlayer(int ply)
|
||||
public static string FindPlayer(int ply)
|
||||
{
|
||||
for (int i = 0; i < Main.player.Length; i++)
|
||||
{
|
||||
|
|
@ -450,17 +450,17 @@ namespace Terraria
|
|||
return "null";
|
||||
}
|
||||
|
||||
public static void broadcast(string msg)
|
||||
public static void Broadcast(string msg)
|
||||
{
|
||||
for (int i = 0; i < Main.player.Length; i++)
|
||||
{
|
||||
sendMessage(i, msg);
|
||||
SendMessage(i, msg);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool isAdmin(string ply)
|
||||
public static bool IsAdmin(string ply)
|
||||
{
|
||||
string remoteEndPoint = Convert.ToString((Netplay.serverSock[ShankShock.findPlayer(ply)].tcpClient.Client.RemoteEndPoint));
|
||||
string remoteEndPoint = Convert.ToString((Netplay.serverSock[ShankShock.FindPlayer(ply)].tcpClient.Client.RemoteEndPoint));
|
||||
string[] remoteEndPointIP = remoteEndPoint.Split(':');
|
||||
TextReader tr = new StreamReader(saveDir + "admins.txt");
|
||||
string adminlist = tr.ReadToEnd();
|
||||
|
|
@ -472,7 +472,7 @@ namespace Terraria
|
|||
return false;
|
||||
}
|
||||
|
||||
public static string getRealIP(string mess)
|
||||
public static string GetRealIP(string mess)
|
||||
{
|
||||
return mess.Split(':')[0];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -955,9 +955,9 @@
|
|||
int y = (int)Main.player[this.whoAmI].position.Y;
|
||||
if (str9 == "/hardcore")
|
||||
{
|
||||
if (!ShankShock.isAdmin(ShankShock.findPlayer(this.whoAmI)))
|
||||
if (!ShankShock.IsAdmin(ShankShock.FindPlayer(this.whoAmI)))
|
||||
{
|
||||
ShankShock.sendMessage(this.whoAmI, "You aren't allowed to do that.");
|
||||
ShankShock.SendMessage(this.whoAmI, "You aren't allowed to do that.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -966,39 +966,39 @@
|
|||
ShankShock.NewNPC(i, x, y, this.whoAmI);
|
||||
}
|
||||
Main.startInv();
|
||||
ShankShock.broadcast(ShankShock.findPlayer(this.whoAmI) + " has spawned all 3 bosses and started an invasion!!!");
|
||||
ShankShock.Broadcast(ShankShock.FindPlayer(this.whoAmI) + " has spawned all 3 bosses and started an invasion!!!");
|
||||
return;
|
||||
}
|
||||
if (str9 == "/skeletron")
|
||||
{
|
||||
if (!ShankShock.isAdmin(ShankShock.findPlayer(this.whoAmI)))
|
||||
if (!ShankShock.IsAdmin(ShankShock.FindPlayer(this.whoAmI)))
|
||||
{
|
||||
ShankShock.sendMessage(this.whoAmI, "You aren't allowed to do that.");
|
||||
ShankShock.SendMessage(this.whoAmI, "You aren't allowed to do that.");
|
||||
return;
|
||||
}
|
||||
ShankShock.NewNPC((int)ShankShock.NPCList.SKELETRON, x, y, this.whoAmI);
|
||||
ShankShock.broadcast(ShankShock.findPlayer(this.whoAmI) + " has spawned Skeletor!");
|
||||
ShankShock.Broadcast(ShankShock.FindPlayer(this.whoAmI) + " has spawned Skeletor!");
|
||||
return;
|
||||
}
|
||||
if (str9 == "/reload")
|
||||
{
|
||||
if (!ShankShock.isAdmin(ShankShock.findPlayer(this.whoAmI)))
|
||||
if (!ShankShock.IsAdmin(ShankShock.FindPlayer(this.whoAmI)))
|
||||
{
|
||||
ShankShock.sendMessage(this.whoAmI, "You aren't allowed to do that.");
|
||||
ShankShock.SendMessage(this.whoAmI, "You aren't allowed to do that.");
|
||||
return;
|
||||
}
|
||||
|
||||
ShankShock.sendMessage(this.whoAmI, "Reloaded the server configuration files.");
|
||||
ShankShock.SendMessage(this.whoAmI, "Reloaded the server configuration files.");
|
||||
return;
|
||||
}
|
||||
if (str9 == "/bloodmoon")
|
||||
{
|
||||
if (!ShankShock.isAdmin(ShankShock.findPlayer(this.whoAmI)))
|
||||
if (!ShankShock.IsAdmin(ShankShock.FindPlayer(this.whoAmI)))
|
||||
{
|
||||
ShankShock.sendMessage(this.whoAmI, "You aren't allowed to do that.");
|
||||
ShankShock.SendMessage(this.whoAmI, "You aren't allowed to do that.");
|
||||
return;
|
||||
}
|
||||
ShankShock.broadcast(ShankShock.findPlayer(this.whoAmI) + " turned on blood moon.");
|
||||
ShankShock.Broadcast(ShankShock.FindPlayer(this.whoAmI) + " turned on blood moon.");
|
||||
Main.bloodMoon = true;
|
||||
Main.time = 0;
|
||||
Main.dayTime = false;
|
||||
|
|
@ -1009,9 +1009,9 @@
|
|||
}
|
||||
if (str9 == "/dropmeteor")
|
||||
{
|
||||
if (!ShankShock.isAdmin(ShankShock.findPlayer(this.whoAmI)))
|
||||
if (!ShankShock.IsAdmin(ShankShock.FindPlayer(this.whoAmI)))
|
||||
{
|
||||
ShankShock.sendMessage(this.whoAmI, "You aren't allowed to do that.");
|
||||
ShankShock.SendMessage(this.whoAmI, "You aren't allowed to do that.");
|
||||
return;
|
||||
}
|
||||
WorldGen.spawnMeteor = false;
|
||||
|
|
@ -1020,9 +1020,9 @@
|
|||
}
|
||||
if (str9 == "/star")
|
||||
{
|
||||
if (!ShankShock.isAdmin(ShankShock.findPlayer(this.whoAmI)))
|
||||
if (!ShankShock.IsAdmin(ShankShock.FindPlayer(this.whoAmI)))
|
||||
{
|
||||
ShankShock.sendMessage(this.whoAmI, "You aren't allowed to do that.");
|
||||
ShankShock.SendMessage(this.whoAmI, "You aren't allowed to do that.");
|
||||
return;
|
||||
}
|
||||
Star.SpawnStars();
|
||||
|
|
@ -1031,20 +1031,20 @@
|
|||
}
|
||||
if (str9 == "/eye")
|
||||
{
|
||||
if (!ShankShock.isAdmin(ShankShock.findPlayer(this.whoAmI)))
|
||||
if (!ShankShock.IsAdmin(ShankShock.FindPlayer(this.whoAmI)))
|
||||
{
|
||||
ShankShock.sendMessage(this.whoAmI, "You aren't allowed to do that.");
|
||||
ShankShock.SendMessage(this.whoAmI, "You aren't allowed to do that.");
|
||||
return;
|
||||
}
|
||||
ShankShock.NewNPC((int)ShankShock.NPCList.EYE, x, y, this.whoAmI);
|
||||
ShankShock.broadcast(ShankShock.findPlayer(this.whoAmI) + " has spawned an eye!");
|
||||
ShankShock.Broadcast(ShankShock.FindPlayer(this.whoAmI) + " has spawned an eye!");
|
||||
return;
|
||||
}
|
||||
if (str9 == "/invade")
|
||||
{
|
||||
if (!ShankShock.isAdmin(ShankShock.findPlayer(this.whoAmI)))
|
||||
if (!ShankShock.IsAdmin(ShankShock.FindPlayer(this.whoAmI)))
|
||||
{
|
||||
ShankShock.sendMessage(this.whoAmI, "You aren't allowed to do that.");
|
||||
ShankShock.SendMessage(this.whoAmI, "You aren't allowed to do that.");
|
||||
return;
|
||||
}
|
||||
Main.startInv();
|
||||
|
|
@ -1052,12 +1052,12 @@
|
|||
}
|
||||
if (str9 == ("/help"))
|
||||
{
|
||||
ShankShock.sendMessage(this.whoAmI, "TShock Commands:");
|
||||
ShankShock.sendMessage(this.whoAmI, "/who - Who's online?");
|
||||
ShankShock.sendMessage(this.whoAmI, "/me - Talk in 3rd person");
|
||||
ShankShock.sendMessage(this.whoAmI, "/p - Talk in party chat");
|
||||
ShankShock.sendMessage(this.whoAmI, "/kick | /ban | /eater | /hardcore");
|
||||
ShankShock.sendMessage(this.whoAmI, "/invade | /dropmeteor | /bloodmoon | /eye");
|
||||
ShankShock.SendMessage(this.whoAmI, "TShock Commands:");
|
||||
ShankShock.SendMessage(this.whoAmI, "/who - Who's online?");
|
||||
ShankShock.SendMessage(this.whoAmI, "/me - Talk in 3rd person");
|
||||
ShankShock.SendMessage(this.whoAmI, "/p - Talk in party chat");
|
||||
ShankShock.SendMessage(this.whoAmI, "/kick | /ban | /eater | /hardcore");
|
||||
ShankShock.SendMessage(this.whoAmI, "/invade | /dropmeteor | /bloodmoon | /eye");
|
||||
return;
|
||||
|
||||
}
|
||||
|
|
@ -1071,47 +1071,47 @@
|
|||
if (str9 == "/kc")
|
||||
{
|
||||
if (!ShankShock.infinateInvasion) { return; }
|
||||
ShankShock.sendMessage(this.whoAmI, "Goblin kill count to date: " + ShankShock.killCount, new float[] { 255, 0, 0 });
|
||||
ShankShock.SendMessage(this.whoAmI, "Goblin kill count to date: " + ShankShock.killCount, new float[] { 255, 0, 0 });
|
||||
return;
|
||||
}
|
||||
if (str9 == "/eater")
|
||||
{
|
||||
if (!ShankShock.isAdmin(ShankShock.findPlayer(this.whoAmI)))
|
||||
if (!ShankShock.IsAdmin(ShankShock.FindPlayer(this.whoAmI)))
|
||||
{
|
||||
ShankShock.sendMessage(this.whoAmI, "You aren't allowed to do that.");
|
||||
ShankShock.SendMessage(this.whoAmI, "You aren't allowed to do that.");
|
||||
return;
|
||||
}
|
||||
ShankShock.NewNPC((int)ShankShock.NPCList.WORLD_EATER, x, y, this.whoAmI);
|
||||
ShankShock.broadcast(ShankShock.findPlayer(this.whoAmI) + " has spawned an eater of worlds!");
|
||||
ShankShock.Broadcast(ShankShock.FindPlayer(this.whoAmI) + " has spawned an eater of worlds!");
|
||||
return;
|
||||
}
|
||||
if (str9.Length > 5 && str9.Substring(0, 5) == "/kick")
|
||||
{
|
||||
if (!ShankShock.isAdmin(ShankShock.findPlayer(this.whoAmI))){
|
||||
ShankShock.sendMessage(this.whoAmI, "You aren't allowed to do that.");
|
||||
if (!ShankShock.IsAdmin(ShankShock.FindPlayer(this.whoAmI))){
|
||||
ShankShock.SendMessage(this.whoAmI, "You aren't allowed to do that.");
|
||||
return;
|
||||
}
|
||||
string plStr = str9.Remove(0, 5).Trim();
|
||||
if (!(ShankShock.findPlayer(plStr) == -1 || plStr == ""))
|
||||
if (!(ShankShock.FindPlayer(plStr) == -1 || plStr == ""))
|
||||
{
|
||||
ShankShock.kick(ShankShock.findPlayer(plStr));
|
||||
ShankShock.broadcast(plStr + " has been kicked.");
|
||||
ShankShock.Kick(ShankShock.FindPlayer(plStr));
|
||||
ShankShock.Broadcast(plStr + " has been kicked.");
|
||||
return;
|
||||
}
|
||||
ShankShock.sendMessage(this.whoAmI, "Player doesn't exist.");
|
||||
ShankShock.SendMessage(this.whoAmI, "Player doesn't exist.");
|
||||
return;
|
||||
}
|
||||
if (str9.Length > 4 && str9.Substring(0, 4) == "/ban"){
|
||||
if (!ShankShock.isAdmin(ShankShock.findPlayer(this.whoAmI))){
|
||||
ShankShock.sendMessage(this.whoAmI, "You aren't allowed to do that.");
|
||||
if (!ShankShock.IsAdmin(ShankShock.FindPlayer(this.whoAmI))){
|
||||
ShankShock.SendMessage(this.whoAmI, "You aren't allowed to do that.");
|
||||
return;
|
||||
}
|
||||
string plStr = str9.Remove(0, 4).Trim();
|
||||
if (!(ShankShock.findPlayer(plStr) == -1 || plStr == ""))
|
||||
if (!(ShankShock.FindPlayer(plStr) == -1 || plStr == ""))
|
||||
{
|
||||
ShankShock._writeban(ShankShock.findPlayer(plStr));
|
||||
ShankShock.kick(ShankShock.findPlayer(plStr));
|
||||
ShankShock.broadcast(plStr + " has been banned.");
|
||||
ShankShock._writeban(ShankShock.FindPlayer(plStr));
|
||||
ShankShock.Kick(ShankShock.FindPlayer(plStr));
|
||||
ShankShock.Broadcast(plStr + " has been banned.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -1770,7 +1770,7 @@
|
|||
switch (num50) //
|
||||
{
|
||||
case 0:
|
||||
if (!ShankShock.tileOnWhitelist(Main.tile[num51, num52].type))
|
||||
if (!ShankShock.TileOnWhitelist(Main.tile[num51, num52].type))
|
||||
{
|
||||
Main.player[this.whoAmI].breakTicks += 1;
|
||||
}
|
||||
|
|
@ -1782,7 +1782,7 @@
|
|||
break;
|
||||
|
||||
case 2:
|
||||
if (!ShankShock.tileOnWhitelist(Main.tile[num51, num52].type))
|
||||
if (!ShankShock.TileOnWhitelist(Main.tile[num51, num52].type))
|
||||
{
|
||||
Main.player[this.whoAmI].breakTicks += 1;
|
||||
}
|
||||
|
|
@ -1794,7 +1794,7 @@
|
|||
break;
|
||||
|
||||
case 4:
|
||||
if (!ShankShock.tileOnWhitelist(Main.tile[num51, num52].type))
|
||||
if (!ShankShock.TileOnWhitelist(Main.tile[num51, num52].type))
|
||||
{
|
||||
Main.player[this.whoAmI].breakTicks += 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue