Index: trunk/src/world_entities/power_ups/laser_power_up.cc
===================================================================
--- trunk/src/world_entities/power_ups/laser_power_up.cc	(revision 6282)
+++ trunk/src/world_entities/power_ups/laser_power_up.cc	(revision 6424)
@@ -19,4 +19,5 @@
 #include "factory.h"
 #include "state.h"
+#include "network_game_manager.h"
 
 #include "primitive_model.h"
@@ -118,2 +119,40 @@
 }
 
+int LaserPowerUp::writeBytes( const byte * data, int length, int sender )
+{
+  setRequestedSync( false );
+  setIsOutOfSync( false );
+
+  SYNCHELP_READ_BEGIN();
+
+  SYNCHELP_READ_FKT( PowerUp::writeState );
+
+  return SYNCHELP_READ_N;
+}
+
+
+
+int LaserPowerUp::readBytes( byte * data, int maxLength, int * reciever )
+{
+  if ( isOutOfSync() && !requestedSync() && this->getHostID()!=this->getOwner() )
+  {
+    (NetworkGameManager::getInstance())->sync( this->getUniqueID(), this->getOwner() );
+    setRequestedSync( true );
+  }
+
+  int rec = this->getRequestSync();
+  if ( rec > 0 )
+  {
+    *reciever = rec;
+
+    SYNCHELP_WRITE_BEGIN();
+
+    SYNCHELP_WRITE_FKT( PowerUp::readState );
+
+    return SYNCHELP_WRITE_N;
+  }
+
+  *reciever = 0;
+  return 0;
+}
+
Index: trunk/src/world_entities/power_ups/laser_power_up.h
===================================================================
--- trunk/src/world_entities/power_ups/laser_power_up.h	(revision 6282)
+++ trunk/src/world_entities/power_ups/laser_power_up.h	(revision 6424)
@@ -23,4 +23,7 @@
   virtual void draw() const;
 
+  virtual int writeBytes(const byte* data, int length, int sender);
+  virtual int readBytes(byte* data, int maxLength, int * reciever );
+
   private:
    void init();
Index: trunk/src/world_entities/power_ups/param_power_up.cc
===================================================================
--- trunk/src/world_entities/power_ups/param_power_up.cc	(revision 6282)
+++ trunk/src/world_entities/power_ups/param_power_up.cc	(revision 6424)
@@ -25,4 +25,5 @@
 #include "factory.h"
 #include "load_param.h"
+#include "network_game_manager.h"
 
 using namespace std;
@@ -53,4 +54,5 @@
 void ParamPowerUp::init()
 {
+  this->setClassID(CL_PARAM_POWER_UP, "ParamPowerUp");
   this->value = 0;
   this->max_value = 0;
@@ -63,5 +65,7 @@
   static_cast<PowerUp*>(this)->loadParams(root);
   LoadParam(root, "type", this, ParamPowerUp, setType);
-  if(root->FirstChildElement("value") != NULL) {
+
+  if( root != NULL && root->FirstChildElement("value") != NULL) {
+
     LoadParam(root, "value", this, ParamPowerUp, setValue);
   }
@@ -116,3 +120,61 @@
 }
 
+int ParamPowerUp::writeBytes( const byte * data, int length, int sender )
+{
+  setRequestedSync( false );
+  setIsOutOfSync( false );
 
+  SYNCHELP_READ_BEGIN();
+
+  SYNCHELP_READ_FKT( PowerUp::writeState );
+
+  int i;
+  SYNCHELP_READ_INT( i );
+  this->type = (EnumParamPowerUpType)i;
+  SYNCHELP_READ_INT( this->value );
+
+  if ( this->value != 0 )
+  {
+    SYNCHELP_READ_INT( this->min_value );
+    SYNCHELP_READ_INT( this->max_value );
+  }
+
+  return SYNCHELP_READ_N;
+}
+
+
+
+int ParamPowerUp::readBytes( byte * data, int maxLength, int * reciever )
+{
+  if ( isOutOfSync() && !requestedSync() && this->getHostID()!=this->getOwner() )
+  {
+    (NetworkGameManager::getInstance())->sync( this->getUniqueID(), this->getOwner() );
+    setRequestedSync( true );
+  }
+
+  int rec = this->getRequestSync();
+  if ( rec > 0 )
+  {
+    *reciever = rec;
+
+    SYNCHELP_WRITE_BEGIN();
+
+    SYNCHELP_WRITE_FKT( PowerUp::readState );
+
+    int i = this->type;
+    SYNCHELP_WRITE_INT( i );
+    SYNCHELP_WRITE_INT( this->value );
+
+    if ( this->value != 0 )
+    {
+      SYNCHELP_WRITE_INT( this->min_value );
+      SYNCHELP_WRITE_INT( this->max_value );
+    }
+
+    return SYNCHELP_WRITE_N;
+  }
+
+  *reciever = 0;
+  return 0;
+}
+
Index: trunk/src/world_entities/power_ups/param_power_up.h
===================================================================
--- trunk/src/world_entities/power_ups/param_power_up.h	(revision 6282)
+++ trunk/src/world_entities/power_ups/param_power_up.h	(revision 6424)
@@ -30,4 +30,7 @@
   int getValue();
 
+  virtual int writeBytes(const byte* data, int length, int sender);
+  virtual int readBytes(byte* data, int maxLength, int * reciever );
+
 protected:
   virtual void respawn();
Index: trunk/src/world_entities/power_ups/power_up.cc
===================================================================
--- trunk/src/world_entities/power_ups/power_up.cc	(revision 6282)
+++ trunk/src/world_entities/power_ups/power_up.cc	(revision 6424)
@@ -25,4 +25,6 @@
 PowerUp::PowerUp(float r, float g, float b)
 {
+  this->setClassID(CL_POWER_UP, "PowerUp");
+
   this->respawnType = RESPAWN_NONE;
 /*  if(!PowerUp::sphereModel) {*/
@@ -52,5 +54,5 @@
 void PowerUp::collidesWith (WorldEntity* entity, const Vector& location)
 {
- if(entity->isA(CL_EXTENDABLE))
+  if(entity->isA(CL_EXTENDABLE))
   {
     if(dynamic_cast<Extendable*>(entity)->pickup(this))
@@ -94,2 +96,28 @@
 }
 
+/**
+ * data copied in data will bee sent to another host
+ * @param data pointer to data
+ * @param maxLength max length of data
+ * @return the number of bytes writen
+ */
+int PowerUp::readState( byte * data, int maxLength )
+{
+  SYNCHELP_WRITE_BEGIN();
+  SYNCHELP_WRITE_FKT( WorldEntity::readState );
+  return SYNCHELP_WRITE_N;
+}
+
+/**
+ * Writes data from network containing information about the state
+ * @param data pointer to data
+ * @param length length of data
+ * @param sender hostID of sender
+ */
+int PowerUp::writeState( const byte * data, int length, int sender )
+{
+  SYNCHELP_READ_BEGIN();
+  SYNCHELP_READ_FKT( WorldEntity::writeState );
+  return SYNCHELP_READ_N;
+}
+
Index: trunk/src/world_entities/power_ups/power_up.h
===================================================================
--- trunk/src/world_entities/power_ups/power_up.h	(revision 6282)
+++ trunk/src/world_entities/power_ups/power_up.h	(revision 6424)
@@ -26,4 +26,7 @@
   void setRespawnType(const char* type);
 
+  int       writeState(const byte* data, int length, int sender);
+  int       readState(byte* data, int maxLength );
+
 protected:
   PowerUp(float r, float g, float b);
Index: trunk/src/world_entities/power_ups/turret_power_up.cc
===================================================================
--- trunk/src/world_entities/power_ups/turret_power_up.cc	(revision 6282)
+++ trunk/src/world_entities/power_ups/turret_power_up.cc	(revision 6424)
@@ -18,4 +18,5 @@
 #include "turret_power_up.h"
 #include "factory.h"
+#include "network_game_manager.h"
 #include "state.h"
 
@@ -118,2 +119,39 @@
 }
 
+int TurretPowerUp::writeBytes( const byte * data, int length, int sender )
+{
+  setRequestedSync( false );
+  setIsOutOfSync( false );
+
+  SYNCHELP_READ_BEGIN();
+
+  SYNCHELP_READ_FKT( PowerUp::writeState );
+
+  return SYNCHELP_READ_N;
+}
+
+
+
+int TurretPowerUp::readBytes( byte * data, int maxLength, int * reciever )
+{
+  if ( isOutOfSync() && !requestedSync() && this->getHostID()!=this->getOwner() )
+  {
+    (NetworkGameManager::getInstance())->sync( this->getUniqueID(), this->getOwner() );
+    setRequestedSync( true );
+  }
+
+  int rec = this->getRequestSync();
+  if ( rec > 0 )
+  {
+    *reciever = rec;
+
+    SYNCHELP_WRITE_BEGIN();
+
+    SYNCHELP_WRITE_FKT( PowerUp::readState );
+
+    return SYNCHELP_WRITE_N;
+  }
+
+  *reciever = 0;
+  return 0;
+}
Index: trunk/src/world_entities/power_ups/turret_power_up.h
===================================================================
--- trunk/src/world_entities/power_ups/turret_power_up.h	(revision 6282)
+++ trunk/src/world_entities/power_ups/turret_power_up.h	(revision 6424)
@@ -23,4 +23,7 @@
   virtual void draw() const;
 
+  virtual int writeBytes(const byte* data, int length, int sender);
+  virtual int readBytes(byte* data, int maxLength, int * reciever );
+
   private:
    void init();
Index: trunk/src/world_entities/power_ups/weapon_power_up.cc
===================================================================
--- trunk/src/world_entities/power_ups/weapon_power_up.cc	(revision 6282)
+++ trunk/src/world_entities/power_ups/weapon_power_up.cc	(revision 6424)
@@ -20,4 +20,5 @@
 #include "state.h"
 #include "list.h"
+#include "network_game_manager.h"
 
 #include "primitive_model.h"
@@ -85,2 +86,44 @@
   this->weapon = dynamic_cast<Weapon*>(Factory::fabricate(name));
 }
+
+int WeaponPowerUp::writeBytes( const byte * data, int length, int sender )
+{
+  setRequestedSync( false );
+  setIsOutOfSync( false );
+
+  SYNCHELP_READ_BEGIN();
+
+  SYNCHELP_READ_FKT( PowerUp::writeState );
+
+  //TODO: sync weapon class ( see loadParams )
+
+  return SYNCHELP_READ_N;
+}
+
+
+
+int WeaponPowerUp::readBytes( byte * data, int maxLength, int * reciever )
+{
+  if ( isOutOfSync() && !requestedSync() && this->getHostID()!=this->getOwner() )
+  {
+    (NetworkGameManager::getInstance())->sync( this->getUniqueID(), this->getOwner() );
+    setRequestedSync( true );
+  }
+
+  int rec = this->getRequestSync();
+  if ( rec > 0 )
+  {
+    *reciever = rec;
+
+    SYNCHELP_WRITE_BEGIN();
+
+    SYNCHELP_WRITE_FKT( PowerUp::readState );
+
+    //TODO: sync weapon class ( see loadParams )
+
+    return SYNCHELP_WRITE_N;
+  }
+
+  *reciever = 0;
+  return 0;
+}
Index: trunk/src/world_entities/power_ups/weapon_power_up.h
===================================================================
--- trunk/src/world_entities/power_ups/weapon_power_up.h	(revision 6282)
+++ trunk/src/world_entities/power_ups/weapon_power_up.h	(revision 6424)
@@ -22,4 +22,7 @@
   void setWeaponClass(const char* name);
 
+  virtual int writeBytes(const byte* data, int length, int sender);
+  virtual int readBytes(byte* data, int maxLength, int * reciever );
+
 protected:
   virtual void respawn();
