Moved the admin check for cheating into HandleCheater instead of cheat detection
This commit is contained in:
parent
39bc48968a
commit
892ef0c770
2 changed files with 13 additions and 10 deletions
|
|
@ -189,7 +189,7 @@ namespace TShockAPI
|
||||||
if (Main.netMode != 2) { return; }
|
if (Main.netMode != 2) { return; }
|
||||||
int plr = who; //legacy support
|
int plr = who; //legacy support
|
||||||
Tools.ShowMOTD(who);
|
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);
|
Tools.HandleCheater(plr);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -223,6 +223,8 @@ namespace TShockAPI
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ply">int player</param>
|
/// <param name="ply">int player</param>
|
||||||
public static void HandleCheater(int ply)
|
public static void HandleCheater(int ply)
|
||||||
|
{
|
||||||
|
if (!Tools.IsAdmin(ply))
|
||||||
{
|
{
|
||||||
string cheater = Tools.FindPlayer(ply);
|
string cheater = Tools.FindPlayer(ply);
|
||||||
string ip = Tools.GetRealIP(Convert.ToString(Netplay.serverSock[ply].tcpClient.Client.RemoteEndPoint));
|
string ip = Tools.GetRealIP(Convert.ToString(Netplay.serverSock[ply].tcpClient.Client.RemoteEndPoint));
|
||||||
|
|
@ -235,6 +237,7 @@ namespace TShockAPI
|
||||||
NetMessage.syncPlayers();
|
NetMessage.syncPlayers();
|
||||||
Tools.Broadcast(cheater + " was " + (ConfigurationManager.banCheater ? "banned " : "kicked ") + "for cheating.");
|
Tools.Broadcast(cheater + " was " + (ConfigurationManager.banCheater ? "banned " : "kicked ") + "for cheating.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Shows a MOTD to the player
|
/// Shows a MOTD to the player
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue