MCPcopy Create free account
hub / github.com/cuberite/cuberite / SendPlayerListItem

Method SendPlayerListItem

src/Protocol/Protocol125.cpp:686–702  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

684
685
686void cProtocol125::SendPlayerListItem(const cPlayer & a_Player, bool a_IsOnline)
687{
688 cCSLock Lock(m_CSPacket);
689 AString PlayerName(a_Player.GetColor());
690 PlayerName.append(a_Player.GetName());
691 if (PlayerName.length() > 14)
692 {
693 PlayerName.erase(14);
694 }
695 PlayerName += cChatColor::White;
696
697 WriteByte ((unsigned char)PACKET_PLAYER_LIST_ITEM);
698 WriteString(PlayerName);
699 WriteBool (a_IsOnline);
700 WriteShort (a_IsOnline ? a_Player.GetClientHandle()->GetPing() : 0);
701 Flush();
702}
703
704
705

Callers

nothing calls this directly

Calls 4

GetColorMethod · 0.80
GetPingMethod · 0.80
GetClientHandleMethod · 0.80
GetNameMethod · 0.45

Tested by

no test coverage detected