From 41aa7cf1232941ebe13efb6f64439d38963beb22 Mon Sep 17 00:00:00 2001 From: bibo38 Date: Wed, 13 Jan 2016 07:55:05 +0100 Subject: 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 --- src/Entities/Player.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/Entities/Player.cpp') diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index c5a1e0f95..766161703 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -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); -- cgit v1.2.3