Index: trunk/src/world_entities/playable.cc
===================================================================
--- trunk/src/world_entities/playable.cc	(revision 6863)
+++ trunk/src/world_entities/playable.cc	(revision 6868)
@@ -40,4 +40,5 @@
 
   this->bFire = false;
+  this->oldFlags = 0;
 
   this->setSynchronized(true);
@@ -246,2 +247,43 @@
 {
 }
+
+#define FLAGS_bFire   1
+
+int Playable::writeSync( const byte * data, int length, int sender )
+{
+  SYNCHELP_READ_BEGIN();
+  
+  byte flags;
+  
+  SYNCHELP_READ_BYTE( flags, NWT_PL_FLAGS );
+  
+  bFire = (flags & FLAGS_bFire) != 0;
+  
+  return SYNCHELP_READ_N;
+}
+
+int Playable::readSync( byte * data, int maxLength )
+{
+  SYNCHELP_WRITE_BEGIN();
+  byte flags = 0;
+  
+  if ( bFire )
+    flags |= FLAGS_bFire;
+  
+
+  SYNCHELP_WRITE_BYTE( flags, NWT_PL_FLAGS );
+  oldFlags = flags;
+
+  
+  return SYNCHELP_WRITE_N;
+}
+
+bool Playable::needsReadSync( )
+{
+  byte flags = 0;
+  
+  if ( bFire )
+    flags |= FLAGS_bFire;
+  
+  return flags!=oldFlags;
+}
Index: trunk/src/world_entities/playable.h
===================================================================
--- trunk/src/world_entities/playable.h	(revision 6863)
+++ trunk/src/world_entities/playable.h	(revision 6868)
@@ -54,4 +54,8 @@
     /** @return a List of Events in PEV_* sytle */
     inline const std::list<int>& getEventList() { return this->events; };
+    
+    int       writeSync(const byte* data, int length, int sender);
+    int       readSync(byte* data, int maxLength );
+    bool      needsReadSync();
 
   protected:
@@ -68,4 +72,5 @@
 
     bool                  bFire;              //!< If the Ship is firing.
+    int                   oldFlags;           //!< Used for synchronisation
 
 };
Index: trunk/src/world_entities/space_ships/space_ship.cc
===================================================================
--- trunk/src/world_entities/space_ships/space_ship.cc	(revision 6863)
+++ trunk/src/world_entities/space_ships/space_ship.cc	(revision 6868)
@@ -95,5 +95,6 @@
   else
   {
-    this->loadModel("models/ships/reap_#.obj");
+    //this->loadModel("models/ships/reap_#.obj");
+    this->loadModel( "models/ships/fighter.obj" );
   }
 
@@ -127,5 +128,5 @@
 
   bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = false;
-  bFire = false;
+
   xMouse = yMouse = 0;
   yInvert = 1;
@@ -516,7 +517,6 @@
 #define MASK_bAscend    16
 #define MASK_bDescend   32
-#define MASK_bFire      64
-#define MASK_bRollL    128
-#define MASK_bRollR    256
+#define MASK_bRollL     64
+#define MASK_bRollR    128
 
 #define DATA_state       1
@@ -525,4 +525,5 @@
 #define DATA_sync        4
 #define DATA_velocity    5
+#define DATA_playables   6
 
 int SpaceShip::writeBytes( const byte * data, int length, int sender )
@@ -547,16 +548,21 @@
     if ( b == DATA_flags )
     {
-      int flags = 0;
-      SYNCHELP_READ_INT( flags, NWT_SS_FLAGS );
-
-      bUp = (flags & MASK_bUp) != 0;
-      bDown = (flags & MASK_bDown) != 0;
-      bLeft = (flags & MASK_bLeft) != 0;
-      bRight = (flags & MASK_bRight) != 0;
-      bAscend = (flags & MASK_bAscend) != 0;
-      bDescend = (flags & MASK_bDescend) != 0;
-      bFire = (flags & MASK_bFire) != 0;
-      bRollL = (flags & MASK_bRollL) != 0;
-      bRollR = (flags & MASK_bRollR) != 0;
+      if ( this->getOwner() != this->getHostID() )
+      {
+        byte flags = 0;
+        SYNCHELP_READ_BYTE( flags, NWT_SS_FLAGS );
+
+        bUp = (flags & MASK_bUp) != 0;
+        bDown = (flags & MASK_bDown) != 0;
+        bLeft = (flags & MASK_bLeft) != 0;
+        bRight = (flags & MASK_bRight) != 0;
+        bAscend = (flags & MASK_bAscend) != 0;
+        bDescend = (flags & MASK_bDescend) != 0;
+        bRollL = (flags & MASK_bRollL) != 0;
+        bRollR = (flags & MASK_bRollR) != 0;
+        
+      }
+      else
+        assert(false);
 
       continue;
@@ -565,8 +571,13 @@
     if ( b == DATA_mouse )
     {
-      SYNCHELP_READ_FLOAT( mouseDir.w, NWT_SS_MOUSEDIRW );
-      SYNCHELP_READ_FLOAT( mouseDir.v.x, NWT_SS_MOUSEDIRX );
-      SYNCHELP_READ_FLOAT( mouseDir.v.y, NWT_SS_MOUSEDIRY );
-      SYNCHELP_READ_FLOAT( mouseDir.v.z, NWT_SS_MOUSEDIRZ );
+      if ( this->getOwner() != this->getHostID() )
+      {
+        SYNCHELP_READ_FLOAT( mouseDir.w, NWT_SS_MOUSEDIRW );
+        SYNCHELP_READ_FLOAT( mouseDir.v.x, NWT_SS_MOUSEDIRX );
+        SYNCHELP_READ_FLOAT( mouseDir.v.y, NWT_SS_MOUSEDIRY );
+        SYNCHELP_READ_FLOAT( mouseDir.v.z, NWT_SS_MOUSEDIRZ );
+      }
+      else
+        assert(false);
 
       continue;
@@ -576,5 +587,9 @@
     {
       if ( this->getOwner() != this->getHostID() )
+      {
         SYNCHELP_READ_FKT( PNode::writeSync, NWT_SS_PN_SYNC );
+      }
+      else
+        assert(false);
 
       continue;
@@ -583,7 +598,24 @@
     if ( b == DATA_velocity )
     {
-      SYNCHELP_READ_FLOAT( velocity.x, NWT_SS_VELX );
-      SYNCHELP_READ_FLOAT( velocity.y, NWT_SS_VELY );
-      SYNCHELP_READ_FLOAT( velocity.z, NWT_SS_VELZ );
+      if ( this->getOwner() != this->getHostID() )
+      {
+        SYNCHELP_READ_FLOAT( velocity.x, NWT_SS_VELX );
+        SYNCHELP_READ_FLOAT( velocity.y, NWT_SS_VELY );
+        SYNCHELP_READ_FLOAT( velocity.z, NWT_SS_VELZ );
+      }      
+      else
+        assert(false);
+      
+      continue;
+    }
+    
+    if ( b == DATA_playables )
+    {
+      if ( this->getOwner() != this->getHostID() )
+      {
+        SYNCHELP_READ_FKT( Playable::writeSync, NWT_SS_PL_SYNC );
+      }
+      else
+        assert(false);
     }
   }
@@ -615,12 +647,12 @@
 
     SYNCHELP_WRITE_FKT( WorldEntity::readState, NWT_SS_WE_STATE );
-    //SYNCHELP_WRITE_FLOAT( cycle );
 
     return SYNCHELP_WRITE_N;
   }
 
-  *reciever = 0;
-
-  if ( this->getOwner() == this->getHostID() && PNode::needsReadSync() )
+  *reciever = -this->getOwner();
+  bool sentSomething = false;
+
+  if ( ( this->getHostID()==0 || this->getOwner() == this->getHostID() ) && PNode::needsReadSync() )
   {
     SYNCHELP_WRITE_BYTE( DATA_sync, NWT_SS_B );
@@ -628,7 +660,7 @@
   }
 
-  if ( this->getHostID()==this->getOwner() )
-  {
-    int mask = 0;
+  if ( this->getHostID()==0 || this->getHostID()==this->getOwner() )
+  {
+    byte mask = 0;
 
     if ( bUp )
@@ -642,6 +674,4 @@
     if ( bAscend )
       mask |= MASK_bAscend;
-    if ( bFire )
-      mask |= MASK_bFire;
     if ( bRollL )
       mask |= MASK_bRollL;
@@ -650,12 +680,10 @@
 
 
-    //static float oldxMouse = xMouse + 1.0;
-    //static float oldyMouse = yMouse + 1.0;
-
     if ( mask != oldMask )
     {
       oldMask = mask;
+      sentSomething = true;
       SYNCHELP_WRITE_BYTE( DATA_flags, NWT_SS_B );
-      SYNCHELP_WRITE_INT( mask, NWT_SS_FLAGS );
+      SYNCHELP_WRITE_BYTE( mask, NWT_SS_FLAGS );
     }
 #define __OFFSET_MDIR_W 0.01
@@ -670,4 +698,5 @@
       SYNCHELP_WRITE_BYTE( DATA_mouse, NWT_SS_B );
       PRINTF(0)("SENDING mousedir\n");
+      sentSomething = true;
       SYNCHELP_WRITE_FLOAT( mouseDir.w, NWT_SS_MOUSEDIRW );
       SYNCHELP_WRITE_FLOAT( mouseDir.v.x, NWT_SS_MOUSEDIRX );
@@ -681,12 +710,22 @@
     {
       oldVelocity = velocity;
-      PRINTF(0)("SENDING velocity\n");
-      SYNCHELP_WRITE_BYTE( DATA_velocity, NWT_SS_B );
-      SYNCHELP_WRITE_FLOAT( velocity.x, NWT_SS_VELX );
-      SYNCHELP_WRITE_FLOAT( velocity.y, NWT_SS_VELY );
-      SYNCHELP_WRITE_FLOAT( velocity.z, NWT_SS_VELZ );
-    }
-
-  }
+      //PRINTF(0)("SENDING velocity\n");
+      //SYNCHELP_WRITE_BYTE( DATA_velocity, NWT_SS_B );
+      //SYNCHELP_WRITE_FLOAT( velocity.x, NWT_SS_VELX );
+      //SYNCHELP_WRITE_FLOAT( velocity.y, NWT_SS_VELY );
+      //SYNCHELP_WRITE_FLOAT( velocity.z, NWT_SS_VELZ );
+    }
+    
+    if ( Playable::needsReadSync() )
+    {
+      sentSomething = true;
+      SYNCHELP_WRITE_BYTE( DATA_playables, NWT_SS_B );
+      SYNCHELP_WRITE_FKT( Playable::readSync, NWT_SS_PL_SYNC );
+    }
+
+  }
+  
+  if ( !sentSomething )
+    reciever = 0;
 
   return SYNCHELP_WRITE_N;
Index: trunk/src/world_entities/space_ships/space_ship.h
===================================================================
--- trunk/src/world_entities/space_ships/space_ship.h	(revision 6863)
+++ trunk/src/world_entities/space_ships/space_ship.h	(revision 6868)
@@ -56,5 +56,5 @@
     bool                  bAscend;            //!< ascend button pressed.
     bool                  bDescend;           //!< descend button presses.
-    bool                  bFire;              //!< fire button pressed.
+//    bool                  bFire;              //!< fire button pressed.(moved to playable)
     bool                  bRollL;             //!< rolling button pressed (left)
     bool                  bRollR;             //!< rolling button pressed (right)
@@ -80,5 +80,5 @@
     float                 airViscosity;
 
-    int oldMask;
+    byte                  oldMask;            //!< used for synchronisation
 
     ParticleEmitter*      burstEmitter;
