summaryrefslogtreecommitdiffstats
path: root/source/cClientHandle.cpp
diff options
context:
space:
mode:
authormtilden@gmail.com <mtilden@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-12-26 02:07:35 +0100
committermtilden@gmail.com <mtilden@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-12-26 02:07:35 +0100
commitbf838238e45f4ba96c0653f77cf1bf79e6c13c78 (patch)
tree12a75a20b00d825c45f846f8e11f7ace9144906b /source/cClientHandle.cpp
parent- Fixed Bug #99 -> Mobs no longer bother you in creative mode (diff)
downloadcuberite-bf838238e45f4ba96c0653f77cf1bf79e6c13c78.tar
cuberite-bf838238e45f4ba96c0653f77cf1bf79e6c13c78.tar.gz
cuberite-bf838238e45f4ba96c0653f77cf1bf79e6c13c78.tar.bz2
cuberite-bf838238e45f4ba96c0653f77cf1bf79e6c13c78.tar.lz
cuberite-bf838238e45f4ba96c0653f77cf1bf79e6c13c78.tar.xz
cuberite-bf838238e45f4ba96c0653f77cf1bf79e6c13c78.tar.zst
cuberite-bf838238e45f4ba96c0653f77cf1bf79e6c13c78.zip
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;