Removed mousefontchars, valid chars are 0x20-0xA9(32-169)
Added checking to player names too.
This commit is contained in:
parent
1cd0f4c74b
commit
b382125cc5
8 changed files with 33 additions and 31 deletions
|
|
@ -134,8 +134,6 @@ namespace TShockAPI
|
|||
{
|
||||
byte playerid = args.Data.ReadInt8();
|
||||
byte hair = args.Data.ReadInt8();
|
||||
//Various colours here
|
||||
|
||||
args.Data.Position += 21;
|
||||
bool hardcore = args.Data.ReadBoolean();
|
||||
string name = Encoding.ASCII.GetString(args.Data.ReadBytes((int)(args.Data.Length - args.Data.Position - 1)));
|
||||
|
|
@ -145,6 +143,11 @@ namespace TShockAPI
|
|||
Tools.ForceKick(args.Player, "Hair crash exploit.");
|
||||
return true;
|
||||
}
|
||||
if (!Tools.ValidString(name))
|
||||
{
|
||||
Tools.ForceKick(args.Player, "Unprintable character in name");
|
||||
return true;
|
||||
}
|
||||
if (name.Length > 32)
|
||||
{
|
||||
Tools.ForceKick(args.Player, "Name exceeded 32 characters.");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue