Changed stack hack handling.

This commit is contained in:
Zidonuke 2011-12-27 14:47:31 -05:00
parent 0763dce4e6
commit 31c4e1a37b
3 changed files with 10 additions and 9 deletions

View file

@ -138,9 +138,9 @@ namespace TShockAPI
item.netDefaults(type);
item.Prefix(prefix);
if (stack > item.maxStack && type != 0)
if (stack > item.maxStack && type != 0 && args.Player.IgnoreActionsForCheating != "none")
{
args.Player.IgnoreActionsForCheating = true;
args.Player.IgnoreActionsForCheating = "Item Hack: " + item.name + " (" + stack + ") exceeds max stack of " + item.maxStack;
}
if (args.Player.IsLoggedIn)
@ -617,7 +617,11 @@ namespace TShockAPI
float distance = Vector2.Distance(new Vector2((pos.X / 16f), (pos.Y / 16f)), new Vector2(Main.spawnTileX, Main.spawnTileY));
if (TShock.CheckIgnores(args.Player) && distance > 6f)
{
if (TShock.Config.RequireLogin && !args.Player.IsLoggedIn)
if(args.Player.IgnoreActionsForCheating != "none")
{
args.Player.SendMessage("Disabled for cheating: " + args.Player.IgnoreActionsForCheating, Color.Red);
}
else if (TShock.Config.RequireLogin && !args.Player.IsLoggedIn)
{
args.Player.SendMessage("Please /register or /login to play!", Color.Red);
}

View file

@ -71,7 +71,7 @@ namespace TShockAPI
private string CacheIP;
public bool IgnoreActionsForPvP = false;
public bool IgnoreActionsForInventory = false;
public bool IgnoreActionsForCheating = false;
public string IgnoreActionsForCheating = "none";
public bool IgnoreActionsForClearingTrashCan = false;
public PlayerData PlayerData;

View file

@ -752,10 +752,7 @@ namespace TShockAPI
TShock.Utils.ForceKick(player, "You have Hacked Health/Mana, Please use a different character.");
}
if (HackedInventory(player))
{
player.IgnoreActionsForCheating = true;
}
HackedInventory(player);
NetMessage.syncPlayers();
@ -1204,7 +1201,7 @@ namespace TShockAPI
check = true;
if (player.IgnoreActionsForInventory)
check = true;
if (player.IgnoreActionsForCheating)
if (player.IgnoreActionsForCheating != "none")
check = true;
if (!player.IsLoggedIn && Config.RequireLogin)
check = true;