summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol18x.cpp
diff options
context:
space:
mode:
authortycho <work.tycho@gmail.com>2015-09-21 00:07:53 +0200
committertycho <work.tycho@gmail.com>2015-09-21 13:32:56 +0200
commitfd7b87741a39de10584b1b1c24982699ab3e3fab (patch)
tree6d30b3e0f16b151b50bc39a675b5b2472543a1f6 /src/Protocol/Protocol18x.cpp
parentMerge pull request #2487 from cuberite/sigpipe (diff)
downloadcuberite-fd7b87741a39de10584b1b1c24982699ab3e3fab.tar
cuberite-fd7b87741a39de10584b1b1c24982699ab3e3fab.tar.gz
cuberite-fd7b87741a39de10584b1b1c24982699ab3e3fab.tar.bz2
cuberite-fd7b87741a39de10584b1b1c24982699ab3e3fab.tar.lz
cuberite-fd7b87741a39de10584b1b1c24982699ab3e3fab.tar.xz
cuberite-fd7b87741a39de10584b1b1c24982699ab3e3fab.tar.zst
cuberite-fd7b87741a39de10584b1b1c24982699ab3e3fab.zip
Diffstat (limited to 'src/Protocol/Protocol18x.cpp')
-rw-r--r--src/Protocol/Protocol18x.cpp66
1 files changed, 5 insertions, 61 deletions
diff --git a/src/Protocol/Protocol18x.cpp b/src/Protocol/Protocol18x.cpp
index 115028fa9..ed1d3bfc1 100644
--- a/src/Protocol/Protocol18x.cpp
+++ b/src/Protocol/Protocol18x.cpp
@@ -232,84 +232,28 @@ void cProtocol180::SendBlockChanges(int a_ChunkX, int a_ChunkZ, const sSetBlockV
-void cProtocol180::SendChat(const AString & a_Message)
-{
- this->SendChatType(a_Message, ctChatBox);
-}
-
-
-
-
-
-void cProtocol180::SendChat(const cCompositeChat & a_Message)
-{
- this->SendChatType(a_Message, ctChatBox);
-}
-
-
-
-
-
-void cProtocol180::SendChatSystem(const AString & a_Message)
-{
- this->SendChatType(a_Message, ctSystem);
-}
-
-
-
-
-
-void cProtocol180::SendChatSystem(const cCompositeChat & a_Message)
-{
- this->SendChatType(a_Message, ctSystem);
-}
-
-
-
-
-
-void cProtocol180::SendChatAboveActionBar(const AString & a_Message)
-{
- this->SendChatType(a_Message, ctAboveActionBar);
-}
-
-
-
-
-
-void cProtocol180::SendChatAboveActionBar(const cCompositeChat & a_Message)
-{
- this->SendChatType(a_Message, ctAboveActionBar);
-}
-
-
-
-
-
-void cProtocol180::SendChatType(const AString & a_Message, eChatType type)
+void cProtocol180::SendChat(const AString & a_Message, eChatType a_Type)
{
ASSERT(m_State == 3); // In game mode?
cPacketizer Pkt(*this, 0x02); // Chat Message packet
Pkt.WriteString(Printf("{\"text\":\"%s\"}", EscapeString(a_Message).c_str()));
- Pkt.WriteBEInt8(type);
+ Pkt.WriteBEInt8(a_Type);
}
-void cProtocol180::SendChatType(const cCompositeChat & a_Message, eChatType type)
+void cProtocol180::SendChat(const cCompositeChat & a_Message, eChatType a_Type, bool a_ShouldUseChatPrefixes)
{
ASSERT(m_State == 3); // In game mode?
- cWorld * World = m_Client->GetPlayer()->GetWorld();
- bool ShouldUseChatPrefixes = (World == nullptr) ? false : World->ShouldUseChatPrefixes();
// Send the message to the client:
cPacketizer Pkt(*this, 0x02);
- Pkt.WriteString(a_Message.CreateJsonString(ShouldUseChatPrefixes));
- Pkt.WriteBEInt8(type);
+ Pkt.WriteString(a_Message.CreateJsonString(a_ShouldUseChatPrefixes));
+ Pkt.WriteBEInt8(a_Type);
}