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:
@@ -89,6 +89,8 @@ cPlayer::cPlayer(cClientHandlePtr a_Client, const AString & a_PlayerName) :
|
||||
m_UUID((a_Client != nullptr) ? a_Client->GetUUID() : ""),
|
||||
m_CustomName("")
|
||||
{
|
||||
ASSERT(a_PlayerName.length() <= 16); // Otherwise this player could crash many clients...
|
||||
|
||||
m_InventoryWindow = new cInventoryWindow(*this);
|
||||
m_CurrentWindow = m_InventoryWindow;
|
||||
m_InventoryWindow->OpenedByPlayer(*this);
|
||||
|
||||
Reference in New Issue
Block a user