Moved the admin check for cheating into HandleCheater instead of cheat detection

This commit is contained in:
Maverick Motherfucker 2011-06-02 21:28:47 -07:00
parent 39bc48968a
commit 892ef0c770
2 changed files with 13 additions and 10 deletions

View file

@ -189,7 +189,7 @@ namespace TShockAPI
if (Main.netMode != 2) { return; }
int plr = who; //legacy support
Tools.ShowMOTD(who);
if ((Main.player[plr].statLifeMax > 400 || Main.player[plr].statManaMax > 200 || Main.player[plr].statLife > 400 || Main.player[plr].statMana > 200 || CheckInventory(plr)) && !Tools.IsAdmin(plr))
if (Main.player[plr].statLifeMax > 400 || Main.player[plr].statManaMax > 200 || Main.player[plr].statLife > 400 || Main.player[plr].statMana > 200 || CheckInventory(plr))
{
Tools.HandleCheater(plr);
}

View file

@ -224,16 +224,19 @@ namespace TShockAPI
/// <param name="ply">int player</param>
public static void HandleCheater(int ply)
{
string cheater = Tools.FindPlayer(ply);
string ip = Tools.GetRealIP(Convert.ToString(Netplay.serverSock[ply].tcpClient.Client.RemoteEndPoint));
if (!Tools.IsAdmin(ply))
{
string cheater = Tools.FindPlayer(ply);
string ip = Tools.GetRealIP(Convert.ToString(Netplay.serverSock[ply].tcpClient.Client.RemoteEndPoint));
FileTools.WriteGrief(ply);
FileTools.WriteCheater(ply);
if (!ConfigurationManager.kickCheater) { return; }
Netplay.serverSock[ply].kill = true;
Netplay.serverSock[ply].Reset();
NetMessage.syncPlayers();
Tools.Broadcast(cheater + " was " + (ConfigurationManager.banCheater ? "banned " : "kicked ") + "for cheating.");
FileTools.WriteGrief(ply);
FileTools.WriteCheater(ply);
if (!ConfigurationManager.kickCheater) { return; }
Netplay.serverSock[ply].kill = true;
Netplay.serverSock[ply].Reset();
NetMessage.syncPlayers();
Tools.Broadcast(cheater + " was " + (ConfigurationManager.banCheater ? "banned " : "kicked ") + "for cheating.");
}
}
/// <summary>
/// Shows a MOTD to the player