summaryrefslogtreecommitdiffstats
path: root/source/cWorld.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-18 12:38:15 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-18 12:38:15 +0200
commit1b5eaa92b562c09ed7cea4de7186ff6541e65e5f (patch)
tree7e196c6021c1777d25ad4d79bb6530fd933a65d4 /source/cWorld.cpp
parentPacket refactoring, phase two, partial. Rewritten a few packet handling functions not to use cPacket-descendant objects. (diff)
downloadcuberite-1b5eaa92b562c09ed7cea4de7186ff6541e65e5f.tar
cuberite-1b5eaa92b562c09ed7cea4de7186ff6541e65e5f.tar.gz
cuberite-1b5eaa92b562c09ed7cea4de7186ff6541e65e5f.tar.bz2
cuberite-1b5eaa92b562c09ed7cea4de7186ff6541e65e5f.tar.lz
cuberite-1b5eaa92b562c09ed7cea4de7186ff6541e65e5f.tar.xz
cuberite-1b5eaa92b562c09ed7cea4de7186ff6541e65e5f.tar.zst
cuberite-1b5eaa92b562c09ed7cea4de7186ff6541e65e5f.zip
Diffstat (limited to 'source/cWorld.cpp')
-rw-r--r--source/cWorld.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/source/cWorld.cpp b/source/cWorld.cpp
index 5bb1e8094..3c1da9945 100644
--- a/source/cWorld.cpp
+++ b/source/cWorld.cpp
@@ -1238,7 +1238,7 @@ void cWorld::Broadcast( const cPacket & a_Packet, cClientHandle * a_Exclude)
{
continue;
}
- (*itr)->GetClientHandle()->Send( a_Packet );
+ ch->Send( a_Packet );
}
}
@@ -1264,6 +1264,24 @@ void cWorld::BroadcastToChunkOfBlock(int a_X, int a_Y, int a_Z, cPacket * a_Pack
+void cWorld::BroadcastChat(const AString & 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::MarkChunkDirty (int a_ChunkX, int a_ChunkY, int a_ChunkZ)
{
m_ChunkMap->MarkChunkDirty (a_ChunkX, a_ChunkY, a_ChunkZ);