Index: branches/network/src/lib/network/network_game_manager.cc
===================================================================
--- branches/network/src/lib/network/network_game_manager.cc	(revision 8151)
+++ branches/network/src/lib/network/network_game_manager.cc	(revision 8152)
@@ -170,4 +170,6 @@
     }
   }
+  
+  return true;
 }
 
@@ -210,4 +212,6 @@
   
   NetworkGameManager::getInstance()->setPreferedTeam( userId, teamId );
+  
+  return true;
 }
 
@@ -220,5 +224,4 @@
   
   stats.setPreferedTeamId( teamId );
-  
 }
 
Index: branches/network/src/world_entities/spectator.cc
===================================================================
--- branches/network/src/world_entities/spectator.cc	(revision 8151)
+++ branches/network/src/world_entities/spectator.cc	(revision 8152)
@@ -23,5 +23,5 @@
 CREATE_FACTORY(Spectator, CL_SPECTATOR);
 
-
+#if 0
 /**
  * constructor
@@ -35,7 +35,4 @@
   bool                  bForward;
   bool                  bBackward;
-    
-  float                 xMouse;             //!< mouse moved in x-Direction
-  float                 yMouse;             //!< mouse moved in y-Direction
 
   this->bLeft = false;
@@ -45,5 +42,11 @@
   this->xMouse = 0.0f;
   this->yMouse = 0.0f;
-    
+  
+  registerVar( new SynchronizeableBool( &bLeft, &bLeft, "bLeft", PERMISSION_OWNER ) );
+  registerVar( new SynchronizeableBool( &bRight, &bRight, "bRight", PERMISSION_OWNER ) );
+  registerVar( new SynchronizeableBool( &bForward, &bForward, "bForward", PERMISSION_OWNER ) );
+  registerVar( new SynchronizeableBool( &bBackward, &bBackward, "bBackward", PERMISSION_OWNER ) );
+  registerVar( new SynchronizeableQuaternion( &mouseDir, &mouseDir, "mouseDir", PERMISSION_OWNER ) );
+  
   registerEvent(KeyMapper::PEV_FORWARD);
   registerEvent(KeyMapper::PEV_BACKWARD);
@@ -52,10 +55,4 @@
   registerEvent(KeyMapper::PEV_FIRE1);
   registerEvent(EV_MOUSE_MOTION);
-  
-  registerVar( new SynchronizeableBool( &bLeft, &bLeft, "bLeft", PERMISSION_OWNER ) );
-  registerVar( new SynchronizeableBool( &bRight, &bRight, "bRight", PERMISSION_OWNER ) );
-  registerVar( new SynchronizeableBool( &bForward, &bForward, "bForward", PERMISSION_OWNER ) );
-  registerVar( new SynchronizeableBool( &bBackward, &bBackward, "bBackward", PERMISSION_OWNER ) );
-  registerVar( new SynchronizeableQuaternion( &mouseDir, &mouseDir, "mouseDir", PERMISSION_OWNER ) );
 }
 
@@ -165,2 +162,264 @@
   }
 }
+#endif
+
+
+#include "executor/executor.h"
+
+#include "util/loading/resource_manager.h"
+
+#include "weapons/test_gun.h"
+#include "weapons/turret.h"
+#include "weapons/cannon.h"
+
+#include "dot_emitter.h"
+#include "sprite_particles.h"
+
+#include "util/loading/factory.h"
+#include "key_mapper.h"
+
+#include "network_game_manager.h"
+
+#include "power_ups/weapon_power_up.h"
+#include "power_ups/param_power_up.h"
+
+#include "graphics_engine.h"
+
+#include "plane.h"
+
+#include "state.h"
+#include "player.h"
+
+#include "util/loading/load_param.h"
+
+
+using namespace std;
+
+
+/**
+ *  destructs the spaceship, deletes alocated memory
+ */
+Spectator::~Spectator ()
+{
+  this->setPlayer(NULL);
+}
+
+/**
+ * loads a Spaceships information from a specified file.
+ * @param fileName the name of the File to load the spaceship from (absolute path)
+ */
+Spectator::Spectator(const std::string& fileName)
+{
+  this->init();
+  TiXmlDocument doc(fileName);
+
+  if(!doc.LoadFile())
+  {
+    PRINTF(2)("Loading file %s failed for spaceship.\n", fileName.c_str());
+    return;
+  }
+
+  this->loadParams(doc.RootElement());
+}
+
+/**
+ *  creates a new Spaceship from Xml Data
+ * @param root the xml element containing spaceship data
+
+   @todo add more parameters to load
+ */
+Spectator::Spectator(const TiXmlElement* root)
+{
+  this->init();
+  if (root != NULL)
+    this->loadParams(root);
+
+}
+
+
+/**
+ * initializes a Spaceship
+ */
+void Spectator::init()
+{
+//  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
+  this->setClassID(CL_SPECTATOR, "Spectator");
+
+  PRINTF(4)("SPACESHIP INIT\n");
+
+
+  this->getWeaponManager().changeWeaponConfig(1);
+
+  this->bLeft = false;
+  this->bRight = false;
+  this->bForward = false;
+  this->bBackward = false;
+  this->xMouse = 0.0f;
+  this->yMouse = 0.0f;
+
+  this->setHealthMax(100);
+  this->setHealth(80);
+
+  this->mouseDir = this->getAbsDir();
+
+  //add events to the eventlist
+  registerEvent(KeyMapper::PEV_FORWARD);
+  registerEvent(KeyMapper::PEV_BACKWARD);
+  registerEvent(KeyMapper::PEV_LEFT);
+  registerEvent(KeyMapper::PEV_RIGHT);
+  registerEvent(KeyMapper::PEV_FIRE1);
+  registerEvent(EV_MOUSE_MOTION);
+
+  this->getWeaponManager().setSlotCount(0);
+
+  this->getWeaponManager().getFixedTarget()->setParent(this);
+  this->getWeaponManager().getFixedTarget()->setRelCoor(100000,0,0);
+
+  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
+
+ 
+  registerVar( new SynchronizeableBool( &bLeft, &bLeft, "bLeft", PERMISSION_OWNER ) );
+  registerVar( new SynchronizeableBool( &bRight, &bRight, "bRight", PERMISSION_OWNER ) );
+  registerVar( new SynchronizeableBool( &bForward, &bForward, "bForward", PERMISSION_OWNER ) );
+  registerVar( new SynchronizeableBool( &bBackward, &bBackward, "bBackward", PERMISSION_OWNER ) );
+  registerVar( new SynchronizeableQuaternion( &mouseDir, &mouseDir, "mouseDir", PERMISSION_OWNER ) );
+}
+
+
+/**
+ * loads the Settings of a Spectator from an XML-element.
+ * @param root the XML-element to load the Spaceship's properties from
+ */
+void Spectator::loadParams(const TiXmlElement* root)
+{
+  Playable::loadParams(root);
+}
+
+void Spectator::setPlayDirection(const Quaternion& quat, float speed)
+{
+  this->mouseDir = quat;
+  this->angleY = quat.getHeading();
+  this->angleX = quat.getAttitude();
+}
+
+
+void Spectator::reset()
+{
+  this->bLeft = false;
+  this->bRight = false;
+  this->bForward = false;
+  this->bBackward = false;
+  this->xMouse = 0.0f;
+  this->yMouse = 0.0f;
+
+  this->setHealth(80);
+}
+
+
+void Spectator::enter()
+{
+  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( true);
+  this->attachCamera();
+}
+
+void Spectator::leave()
+{
+  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
+  this->detachCamera();
+}
+
+
+/**
+ *  this function is called, when two entities collide
+ * @param entity: the world entity with whom it collides
+ *
+ * Implement behaviour like damage application or other miscellaneous collision stuff in this function
+ * @todo dont let Spectator fly through walls
+ */
+void Spectator::collidesWith(WorldEntity* entity, const Vector& location)
+{
+}
+
+
+
+/**
+ *  the function called for each passing timeSnap
+ * @param time The timespan passed since last update
+ */
+void Spectator::tick (float time)
+{
+  Playable::tick( time );
+  
+  if( ( xMouse != 0 || yMouse != 0 ) && this->getOwner() == this->getHostID() )
+  {
+    xMouse *= time / 10;
+    yMouse *= time / 10;
+    
+    angleX -= xMouse;
+    angleY -= yMouse;
+    
+    if ( angleY > 2.05 )
+      angleY = 2.05;
+    
+    if ( angleY < -1.15 )
+      angleY = -1.15;
+    
+    this->mouseDir = Quaternion( angleX, Vector( 0, 1, 0 ) ) * Quaternion( angleY, Vector( 0, 0, 1 ) );
+    
+    xMouse = yMouse = 0;
+  }
+  
+  this->setAbsDir( this->mouseDir );
+  
+  Vector velocity;
+  
+  if ( this->bForward )
+  {
+    velocity += this->getAbsDirX();
+  }
+  
+  if ( this->bBackward )
+  {
+    velocity -= this->getAbsDirX();
+  }
+  
+  if ( this->bRight )
+  {
+    velocity += this->getAbsDirZ();
+  }
+  
+  if ( this->bLeft )
+  {
+    velocity -= this->getAbsDirZ();
+  }
+  
+  velocity *= 100;
+  
+  this->shiftCoor( velocity*time );
+}
+
+/**
+ * @todo switch statement ??
+ */
+void Spectator::process(const Event &event)
+{
+  Playable::process(event);
+
+  if( event.type == KeyMapper::PEV_LEFT)
+    this->bLeft = event.bPressed;
+  else if( event.type == KeyMapper::PEV_RIGHT)
+    this->bRight = event.bPressed;
+  else if( event.type == KeyMapper::PEV_FORWARD)
+    this->bForward = event.bPressed; //this->shiftCoor(0,.1,0);
+  else if( event.type == KeyMapper::PEV_BACKWARD)
+    this->bBackward = event.bPressed; //this->shiftCoor(0,-.1,0);
+  else if( event.type == EV_MOUSE_MOTION)
+  {
+    this->xMouse += event.xRel;
+    this->yMouse += event.yRel;
+  }
+}
+
+
+
+
Index: branches/network/src/world_entities/spectator.h
===================================================================
--- branches/network/src/world_entities/spectator.h	(revision 8151)
+++ branches/network/src/world_entities/spectator.h	(revision 8152)
@@ -9,4 +9,5 @@
 #include "playable.h"
 
+#if 0
 class Spectator : public Playable
 {
@@ -40,4 +41,51 @@
     float                 angleY;
 };
+#endif 
+
+class Vector;
+class Event;
+class ParticleEmitter;
+class ParticleSystem;
+
+class Spectator : public Playable
+{
+
+  public:
+    Spectator(const std::string& fileName);
+    Spectator(const TiXmlElement* root = NULL);
+    virtual ~Spectator();
+
+    virtual void loadParams(const TiXmlElement* root);
+
+    virtual void setPlayDirection(const Quaternion& rot, float speed = 0.0f);
+
+    virtual void enter();
+    virtual void leave();
+
+    virtual void reset();
+
+    virtual void collidesWith(WorldEntity* entity, const Vector& location);
+    virtual void tick(float time);
+
+    virtual void process(const Event &event);
+
+  private:
+    void init();
+
+    bool                  bLeft;
+    bool                  bRight;
+    bool                  bForward;
+    bool                  bBackward;
+    
+    float                 xMouse;             //!< mouse moved in x-Direction
+    float                 yMouse;             //!< mouse moved in y-Direction
+    Quaternion            mouseDir;           //!< the direction where the player wants to fly
+
+    //Quaternion            rotY;
+    //Quaternion            rotAxis;
+    float                 angleX;
+    float                 angleY;
+
+};
 
 #endif
