diff options
author | madmaxoft <github@xoft.cz> | 2014-02-15 23:16:44 +0100 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-02-15 23:17:49 +0100 |
commit | 0f1f7583aeea65335b2ee051585a857b1142a927 (patch) | |
tree | d87a4a6c92ea5f144327d2e88d5bd5845cd668e8 /src/World.cpp | |
parent | Merge pull request #679 from mc-server/NotchDeath (diff) | |
download | cuberite-0f1f7583aeea65335b2ee051585a857b1142a927.tar cuberite-0f1f7583aeea65335b2ee051585a857b1142a927.tar.gz cuberite-0f1f7583aeea65335b2ee051585a857b1142a927.tar.bz2 cuberite-0f1f7583aeea65335b2ee051585a857b1142a927.tar.lz cuberite-0f1f7583aeea65335b2ee051585a857b1142a927.tar.xz cuberite-0f1f7583aeea65335b2ee051585a857b1142a927.tar.zst cuberite-0f1f7583aeea65335b2ee051585a857b1142a927.zip |
Diffstat (limited to '')
-rw-r--r-- | src/World.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/World.cpp b/src/World.cpp index cb07caa5d..d1a13794c 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -1747,7 +1747,7 @@ void cWorld::BroadcastBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ, cons -void cWorld::LoopPlayersAndBroadcastChat(const AString & a_Message, ChatPrefixCodes a_ChatPrefix, const cClientHandle * a_Exclude) +void cWorld::LoopPlayersAndBroadcastChat(const AString & a_Message, eMessageType a_ChatPrefix, const cClientHandle * a_Exclude) { cCSLock Lock(m_CSPlayers); for (cPlayerList::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) @@ -1765,6 +1765,24 @@ void cWorld::LoopPlayersAndBroadcastChat(const AString & a_Message, ChatPrefixCo +void cWorld::BroadcastChat(const cCompositeChat & a_Message, const cClientHandle * a_Exclude) +{ + cCSLock Lock(m_CSPlayers); + for (cPlayerList::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) + { + cClientHandle * ch = (*itr)->GetClientHandle(); + if ((ch == a_Exclude) || (ch == NULL) || !ch->IsLoggedIn() || ch->IsDestroyed()) + { + continue; + } + ch->SendChat(a_Message); + } +} + + + + + void cWorld::BroadcastChunkData(int a_ChunkX, int a_ChunkZ, cChunkDataSerializer & a_Serializer, const cClientHandle * a_Exclude) { m_ChunkMap->BroadcastChunkData(a_ChunkX, a_ChunkZ, a_Serializer, a_Exclude); |