Now only entities with NetworkComponent will be send in Snapshots.
This commit is contained in:
@@ -641,21 +641,7 @@ void Server::parsePlayerTransform(Packet& packet)
|
|||||||
|
|
||||||
bool Server::shouldSendToClient(EntityWrapper childEntity)
|
bool Server::shouldSendToClient(EntityWrapper childEntity)
|
||||||
{
|
{
|
||||||
auto children = m_World->GetDirectChildren(childEntity.ID);
|
return childEntity.HasComponent("NetworkComponent") ||childEntity.FirstParentWithComponent("Player").Valid();
|
||||||
for (auto it = children.first; it != children.second; it++) {
|
|
||||||
EntityWrapper child(m_World, it->second);
|
|
||||||
if (child.HasComponent("CapturePoint") || child.HasComponent("HealthPickup")
|
|
||||||
|| child.HasComponent("AmmoPickup")) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return childEntity.HasComponent("Player")
|
|
||||||
|| childEntity.FirstParentWithComponent("Player").Valid()
|
|
||||||
|| childEntity.HasComponent("CapturePoint")
|
|
||||||
|| childEntity.HasComponent("HealthPickup")
|
|
||||||
|| childEntity.HasComponent("AmmoPickup")
|
|
||||||
|| childEntity.HasComponent("ScoreScreen")
|
|
||||||
|| childEntity.FirstParentWithComponent("ScoreScreen").Valid();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerID Server::getPlayerIDFromEndpoint()
|
PlayerID Server::getPlayerIDFromEndpoint()
|
||||||
|
|||||||
Reference in New Issue
Block a user