Changed stack hack handling.
This commit is contained in:
parent
0763dce4e6
commit
31c4e1a37b
3 changed files with 10 additions and 9 deletions
|
|
@ -138,9 +138,9 @@ namespace TShockAPI
|
||||||
item.netDefaults(type);
|
item.netDefaults(type);
|
||||||
item.Prefix(prefix);
|
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)
|
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));
|
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.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);
|
args.Player.SendMessage("Please /register or /login to play!", Color.Red);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ namespace TShockAPI
|
||||||
private string CacheIP;
|
private string CacheIP;
|
||||||
public bool IgnoreActionsForPvP = false;
|
public bool IgnoreActionsForPvP = false;
|
||||||
public bool IgnoreActionsForInventory = false;
|
public bool IgnoreActionsForInventory = false;
|
||||||
public bool IgnoreActionsForCheating = false;
|
public string IgnoreActionsForCheating = "none";
|
||||||
public bool IgnoreActionsForClearingTrashCan = false;
|
public bool IgnoreActionsForClearingTrashCan = false;
|
||||||
public PlayerData PlayerData;
|
public PlayerData PlayerData;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -752,10 +752,7 @@ namespace TShockAPI
|
||||||
TShock.Utils.ForceKick(player, "You have Hacked Health/Mana, Please use a different character.");
|
TShock.Utils.ForceKick(player, "You have Hacked Health/Mana, Please use a different character.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HackedInventory(player))
|
HackedInventory(player);
|
||||||
{
|
|
||||||
player.IgnoreActionsForCheating = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
NetMessage.syncPlayers();
|
NetMessage.syncPlayers();
|
||||||
|
|
||||||
|
|
@ -1204,7 +1201,7 @@ namespace TShockAPI
|
||||||
check = true;
|
check = true;
|
||||||
if (player.IgnoreActionsForInventory)
|
if (player.IgnoreActionsForInventory)
|
||||||
check = true;
|
check = true;
|
||||||
if (player.IgnoreActionsForCheating)
|
if (player.IgnoreActionsForCheating != "none")
|
||||||
check = true;
|
check = true;
|
||||||
if (!player.IsLoggedIn && Config.RequireLogin)
|
if (!player.IsLoggedIn && Config.RequireLogin)
|
||||||
check = true;
|
check = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue