Index: trunk/src/world_entities/WorldEntities.am
===================================================================
--- trunk/src/world_entities/WorldEntities.am	(revision 9494)
+++ trunk/src/world_entities/WorldEntities.am	(revision 9656)
@@ -5,4 +5,5 @@
                 world_entities/npcs/ground_turret.cc \
                 world_entities/npcs/space_turret.cc \
+                world_entities/npcs/network_turret.cc \
                 world_entities/npcs/generic_npc.cc \
                 world_entities/npcs/door.cc \
@@ -79,4 +80,5 @@
                 npcs/ground_turret.h \
                 npcs/space_turret.h \
+                npcs/network_turret.h \
                 npcs/door.cc \
                 npcs/repair_station.h \
Index: trunk/src/world_entities/bsp_entity.cc
===================================================================
--- trunk/src/world_entities/bsp_entity.cc	(revision 9494)
+++ trunk/src/world_entities/bsp_entity.cc	(revision 9656)
@@ -54,5 +54,5 @@
   this->bspManager = NULL;
 
-  this->name_handle = registerVarId( new SynchronizeableString( &this->name, &this->name_write, "name" ) );
+  this->name_handle = registerVarId( new SynchronizeableString( &this->name, &this->name_write, "name", PERMISSION_MASTER_SERVER ) );
 
   this->setSynchronized( true );
Index: trunk/src/world_entities/environments/model_entity.cc
===================================================================
--- trunk/src/world_entities/environments/model_entity.cc	(revision 9494)
+++ trunk/src/world_entities/environments/model_entity.cc	(revision 9656)
@@ -36,4 +36,6 @@
   this->speed = NULL;
   this->momentum = NULL;
+
+  this->setSynchronized(true);
 
   if (root != NULL)
Index: trunk/src/world_entities/environments/water.cc
===================================================================
--- trunk/src/world_entities/environments/water.cc	(revision 9494)
+++ trunk/src/world_entities/environments/water.cc	(revision 9656)
@@ -59,10 +59,10 @@
   // To test the Wave equation
   //this->wave(5.0,4.0, 1, 10);
-  
-  height_handle = registerVarId( new SynchronizeableFloat( &height, &height, "height" ) );
-  resX_handle = registerVarId( new SynchronizeableUInt( &resX, &resX, "resX" ) );
-  resY_handle = registerVarId( new SynchronizeableUInt( &resY, &resY, "resY" ) );
-  sizeX_handle = registerVarId( new SynchronizeableFloat( &sizeX, &sizeX, "sizeX" ) );
-  sizeY_handle = registerVarId( new SynchronizeableFloat( &sizeY, &sizeY, "sizeY" ) );
+
+  height_handle = registerVarId( new SynchronizeableFloat( &height, &height, "height", PERMISSION_MASTER_SERVER ) );
+  resX_handle = registerVarId( new SynchronizeableUInt( &resX, &resX, "resX", PERMISSION_MASTER_SERVER ) );
+  resY_handle = registerVarId( new SynchronizeableUInt( &resY, &resY, "resY", PERMISSION_MASTER_SERVER ) );
+  sizeX_handle = registerVarId( new SynchronizeableFloat( &sizeX, &sizeX, "sizeX", PERMISSION_MASTER_SERVER ) );
+  sizeY_handle = registerVarId( new SynchronizeableFloat( &sizeY, &sizeY, "sizeY", PERMISSION_MASTER_SERVER ) );
 }
 
@@ -313,5 +313,5 @@
     this->rebuildGrid();
   }
-  
+
   WorldEntity::varChangeHandler( id );
 }
Index: trunk/src/world_entities/npcs/ground_turret.cc
===================================================================
--- trunk/src/world_entities/npcs/ground_turret.cc	(revision 9494)
+++ trunk/src/world_entities/npcs/ground_turret.cc	(revision 9656)
@@ -39,5 +39,5 @@
  */
 GroundTurret::GroundTurret(const TiXmlElement* root)
-  : NPC(root)
+    : NPC(root)
 {
   this->init();
@@ -52,5 +52,4 @@
 GroundTurret::~GroundTurret ()
 {
-
 }
 
@@ -80,5 +79,5 @@
 
 /**
- * loads a GroundTurret from a XML-element
+ * @brief loads a GroundTurret from a XML-element
  * @param root the XML-element to load from
  * @todo make the class Loadable
@@ -88,5 +87,4 @@
   // all the clases this Entity is directly derived from must be called in this way, to load all settings.
   NPC::loadParams(root);
-
 
   /**
@@ -126,18 +124,17 @@
 void GroundTurret::tick(float dt)
 {
-  if(this->getHealth() > 0.0f && State::getPlayer() &&
-     State::getPlayer()->getPlayable() &&
-     State::getPlayer()->getPlayable()->distance(this) < 120) // HACK
+  if(this->getHealth() > 0.0f
+    ) // HACK <--- YOU ARE THE MOTHERFUCKER
   {
-  if (likely(this->left != NULL))
-  {
-//    this->left->tickW(dt);
-    this->left->requestAction(WA_SHOOT);
-  }
-  if (likely(this->right != NULL))
-  {
-//    this->right->tickW(dt);
-    this->right->requestAction(WA_SHOOT);
-  }
+    if (likely(this->left != NULL))
+    {
+      //    this->left->tickW(dt);
+      this->left->requestAction(WA_SHOOT);
+    }
+    if (likely(this->right != NULL))
+    {
+      //    this->right->tickW(dt);
+      this->right->requestAction(WA_SHOOT);
+    }
   }
 }
@@ -164,5 +161,4 @@
 void GroundTurret::postSpawn ()
 {
-
 }
 
@@ -173,5 +169,4 @@
 void GroundTurret::leftWorld ()
 {
-
 }
 
Index: trunk/src/world_entities/npcs/ground_turret.h
===================================================================
--- trunk/src/world_entities/npcs/ground_turret.h	(revision 9494)
+++ trunk/src/world_entities/npcs/ground_turret.h	(revision 9656)
@@ -15,9 +15,8 @@
 {
 
- public:
+public:
   GroundTurret(const TiXmlElement* root = NULL);
   virtual ~GroundTurret();
 
-  void init();
   virtual void loadParams(const TiXmlElement* root);
 
@@ -30,7 +29,11 @@
   virtual void tick(float time);
 
- private:
-   PNode  weaponHolder[2];
-   Weapon *left, *right;
+private:
+  void init();
+
+
+private:
+  PNode  weaponHolder[2];
+  Weapon *left, *right;
 };
 
Index: trunk/src/world_entities/npcs/network_turret.cc
===================================================================
--- trunk/src/world_entities/npcs/network_turret.cc	(revision 9656)
+++ trunk/src/world_entities/npcs/network_turret.cc	(revision 9656)
@@ -0,0 +1,187 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Manuel Leuenberger
+   co-programmer: ...
+*/
+
+#include "network_turret.h"
+#include "model.h"
+#include "world_entities/weapons/turret.h"
+
+#include "state.h"
+#include "playable.h"
+#include "player.h"
+
+
+#include "util/loading/factory.h"
+#include "network_game_manager.h"
+#include "util/loading/load_param.h"
+
+#include "effects/explosion.h"
+
+#include "weapons/aiming_turret.h"
+
+CREATE_FACTORY(NetworkTurret, CL_NETWORK_TURRET);
+
+
+
+
+/**
+ * constructs and loads a NetworkTurret from a XML-element
+ * @param root the XML-element to load from
+ */
+NetworkTurret::NetworkTurret(const TiXmlElement* root)
+    : NPC(root)
+{
+  this->init();
+  if (root != NULL)
+    this->loadParams(root);
+}
+
+
+/**
+ * standard deconstructor
+ */
+NetworkTurret::~NetworkTurret ()
+{}
+
+
+/**
+ * initializes the NetworkTurret
+ * @todo change this to what you wish
+ */
+void NetworkTurret::init()
+{
+  this->setClassID(CL_NETWORK_TURRET, "NetworkTurret");
+  this->loadModel("models/ground_turret_#.obj", 5);
+
+  this->weapon = new AimingTurret();
+  this->weapon->loadModel("models/guns/turret2.obj", 10);
+  this->weapon->setParent(this);
+  this->weapon->toList(this->getOMListNumber());
+  this->weapon->setRelCoor(0,10,-5);
+  this->weapon->requestAction( WA_ACTIVATE);
+  this->weapon->setParent(&this->weaponHolder);
+
+  this->setHealthMax(300);
+  this->setHealth(300);
+
+  this->weaponHolder.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
+
+  this->weaponHolder.setRelCoor(0,25,0);
+  this->weaponHolder.setParent(this);
+
+
+  this->targetGroup = OM_GROUP_01;
+  this->targetGroup_write = OM_GROUP_01;
+  this->targetGroup_handle = this->registerVarId( new SynchronizeableInt ( &targetGroup, &targetGroup_write, "targetgroup", PERMISSION_MASTER_SERVER ) );
+
+  this->setSynchronized( true );
+}
+
+
+/**
+ * @brief loads a NetworkTurret from a XML-element
+ * @param root the XML-element to load from
+ * @todo make the class Loadable
+ */
+void NetworkTurret::loadParams(const TiXmlElement* root)
+{
+  // all the clases this Entity is directly derived from must be called in this way, to load all settings.
+  NPC::loadParams(root);
+
+  LoadParam(root, "target-group", this, NetworkTurret, setTargetGroupS);
+}
+
+/**
+ * advances the NetworkTurret about time seconds
+ * @param time the Time to step
+ */
+void NetworkTurret::tick(float dt)
+{
+  ObjectManager::EntityList::iterator entity;
+  Vector diffVec;
+  for (entity = State::getObjectManager()->getObjectList((OM_LIST)this->targetGroup).begin();
+       entity != State::getObjectManager()->getObjectList((OM_LIST)this->targetGroup).end();
+       entity ++)
+  {
+    diffVec = ( (*entity)->getAbsCoor() - this->getAbsCoor() );
+
+    if ( diffVec.len() < 400.0 )//&&  acos( (this->source->getAbsDirX()).dot(diffVec)/(diffVec.len() * (this->source->getAbsDirX()).len() ) )  < angle)
+    {
+      //if (this->getParent() != (*entity))
+      {
+        this->weapon->requestAction(WA_SHOOT);
+        return;
+      }
+    }
+  }
+}
+
+/**
+ * draws this worldEntity
+ */
+void NetworkTurret::draw () const
+{
+  WorldEntity::draw();
+
+  if (this->weapon != NULL)
+    this->weapon->draw();
+}
+
+void NetworkTurret::setTargetGroup(int targetGroup)
+{
+  this->targetGroup = targetGroup;
+  this->weapon->setTargetGroup((OM_LIST)targetGroup);
+}
+
+
+void NetworkTurret::setTargetGroupS(const std::string& groupName)
+{
+  OM_LIST id = ObjectManager::StringToOMList(groupName);
+  if (id != OM_NULL)
+    this->setTargetGroup(id);
+  else
+    PRINTF(2)("List %s not found for targetting\n", groupName.c_str());
+}
+
+void NetworkTurret::varChangeHandler( std::list< int > & id )
+{
+  WorldEntity::varChangeHandler( id );
+
+  if ( std::find( id.begin(), id.end(), targetGroup_handle) != id.end() )
+  {
+    setTargetGroup( targetGroup_write );
+  }
+}
+
+/**
+ *
+ *
+ */
+void NetworkTurret::postSpawn ()
+{}
+
+/**
+ *
+ *
+ */
+void NetworkTurret::leftWorld ()
+{}
+
+void NetworkTurret::destroy(WorldEntity* killer)
+{
+  this->setAbsDirSoft(Quaternion(-90, Vector(0,0,1)), 90);
+  Explosion::explode(this, Vector(10,10,10));
+
+  this->toList(OM_DEAD);
+}
Index: trunk/src/world_entities/npcs/network_turret.h
===================================================================
--- trunk/src/world_entities/npcs/network_turret.h	(revision 9656)
+++ trunk/src/world_entities/npcs/network_turret.h	(revision 9656)
@@ -0,0 +1,52 @@
+/*!
+ * @file network_turret.h
+ * @brief description
+*/
+
+#ifndef _NETWORK_TURRET_H
+#define _NETWORK_TURRET_H
+
+#include "npcs/npc.h"
+
+class AimingTurret;
+
+//! A Class to ...
+class NetworkTurret : public NPC
+{
+
+public:
+  NetworkTurret(const TiXmlElement* root = NULL);
+  virtual ~NetworkTurret();
+
+  virtual void loadParams(const TiXmlElement* root);
+
+  virtual void postSpawn ();
+  virtual void leftWorld ();
+
+
+  virtual void destroy(WorldEntity* killer);
+
+  virtual void draw() const;
+  virtual void tick(float time);
+
+
+  void setTargetGroup(int targetGroup);
+  void setTargetGroupS(const std::string& targetGroup);
+
+  virtual void varChangeHandler( std::list<int> & id );
+
+
+private:
+  void init();
+
+private:
+  PNode  weaponHolder;
+  AimingTurret *weapon;
+
+  int    targetGroup;
+  int    targetGroup_write;
+
+  int    targetGroup_handle;
+};
+
+#endif /* _NETWORK_TURRET_H */
Index: trunk/src/world_entities/npcs/space_turret.cc
===================================================================
--- trunk/src/world_entities/npcs/space_turret.cc	(revision 9494)
+++ trunk/src/world_entities/npcs/space_turret.cc	(revision 9656)
@@ -74,4 +74,8 @@
   this->weaponHolder[0].setParent(this);
   this->weaponHolder[1].setParent(this);
+
+  this->wLeftHandle = registerVarId( new SynchronizeableString( &this->wLeft, &this->wLeft, "weapon-left", PERMISSION_MASTER_SERVER ) );
+  this->wRightHandle = registerVarId( new SynchronizeableString( &this->wRight, &this->wRight, "weapon-right", PERMISSION_MASTER_SERVER ) );
+
 }
 
@@ -98,4 +102,6 @@
   if (this->left)
   {
+    this->wLeft = element->Value();
+
     this->left->setParent(this);
     this->left->toList(this->getOMListNumber());
@@ -110,4 +116,6 @@
   if (this->right)
   {
+    this->wRight = element->Value();
+
     this->right->setParent(this);
     this->right->toList(this->getOMListNumber());
@@ -117,4 +125,21 @@
   }
 }
+
+
+/**
+ * sets the left weapon called from net sync
+ * @param wLeft the left weapon string
+ */
+void SpaceTurret::setWeaponLeft(const std::string& wLeft)
+{
+
+}
+
+/**
+ * sets the left weapon called from net sync
+ * @param wRught the right weapon string
+ */
+void SpaceTurret::setWeaponRight(const std::string& wRight)
+{}
 
 /**
@@ -198,2 +223,25 @@
 
 }
+
+
+
+/**
+ * handler for changes on registred vars
+ * @param id id's which changed
+ */
+void SpaceTurret::varChangeHandler( std::list< int > & id )
+{
+  if ( std::find( id.begin(), id.end(), this->wLeftHandle ) != id.end())
+  {
+    this->setWeaponLeft(this->wLeft);
+  }
+
+  if ( std::find( id.begin(), id.end(), this->wRightHandle ) != id.end() )
+  {
+    this->setWeaponRight(this->wRight);
+  }
+
+
+  WorldEntity::varChangeHandler( id );
+}
+
Index: trunk/src/world_entities/npcs/space_turret.h
===================================================================
--- trunk/src/world_entities/npcs/space_turret.h	(revision 9494)
+++ trunk/src/world_entities/npcs/space_turret.h	(revision 9656)
@@ -8,4 +8,8 @@
 
 #include "npcs/npc.h"
+
+#include <string>
+#include <list>
+
 
 class Weapon;
@@ -20,4 +24,9 @@
 
   virtual void loadParams(const TiXmlElement* root);
+  virtual void varChangeHandler( std::list< int > & id );
+
+
+  void setWeaponLeft(const std::string& wLeft);
+  void setWeaponRight(const std::string& wRight);
 
   virtual void postSpawn ();
@@ -36,4 +45,9 @@
   PNode  weaponHolder[2];
   Weapon *left, *right;
+
+  std::string wLeft;
+  std::string wRight;
+  int wLeftHandle;
+  int wRightHandle;
 };
 
Index: trunk/src/world_entities/playable.cc
===================================================================
--- trunk/src/world_entities/playable.cc	(revision 9494)
+++ trunk/src/world_entities/playable.cc	(revision 9656)
@@ -68,5 +68,7 @@
 
 
-  registerVar( new SynchronizeableInt( &score, &score, "score" ) );
+  this->teamChangeHandler = registerVarId( new SynchronizeableInt( &this->teamId, &this->teamId, "team-id", PERMISSION_MASTER_SERVER ) );
+
+  registerVar( new SynchronizeableInt( &score, &score, "score", PERMISSION_MASTER_SERVER ) );
   registerVar( new SynchronizeableBool( &bFire, &bFire, "bFire", PERMISSION_OWNER));
 }
@@ -139,4 +141,7 @@
 bool Playable::addWeapon(Weapon* weapon, int configID, int slotID)
 {
+  weapon->setOwner(this->getOwner());
+
+
   if(this->weaponMan.addWeapon(weapon, configID, slotID))
   {
@@ -272,4 +277,16 @@
   return false;
 }
+
+
+/**
+ * @brief sets the TeamID and all the properties needed to be visible on the Playable
+ * @param teamID: the new TeamID of the Entity
+ */
+void Playable::setTeam(int teamID)
+{
+  /// Derive this function to make it look different with differen groups.
+  PRINTF(4)("No special team specific function implemented for %s::%s in Team %d\n", this->getClassCName(), this->getCName(), teamID);
+}
+
 
 /**
@@ -512,2 +529,17 @@
   "FirstPerson"
 };
+
+
+/**
+ * handler for changes on registred vars
+ * @param id id's which changed
+ */
+void Playable::varChangeHandler( std::list< int > & id )
+{
+  if ( std::find( id.begin(), id.end(), this->teamChangeHandler) != id.end() )
+  {
+    this->setTeam(this->teamId);
+  }
+
+  WorldEntity::varChangeHandler(id);
+}
Index: trunk/src/world_entities/playable.h
===================================================================
--- trunk/src/world_entities/playable.h	(revision 9494)
+++ trunk/src/world_entities/playable.h	(revision 9656)
@@ -11,4 +11,5 @@
 #include "event.h"
 #include <vector>
+#include <list>
 
 #include "world_entities/weapons/weapon_manager.h"
@@ -43,4 +44,5 @@
 
   virtual void loadParams(const TiXmlElement* root);
+  void varChangeHandler( std::list< int > & id );
 
   // Weapon and Pickups
@@ -62,4 +64,5 @@
   inline const std::vector<int>& getEventList() { return this->events; };
 
+
   // Camera and Playmode
   void attachCamera();
@@ -72,6 +75,11 @@
   void setPlayDirection(float angle, float dirX, float dirY, float dirZ, float speed = 0.0f);
 
+  // Networking interface
   inline void setScore( int score ) { this->score = score; }
   inline int  getScore() { return this->score; }
+  inline void setTeamId( int teamId) { this->teamId = teamId;}
+  inline int getTeamId() const { return this->teamId; }
+  virtual void setTeam(int teamID);
+
 
   void setEnterRadius(float radius) { this->enterRadius = radius; };
@@ -85,11 +93,12 @@
   virtual void tick(float dt);
 
+
+  inline bool beFire() const { return this->bFire; }
+  inline void fire(bool bF) { this->bFire = bF;}
+
   // Transformations:
   static Playable::Playmode stringToPlaymode(const std::string& playmode);
   static const std::string& playmodeToString(Playable::Playmode playmode);
   static const std::string playmodeNames[];
-
-  inline bool beFire(){ return this->bFire; }
-  inline void fire(bool bF){ this->bFire = bF;}
 
 protected:
@@ -117,4 +126,6 @@
 
   int                   score;              //!< players score
+  int                   teamChangeHandler;  //!< handler id for team changes network sync
+  int                   teamId;             //!< id of the current team
 
   bool                  bDead;
@@ -124,5 +135,5 @@
   float                 enterRadius;        //!< How far one can be away from the Playable to enter it.
 
-  WorldEntity* collider;
+  WorldEntity*          collider;
 };
 
Index: trunk/src/world_entities/power_ups/param_power_up.cc
===================================================================
--- trunk/src/world_entities/power_ups/param_power_up.cc	(revision 9494)
+++ trunk/src/world_entities/power_ups/param_power_up.cc	(revision 9656)
@@ -43,9 +43,9 @@
   if( root != NULL)
     this->loadParams(root);
-  
-  registerVar( new SynchronizeableInt( (int*)&type, (int*)&type, "type" ) );
-  registerVar( new SynchronizeableFloat( &value, &value, "value" ) );
-  registerVar( new SynchronizeableFloat( &max_value, &max_value, "max_value" ) );
-  registerVar( new SynchronizeableFloat( &min_value, &min_value, "min_value" ) );
+
+  registerVar( new SynchronizeableInt( (int*)&type, (int*)&type, "type", PERMISSION_MASTER_SERVER ) );
+  registerVar( new SynchronizeableFloat( &value, &value, "value", PERMISSION_MASTER_SERVER ) );
+  registerVar( new SynchronizeableFloat( &max_value, &max_value, "max_value", PERMISSION_MASTER_SERVER ) );
+  registerVar( new SynchronizeableFloat( &min_value, &min_value, "min_value", PERMISSION_MASTER_SERVER ) );
 }
 
Index: trunk/src/world_entities/projectiles/guided_missile.h
===================================================================
--- trunk/src/world_entities/projectiles/guided_missile.h	(revision 9494)
+++ trunk/src/world_entities/projectiles/guided_missile.h	(revision 9656)
@@ -13,5 +13,4 @@
 class ParticleEmitter;
 class FastFactory;
-class Aim;
 
 class GuidedMissile : public Projectile
Index: trunk/src/world_entities/projectiles/laser.cc
===================================================================
--- trunk/src/world_entities/projectiles/laser.cc	(revision 9494)
+++ trunk/src/world_entities/projectiles/laser.cc	(revision 9656)
@@ -88,5 +88,5 @@
   }
 
-  this->setDamage(0);
+  this->setDamage(20);
   this->setHealth(0);
 }
Index: trunk/src/world_entities/projectiles/projectile.cc
===================================================================
--- trunk/src/world_entities/projectiles/projectile.cc	(revision 9494)
+++ trunk/src/world_entities/projectiles/projectile.cc	(revision 9656)
@@ -45,4 +45,6 @@
   this->explosionBuffer = NULL;
   this->engineBuffer = NULL;
+
+  //this->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
 }
 
Index: trunk/src/world_entities/script_trigger.cc
===================================================================
--- trunk/src/world_entities/script_trigger.cc	(revision 9494)
+++ trunk/src/world_entities/script_trigger.cc	(revision 9656)
@@ -49,5 +49,5 @@
  */
 ScriptTrigger::ScriptTrigger(const TiXmlElement* root)
-{ PRINT(1)("testerror\n");
+{ 
   this->setClassID(CL_SCRIPT_TRIGGER, "ScriptTrigger");
   this->toList(OM_COMMON);
Index: trunk/src/world_entities/skybox.cc
===================================================================
--- trunk/src/world_entities/skybox.cc	(revision 9494)
+++ trunk/src/world_entities/skybox.cc	(revision 9656)
@@ -96,7 +96,7 @@
 {
   this->rebuild();
-  
-  textureName_handle = registerVarId( new SynchronizeableString( &textureName, &textureName, "textureName") );
-  size_handle = registerVarId( new SynchronizeableFloat( &size, &size, "size" ) );
+
+  textureName_handle = registerVarId( new SynchronizeableString( &textureName, &textureName, "textureName", PERMISSION_MASTER_SERVER) );
+  size_handle = registerVarId( new SynchronizeableFloat( &size, &size, "size", PERMISSION_MASTER_SERVER ) );
 }
 
@@ -297,5 +297,5 @@
 {
   bool somethinChanged = false;
-  
+
   if ( std::find( id.begin(), id.end(), textureName_handle ) != id.end() )
   {
@@ -303,12 +303,12 @@
     setTexture( textureName );
   }
-  
+
   if ( std::find( id.begin(), id.end(), size_handle ) != id.end() )
   {
     somethinChanged = true;
   }
-  
+
   rebuild();
-  
+
   WorldEntity::varChangeHandler( id );
 }
Index: trunk/src/world_entities/space_ships/hover.cc
===================================================================
--- trunk/src/world_entities/space_ships/hover.cc	(revision 9494)
+++ trunk/src/world_entities/space_ships/hover.cc	(revision 9656)
@@ -330,5 +330,5 @@
   this->shiftCoor (this->velocity * dt);
 
-    // limit the maximum rotation speed.
+  // limit the maximum rotation speed.
   if (this->rotation != 0.0f)
   {
Index: trunk/src/world_entities/space_ships/space_ship.cc
===================================================================
--- trunk/src/world_entities/space_ships/space_ship.cc	(revision 9494)
+++ trunk/src/world_entities/space_ships/space_ship.cc	(revision 9656)
@@ -234,5 +234,5 @@
   this->burstSystem->setColor(1.0, .8,.8,.8,.0);
 
-  registerVar( new SynchronizeableVector( &velocity, &velocity, "velocity" ) );
+  registerVar( new SynchronizeableVector( &velocity, &velocity, "velocity", PERMISSION_MASTER_SERVER ) );
   registerVar( new SynchronizeableQuaternion( &mouseDir, &mouseDir, "mousedir", PERMISSION_OWNER ) );
 
Index: trunk/src/world_entities/space_ships/turbine_hover.cc
===================================================================
--- trunk/src/world_entities/space_ships/turbine_hover.cc	(revision 9494)
+++ trunk/src/world_entities/space_ships/turbine_hover.cc	(revision 9656)
@@ -91,4 +91,5 @@
 
   this->loadModel("models/ships/hoverglider_mainbody.obj");
+
 }
 
@@ -222,4 +223,7 @@
   registerVar( new SynchronizeableFloat( &cameraLook, &cameraLook, "cameraLook", PERMISSION_OWNER ) );
   registerVar( new SynchronizeableFloat( &rotation, &rotation, "rotation", PERMISSION_OWNER ) );
+
+  if( State::isOnline())
+    toList( OM_PLAYERS );
 }
 
@@ -231,4 +235,16 @@
 {
   Playable::loadParams(root);
+}
+
+
+void TurbineHover::setBoostColor(const Color& color)
+{
+  this->burstSystem->setColor(0.0, color);
+  this->burstSystem->setColor(0.2, color * 0.6);
+  this->burstSystem->setColor(0.5, color * .3 + Color(0.5, 0.5, 0.8, 0.3));
+  this->burstSystem->setColor(1.0, 0.8, 0.8, 0.8, 0.0);
+
+  printf(":::::::::::::::::::::::\n");
+  this->burstSystem->debug();
 }
 
@@ -256,4 +272,35 @@
 
 }
+
+void TurbineHover::setTeam(int teamID)
+{
+  printf("::::::::::::::::: TEAM ::: %d\n", teamID);
+  if (teamID == 0)
+  {
+    this->setBoostColor(Color::blue);
+  }
+  else if (teamID == 1)
+  {
+    this->setBoostColor(Color::red);
+  }
+
+  ///HACK this is very much hard coded.set the owner of the weapons
+  this->getWeaponManager().getWeapon(0)->setOwner(this->getOwner());
+  this->getWeaponManager().getWeapon(1)->setOwner(this->getOwner());
+
+  //choose collision list
+  if( State::isOnline())
+  {
+    if( teamID == 0)
+      toList( OM_GROUP_00 );
+    else if(teamID == 1)
+      toList( OM_GROUP_01);
+  }
+
+
+  // set the local team id, very important
+  this->setTeamId(teamID);
+}
+
 
 
@@ -527,2 +574,12 @@
   }
 }
+
+
+/**
+ *  respawning function called by the GameRules
+ */
+void TurbineHover::respawn( )
+{
+
+  Playable::respawn();
+}
Index: trunk/src/world_entities/space_ships/turbine_hover.h
===================================================================
--- trunk/src/world_entities/space_ships/turbine_hover.h	(revision 9494)
+++ trunk/src/world_entities/space_ships/turbine_hover.h	(revision 9656)
@@ -9,4 +9,6 @@
 
 #include "playable.h"
+
+#include "color.h"
 
 // Forward Declaration
@@ -21,4 +23,6 @@
     virtual ~TurbineHover();
 
+    void setBoostColor(const Color& color);
+
     virtual void loadParams(const TiXmlElement* root);
     virtual void setPlayDirection(const Quaternion& rot, float speed = 0.0f);
@@ -26,6 +30,9 @@
     virtual void leave();
 
+    virtual void setTeam(int teamID);
+
     virtual void postSpawn();
     virtual void leftWorld();
+    virtual void respawn();
 
     virtual void collidesWith(WorldEntity* entity, const Vector& location);
Index: trunk/src/world_entities/spawning_point.cc
===================================================================
--- trunk/src/world_entities/spawning_point.cc	(revision 9494)
+++ trunk/src/world_entities/spawning_point.cc	(revision 9656)
@@ -207,14 +207,16 @@
 void SpawningPoint::sendRespawnMessage( int uniqueId )
 {
-#warning this byte array is not being deleted according to valginrd
-  byte * buf = new byte[2*INTSIZE];
+  byte buf[2*INTSIZE];
 
   assert( Converter::intToByteArray( this->getUniqueID(), buf, INTSIZE ) == INTSIZE );
   assert( Converter::intToByteArray( uniqueId, buf + INTSIZE, INTSIZE ) == INTSIZE );
 
-  MessageManager::getInstance()->sendMessage( MSGID_RESPAWN, buf, 2*INTSIZE, RT_ALL_BUT_ME, 0, MP_HIGHBANDWIDTH );
-}
-
-bool SpawningPoint::respawnMessageHandler( MessageId messageId, byte * data, int dataLength, void * someData, int userId )
+  MessageManager::getInstance()->sendMessage( MSGID_RESPAWN, buf, 2*INTSIZE, RT_ALL_BUT_ME, NET_UNASSIGNED, MP_HIGHBANDWIDTH );
+}
+
+/**
+ * message handler for respawn message
+ */
+bool SpawningPoint::respawnMessageHandler( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId  )
 {
   if ( SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive()*/)
Index: trunk/src/world_entities/spawning_point.h
===================================================================
--- trunk/src/world_entities/spawning_point.h	(revision 9494)
+++ trunk/src/world_entities/spawning_point.h	(revision 9656)
@@ -70,5 +70,5 @@
 
     void sendRespawnMessage( int uniqueId );
-    static bool respawnMessageHandler( MessageId messageId, byte * data, int dataLength, void * someData, int userId );
+    static bool respawnMessageHandler( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId  );
 
 
Index: trunk/src/world_entities/weapons/aim.cc
===================================================================
--- trunk/src/world_entities/weapons/aim.cc	(revision 9494)
+++ trunk/src/world_entities/weapons/aim.cc	(revision 9656)
@@ -50,7 +50,4 @@
 Aim::~Aim ()
 {
-  if (this->material)
-    delete this->material;
-
 /*  if (this->text != NULL)
     delete this->text;*/
@@ -70,10 +67,9 @@
 
   this->setBindNode(this);
-  this->material = new Material;
   this->source = NULL;
 
-  this->range = 10000;
+  this->range = 1000;
   this->angle = M_PI_4;
-  this->group = OM_GROUP_01;
+  this->targetGroup = OM_GROUP_01;
   this->anim = new tAnimation<Aim>(this, &Aim::setSize);
   this->anim->setInfinity(ANIM_INF_CONSTANT);
@@ -103,4 +99,6 @@
   LoadParam(root, "rotation-speed", this, Aim, setRotationSpeed)
       .describe("the Speed with which the Aim should rotate");
+
+  LoadParam(root, "target-group", this, Aim, setTargetGroupS);
 }
 
@@ -108,15 +106,16 @@
 {
   ObjectManager::EntityList::iterator entity;
-
-  for (entity = State::getObjectManager()->getObjectList(group).begin();
-       entity != State::getObjectManager()->getObjectList(group).end();
+  //printf("%d\n", this->targetGroup);
+  for (entity = State::getObjectManager()->getObjectList(this->targetGroup).begin();
+       entity != State::getObjectManager()->getObjectList(this->targetGroup).end();
        entity ++)
   {
     diffVec = ( (*entity)->getAbsCoor() - this->source->getAbsCoor() );
 
-    if ( diffVec.len() < range &&  acos( (this->source->getAbsDirX()).dot(diffVec)/(diffVec.len() * (this->source->getAbsDirX()).len() ) )  < angle)
+    if ( diffVec.len() < range )//&&  acos( (this->source->getAbsDirX()).dot(diffVec)/(diffVec.len() * (this->source->getAbsDirX()).len() ) )  < angle)
     {
       //if (this->getParent() != (*entity))
       {
+        printf("found target::: %d %s::%s\n", (*entity)->getOMListNumber(), (*entity)->getClassCName(), (*entity)->getCName());
         this->anim->replay();
         this->setParentSoft(*entity, 5);
@@ -128,9 +127,14 @@
    //if no target found:
    this->setParent(PNode::getNullParent());
-
-
-
-}
-
+}
+
+void Aim::setTargetGroupS(const std::string& groupName)
+{
+  OM_LIST id = ObjectManager::StringToOMList(groupName);
+  if (id != OM_NULL)
+    this->setTargetGroup(id);
+  else
+    PRINTF(2)("List %s not found for targetting\n", groupName.c_str());
+}
 
 /**
@@ -149,5 +153,5 @@
 void Aim::setTexture(const std::string& textureFile)
 {
-  this->material->setDiffuseMap(textureFile);
+  this->material.setDiffuseMap(textureFile);
 }
 
@@ -170,6 +174,6 @@
 //only look for target if the aim hasn`t locked a target yet or if the actual target is out of range
    if(this->getParent() == PNode::getNullParent() ||
-      diffVec.len() > range  ||
-     ( acos( (this->source->getAbsDirX()).dot(diffVec)/(diffVec.len() * (this->source->getAbsDirX()).len() ) ) > angle))
+      diffVec.len() > range )// ||
+     //( acos( (this->source->getAbsDirX()).dot(diffVec)/(diffVec.len() * (this->source->getAbsDirX()).len() ) ) > angle))
     {
      this->setParentSoft(PNode::getNullParent(),5);
@@ -213,5 +217,5 @@
 
   glRotatef(this->getAbsDir2D(), 0,0,1);
-  this->material->select();
+  this->material.select();
   glBegin(GL_TRIANGLE_STRIP);
   glTexCoord2f(0, 0);
Index: trunk/src/world_entities/weapons/aim.h
===================================================================
--- trunk/src/world_entities/weapons/aim.h	(revision 9494)
+++ trunk/src/world_entities/weapons/aim.h	(revision 9656)
@@ -11,8 +11,9 @@
 #include "object_manager.h"
 
+#include "material.h"
+
 // FORWARD DECLARATION
 class Model;
 class Text;
-class Material;
 class TiXmlElement;
 template<class T> class tAnimation;
@@ -25,11 +26,11 @@
  * Also the Aim is a Element2D, as it draws a cross onto the Target.
  */
-class Aim : public PNode, public Element2D {
+class Aim : public PNode, public Element2D
+{
 
- public:
+public:
   Aim(PNode* source, const TiXmlElement* root = NULL);
   virtual ~Aim();
 
-  void init();
   virtual void loadParams(const TiXmlElement* root);
 
@@ -37,11 +38,12 @@
 
   inline void selectTarget(PNode* target) { this->setParent(target); };
-  inline PNode* getTarget(PNode* target) { return this->getParent(); };
+  inline PNode* getTarget(PNode* target) const { return this->getParent(); };
 
   void searchTarget();
 
-  void setRange(float range){this->range = range;};
-  void setAngle(float angle){this->angle = angle;};
-  void setGroup(OM_LIST group){this->group = group;};
+  void setRange(float range) {this->range = range;};
+  void setAngle(float angle) {this->angle = angle;};
+  void setTargetGroup(OM_LIST group) { this->targetGroup = group; };
+  void setTargetGroupS(const std::string& grounName);
 
   void setSize(float size);
@@ -53,17 +55,21 @@
   virtual void draw() const;
 
- private:
-   Material*        material;             //!< a material for the Aim.
-   float            rotationSpeed;        //!< Speed of the Rotation.
-   tAnimation<Aim>* anim;
+private:
+  void init();
 
-   float            range;                //!<
-   float            angle;                //!<
-   Vector           diffVec;
-   OM_LIST          group;
 
-   PNode*           source;               //!< Where this Shot has come from.
+private:
+  Material         material;             //!< a material for the Aim.
+  float            rotationSpeed;        //!< Speed of the Rotation.
+  tAnimation<Aim>* anim;
 
-   Text*            text;                 //!< A Text to display onto this Node. (distance to Target)
+  float            range;                //!<
+  float            angle;                //!<
+  Vector           diffVec;
+  OM_LIST          targetGroup;
+
+  PNode*           source;               //!< Where this Shot has come from.
+
+  //   Text             text;                 //!< A Text to display onto this Node. (distance to Target)
 };
 
Index: trunk/src/world_entities/weapons/aiming_turret.cc
===================================================================
--- trunk/src/world_entities/weapons/aiming_turret.cc	(revision 9494)
+++ trunk/src/world_entities/weapons/aiming_turret.cc	(revision 9656)
@@ -38,5 +38,5 @@
 */
 AimingTurret::AimingTurret ()
-  : Weapon()
+    : Weapon(), target(this)
 {
   this->init();
@@ -46,4 +46,5 @@
 
 AimingTurret::AimingTurret(const TiXmlElement* root)
+    : target(this)
 {
   this->init();
@@ -58,5 +59,5 @@
 {
   // model will be deleted from WorldEntity-destructor
-//  delete this->target;
+  //  delete this->target;
 }
 
@@ -91,8 +92,8 @@
   //this->getProjectileFactory()->prepare(100);
 
-  this->target = new Aim(this);
-  this->target->setVisibility(false);
-  this->target->setRange(400);
-  this->target->setAngle(M_PI_2);
+  this->target.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT | PNODE_PROHIBIT_CHILD_DELETE);
+  this->target.setVisibility(false);
+  this->target.setRange(400);
+  this->target.setAngle(M_PI_2);
 
   this->setActionSound(WA_SHOOT, "sound/explosions/explosion_3.wav");
@@ -110,10 +111,10 @@
 void AimingTurret::activate()
 {
-  this->target->setVisibility(true);
+  this->target.setVisibility(true);
 }
 
 void AimingTurret::deactivate()
 {
-  this->target->setVisibility(false);
+  this->target.setVisibility(false);
 }
 
@@ -123,16 +124,18 @@
     return;
   Quaternion quat;
-  Vector direction = this->target->getAbsCoor() - this->getAbsCoor();
+  Vector direction = this->target.getAbsCoor() - this->getAbsCoor();
 
   direction.normalize();
 
   if (likely (this->getParent() != NULL))
-    quat = Quaternion(direction, this->getParent()->getAbsDir().apply(Vector(0,1,0))) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
+    //quat = Quaternion(direction, this->getParent()->getAbsDirY()) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
+    quat = Quaternion ( M_PI_2, this->getParent()->getAbsDirY()) * Quaternion::lookAt(this->getAbsCoor(), this->target.getAbsCoor(), this->getParent()->getAbsDirY());
   else
-    quat = Quaternion(direction, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
+    //quat = Quaternion(direction, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
+    quat = Quaternion ( M_PI_2, Vector(0,1,0)) * Quaternion::lookAt(this->getAbsCoor(), this->target.getAbsCoor(), Vector(0,1,0));
 
   this->setAbsDirSoft(quat, 5);
 
-  this->target->tick(dt);
+  this->target.tick(dt);
 }
 
@@ -143,6 +146,6 @@
     return;
 
-  pj->setVelocity(/*this->getVelocity()+*/(this->getAbsDir().apply(Vector(1,0,0))*250.0 + VECTOR_RAND(13)
-            /*target->getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity());
+  pj->setVelocity(/*this->getVelocity()+*/(this->getAbsDirX()*250.0 + VECTOR_RAND(4)
+                                          /*target.getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity());
 
   pj->setParent(PNode::getNullParent());
Index: trunk/src/world_entities/weapons/aiming_turret.h
===================================================================
--- trunk/src/world_entities/weapons/aiming_turret.h	(revision 9494)
+++ trunk/src/world_entities/weapons/aiming_turret.h	(revision 9656)
@@ -8,30 +8,33 @@
 
 #include "weapon.h"
-
+#include "aim.h"
 /* FORWARD DECLARATION */
-class Aim;
 
 class AimingTurret : public Weapon
-  {
-  public:
-    AimingTurret ();
-    AimingTurret(const TiXmlElement* root);
-    virtual ~AimingTurret ();
+{
+public:
+  AimingTurret ();
+  AimingTurret(const TiXmlElement* root);
+  virtual ~AimingTurret ();
 
-    void init();
-    virtual void loadParams(const TiXmlElement* root);
+  virtual void loadParams(const TiXmlElement* root);
 
-    virtual void activate();
-    virtual void deactivate();
+  void setTargetGroup(OM_LIST targetGroup) { this->target.setTargetGroup(targetGroup); };
 
-    virtual void tick(float dt);
-    virtual void fire();
+  virtual void activate();
+  virtual void deactivate();
+
+  virtual void tick(float dt);
+  virtual void fire();
 
 
-    virtual void draw() const;
+  virtual void draw() const;
 
-  private:
-    Aim*          target;
-  };
+private:
+  void init();
+
+private:
+  Aim           target;
+};
 
 #endif /* _AIMING_TURRET_H */
Index: trunk/src/world_entities/weapons/laser_cannon.cc
===================================================================
--- trunk/src/world_entities/weapons/laser_cannon.cc	(revision 9494)
+++ trunk/src/world_entities/weapons/laser_cannon.cc	(revision 9656)
@@ -121,4 +121,7 @@
     return;
 
+  // make this to let the onKill(...) fuction get the stuff
+  pj->setOwner(this->getOwner());
+
   pj->setParent(PNode::getNullParent());
 
Index: trunk/src/world_entities/weapons/targeting_turret.cc
===================================================================
--- trunk/src/world_entities/weapons/targeting_turret.cc	(revision 9494)
+++ trunk/src/world_entities/weapons/targeting_turret.cc	(revision 9656)
@@ -17,7 +17,5 @@
 #include "targeting_turret.h"
 
-#include "weapon_manager.h"
-#include "aim.h"
-#include "world_entities/projectiles/projectile.h"
+#include "projectiles/projectile.h"
 
 #include "model.h"
@@ -25,4 +23,5 @@
 #include "animation3d.h"
 
+#include "util/loading/load_param.h"
 #include "util/loading/factory.h"
 
@@ -30,20 +29,6 @@
 
 
-
-
-/**
- *  standard constructor
-
-   creates a new weapon
-*/
-TargetingTurret::TargetingTurret ()
-  : Weapon()
-{
-  this->init();
-
-}
-
-
 TargetingTurret::TargetingTurret(const TiXmlElement* root)
+  : target(this)
 {
   this->init();
@@ -91,9 +76,9 @@
   //this->getProjectileFactory()->prepare(100);
 
-  this->target = new Aim(this);
-  this->target->setVisibility(false);
-  this->target->setRange(1000);
-  this->target->setAngle(M_PI_4);
-  this->lockedTarget = this->target;
+  this->target.setVisibility(false);
+  this->target.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT | PNODE_PROHIBIT_CHILD_DELETE);
+  this->target.setRange(1000);
+  this->target.setAngle(M_PI_4);
+  this->lockedTarget = &this->target;
 
   this->lockedTime = 0;
@@ -112,4 +97,6 @@
   Weapon::loadParams(root);
 
+  LoadParam(root, "target-group", &target, Aim, setTargetGroupS);
+
 }
 
@@ -122,5 +109,5 @@
 void TargetingTurret::deactivate()
 {
-  this->target->setVisibility(false);
+  this->target.setVisibility(false);
 }
 
@@ -130,13 +117,14 @@
     return;
 
+  this->target.tick(dt);
+
   if( lockedTime >= neededLockTime )
    {
-    lockedTarget = this->target->getParent();
+    lockedTarget = this->target.getParent();
     lockedTime = 0;
    }
 
-  this->target->tick(dt);
 
-  if(this->target->getParent() == PNode::getNullParent())
+  if(this->target.getParent() == PNode::getNullParent())
    lockedTime = 0;
   else
@@ -159,5 +147,4 @@
   pj->setAbsDir(this->getAbsDir());
   pj->activate();
-
 }
 
Index: trunk/src/world_entities/weapons/targeting_turret.h
===================================================================
--- trunk/src/world_entities/weapons/targeting_turret.h	(revision 9494)
+++ trunk/src/world_entities/weapons/targeting_turret.h	(revision 9656)
@@ -8,32 +8,34 @@
 
 #include "weapon.h"
-
-/* FORWARD DECLARATION */
-class Aim;
+#include "aim.h"
 
 class TargetingTurret : public Weapon
-  {
-  public:
-    TargetingTurret ();
-    TargetingTurret(const TiXmlElement* root);
-    virtual ~TargetingTurret ();
+{
+public:
+  TargetingTurret(const TiXmlElement* root = NULL);
+  virtual ~TargetingTurret ();
 
-    void init();
-    virtual void loadParams(const TiXmlElement* root);
+  virtual void loadParams(const TiXmlElement* root);
 
-    virtual void activate();
-    virtual void deactivate();
+  virtual void activate();
+  virtual void deactivate();
 
-    virtual void tick(float dt);
-    virtual void fire();
+  virtual void tick(float dt);
+  virtual void fire();
 
-    virtual void draw() const;
+  virtual void draw() const;
 
-  private:
-    Aim*           target;
-    PNode*         lockedTarget;
-    float          lockedTime;
-    float          neededLockTime;
-  };
+  void setTargetGroup(OM_LIST targetGroup) { this->target.setTargetGroup(targetGroup); };
+  const PNode* getLockedTarget() const { return lockedTarget; };
+
+private:
+  void init();
+
+private:
+  Aim            target;
+  PNode*         lockedTarget;
+  float          lockedTime;
+  float          neededLockTime;
+};
 
 #endif /* _TARGETING_TURRET_H */
Index: trunk/src/world_entities/weapons/test_gun.cc
===================================================================
--- trunk/src/world_entities/weapons/test_gun.cc	(revision 9494)
+++ trunk/src/world_entities/weapons/test_gun.cc	(revision 9656)
@@ -177,4 +177,7 @@
   if (pj == NULL)
     return;
+
+  // set the owner
+  pj->setOwner(this->getOwner());
 
   pj->setParent(PNode::getNullParent());
Index: trunk/src/world_entities/world_entity.cc
===================================================================
--- trunk/src/world_entities/world_entity.cc	(revision 9494)
+++ trunk/src/world_entities/world_entity.cc	(revision 9656)
@@ -28,5 +28,4 @@
 #include "util/loading/resource_manager.h"
 #include "util/loading/load_param.h"
-#include "vector.h"
 #include "obb_tree.h"
 
@@ -86,11 +85,11 @@
   this->toList(OM_NULL);
 
-  registerVar( new SynchronizeableString( &this->md2TextureFileName, &this->md2TextureFileName, "md2TextureFileName" ) );
-  modelFileName_handle = registerVarId( new SynchronizeableString( &modelFileName, &modelFileName, "modelFileName" ) );
-  scaling_handle = registerVarId( new SynchronizeableFloat( &scaling, &scaling, "scaling" ) );
-  list_handle = registerVarId( new SynchronizeableInt( (int*)&objectListNumber, &list_write, "list" ) );
-
-  health_handle = registerVarId( new SynchronizeableFloat( &this->health, &this->health_write, "health" ) );
-  healthMax_handle = registerVarId( new SynchronizeableFloat( &this->healthMax, &this->healthMax_write, "maxHealth" ) );
+  registerVar( new SynchronizeableString( &this->md2TextureFileName, &this->md2TextureFileName, "md2TextureFileName", PERMISSION_MASTER_SERVER ) );
+  modelFileName_handle = registerVarId( new SynchronizeableString( &modelFileName, &modelFileName, "modelFileName", PERMISSION_MASTER_SERVER ) );
+  scaling_handle = registerVarId( new SynchronizeableFloat( &scaling, &scaling, "scaling", PERMISSION_MASTER_SERVER ) );
+  list_handle = registerVarId( new SynchronizeableInt( (int*)&objectListNumber, &list_write, "list", PERMISSION_MASTER_SERVER ) );
+
+  health_handle = registerVarId( new SynchronizeableFloat( &this->health, &this->health_write, "health", PERMISSION_MASTER_SERVER ) );
+  healthMax_handle = registerVarId( new SynchronizeableFloat( &this->healthMax, &this->healthMax_write, "maxHealth", PERMISSION_MASTER_SERVER ) );
 }
 
@@ -141,4 +140,6 @@
   .describe("The Health the WorldEntity has at this moment")
   .defaultValues(1.0f);
+
+  LoadParam(root, "list", this, WorldEntity, toListS);
 }
 
@@ -478,4 +479,14 @@
 }
 
+void WorldEntity::toListS(const std::string& listName)
+{
+  OM_LIST id = ObjectManager::StringToOMList(listName);
+  if (id != OM_NULL)
+    this->toList(id);
+  else
+    PRINTF(2)("List %s not found\n", listName.c_str());
+}
+
+
 void WorldEntity::toReflectionList()
 {
@@ -822,5 +833,5 @@
   PRINT(0)("WorldEntity %s::%s  (DEBUG)\n", this->getClassCName(), this->getCName());
   this->debugNode();
-  PRINT(0)("List: %s ; ModelCount %d - ", ObjectManager::OMListToString(this->objectListNumber) , this->models.size());
+  PRINT(0)("List: %s ; ModelCount %d - ", ObjectManager::OMListToString(this->objectListNumber).c_str(), this->models.size());
   for (unsigned int i = 0; i < this->models.size(); i++)
   {
Index: trunk/src/world_entities/world_entity.h
===================================================================
--- trunk/src/world_entities/world_entity.h	(revision 9494)
+++ trunk/src/world_entities/world_entity.h	(revision 9656)
@@ -115,4 +115,5 @@
   /* --- Object Manager Block --- */
   void toList(OM_LIST list);
+  void toListS(const std::string& listName);
 
   void toReflectionList();
