Fix death text exploit.
This commit is contained in:
parent
a44618d6c6
commit
b78ea17d68
2 changed files with 16 additions and 2 deletions
|
|
@ -506,6 +506,20 @@ namespace TShockAPI
|
|||
private static bool HandlePlayerKillMe(GetDataHandlerArgs args)
|
||||
{
|
||||
byte id = args.Data.ReadInt8();
|
||||
byte direction = args.Data.ReadInt8();
|
||||
short dmg = args.Data.ReadInt16();
|
||||
bool pvp = args.Data.ReadInt8() == 0;
|
||||
int textlength = (int)(args.Data.Length - args.Data.Position - 1);
|
||||
string deathtext = "";
|
||||
if (textlength > 0)
|
||||
{
|
||||
deathtext = Encoding.ASCII.GetString(args.Data.ReadBytes(textlength));
|
||||
if (!TShock.Utils.ValidString(deathtext))
|
||||
{
|
||||
TShock.Utils.HandleGriefer(args.Player, "Death text exploit.");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (id != args.Player.Index)
|
||||
{
|
||||
return TShock.Utils.HandleGriefer(args.Player, TShock.Config.KillMeAbuseReason);
|
||||
|
|
|
|||
|
|
@ -36,5 +36,5 @@ using System.Runtime.InteropServices;
|
|||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
|
||||
[assembly: AssemblyVersion("3.3.4.1202")]
|
||||
[assembly: AssemblyFileVersion("3.3.4.1202")]
|
||||
[assembly: AssemblyVersion("3.3.4.1203")]
|
||||
[assembly: AssemblyFileVersion("3.3.4.1203")]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue