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)
{ {
Ban(ply, "Abnormal life increase"); string playerName = Tools.FindPlayer(ply);
Tools.Broadcast(Tools.FindPlayer(ply) + if (ConfigurationManager.banCheater)
" was banned because they gained an abnormal amount of health."); Ban(ply, "Abnormal life increase");
}
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"))
{ {
Ban(ply, "Abnormal mana increase"); if (ConfigurationManager.banCheater || ConfigurationManager.kickCheater)
Tools.Broadcast(Tools.FindPlayer(ply) + {
" was banned because they gained an abnormal amount of mana."); string playerName = Tools.FindPlayer(ply);
if (ConfigurationManager.banCheater)
Ban(ply, "Abnormal mana increase");
Tools.Kick(ply, "Abnormal mana increase");
Tools.Broadcast(playerName + " was " + (ConfigurationManager.kickCheater ? "banned" : "kicked") +
" because they gained an abnormal amount of mana.");
}
} }
else if (ConfigurationManager.kickCheater)
Tools.Kick(ply, "Abnormal mana increase");
Log.Info(Tools.FindPlayer(ply) +
" had increased max mana by more than 20 or increased mana more than max");
} }
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))
{ {
Ban(who, "Hacked health."); if (ConfigurationManager.banCheater || ConfigurationManager.kickCheater)
Tools.Broadcast(Tools.FindPlayer(who) + " was banned for hacked health."); {
} string playerName = Tools.FindPlayer(who);
else if (HackedHealth(who) && ConfigurationManager.kickCheater && (!ConfigurationManager.banCheater)) if (ConfigurationManager.banCheater)
{ Ban(who, "Hacked health.");
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