Merge branch 'hackedinventory' into crp
This commit is contained in:
commit
848d3c4778
5 changed files with 285 additions and 218 deletions
|
|
@ -42,6 +42,7 @@ namespace TShockAPI
|
|||
{
|
||||
// Setup hooks
|
||||
|
||||
GetDataHandlers.GetSection += OnGetSection;
|
||||
GetDataHandlers.PlaceItemFrame += OnPlaceItemFrame;
|
||||
GetDataHandlers.GemLockToggle += OnGemLockToggle;
|
||||
GetDataHandlers.PlaceTileEntity += OnPlaceTileEntity;
|
||||
|
|
@ -64,6 +65,28 @@ namespace TShockAPI
|
|||
GetDataHandlers.TileEdit += OnTileEdit;
|
||||
}
|
||||
|
||||
internal void OnGetSection(object sender, GetDataHandlers.GetSectionEventArgs args)
|
||||
{
|
||||
if (args.Player.RequestedSection)
|
||||
{
|
||||
args.Handled = true;
|
||||
return;
|
||||
}
|
||||
args.Player.RequestedSection = true;
|
||||
|
||||
if (String.IsNullOrEmpty(args.Player.Name))
|
||||
{
|
||||
TShock.Utils.ForceKick(args.Player, "Blank name.", true);
|
||||
args.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!args.Player.HasPermission(Permissions.ignorestackhackdetection))
|
||||
{
|
||||
args.Player.IsDisabledForStackDetection = args.Player.HasHackedItemStacks(shouldWarnPlayer: true);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Fired when an item frame is placed for anti-cheat detection.</summary>
|
||||
/// <param name="sender">The object that triggered the event.</param>
|
||||
/// <param name="args">The packet arguments that the event has.</param>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue