Merge branch 'master' of github.com:TShock/TShock

This commit is contained in:
Shank 2011-06-06 03:11:05 -06:00
commit 906ae46785
2 changed files with 30 additions and 26 deletions

View file

@ -284,17 +284,18 @@ namespace TShockAPI
{ {
if (players[ply].syncHP) if (players[ply].syncHP)
{ {
if (maxLife > Main.player[ply].statLifeMax + 20 || life > maxLife) if (!players[ply].group.HasPermission("ignorecheatdetection"))
if (ConfigurationManager.banCheater)
{ {
if (ConfigurationManager.banCheater || ConfigurationManager.kickCheater)
{
string playerName = Tools.FindPlayer(ply);
if (ConfigurationManager.banCheater)
Ban(ply, "Abnormal life increase"); Ban(ply, "Abnormal life increase");
Tools.Broadcast(Tools.FindPlayer(ply) +
" was banned because they gained an abnormal amount of health.");
}
else if (ConfigurationManager.kickCheater)
Tools.Kick(ply, "Abnormal life increase"); Tools.Kick(ply, "Abnormal life increase");
Tools.Broadcast(Tools.FindPlayer(ply) + Tools.Broadcast(playerName + " was " + (ConfigurationManager.kickCheater ? "banned" : "kicked") +
" was kicked because they gained an abnormal amount of health."); " because they gained an abnormal amount of health.");
}
}
} }
else else
{ {
@ -315,16 +316,18 @@ namespace TShockAPI
{ {
if (players[ply].syncMP) if (players[ply].syncMP)
{ {
if (ConfigurationManager.banCheater) if (!players[ply].group.HasPermission("ignorecheatdetection"))
{ {
if (ConfigurationManager.banCheater || ConfigurationManager.kickCheater)
{
string playerName = Tools.FindPlayer(ply);
if (ConfigurationManager.banCheater)
Ban(ply, "Abnormal mana increase"); Ban(ply, "Abnormal mana increase");
Tools.Broadcast(Tools.FindPlayer(ply) +
" was banned because they gained an abnormal amount of mana.");
}
else if (ConfigurationManager.kickCheater)
Tools.Kick(ply, "Abnormal mana increase"); Tools.Kick(ply, "Abnormal mana increase");
Log.Info(Tools.FindPlayer(ply) + Tools.Broadcast(playerName + " was " + (ConfigurationManager.kickCheater ? "banned" : "kicked") +
" had increased max mana by more than 20 or increased mana more than max"); " because they gained an abnormal amount of mana.");
}
}
} }
else else
{ {
@ -447,15 +450,16 @@ namespace TShockAPI
} }
int plr = who; //legacy support int plr = who; //legacy support
Tools.ShowMOTD(who); Tools.ShowMOTD(who);
if (HackedHealth(who) && ConfigurationManager.kickCheater && ConfigurationManager.banCheater) if (!players[who].group.HasPermission("ignorecheatdetection") && HackedHealth(who))
{ {
if (ConfigurationManager.banCheater || ConfigurationManager.kickCheater)
{
string playerName = Tools.FindPlayer(who);
if (ConfigurationManager.banCheater)
Ban(who, "Hacked health."); Ban(who, "Hacked health.");
Tools.Broadcast(Tools.FindPlayer(who) + " was banned for hacked health.");
}
else if (HackedHealth(who) && ConfigurationManager.kickCheater && (!ConfigurationManager.banCheater))
{
Tools.Kick(who, "Hacked health."); Tools.Kick(who, "Hacked health.");
Tools.Broadcast(Tools.FindPlayer(who) + " was kicked for hacked health."); Tools.Broadcast(playerName + " was " + (ConfigurationManager.kickCheater ? "banned" : "kicked") + " for hacked health.");
}
} }
if (ConfigurationManager.permaPvp) if (ConfigurationManager.permaPvp)
{ {

View file

@ -18,4 +18,4 @@ default null
vip default reservedslot vip default reservedslot
newadmin default kick editspawn reservedslot newadmin default kick editspawn reservedslot
admin newadmin ban causeevents spawnboss spawnmob tp immunetokick kill admin newadmin ban causeevents spawnboss spawnmob tp immunetokick kill
trustedadmin admin ignorecheatdetection maintenance cfg cheat pvpfun ignorecheatdetection immunetoban ignoregriefdetection trustedadmin admin maintenance cfg cheat pvpfun ignorecheatdetection immunetoban ignoregriefdetection