summaryrefslogtreecommitdiffstats
path: root/source/cClientHandle.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/cClientHandle.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp
index 902e3df2f..c9d1de1ce 100644
--- a/source/cClientHandle.cpp
+++ b/source/cClientHandle.cpp
@@ -65,6 +65,7 @@
#include "packets/cPacket_13.h"
#include "packets/cPacket_UpdateSign.h"
#include "packets/cPacket_Ping.h"
+#include "packets/cPacket_PlayerListItem.h"
#ifndef _WIN32
@@ -155,6 +156,7 @@ cClientHandle::cClientHandle(const cSocket & a_Socket)
m_pState->PacketMap[E_UPDATE_SIGN] = new cPacket_UpdateSign;
m_pState->PacketMap[E_RESPAWN] = new cPacket_Respawn;
m_pState->PacketMap[E_PING] = new cPacket_Ping;
+ m_pState->PacketMap[E_PLAYER_LIST_ITEM] = new cPacket_PlayerListItem;
memset( m_LoadedChunks, 0x00, sizeof(cChunk*)*VIEWDISTANCE*VIEWDISTANCE );
@@ -1161,6 +1163,15 @@ 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;
+ PlayerList.m_PlayerName = GetUsername();
+ PlayerList.m_Online = false;
+ PlayerList.m_Ping = (short)5;
+ (*itr)->GetClientHandle()->Send( PlayerList );
+ }
}
Destroy();
return;