Prevents users from sneaking items onto the server by holding them in their hands when ServerSideInventory is enabled.

This commit is contained in:
k0rd 2012-01-24 00:07:25 -05:00
parent 1666c657d6
commit b66358bef2
4 changed files with 37 additions and 33 deletions

View file

@ -1921,7 +1921,7 @@ namespace TShockAPI
Log.Debug("Skeletron Prime's death laser ignored for cheat detection..");
}
else
{
{
args.Player.Disable("Does not have projectile permission to update projectile.");
args.Player.RemoveProjectile(ident, owner);
}
@ -1948,7 +1948,7 @@ namespace TShockAPI
Log.Debug("Ignoring shrapnel per config..");
}
else
{
{
args.Player.ProjectileThreshold++;
}
}
@ -2374,7 +2374,14 @@ namespace TShockAPI
args.Player.SendData(PacketTypes.ItemDrop, "", id);
return true;
}
if ((TShock.Config.ServerSideInventory) && (DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond - args.Player.LoginMS < TShock.Config.LogonDiscardThreshold))
{
//Player is probably trying to sneak items onto the server in their hands!!!
Log.ConsoleInfo(string.Format("Player {0} tried to sneak {1} onto the server!", args.Player.Name, item.name));
args.Player.SendData(PacketTypes.ItemDrop, "", id);
return true;
}
if (TShock.CheckIgnores(args.Player))
{
args.Player.SendData(PacketTypes.ItemDrop, "", id);
@ -2608,4 +2615,4 @@ namespace TShockAPI
return false;
}
}
}
}