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.ChestGetContents, HandleChest},
|
||||||
{PacketTypes.SignNew, HandleSign},
|
{PacketTypes.SignNew, HandleSign},
|
||||||
{PacketTypes.PlayerSlot, HandlePlayerSlot},
|
{PacketTypes.PlayerSlot, HandlePlayerSlot},
|
||||||
|
{PacketTypes.TileGetSection, HandleGetSection}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -692,5 +693,16 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
return false;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,7 @@ namespace TShockAPI
|
||||||
public bool HasBeenNaggedAboutLoggingIn;
|
public bool HasBeenNaggedAboutLoggingIn;
|
||||||
public bool TpLock = false;
|
public bool TpLock = false;
|
||||||
Player FakePlayer;
|
Player FakePlayer;
|
||||||
|
public List<Vector2> RequestedSections = new List<Vector2>();
|
||||||
|
|
||||||
public bool RealPlayer
|
public bool RealPlayer
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue