summaryrefslogtreecommitdiffstats
path: root/source/cWorld.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-27 19:31:16 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-27 19:31:16 +0200
commit66f4c9e0c08762fb4668792999c6200e9fd78c89 (patch)
treeaf89423afb69f78251a16eb041e88cca9ebef478 /source/cWorld.cpp
parentgit-svn-id: http://mc-server.googlecode.com/svn/trunk@795 0a769ca7-a7f5-676a-18bf-c427514a06d6 (diff)
downloadcuberite-66f4c9e0c08762fb4668792999c6200e9fd78c89.tar
cuberite-66f4c9e0c08762fb4668792999c6200e9fd78c89.tar.gz
cuberite-66f4c9e0c08762fb4668792999c6200e9fd78c89.tar.bz2
cuberite-66f4c9e0c08762fb4668792999c6200e9fd78c89.tar.lz
cuberite-66f4c9e0c08762fb4668792999c6200e9fd78c89.tar.xz
cuberite-66f4c9e0c08762fb4668792999c6200e9fd78c89.tar.zst
cuberite-66f4c9e0c08762fb4668792999c6200e9fd78c89.zip
Diffstat (limited to 'source/cWorld.cpp')
-rw-r--r--source/cWorld.cpp55
1 files changed, 19 insertions, 36 deletions
diff --git a/source/cWorld.cpp b/source/cWorld.cpp
index 8eb4530a3..ee41a6aa1 100644
--- a/source/cWorld.cpp
+++ b/source/cWorld.cpp
@@ -1213,41 +1213,6 @@ const double & cWorld::GetSpawnY(void)
-void cWorld::Broadcast( const cPacket & a_Packet, 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->Send( a_Packet );
- }
-}
-
-
-
-
-
-void cWorld::BroadcastToChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ, const cPacket & a_Packet, cClientHandle * a_Exclude)
-{
- m_ChunkMap->BroadcastToChunk(a_ChunkX, a_ChunkY, a_ChunkZ, a_Packet, a_Exclude);
-}
-
-
-
-
-
-void cWorld::BroadcastToChunkOfBlock(int a_X, int a_Y, int a_Z, cPacket * a_Packet, cClientHandle * a_Exclude)
-{
- m_ChunkMap->BroadcastToChunkOfBlock(a_X, a_Y, a_Z, a_Packet, a_Exclude);
-}
-
-
-
-
void cWorld::BroadcastChat(const AString & a_Message, const cClientHandle * a_Exclude)
{
@@ -1447,6 +1412,24 @@ void cWorld::BroadcastChunkData(int a_ChunkX, int a_ChunkZ, cChunkDataSerializer
+void cWorld::BroadcastPlayerListItem (const cPlayer & a_Player, bool a_IsOnline, 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->SendPlayerListItem(a_Player, a_IsOnline);
+ }
+}
+
+
+
+
+
void cWorld::BroadcastBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ, const cClientHandle * a_Exclude)
{
m_ChunkMap->BroadcastBlockEntity(a_BlockX, a_BlockY, a_BlockZ, a_Exclude);
@@ -1767,7 +1750,7 @@ void cWorld::SendPlayerList(cPlayer * a_DestPlayer)
cClientHandle * ch = (*itr)->GetClientHandle();
if ((ch != NULL) && !ch->IsDestroyed())
{
- a_DestPlayer->GetClientHandle()->SendPlayerListItem(*(*itr));
+ a_DestPlayer->GetClientHandle()->SendPlayerListItem(*(*itr), true);
}
}
}