Max Stack and Stat Hack detection permissions implemented.
This commit is contained in:
parent
34efba9c1f
commit
24431017e6
3 changed files with 30 additions and 2 deletions
|
|
@ -138,7 +138,7 @@ namespace TShockAPI
|
||||||
item.netDefaults(type);
|
item.netDefaults(type);
|
||||||
item.Prefix(prefix);
|
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;
|
args.Player.IgnoreActionsForCheating = "Item Hack: " + item.name + " (" + stack + ") exceeds max stack of " + item.maxStack;
|
||||||
}
|
}
|
||||||
|
|
@ -331,11 +331,16 @@ namespace TShockAPI
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
args.Player.RequestedSection = 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.");
|
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))
|
if (TShock.Utils.ActivePlayers() + 1 > TShock.Config.MaxSlots && !args.Player.Group.HasPermission(Permissions.reservedslot))
|
||||||
{
|
{
|
||||||
TShock.Utils.ForceKick(args.Player, TShock.Config.ServerFullReason);
|
TShock.Utils.ForceKick(args.Player, TShock.Config.ServerFullReason);
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,12 @@ namespace TShockAPI
|
||||||
[Description("Prevents you from being reverted by no clip detection")]
|
[Description("Prevents you from being reverted by no clip detection")]
|
||||||
public static readonly string ignorenoclipdetection;
|
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")]
|
[Description("Specific log messages are sent to users with this permission")]
|
||||||
public static readonly string logs;
|
public static readonly string logs;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -801,6 +801,23 @@ namespace TShockAPI
|
||||||
player.SendMessage("PvP is forced! Enable PvP else you can't move or do anything!", Color.Red);
|
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)
|
if (player.Group.HasPermission(Permissions.causeevents) && Config.InfiniteInvasion)
|
||||||
{
|
{
|
||||||
StartInvasion();
|
StartInvasion();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue