Ban/Kick cheater now respect the ignorecheatdetection priviledge

Removed duplicated priviledge from trustedadmin group
This commit is contained in:
ricky 2011-06-06 19:03:31 +10:00
parent 72eda4f3e2
commit 77aa15e2f8
2 changed files with 30 additions and 26 deletions

View file

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

View file

@ -18,4 +18,4 @@ default null
vip default reservedslot
newadmin default kick editspawn reservedslot
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