summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol17x.cpp
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2015-09-21 14:30:17 +0200
committerworktycho <work.tycho@gmail.com>2015-09-21 14:30:17 +0200
commit87489dc30846e0b46822d5ed3b841417577d1fff (patch)
tree6d30b3e0f16b151b50bc39a675b5b2472543a1f6 /src/Protocol/Protocol17x.cpp
parentMerge pull request #2487 from cuberite/sigpipe (diff)
parentRefactored cProtocol Chat handling (diff)
downloadcuberite-87489dc30846e0b46822d5ed3b841417577d1fff.tar
cuberite-87489dc30846e0b46822d5ed3b841417577d1fff.tar.gz
cuberite-87489dc30846e0b46822d5ed3b841417577d1fff.tar.bz2
cuberite-87489dc30846e0b46822d5ed3b841417577d1fff.tar.lz
cuberite-87489dc30846e0b46822d5ed3b841417577d1fff.tar.xz
cuberite-87489dc30846e0b46822d5ed3b841417577d1fff.tar.zst
cuberite-87489dc30846e0b46822d5ed3b841417577d1fff.zip
Diffstat (limited to 'src/Protocol/Protocol17x.cpp')
-rw-r--r--src/Protocol/Protocol17x.cpp67
1 files changed, 5 insertions, 62 deletions
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp
index 3ac656d47..ad76480b3 100644
--- a/src/Protocol/Protocol17x.cpp
+++ b/src/Protocol/Protocol17x.cpp
@@ -245,65 +245,11 @@ void cProtocol172::SendBlockChanges(int a_ChunkX, int a_ChunkZ, const sSetBlockV
-void cProtocol172::SendChat(const AString & a_Message)
-{
- this->SendChatType(a_Message, ctChatBox);
-}
-
-
-
-
-
-void cProtocol172::SendChat(const cCompositeChat & a_Message)
-{
- this->SendChatType(a_Message, ctChatBox);
-}
-
-
-
-
-
-void cProtocol172::SendChatSystem(const AString & a_Message)
-{
- this->SendChatType(a_Message, ctSystem);
-}
-
-
-
-
-
-void cProtocol172::SendChatSystem(const cCompositeChat & a_Message)
-{
- this->SendChatType(a_Message, ctSystem);
-}
-
-
-
-
-
-void cProtocol172::SendChatAboveActionBar(const AString & a_Message)
-{
- this->SendChatType(a_Message, ctAboveActionBar);
-}
-
-
-
-
-
-void cProtocol172::SendChatAboveActionBar(const cCompositeChat & a_Message)
-{
- this->SendChatType(a_Message, ctAboveActionBar);
-}
-
-
-
-
-
-void cProtocol172::SendChatType(const AString & a_Message, eChatType type)
+void cProtocol172::SendChat(const AString & a_Message, eChatType a_Type)
{
ASSERT(m_State == 3); // In game mode?
- if (type != ctChatBox) // 1.7.2 doesn't support anything else
+ if (a_Type != ctChatBox) // 1.7.2 doesn't support anything else
{
return;
}
@@ -316,21 +262,18 @@ void cProtocol172::SendChatType(const AString & a_Message, eChatType type)
-void cProtocol172::SendChatType(const cCompositeChat & a_Message, eChatType type)
+void cProtocol172::SendChat(const cCompositeChat & a_Message, eChatType a_Type, bool a_ShouldUseChatPrefixes)
{
ASSERT(m_State == 3); // In game mode?
- if (type != ctChatBox) // 1.7.2 doesn't support anything else
+ if (a_Type != ctChatBox) // 1.7.2 doesn't support anything else
{
return;
}
- 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.WriteString(a_Message.CreateJsonString(a_ShouldUseChatPrefixes));
}