diff options
author | worktycho <work.tycho@gmail.com> | 2015-09-21 14:30:17 +0200 |
---|---|---|
committer | worktycho <work.tycho@gmail.com> | 2015-09-21 14:30:17 +0200 |
commit | 87489dc30846e0b46822d5ed3b841417577d1fff (patch) | |
tree | 6d30b3e0f16b151b50bc39a675b5b2472543a1f6 /src/ClientHandle.cpp | |
parent | Merge pull request #2487 from cuberite/sigpipe (diff) | |
parent | Refactored cProtocol Chat handling (diff) | |
download | cuberite-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/ClientHandle.cpp')
-rw-r--r-- | src/ClientHandle.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 679dd6a46..6c9e6a781 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -2086,8 +2086,9 @@ void cClientHandle::SendChat(const AString & a_Message, eMessageType a_ChatPrefi } } - AString Message = FormatMessageType(World->ShouldUseChatPrefixes(), a_ChatPrefix, a_AdditionalData); - m_Protocol->SendChat(Message.append(a_Message)); + bool ShouldUsePrefixes = World->ShouldUseChatPrefixes(); + AString Message = FormatMessageType(ShouldUsePrefixes, a_ChatPrefix, a_AdditionalData); + m_Protocol->SendChat(Message.append(a_Message), ctChatBox, ShouldUsePrefixes); } @@ -2096,7 +2097,7 @@ void cClientHandle::SendChat(const AString & a_Message, eMessageType a_ChatPrefi void cClientHandle::SendChat(const cCompositeChat & a_Message) { - m_Protocol->SendChat(a_Message); + m_Protocol->SendChat(a_Message, ctChatBox, GetPlayer()->GetWorld()->ShouldUseChatPrefixes()); } @@ -2116,7 +2117,7 @@ void cClientHandle::SendChatAboveActionBar(const AString & a_Message, eMessageTy } AString Message = FormatMessageType(World->ShouldUseChatPrefixes(), a_ChatPrefix, a_AdditionalData); - m_Protocol->SendChatAboveActionBar(Message.append(a_Message)); + m_Protocol->SendChat(Message.append(a_Message), ctAboveActionBar); } @@ -2125,7 +2126,7 @@ void cClientHandle::SendChatAboveActionBar(const AString & a_Message, eMessageTy void cClientHandle::SendChatAboveActionBar(const cCompositeChat & a_Message) { - m_Protocol->SendChatAboveActionBar(a_Message); + m_Protocol->SendChat(a_Message, ctAboveActionBar, GetPlayer()->GetWorld()->ShouldUseChatPrefixes()); } @@ -2144,8 +2145,9 @@ void cClientHandle::SendChatSystem(const AString & a_Message, eMessageType a_Cha } } - AString Message = FormatMessageType(World->ShouldUseChatPrefixes(), a_ChatPrefix, a_AdditionalData); - m_Protocol->SendChatSystem(Message.append(a_Message)); + auto ShouldUsePrefixes = World->ShouldUseChatPrefixes(); + AString Message = FormatMessageType(ShouldUsePrefixes, a_ChatPrefix, a_AdditionalData); + m_Protocol->SendChat(Message.append(a_Message), ctSystem, ShouldUsePrefixes); } @@ -2154,7 +2156,7 @@ void cClientHandle::SendChatSystem(const AString & a_Message, eMessageType a_Cha void cClientHandle::SendChatSystem(const cCompositeChat & a_Message) { - m_Protocol->SendChatSystem(a_Message); + m_Protocol->SendChat(a_Message, ctSystem, GetPlayer()->GetWorld()->ShouldUseChatPrefixes()); } |