Implement Handler.LandGolfBalInCupHandler and handle packet exploits.

Added multiple checks to prevent clients from sending the golfball packet directly, without having golf play actions.
This commit is contained in:
Patrikkk 2020-06-01 12:59:40 +02:00
parent 26773f61a2
commit 4944ee3144
3 changed files with 120 additions and 0 deletions

View file

@ -37,6 +37,7 @@ namespace TShockAPI
internal sealed class Bouncer
{
internal Handlers.SendTileSquareHandler STSHandler { get; set; }
internal Handlers.LandGolfBallInCupHandler LandGolfBallInCupHandler { get; set; }
/// <summary>Constructor call initializes Bouncer and related functionality.</summary>
/// <returns>A new Bouncer.</returns>
@ -45,6 +46,9 @@ namespace TShockAPI
STSHandler = new Handlers.SendTileSquareHandler();
GetDataHandlers.SendTileSquare += STSHandler.OnReceiveSendTileSquare;
LandGolfBallInCupHandler = new Handlers.LandGolfBallInCupHandler();
GetDataHandlers.LandGolfBallInCup += LandGolfBallInCupHandler.OnLandGolfBallInCup;
// Setup hooks
GetDataHandlers.GetSection += OnGetSection;
GetDataHandlers.PlayerUpdate += OnPlayerUpdate;