Merge remote-tracking branch 'origin/master' into FriendlyHost/Join

This commit is contained in:
stiffly
2016-03-09 10:12:57 +01:00
15 changed files with 26 additions and 16 deletions
+1
View File
@@ -65,4 +65,5 @@
<xs:include schemaLocation="Components/InputCmdButton.xsd"/>
<xs:include schemaLocation="Components/ScoreScreen.xsd"/>
<xs:include schemaLocation="Components/ScoreIdentity.xsd"/>
<xs:include schemaLocation="Components/NetworkComponent.xsd"/>
</xs:schema>
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<NetworkComponent xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="NetworkComponent.xsd">
</NetworkComponent>
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:t="types">
<xs:import schemaLocation="../Types.xsd" namespace="types"/>
<xs:element name="NetworkComponent">
<xs:annotation>
<xs:documentation>If an entity has this component, it will be broadcasted to clients in a snapshot.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:schema>
+1
View File
@@ -2,6 +2,7 @@
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:NetworkComponent/>
<c:AmmoPickup/>
<c:Model>
<Resource>Models/Props/PickUps/AmmoPickUp.mesh</Resource>
@@ -2,6 +2,7 @@
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:NetworkComponent/>
<c:HealthPickup/>
<c:Model>
<Resource>Models/Props/PickUps/HealthPickUp.mesh</Resource>
+1
View File
@@ -2,6 +2,7 @@
<Entity name="Player" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:NetworkComponent/>
<c:AABB>
<Origin X="0" Y="0.772000015" Z="0"/>
<Size X="1" Y="1.60000002" Z="1"/>
@@ -2,6 +2,7 @@
<Entity name="PlayerAssault" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:NetworkComponent/>
<c:AABB>
<Origin X="0" Y="0.772000015" Z="0"/>
<Size X="1" Y="1.60000002" Z="1"/>
@@ -2,6 +2,7 @@
<Entity name="Player" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:NetworkComponent/>
<c:AABB>
<Origin X="0" Y="0.772000015" Z="0"/>
<Size X="1" Y="1.60000002" Z="1"/>
@@ -2,6 +2,7 @@
<Entity name="Player" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:NetworkComponent/>
<c:AABB>
<Origin X="0" Y="0.772000015" Z="0"/>
<Size X="1" Y="1.60000002" Z="1"/>
@@ -2,6 +2,7 @@
<Entity name="PlayerAssault" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:NetworkComponent/>
<c:AABB>
<Origin X="0" Y="0.772000015" Z="0"/>
<Size X="1" Y="1.60000002" Z="1"/>
@@ -2,6 +2,7 @@
<Entity name="PlayerDefender" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:NetworkComponent/>
<c:AABB>
<Origin X="0" Y="0.772000015" Z="0"/>
<Size X="1" Y="1.60000002" Z="1"/>
+1
View File
@@ -2,6 +2,7 @@
<Entity name="Player" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:NetworkComponent/>
<c:AABB>
<Origin X="0" Y="0.772000015" Z="0"/>
<Size X="1" Y="1.60000002" Z="1"/>
+1
View File
@@ -2,6 +2,7 @@
<Entity name="ScoreBoardOrigin" xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:NetworkComponent/>
<c:Transform>
<Position X="66.4319992" Y="37.9560013" Z="0"/>
<Orientation X="0" Y="4.71199989" Z="0"/>
+1
View File
@@ -68,6 +68,7 @@
<xs:element ref="c:InputCmdButton" minOccurs="0"/>
<xs:element ref="c:ScoreScreen" minOccurs="0"/>
<xs:element ref="c:ScoreIdentity" minOccurs="0"/>
<xs:element ref="c:NetworkComponent" minOccurs="0"/>
</xs:all>
</xs:complexType>
</xs:element>
+1 -16
View File
@@ -643,22 +643,7 @@ void Server::parsePlayerTransform(Packet& packet)
bool Server::shouldSendToClient(EntityWrapper childEntity)
{
auto children = m_World->GetDirectChildren(childEntity.ID);
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()
|| childEntity.FirstParentWithComponent("CapturePoint").Valid();
return childEntity.HasComponent("NetworkComponent") || childEntity.FirstParentWithComponent("NetworkComponent").Valid();
}
PlayerID Server::getPlayerIDFromEndpoint()