diff options
author | madmaxoft <github@xoft.cz> | 2014-04-06 22:28:41 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-04-06 22:28:41 +0200 |
commit | 95fb90eaa642b76915a117495b472d7f7e141cde (patch) | |
tree | 289c5b01a233019b0a7eec3f09757ab01687f7e1 | |
parent | Fixed crash in protocols sending 64-bit ints. (diff) | |
download | cuberite-95fb90eaa642b76915a117495b472d7f7e141cde.tar cuberite-95fb90eaa642b76915a117495b472d7f7e141cde.tar.gz cuberite-95fb90eaa642b76915a117495b472d7f7e141cde.tar.bz2 cuberite-95fb90eaa642b76915a117495b472d7f7e141cde.tar.lz cuberite-95fb90eaa642b76915a117495b472d7f7e141cde.tar.xz cuberite-95fb90eaa642b76915a117495b472d7f7e141cde.tar.zst cuberite-95fb90eaa642b76915a117495b472d7f7e141cde.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Protocol/Protocol16x.cpp | 13 | ||||
-rw-r--r-- | src/Protocol/Protocol16x.h | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/Protocol/Protocol16x.cpp b/src/Protocol/Protocol16x.cpp index bf7d9a0b1..3da23a1dc 100644 --- a/src/Protocol/Protocol16x.cpp +++ b/src/Protocol/Protocol16x.cpp @@ -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); diff --git a/src/Protocol/Protocol16x.h b/src/Protocol/Protocol16x.h index 325e41c5a..ae1388649 100644 --- a/src/Protocol/Protocol16x.h +++ b/src/Protocol/Protocol16x.h @@ -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; |