summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-09-02 19:12:35 +0200
committerHowaner <franzi.moos@googlemail.com>2014-09-02 19:12:35 +0200
commit1bb4d7941267ee55cdf7f35fa6a0055521115960 (patch)
tree38b2faa2d824bca6da9ec88c2c0c0d9bbe81f6df /src/World.cpp
parentAdded name tag (diff)
downloadcuberite-1bb4d7941267ee55cdf7f35fa6a0055521115960.tar
cuberite-1bb4d7941267ee55cdf7f35fa6a0055521115960.tar.gz
cuberite-1bb4d7941267ee55cdf7f35fa6a0055521115960.tar.bz2
cuberite-1bb4d7941267ee55cdf7f35fa6a0055521115960.tar.lz
cuberite-1bb4d7941267ee55cdf7f35fa6a0055521115960.tar.xz
cuberite-1bb4d7941267ee55cdf7f35fa6a0055521115960.tar.zst
cuberite-1bb4d7941267ee55cdf7f35fa6a0055521115960.zip
Diffstat (limited to '')
-rw-r--r--src/World.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/World.cpp b/src/World.cpp
index 99e09c658..469606012 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -2147,7 +2147,7 @@ void cWorld::BroadcastParticleEffect(const AString & a_ParticleName, float a_Src
-void cWorld::BroadcastPlayerListItem (const cPlayer & a_Player, bool a_IsOnline, const cClientHandle * a_Exclude)
+void cWorld::BroadcastPlayerListItem(const AString & a_PlayerName, bool a_IsOnline, short a_Ping, const cClientHandle * a_Exclude)
{
cCSLock Lock(m_CSPlayers);
for (cPlayerList::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
@@ -2157,7 +2157,7 @@ void cWorld::BroadcastPlayerListItem (const cPlayer & a_Player, bool a_IsOnline,
{
continue;
}
- ch->SendPlayerListItem(a_Player, a_IsOnline);
+ ch->SendPlayerListItem(a_PlayerName, a_IsOnline, a_Ping);
}
}
@@ -2669,7 +2669,7 @@ void cWorld::SendPlayerList(cPlayer * a_DestPlayer)
cClientHandle * ch = (*itr)->GetClientHandle();
if ((ch != NULL) && !ch->IsDestroyed())
{
- a_DestPlayer->GetClientHandle()->SendPlayerListItem(*(*itr), true);
+ a_DestPlayer->GetClientHandle()->SendPlayerListItem((*itr)->GetTabListName(), true, (*itr)->GetClientHandle()->GetPing());
}
}
}
@@ -3209,13 +3209,17 @@ void cWorld::TabCompleteUserName(const AString & a_Text, AStringVector & a_Resul
for (cPlayerList::iterator itr = m_Players.begin(), end = m_Players.end(); itr != end; ++itr)
{
AString PlayerName ((*itr)->GetName());
+ if ((*itr)->HasCustomName())
+ {
+ PlayerName = (*itr)->GetCustomName();
+ }
+
AString::size_type Found = PlayerName.find(LastWord); // Try to find last word in playername
-
if (Found == AString::npos)
{
continue; // No match
}
-
+
UsernamesByWeight.push_back(std::make_pair(Found, PlayerName)); // Match! Store it with the position of the match as a weight
}
Lock.Unlock();