1
0

Limited the username length to 16 characters.

This fixes a client crash, because Minecraft requires that a username is not longer than 16 characters.
See also: http://minecraft.gamepedia.com/The_Player#Name
Fixes #2545
This commit is contained in:
bibo38
2016-01-13 07:55:05 +01:00
parent 0902d5121c
commit 41aa7cf123
2 changed files with 8 additions and 0 deletions

View File

@@ -1719,6 +1719,12 @@ bool cClientHandle::CheckMultiLogin(const AString & a_Username)
bool cClientHandle::HandleHandshake(const AString & a_Username)
{
if (a_Username.length() > 16)
{
Kick("Your username is too long(>16 characters)");
return false;
}
if (!cRoot::Get()->GetPluginManager()->CallHookHandshake(*this, a_Username))
{
if (cRoot::Get()->GetServer()->GetNumPlayers() >= cRoot::Get()->GetServer()->GetMaxPlayers())