Index: code/branches/netp2/src/orxonox/objects/worldentities/ControllableEntity.cc
===================================================================
--- code/branches/netp2/src/orxonox/objects/worldentities/ControllableEntity.cc	(revision 2961)
+++ code/branches/netp2/src/orxonox/objects/worldentities/ControllableEntity.cc	(revision 2964)
@@ -71,12 +71,12 @@
         this->changedGametype();
 
-        this->server_position_         = Vector3::ZERO;
-        this->client_position_         = Vector3::ZERO;
-        this->server_linear_velocity_  = Vector3::ZERO;
-        this->client_linear_velocity_  = Vector3::ZERO;
-        this->server_orientation_      = Quaternion::IDENTITY;
-        this->client_orientation_      = Quaternion::IDENTITY;
-        this->server_angular_velocity_ = Vector3::ZERO;
-        this->client_angular_velocity_ = Vector3::ZERO;
+        this->common_position_         = Vector3::ZERO;
+//         this->client_position_         = Vector3::ZERO;
+        this->common_linear_velocity_  = Vector3::ZERO;
+//         this->client_linear_velocity_  = Vector3::ZERO;
+        this->common_orientation_      = Quaternion::IDENTITY;
+//         this->client_orientation_      = Quaternion::IDENTITY;
+        this->common_angular_velocity_ = Vector3::ZERO;
+//         this->client_angular_velocity_ = Vector3::ZERO;
 
 
@@ -340,18 +340,18 @@
             if (!this->isDynamic())
             {
-                if (Core::isMaster())
-                {
-                    this->server_position_ = this->getPosition();
-                    this->server_orientation_ = this->getOrientation();
-                    this->server_linear_velocity_ = this->getVelocity();
-                    this->server_angular_velocity_ = this->getAngularVelocity();
-                }
-                else if (this->bHasLocalController_)
-                {
-                    this->client_position_ = this->getPosition();
-                    this->client_orientation_ = this->getOrientation();
-                    this->client_linear_velocity_ = this->getVelocity();
-                    this->client_angular_velocity_ = this->getAngularVelocity();
-                }
+//                 if (Core::isMaster())
+//                 {
+                    this->common_position_ = this->getPosition();
+                    this->common_orientation_ = this->getOrientation();
+                    this->common_linear_velocity_ = this->getVelocity();
+                    this->common_angular_velocity_ = this->getAngularVelocity();
+//                 }
+//                 else if (this->bHasLocalController_)
+//                 {
+//                     this->client_position_ = this->getPosition();
+//                     this->client_orientation_ = this->getOrientation();
+//                     this->client_linear_velocity_ = this->getVelocity();
+//                     this->client_angular_velocity_ = this->getAngularVelocity();
+//                 }
             }
         }
@@ -363,16 +363,21 @@
         registerVariable(this->hudtemplate_,             variableDirection::toclient);
 
-        registerVariable(this->server_position_,         variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition));
-        registerVariable(this->server_linear_velocity_,  variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerLinearVelocity));
-        registerVariable(this->server_orientation_,      variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation));
-        registerVariable(this->server_angular_velocity_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerAngularVelocity));
-
-        registerVariable(this->server_overwrite_,        variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite));
-        registerVariable(this->client_overwrite_,        variableDirection::toserver);
-
-        registerVariable(this->client_position_,         variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientPosition));
-        registerVariable(this->client_linear_velocity_,  variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientLinearVelocity));
-        registerVariable(this->client_orientation_,      variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientOrientation));
-        registerVariable(this->client_angular_velocity_, variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientAngularVelocity));
+//         registerVariable(this->server_position_,         variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition));
+//         registerVariable(this->server_linear_velocity_,  variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerLinearVelocity));
+//         registerVariable(this->server_orientation_,      variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation));
+//         registerVariable(this->server_angular_velocity_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerAngularVelocity));
+// 
+//         registerVariable(this->server_overwrite_,        variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite));
+//         registerVariable(this->client_overwrite_,        variableDirection::toserver);
+// 
+//         registerVariable(this->client_position_,         variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientPosition));
+//         registerVariable(this->client_linear_velocity_,  variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientLinearVelocity));
+//         registerVariable(this->client_orientation_,      variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientOrientation));
+//         registerVariable(this->client_angular_velocity_, variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientAngularVelocity));
+        
+        registerVariable(this->common_position_,         variableDirection::serverMaster, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition), true);
+        registerVariable(this->common_linear_velocity_,  variableDirection::serverMaster, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerLinearVelocity), true);
+        registerVariable(this->common_orientation_,      variableDirection::serverMaster, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation), true);
+        registerVariable(this->common_angular_velocity_, variableDirection::serverMaster, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerAngularVelocity), true);
 
         registerVariable(this->playerID_,                variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::networkcallback_changedplayerID));
@@ -383,5 +388,5 @@
     {
         if (!this->bHasLocalController_)
-            MobileEntity::setPosition(this->server_position_);
+            MobileEntity::setPosition(this->common_position_);
     }
 
@@ -389,5 +394,5 @@
     {
         if (!this->bHasLocalController_)
-            MobileEntity::setVelocity(this->server_linear_velocity_);
+            MobileEntity::setVelocity(this->common_linear_velocity_);
     }
 
@@ -395,5 +400,5 @@
     {
         if (!this->bHasLocalController_)
-            MobileEntity::setOrientation(this->server_orientation_);
+            MobileEntity::setOrientation(this->common_orientation_);
     }
 
@@ -401,5 +406,5 @@
     {
         if (!this->bHasLocalController_)
-            MobileEntity::setAngularVelocity(this->server_angular_velocity_);
+            MobileEntity::setAngularVelocity(this->common_angular_velocity_);
     }
 
@@ -408,10 +413,10 @@
         if (this->bHasLocalController_)
         {
-            this->setPosition(this->server_position_);
-            this->setOrientation(this->server_orientation_);
-            this->setVelocity(this->server_linear_velocity_);
-            this->setAngularVelocity(this->server_angular_velocity_);
-
-            this->client_overwrite_ = this->server_overwrite_;
+//             this->setPosition(this->server_position_);
+//             this->setOrientation(this->server_orientation_);
+//             this->setVelocity(this->server_linear_velocity_);
+//             this->setAngularVelocity(this->server_angular_velocity_);
+
+//             this->client_overwrite_ = this->server_overwrite_;
         }
     }
@@ -421,6 +426,6 @@
         if (this->server_overwrite_ == this->client_overwrite_)
         {
-            MobileEntity::setPosition(this->client_position_);
-            this->server_position_ = this->getPosition();
+//             MobileEntity::setPosition(this->client_position_);
+//             this->server_position_ = this->getPosition();
         }
     }
@@ -430,6 +435,6 @@
         if (this->server_overwrite_ == this->client_overwrite_)
         {
-            MobileEntity::setVelocity(this->client_linear_velocity_);
-            this->server_linear_velocity_ = this->getVelocity();
+//             MobileEntity::setVelocity(this->client_linear_velocity_);
+//             this->server_linear_velocity_ = this->getVelocity();
         }
     }
@@ -439,6 +444,6 @@
         if (this->server_overwrite_ == this->client_overwrite_)
         {
-            MobileEntity::setOrientation(this->client_orientation_);
-            this->server_orientation_ = this->getOrientation();
+//             MobileEntity::setOrientation(this->client_orientation_);
+//             this->server_orientation_ = this->getOrientation();
         }
     }
@@ -448,6 +453,6 @@
         if (this->server_overwrite_ == this->client_overwrite_)
         {
-            MobileEntity::setAngularVelocity(this->client_angular_velocity_);
-            this->server_angular_velocity_ = this->getAngularVelocity();
+//             MobileEntity::setAngularVelocity(this->client_angular_velocity_);
+//             this->server_angular_velocity_ = this->getAngularVelocity();
         }
     }
@@ -455,60 +460,60 @@
     void ControllableEntity::setPosition(const Vector3& position)
     {
-        if (Core::isMaster())
-        {
+//         if (Core::isMaster())
+//         {
             MobileEntity::setPosition(position);
-            this->server_position_ = this->getPosition();
-            ++this->server_overwrite_;
-        }
-        else if (this->bHasLocalController_)
-        {
-            MobileEntity::setPosition(position);
-            this->client_position_ = this->getPosition();
-        }
+            this->common_position_ = this->getPosition();
+//             ++this->server_overwrite_;
+//         }
+//         else if (this->bHasLocalController_)
+//         {
+//             MobileEntity::setPosition(position);
+//             this->client_position_ = this->getPosition();
+//         }
     }
 
     void ControllableEntity::setOrientation(const Quaternion& orientation)
     {
-        if (Core::isMaster())
-        {
+//         if (Core::isMaster())
+//         {
             MobileEntity::setOrientation(orientation);
-            this->server_orientation_ = this->getOrientation();
-            ++this->server_overwrite_;
-        }
-        else if (this->bHasLocalController_)
-        {
-            MobileEntity::setOrientation(orientation);
-            this->client_orientation_ = this->getOrientation();
-        }
+            this->common_orientation_ = this->getOrientation();
+//             ++this->server_overwrite_;
+//         }
+//         else if (this->bHasLocalController_)
+//         {
+//             MobileEntity::setOrientation(orientation);
+//             this->client_orientation_ = this->getOrientation();
+//         }
     }
 
     void ControllableEntity::setVelocity(const Vector3& velocity)
     {
-        if (Core::isMaster())
-        {
+//         if (Core::isMaster())
+//         {
             MobileEntity::setVelocity(velocity);
-            this->server_linear_velocity_ = this->getVelocity();
-            ++this->server_overwrite_;
-        }
-        else if (this->bHasLocalController_)
-        {
-            MobileEntity::setVelocity(velocity);
-            this->client_linear_velocity_ = this->getVelocity();
-        }
+            this->common_linear_velocity_ = this->getVelocity();
+//             ++this->server_overwrite_;
+//         }
+//         else if (this->bHasLocalController_)
+//         {
+//             MobileEntity::setVelocity(velocity);
+//             this->client_linear_velocity_ = this->getVelocity();
+//         }
     }
 
     void ControllableEntity::setAngularVelocity(const Vector3& velocity)
     {
-        if (Core::isMaster())
-        {
+//         if (Core::isMaster())
+//         {
             MobileEntity::setAngularVelocity(velocity);
-            this->server_angular_velocity_ = this->getAngularVelocity();
-            ++this->server_overwrite_;
-        }
-        else if (this->bHasLocalController_)
-        {
-            MobileEntity::setAngularVelocity(velocity);
-            this->client_angular_velocity_ = this->getAngularVelocity();
-        }
+            this->common_angular_velocity_ = this->getAngularVelocity();
+//             ++this->server_overwrite_;
+//         }
+//         else if (this->bHasLocalController_)
+//         {
+//             MobileEntity::setAngularVelocity(velocity);
+//             this->client_angular_velocity_ = this->getAngularVelocity();
+//         }
     }
 
@@ -516,18 +521,18 @@
     {
         MobileEntity::setWorldTransform(worldTrans);
-        if (Core::isMaster())
-        {
-            this->server_position_ = this->getPosition();
-            this->server_orientation_ = this->getOrientation();
-            this->server_linear_velocity_ = this->getVelocity();
-            this->server_angular_velocity_ = this->getAngularVelocity();
-        }
-        else if (this->bHasLocalController_)
-        {
-            this->client_position_ = this->getPosition();
-            this->client_orientation_ = this->getOrientation();
-            this->client_linear_velocity_ = this->getVelocity();
-            this->client_angular_velocity_ = this->getAngularVelocity();
-        }
+//         if (Core::isMaster())
+//         {
+            this->common_position_ = this->getPosition();
+            this->common_orientation_ = this->getOrientation();
+            this->common_linear_velocity_ = this->getVelocity();
+            this->common_angular_velocity_ = this->getAngularVelocity();
+//         }
+//         else if (this->bHasLocalController_)
+//         {
+//             this->client_position_ = this->getPosition();
+//             this->client_orientation_ = this->getOrientation();
+//             this->client_linear_velocity_ = this->getVelocity();
+//             this->client_angular_velocity_ = this->getAngularVelocity();
+//         }
     }
 }
Index: code/branches/netp2/src/orxonox/objects/worldentities/ControllableEntity.h
===================================================================
--- code/branches/netp2/src/orxonox/objects/worldentities/ControllableEntity.h	(revision 2961)
+++ code/branches/netp2/src/orxonox/objects/worldentities/ControllableEntity.h	(revision 2964)
@@ -167,12 +167,16 @@
             bool bDestroyWhenPlayerLeft_;
 
-            Vector3 server_position_;
-            Vector3 client_position_;
-            Vector3 server_linear_velocity_;
-            Vector3 client_linear_velocity_;
-            Quaternion server_orientation_;
-            Quaternion client_orientation_;
-            Vector3 server_angular_velocity_;
-            Vector3 client_angular_velocity_;
+//             Vector3 server_position_;
+            Vector3 common_position_;
+//             Vector3 client_position_;
+//             Vector3 server_linear_velocity_;
+//             Vector3 client_linear_velocity_;
+            Vector3 common_linear_velocity_;
+//             Quaternion server_orientation_;
+//             Quaternion client_orientation_;
+            Quaternion common_orientation_;
+//             Vector3 server_angular_velocity_;
+//             Vector3 client_angular_velocity_;
+            Vector3 common_angular_velocity_;
 
             PlayerInfo* player_;
