Prevent repeated requests for sections.
(patches KANNIBALE's .ddos command)
This commit is contained in:
parent
eb88dc8924
commit
67f8760ba3
2 changed files with 13 additions and 0 deletions
|
|
@ -114,6 +114,7 @@ namespace TShockAPI
|
|||
{PacketTypes.ChestGetContents, HandleChest},
|
||||
{PacketTypes.SignNew, HandleSign},
|
||||
{PacketTypes.PlayerSlot, HandlePlayerSlot},
|
||||
{PacketTypes.TileGetSection, HandleGetSection}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -692,5 +693,16 @@ namespace TShockAPI
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool HandleGetSection(GetDataHandlerArgs args)
|
||||
{
|
||||
var x = args.Data.ReadInt32();
|
||||
var y = args.Data.ReadInt32();
|
||||
|
||||
if (args.Player.RequestedSections.Contains(new Vector2(x, y)))
|
||||
return true;
|
||||
args.Player.RequestedSections.Add(new Vector2(x, y));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue