diff options
author | mtilden@gmail.com <mtilden@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-12-26 03:46:53 +0100 |
---|---|---|
committer | mtilden@gmail.com <mtilden@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-12-26 03:46:53 +0100 |
commit | 0321819ce83e4ef3fae25ade4256a3a3229d1821 (patch) | |
tree | 8b6671fcc1c0d885a0627c1449c77b73cb45f4d7 /source | |
parent | Moved the actual world generation from cChunk.cpp to a more isolated file cWorldGenerator.cpp (diff) | |
download | cuberite-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 |
Diffstat (limited to 'source')
-rw-r--r-- | source/cClientHandle.cpp | 16 |
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;
|