diff options
author | Mattes D <github@xoft.cz> | 2015-06-03 09:49:28 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-06-03 09:49:28 +0200 |
commit | 1f2c9b226ca9287237d4489e08419076f4a87620 (patch) | |
tree | f5e5b669b0f8c3fe98b39133c5772df2db6ad5c0 /src/ClientHandle.cpp | |
parent | Merge pull request #2190 from mc-server/CrashDumpArgs (diff) | |
parent | Added system and above action bar chat messages (diff) | |
download | cuberite-1f2c9b226ca9287237d4489e08419076f4a87620.tar cuberite-1f2c9b226ca9287237d4489e08419076f4a87620.tar.gz cuberite-1f2c9b226ca9287237d4489e08419076f4a87620.tar.bz2 cuberite-1f2c9b226ca9287237d4489e08419076f4a87620.tar.lz cuberite-1f2c9b226ca9287237d4489e08419076f4a87620.tar.xz cuberite-1f2c9b226ca9287237d4489e08419076f4a87620.tar.zst cuberite-1f2c9b226ca9287237d4489e08419076f4a87620.zip |
Diffstat (limited to 'src/ClientHandle.cpp')
-rw-r--r-- | src/ClientHandle.cpp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index e3f63b091..d89f7ab77 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -2113,6 +2113,64 @@ void cClientHandle::SendChat(const cCompositeChat & a_Message) +void cClientHandle::SendChatAboveActionBar(const AString & a_Message, eMessageType a_ChatPrefix, const AString & a_AdditionalData) +{ + cWorld * World = GetPlayer()->GetWorld(); + if (World == nullptr) + { + World = cRoot::Get()->GetWorld(GetPlayer()->GetLoadedWorldName()); + if (World == nullptr) + { + World = cRoot::Get()->GetDefaultWorld(); + } + } + + AString Message = FormatMessageType(World->ShouldUseChatPrefixes(), a_ChatPrefix, a_AdditionalData); + m_Protocol->SendChatAboveActionBar(Message.append(a_Message)); +} + + + + + +void cClientHandle::SendChatAboveActionBar(const cCompositeChat & a_Message) +{ + m_Protocol->SendChatAboveActionBar(a_Message); +} + + + + + +void cClientHandle::SendChatSystem(const AString & a_Message, eMessageType a_ChatPrefix, const AString & a_AdditionalData) +{ + cWorld * World = GetPlayer()->GetWorld(); + if (World == nullptr) + { + World = cRoot::Get()->GetWorld(GetPlayer()->GetLoadedWorldName()); + if (World == nullptr) + { + World = cRoot::Get()->GetDefaultWorld(); + } + } + + AString Message = FormatMessageType(World->ShouldUseChatPrefixes(), a_ChatPrefix, a_AdditionalData); + m_Protocol->SendChatSystem(Message.append(a_Message)); +} + + + + + +void cClientHandle::SendChatSystem(const cCompositeChat & a_Message) +{ + m_Protocol->SendChatSystem(a_Message); +} + + + + + void cClientHandle::SendChunkData(int a_ChunkX, int a_ChunkZ, cChunkDataSerializer & a_Serializer) { ASSERT(m_Player != nullptr); |