summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-09-18 18:50:17 +0200
committerHowaner <franzi.moos@googlemail.com>2014-09-18 18:50:17 +0200
commit43ed690520d3c3b47ed7ff6f48f868e8011565e0 (patch)
tree7db2b1b7dde37f498e6ed09e90a68ae3faff0718 /src/World.cpp
parent1.8: Simplified item metadata reading. (diff)
downloadcuberite-43ed690520d3c3b47ed7ff6f48f868e8011565e0.tar
cuberite-43ed690520d3c3b47ed7ff6f48f868e8011565e0.tar.gz
cuberite-43ed690520d3c3b47ed7ff6f48f868e8011565e0.tar.bz2
cuberite-43ed690520d3c3b47ed7ff6f48f868e8011565e0.tar.lz
cuberite-43ed690520d3c3b47ed7ff6f48f868e8011565e0.tar.xz
cuberite-43ed690520d3c3b47ed7ff6f48f868e8011565e0.tar.zst
cuberite-43ed690520d3c3b47ed7ff6f48f868e8011565e0.zip
Diffstat (limited to '')
-rw-r--r--src/World.cpp78
1 files changed, 75 insertions, 3 deletions
diff --git a/src/World.cpp b/src/World.cpp
index 2d2137b3f..71ce7e680 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -2153,7 +2153,7 @@ void cWorld::BroadcastParticleEffect(const AString & a_ParticleName, float a_Src
-void cWorld::BroadcastPlayerListItem(const cPlayer & a_Player, char a_Action, const cClientHandle * a_Exclude)
+void cWorld::BroadcastPlayerListAddPlayer(const cPlayer & a_Player, const cClientHandle * a_Exclude)
{
cCSLock Lock(m_CSPlayers);
for (cPlayerList::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
@@ -2163,7 +2163,79 @@ void cWorld::BroadcastPlayerListItem(const cPlayer & a_Player, char a_Action, co
{
continue;
}
- ch->SendPlayerListItem(a_Player, a_Action);
+ ch->SendPlayerListAddPlayer(a_Player);
+ }
+}
+
+
+
+
+
+void cWorld::BroadcastPlayerListRemovePlayer(const cPlayer & a_Player, const cClientHandle * a_Exclude)
+{
+ cCSLock Lock(m_CSPlayers);
+ for (cPlayerList::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
+ {
+ cClientHandle * ch = (*itr)->GetClientHandle();
+ if ((ch == a_Exclude) || (ch == NULL) || !ch->IsLoggedIn() || ch->IsDestroyed())
+ {
+ continue;
+ }
+ ch->SendPlayerListRemovePlayer(a_Player);
+ }
+}
+
+
+
+
+
+void cWorld::BroadcastPlayerListUpdateGameMode(const cPlayer & a_Player, const cClientHandle * a_Exclude)
+{
+ cCSLock Lock(m_CSPlayers);
+ for (cPlayerList::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
+ {
+ cClientHandle * ch = (*itr)->GetClientHandle();
+ if ((ch == a_Exclude) || (ch == NULL) || !ch->IsLoggedIn() || ch->IsDestroyed())
+ {
+ continue;
+ }
+ ch->SendPlayerListUpdateGameMode(a_Player);
+ }
+}
+
+
+
+
+
+void cWorld::BroadcastPlayerListUpdatePing(const cPlayer & a_Player, const cClientHandle * a_Exclude)
+{
+ cCSLock Lock(m_CSPlayers);
+ for (cPlayerList::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
+ {
+ cClientHandle * ch = (*itr)->GetClientHandle();
+ if ((ch == a_Exclude) || (ch == NULL) || !ch->IsLoggedIn() || ch->IsDestroyed())
+ {
+ continue;
+ }
+ ch->SendPlayerListUpdatePing(a_Player);
+ }
+}
+
+
+
+
+
+void cWorld::BroadcastPlayerListUpdateDisplayName(const cPlayer & a_Player, const AString & a_OldListName, const cClientHandle * a_Exclude)
+{
+ cCSLock Lock(m_CSPlayers);
+ for (cPlayerList::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
+ {
+ cClientHandle * ch = (*itr)->GetClientHandle();
+ if ((ch == a_Exclude) || (ch == NULL) || !ch->IsLoggedIn() || ch->IsDestroyed())
+ {
+ continue;
+ }
+ ch->SendPlayerListUpdateDisplayName(a_Player, a_OldListName);
}
}
@@ -2686,7 +2758,7 @@ void cWorld::SendPlayerList(cPlayer * a_DestPlayer)
cClientHandle * ch = (*itr)->GetClientHandle();
if ((ch != NULL) && !ch->IsDestroyed())
{
- a_DestPlayer->GetClientHandle()->SendPlayerListItem(*(*itr), 0);
+ a_DestPlayer->GetClientHandle()->SendPlayerListAddPlayer(*(*itr));
}
}
}