diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 9c71a0ca..b987d4e4 100755 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -2501,15 +2501,18 @@ namespace TShockAPI if (OnKillMe(id, direction, dmg, pvp)) return true; + int textlength = (int) (args.Data.Length - args.Data.Position - 1); string deathtext = ""; if (textlength > 0) { deathtext = Encoding.UTF8.GetString(args.Data.ReadBytes(textlength)); - /*if (!TShock.Utils.ValidString(deathtext)) - { - return true; - }*/ + } + + if (deathtext.Length > 500) + { + TShock.Utils.Kick(TShock.Players[id], "Crash attempt", true); + return true; } args.Player.LastDeath = DateTime.Now; diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 8017e291..785fb7ed 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -950,6 +950,13 @@ namespace TShockAPI return; } + if (args.Text.Length > 500) + { + Utils.Kick(tsplr, "Crash attempt", true); + args.Handled = true; + return; + } + /*if (!Utils.ValidString(text)) { e.Handled = true;