Max Stack and Stat Hack detection permissions implemented.

This commit is contained in:
Zidonuke 2011-12-28 21:10:59 -05:00
parent 34efba9c1f
commit 24431017e6
3 changed files with 30 additions and 2 deletions

View file

@ -138,7 +138,7 @@ namespace TShockAPI
item.netDefaults(type);
item.Prefix(prefix);
if (stack > item.maxStack && type != 0 && args.Player.IgnoreActionsForCheating != "none")
if (stack > item.maxStack && type != 0 && args.Player.IgnoreActionsForCheating != "none" && !args.Player.Group.HasPermission(Permissions.ignorestackhackdetection))
{
args.Player.IgnoreActionsForCheating = "Item Hack: " + item.name + " (" + stack + ") exceeds max stack of " + item.maxStack;
}
@ -331,11 +331,16 @@ namespace TShockAPI
return true;
args.Player.RequestedSection = true;
if (TShock.HackedHealth(args.Player))
if (TShock.HackedHealth(args.Player) && !args.Player.Group.HasPermission(Permissions.ignorestathackdetection))
{
TShock.Utils.ForceKick(args.Player, "You have Hacked Health/Mana, Please use a different character.");
}
if (!args.Player.Group.HasPermission(Permissions.ignorestackhackdetection))
{
TShock.HackedInventory(args.Player);
}
if (TShock.Utils.ActivePlayers() + 1 > TShock.Config.MaxSlots && !args.Player.Group.HasPermission(Permissions.reservedslot))
{
TShock.Utils.ForceKick(args.Player, TShock.Config.ServerFullReason);

View file

@ -47,6 +47,12 @@ namespace TShockAPI
[Description("Prevents you from being reverted by no clip detection")]
public static readonly string ignorenoclipdetection;
[Description("Prevents you from being disabled by stack hack detection")]
public static readonly string ignorestackhackdetection;
[Description("Prevents you from being kicked by hacked health detection")]
public static readonly string ignorestathackdetection;
[Description("Specific log messages are sent to users with this permission")]
public static readonly string logs;

View file

@ -801,6 +801,23 @@ namespace TShockAPI
player.SendMessage("PvP is forced! Enable PvP else you can't move or do anything!", Color.Red);
}
if (!player.IsLoggedIn)
{
if (Config.RequireLogin)
{
player.SendMessage("Please /register or /login to play!", Color.Red);
}
else if (Config.ServerSideInventory)
{
player.SendMessage("Server Side Inventory is enabled! Please /register or /login to play!", Color.Red);
}
if (Config.ServerSideInventory)
{
player.IgnoreActionsForInventory = true;
}
}
if (player.Group.HasPermission(Permissions.causeevents) && Config.InfiniteInvasion)
{
StartInvasion();