summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormtilden@gmail.com <mtilden@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-12-26 03:46:53 +0100
committermtilden@gmail.com <mtilden@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-12-26 03:46:53 +0100
commit0321819ce83e4ef3fae25ade4256a3a3229d1821 (patch)
tree8b6671fcc1c0d885a0627c1449c77b73cb45f4d7
parentMoved the actual world generation from cChunk.cpp to a more isolated file cWorldGenerator.cpp (diff)
downloadcuberite-0321819ce83e4ef3fae25ade4256a3a3229d1821.tar
cuberite-0321819ce83e4ef3fae25ade4256a3a3229d1821.tar.gz
cuberite-0321819ce83e4ef3fae25ade4256a3a3229d1821.tar.bz2
cuberite-0321819ce83e4ef3fae25ade4256a3a3229d1821.tar.lz
cuberite-0321819ce83e4ef3fae25ade4256a3a3229d1821.tar.xz
cuberite-0321819ce83e4ef3fae25ade4256a3a3229d1821.tar.zst
cuberite-0321819ce83e4ef3fae25ade4256a3a3229d1821.zip
-rw-r--r--source/cClientHandle.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp
index 66d343784..05bdec249 100644
--- a/source/cClientHandle.cpp
+++ b/source/cClientHandle.cpp
@@ -178,6 +178,16 @@ cClientHandle::~cClientHandle()
if( m_LoadedChunks[i] ) m_LoadedChunks[i]->RemoveClient( this );
}
+ cWorld::PlayerList PlayerList = cRoot::Get()->GetWorld()->GetAllPlayers();
+ for( cWorld::PlayerList::iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr )
+ {
+ if ((*itr) && (*itr)->GetClientHandle() && strlen(GetUsername()) > 0)
+ {
+ cPacket_PlayerListItem *PlayerList = new cPacket_PlayerListItem(m_Player->GetColor() + GetUsername(), false, (short)9999);
+ (*itr)->GetClientHandle()->Send( *PlayerList );
+ }
+ }
+
// First stop sending thread
m_bKeepThreadGoing = false;
@@ -1162,12 +1172,6 @@ void cClientHandle::HandlePacket( cPacket* a_Packet )
{
cPacket_Chat DisconnectMessage( m_pState->Username + " disconnected: " + PacketData->m_Reason );
cRoot::Get()->GetServer()->Broadcast( DisconnectMessage );
- cWorld::PlayerList PlayerList = cRoot::Get()->GetWorld()->GetAllPlayers();
- for( cWorld::PlayerList::iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr )
- {
- cPacket_PlayerListItem *PlayerList = new cPacket_PlayerListItem(m_Player->GetColor() + GetUsername(), false, (short)9999);
- (*itr)->GetClientHandle()->Send( *PlayerList );
- }
}
Destroy();
return;