1
0

Fixed 1.6.4 client crash on composite chat messages.

This commit is contained in:
madmaxoft 2014-04-06 22:28:41 +02:00
parent de3df0a71f
commit 95fb90eaa6
2 changed files with 14 additions and 0 deletions

View File

@ -18,6 +18,7 @@ Implements the 1.6.x protocol classes:
#include "../Entities/Entity.h"
#include "../Entities/Player.h"
#include "../UI/Window.h"
#include "../CompositeChat.h"
@ -89,6 +90,18 @@ void cProtocol161::SendChat(const AString & a_Message)
void cProtocol161::SendChat(const cCompositeChat & a_Message)
{
// This protocol version doesn't support composite messages to the full
// Just extract each part's text and use it:
super::SendChat(Printf("{\"text\":\"%s\"}", EscapeString(a_Message.ExtractText()).c_str()));
}
void cProtocol161::SendEditSign(int a_BlockX, int a_BlockY, int a_BlockZ)
{
cCSLock Lock(m_CSPacket);

View File

@ -37,6 +37,7 @@ protected:
// cProtocol150 overrides:
virtual void SendAttachEntity (const cEntity & a_Entity, const cEntity * a_Vehicle) override;
virtual void SendChat (const AString & a_Message) override;
virtual void SendChat (const cCompositeChat & a_Message) override;
virtual void SendEditSign (int a_BlockX, int a_BlockY, int a_BlockZ) override; ///< Request the client to open up the sign editor for the sign (1.6+)
virtual void SendGameMode (eGameMode a_GameMode) override;
virtual void SendHealth (void) override;