1
0

Added the player list to the 1.8 protocol.

This commit is contained in:
Howaner
2014-09-09 03:02:25 +02:00
parent 6fb0a76b1e
commit f94df06b66
16 changed files with 109 additions and 32 deletions

View File

@@ -867,14 +867,19 @@ void cProtocol172::SendParticleEffect(const AString & a_ParticleName, float a_Sr
void cProtocol172::SendPlayerListItem(const cPlayer & a_Player, bool a_IsOnline)
void cProtocol172::SendPlayerListItem(const cPlayer & a_Player, char a_Action)
{
ASSERT(m_State == 3); // In game mode?
if (a_Action == 1)
{
// Ignore gamemode update
return;
}
cPacketizer Pkt(*this, 0x38); // Playerlist Item packet
Pkt.WriteString(a_Player.GetName());
Pkt.WriteBool(a_IsOnline);
Pkt.WriteShort(a_IsOnline ? a_Player.GetClientHandle()->GetPing() : 0);
Pkt.WriteBool(a_Action != 4);
Pkt.WriteShort((a_Action == 4) ? 0 : a_Player.GetClientHandle()->GetPing());
}