Index: code/trunk/src/orxonox/objects/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/objects/CMakeLists.txt	(revision 3081)
+++ code/trunk/src/orxonox/objects/CMakeLists.txt	(revision 3084)
@@ -10,5 +10,4 @@
   Teamcolourable.cc
   Tickable.cc
-  Test.cc
   Scene.cc
   Script.cc
Index: code/trunk/src/orxonox/objects/Test.cc
===================================================================
--- code/trunk/src/orxonox/objects/Test.cc	(revision 3081)
+++ code/trunk/src/orxonox/objects/Test.cc	(revision 3084)
@@ -31,5 +31,7 @@
 #include "core/ConfigValueIncludes.h"
 #include "core/ConsoleCommand.h"
+#include "network/NetworkFunction.h"
 #include "Test.h"
+#include "util/MultiType.h"
 
 namespace orxonox
@@ -41,4 +43,15 @@
   SetConsoleCommand(Test, printV3, true).accessLevel(AccessLevel::User);
   SetConsoleCommand(Test, printV4, true).accessLevel(AccessLevel::User);
+  SetConsoleCommand(Test, call, true).accessLevel(AccessLevel::User);
+  SetConsoleCommand(Test, call2, true).accessLevel(AccessLevel::User);
+  
+  
+  //void=* aaaaa = copyPtr<sizeof(&Test::printV1)>( &NETWORK_FUNCTION_POINTER, &Test::printV1 );
+  //void* NETWORK_FUNCTION_TEST_B = memcpy(&NETWORK_FUNCTION_POINTER, &a, sizeof(a));
+//   NetworkFunctionBase* NETWORK_FUNCTION_TEST_C = new NetworkFunctionStatic( createFunctor(&Test::printV1), "bla", NETWORK_FUNCTION_POINTER );
+  
+  registerStaticNetworkFunction( &Test::printV1 );
+  registerMemberNetworkFunction( Test, checkU1 );
+  registerMemberNetworkFunction( Test, printBlaBla );
   
   Test* Test::instance_ = 0;
@@ -73,9 +86,9 @@
 
 
-	void Test::registerVariables()
-	{
-		registerVariable ( u1, variableDirection::toclient, new NetworkCallback<Test> ( this, &Test::checkU1 ));
+  void Test::registerVariables()
+  {
+    registerVariable ( u1, variableDirection::toclient, new NetworkCallback<Test> ( this, &Test::checkU1 ));
     registerVariable ( u2, variableDirection::toserver, new NetworkCallback<Test> ( this, &Test::checkU2 ));
-		registerVariable ( u3, variableDirection::serverMaster, new NetworkCallback<Test> ( this, &Test::checkU3 ), true );
+    registerVariable ( u3, variableDirection::serverMaster, new NetworkCallback<Test> ( this, &Test::checkU3 ), true );
     registerVariable ( u4, variableDirection::clientMaster, new NetworkCallback<Test> ( this, &Test::checkU4 ), true );
     
@@ -84,6 +97,41 @@
     registerVariable ( s3, variableDirection::serverMaster, new NetworkCallback<Test> ( this, &Test::checkS3 ), true );
     registerVariable ( s4, variableDirection::clientMaster, new NetworkCallback<Test> ( this, &Test::checkS4 ), true );
-	}
-
+  }
+  
+  void Test::call(unsigned int clientID)
+  {
+    callStaticNetworkFunction( &Test::printV1, clientID );
+    callStaticNetworkFunction( &Test::printV1, clientID );
+  }
+  
+  void Test::call2(unsigned int clientID, std::string s1, std::string s2, std::string s3, std::string s4)
+  {
+    callMemberNetworkFunction( Test, printBlaBla, this->getObjectID(), clientID, s1, s2, s3, s4, s4 );
+  }
+  
+  void Test::tick(float dt)
+  {
+//     std::string str1 = "blub";
+//     //MultiType mt1(std::string("blub"));
+//     MultiType mt1(str1);
+//     uint8_t* mem = new uint8_t[mt1.getNetworkSize()];
+//     uint8_t* temp = mem;
+//     mt1.exportData( temp );
+//     assert( temp-mem == mt1.getNetworkSize() );
+//     MultiType mt2;
+//     temp = mem;
+//     mt2.importData( temp );
+//     assert( temp-mem == mt1.getNetworkSize() );
+//     COUT(0) << mt2 << endl;
+    if(!Core::isMaster())
+      call2(0, "bal", "a", "n", "ce");
+//       callMemberNetworkFunction( Test, checkU1, this->getObjectID(), 0 );
+  }
+  
+  void Test::printBlaBla(std::string s1, std::string s2, std::string s3, std::string s4, std::string s5)
+  {
+    COUT(0) << s1 << s2 << s3 << s4 << s5 << endl;
+  }
+  
   void Test::checkU1(){ COUT(1) << "U1 changed: " << u1 << std::endl; }
   void Test::checkU2(){ COUT(1) << "U2 changed: " << u2 << std::endl; }
Index: code/trunk/src/orxonox/objects/Test.h
===================================================================
--- code/trunk/src/orxonox/objects/Test.h	(revision 3081)
+++ code/trunk/src/orxonox/objects/Test.h	(revision 3084)
@@ -33,4 +33,5 @@
 #include "core/BaseObject.h"
 #include "network/synchronisable/Synchronisable.h"
+#include "Tickable.h"
 
 
@@ -41,5 +42,5 @@
 namespace orxonox
 {
-  class _OrxonoxExport Test: public BaseObject, public Synchronisable
+  class _OrxonoxExport Test: public BaseObject, public Synchronisable, public Tickable
   {
     public:
@@ -49,4 +50,8 @@
       void setConfigValues();
       void registerVariables();
+      
+      static void call(unsigned int clientID);
+      void call2(unsigned int clientID, std::string s1, std::string s2, std::string s3, std::string s4);
+      virtual void tick(float dt);
 
 
@@ -75,4 +80,6 @@
       static void printV3(){ instance_->checkU3(); }
       static void printV4(){ instance_->checkU4(); }
+      
+      void printBlaBla(std::string s1, std::string s2, std::string s3, std::string s4, std::string s5);
 
     private:
Index: code/trunk/src/orxonox/objects/controllers/AIController.cc
===================================================================
--- code/trunk/src/orxonox/objects/controllers/AIController.cc	(revision 3081)
+++ code/trunk/src/orxonox/objects/controllers/AIController.cc	(revision 3084)
@@ -30,5 +30,4 @@
 #include "AIController.h"
 
-#include "core/GameMode.h"
 #include "core/CoreIncludes.h"
 #include "core/Executor.h"
@@ -45,6 +44,5 @@
         RegisterObject(AIController);
 
-        if (GameMode::isMaster())
-            this->actionTimer_.setTimer(ACTION_INTERVAL, true, this, createExecutor(createFunctor(&AIController::action)));
+        this->actionTimer_.setTimer(ACTION_INTERVAL, true, this, createExecutor(createFunctor(&AIController::action)));
     }
 
Index: code/trunk/src/orxonox/objects/worldentities/ControllableEntity.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/ControllableEntity.cc	(revision 3081)
+++ code/trunk/src/orxonox/objects/worldentities/ControllableEntity.cc	(revision 3084)
@@ -379,4 +379,5 @@
         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->playerID_,                variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::networkcallback_changedplayerID));
Index: code/trunk/src/orxonox/objects/worldentities/MobileEntity.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/MobileEntity.h	(revision 3081)
+++ code/trunk/src/orxonox/objects/worldentities/MobileEntity.h	(revision 3084)
@@ -61,5 +61,5 @@
                 { this->setAngularVelocity(Vector3(x, y, z)); }
             inline const Vector3& getAngularVelocity() const
-                { return this->linearAcceleration_; }
+                { return this->angularVelocity_; }
 
             void setAcceleration(const Vector3& acceleration);
Index: code/trunk/src/orxonox/objects/worldentities/PongBall.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/PongBall.cc	(revision 3081)
+++ code/trunk/src/orxonox/objects/worldentities/PongBall.cc	(revision 3084)
@@ -32,5 +32,4 @@
 #include "core/CoreIncludes.h"
 #include "core/GameMode.h"
-#include "objects/worldentities/PongBat.h"
 #include "objects/gametypes/Gametype.h"
 
@@ -47,5 +46,21 @@
         this->speed_ = 0;
         this->bat_ = 0;
+        this->batID_ = new unsigned int[2];
+        this->batID_[0] = OBJECTID_UNKNOWN;
+        this->batID_[1] = OBJECTID_UNKNOWN;
         this->relMercyOffset_ = 0.05;
+        
+        this->registerVariables();
+    }
+    
+    void PongBall::registerVariables()
+    {
+        registerVariable( this->fieldWidth_ );
+        registerVariable( this->fieldHeight_ );
+        registerVariable( this->batlength_ );
+        registerVariable( this->speed_ );
+        registerVariable( this->relMercyOffset_ );
+        registerVariable( this->batID_[0] );
+        registerVariable( this->batID_[1], variableDirection::toclient, new NetworkCallback<PongBall>( this, &PongBall::applyBats) );
     }
 
@@ -119,4 +134,53 @@
                 this->setPosition(position);
         }
+        else
+        {
+          Vector3 position = this->getPosition();
+          Vector3 velocity = this->getVelocity();
+
+          if (position.z > this->fieldHeight_ / 2 || position.z < -this->fieldHeight_ / 2)
+          {
+            velocity.z = -velocity.z;
+
+            if (position.z > this->fieldHeight_ / 2)
+              position.z = this->fieldHeight_ / 2;
+            if (position.z < -this->fieldHeight_ / 2)
+              position.z = -this->fieldHeight_ / 2;
+          }
+
+          if (position.x > this->fieldWidth_ / 2 || position.x < -this->fieldWidth_ / 2)
+          {
+            float distance = 0;
+
+            if (this->bat_)
+            {
+              if (position.x > this->fieldWidth_ / 2 && this->bat_[1])
+              {
+                distance = (position.z - this->bat_[1]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10) / 2);
+                if (fabs(distance) <= 1)
+                {
+                  position.x = this->fieldWidth_ / 2;
+                  velocity.x = -velocity.x;
+                  velocity.z = distance * distance * sgn(distance) * PongBall::MAX_REL_Z_VELOCITY * this->speed_;
+                }
+              }
+              if (position.x < -this->fieldWidth_ / 2 && this->bat_[0])
+              {
+                distance = (position.z - this->bat_[0]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10) / 2);
+                if (fabs(distance) <= 1)
+                {
+                  position.x = -this->fieldWidth_ / 2;
+                  velocity.x = -velocity.x;
+                  velocity.z = distance * distance * sgn(distance) * PongBall::MAX_REL_Z_VELOCITY * this->speed_;
+                }
+              }
+            }
+          }
+
+          if (velocity != this->getVelocity())
+            this->setVelocity(velocity);
+          if (position != this->getPosition())
+            this->setPosition(position);
+        }
     }
 
Index: code/trunk/src/orxonox/objects/worldentities/PongBall.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/PongBall.h	(revision 3081)
+++ code/trunk/src/orxonox/objects/worldentities/PongBall.h	(revision 3084)
@@ -33,4 +33,5 @@
 
 #include "objects/worldentities/MovableEntity.h"
+#include "objects/worldentities/PongBat.h"
 
 namespace orxonox
@@ -43,4 +44,6 @@
 
             virtual void tick(float dt);
+            
+            void registerVariables();
 
             void setFieldDimension(float width, float height)
@@ -61,5 +64,8 @@
 
             void setBats(PongBat** bats)
-                { this->bat_ = bats; }
+            { this->bat_ = bats; this->batID_[0] = this->bat_[0]->getObjectID(); this->batID_[1] = this->bat_[1]->getObjectID(); }
+            
+            void applyBats()
+            { if(!this->bat_) this->bat_ = new PongBat*[2]; if(this->batID_[0] != OBJECTID_UNKNOWN) this->bat_[0] = dynamic_cast<PongBat*>(Synchronisable::getSynchronisable(this->batID_[0])); if(this->batID_[1] != OBJECTID_UNKNOWN) this->bat_[1] = dynamic_cast<PongBat*>(Synchronisable::getSynchronisable(this->batID_[1])); }
 
             static const float MAX_REL_Z_VELOCITY;
@@ -71,4 +77,5 @@
             float batlength_;
             PongBat** bat_;
+            unsigned int* batID_;
             float relMercyOffset_;
     };
Index: code/trunk/src/orxonox/objects/worldentities/PongBat.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/PongBat.cc	(revision 3081)
+++ code/trunk/src/orxonox/objects/worldentities/PongBat.cc	(revision 3084)
@@ -54,6 +54,6 @@
     {
         registerVariable(this->speed_);
-        registerVariable(this->speed_);
-        registerVariable(this->speed_);
+        registerVariable(this->fieldHeight_);
+        registerVariable(this->length_);
     }
 
@@ -91,5 +91,8 @@
             position.z = -this->fieldHeight_ / 2 + this->fieldHeight_ * this->length_ / 2;
         if (position != this->getPosition())
+        {
             this->setPosition(position);
+            this->setVelocity( Vector3::ZERO );
+        }
     }
 
@@ -97,5 +100,5 @@
     {
         this->bMoveLocal_ = false;
-        this->movement_ -= value.x;
+        this->movement_ = -value.x;
     }
 
Index: code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc	(revision 3081)
+++ code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.cc	(revision 3084)
@@ -39,4 +39,5 @@
 #include "objects/worldentities/ParticleSpawner.h"
 #include "objects/worldentities/ExplosionChunk.h"
+
 #include "objects/weaponsystem/WeaponSystem.h"
 #include "objects/weaponsystem/WeaponSlot.h"
@@ -44,7 +45,11 @@
 #include "objects/weaponsystem/WeaponSet.h"
 
+#include "network/NetworkFunction.h"
+
 namespace orxonox
 {
     CreateFactory(Pawn);
+
+    registerMemberNetworkFunction( Pawn, doFire );
 
     Pawn::Pawn(BaseObject* creator) : ControllableEntity(creator)
@@ -123,19 +128,20 @@
         SUPER(Pawn, tick, dt);
 
-        if (this->weaponSystem_ && GameMode::isMaster())
-        {
-            for (unsigned int firemode = 0; firemode < WeaponSystem::MAX_FIRE_MODES; firemode++)
-                if (this->fire_ & WeaponSystem::getFiremodeMask(firemode))
-                    this->weaponSystem_->fire(firemode);
-
-            if (this->bReload_)
-                this->weaponSystem_->reload();
-        }
-
-        this->fire_ = this->firehack_;
-        this->firehack_ = 0x0;
+//        if (this->weaponSystem_ && GameMode::isMaster())
+//        {
+//            for (unsigned int firemode = 0; firemode < WeaponSystem::MAX_FIRE_MODES; firemode++)
+//                if (this->fire_ & WeaponSystem::getFiremodeMask(firemode))
+//                    this->weaponSystem_->fire(firemode);
+//
+//            if (this->bReload_)
+//                this->weaponSystem_->reload();
+//        }
+//
+//        this->fire_ = this->firehack_;
+//        this->firehack_ = 0x0;
         this->bReload_ = false;
 
-        if (this->health_ <= 0)
+        if (GameMode::isMaster())
+          if (this->health_ <= 0)
             this->death();
     }
@@ -263,5 +269,20 @@
     void Pawn::fire(unsigned int firemode)
     {
-        this->firehack_ |= WeaponSystem::getFiremodeMask(firemode);
+        this->doFire(firemode);
+    }
+
+    void Pawn::doFire(uint8_t firemode)
+    {
+        if(GameMode::isMaster())
+        {
+            if (this->weaponSystem_)
+                this->weaponSystem_->fire(firemode);
+        }
+        else
+        {
+            callMemberNetworkFunction(Pawn, doFire, this->getObjectID(), 0, ((uint8_t)firemode));
+            if (this->weaponSystem_)
+                this->weaponSystem_->fire(firemode);
+        }
     }
 
Index: code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.h	(revision 3081)
+++ code/trunk/src/orxonox/objects/worldentities/pawns/Pawn.h	(revision 3084)
@@ -79,4 +79,5 @@
             virtual void fire(unsigned int firemode);
             virtual void reload();
+            virtual void doFire(uint8_t firemode);
             virtual void postSpawn();
 
