Index: code/trunk/src/orxonox/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/CMakeLists.txt	(revision 1227)
+++ code/trunk/src/orxonox/CMakeLists.txt	(revision 1293)
@@ -16,4 +16,5 @@
   objects/Ambient.cc
   objects/Camera.cc
+  objects/CameraHandler.cc
   objects/Explosion.cc
   objects/Model.cc
@@ -42,4 +43,23 @@
 ADD_EXECUTABLE( orxonox ${ORXONOX_SRC_FILES} )
 
+IF(NETWORKTRAFFIC_TESTING_ENABLED)
+
+  SET( ORXONOXS_SRC_FILES
+    GraphicsEngine.cc
+    objects/Ambient.cc
+    objects/Camera.cc
+    objects/CameraHandler.cc
+    objects/Explosion.cc
+    objects/Model.cc
+    objects/NPC.cc
+    objects/Projectile.cc
+    objects/Skybox.cc
+    objects/SpaceShip.cc
+    objects/WorldEntity.cc
+  )
+
+  ADD_LIBRARY(orxonoxs SHARED ${ORXONOX_SRC_FILES})
+ENDIF(NETWORKTRAFFIC_TESTING_ENABLED)
+
 TARGET_LINK_LIBRARIES( orxonox
   ${OGRE_LIBRARIES}
Index: code/trunk/src/orxonox/GraphicsEngine.cc
===================================================================
--- code/trunk/src/orxonox/GraphicsEngine.cc	(revision 1227)
+++ code/trunk/src/orxonox/GraphicsEngine.cc	(revision 1293)
@@ -9,6 +9,6 @@
  *   modify it under the terms of the GNU General Public License
  *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
+ *   of the License, or (atl your option) any later version.
+ *lo
  *   This program is distributed in the hope that it will be useful,
  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -44,5 +44,5 @@
 #include "core/ConfigValueIncludes.h"
 #include "core/Debug.h"
-#include "core/TclBind.h"
+#include "core/CommandExecutor.h"
 
 
@@ -53,5 +53,5 @@
     @return The only instance of GraphicsEngine.
   */
-  GraphicsEngine& GraphicsEngine::getSingleton()
+  /*static*/ GraphicsEngine& GraphicsEngine::getSingleton()
   {
     static GraphicsEngine theOnlyInstance;
@@ -62,15 +62,25 @@
     @brief Only use constructor to initialise variables and pointers!
   */
-  GraphicsEngine::GraphicsEngine()
+  GraphicsEngine::GraphicsEngine() :
+    root_(0),
+    scene_(0),
+    renderWindow_(0),
+    //configPath_(""),
+    dataPath_(""),
+    ogreLogfile_("")
   {
     RegisterObject(GraphicsEngine);
-    //this->bOverwritePath_ = false;
+
     this->setConfigValues();
-    // set to standard values
-    this->configPath_ = "";
-    this->root_ = 0;
-    this->scene_ = 0;
-    this->renderWindow_ = 0;
-    COUT(4) << "*** GraphicsEngine: Constructed" << std::endl;
+    CCOUT(4) << "Constructed" << std::endl;
+  }
+
+  void GraphicsEngine::setConfigValues()
+  {
+    SetConfigValue(dataPath_, "../../Media/").description("relative path to media data");
+    SetConfigValue(ogreLogfile_, "ogre.log").description("Logfile for messages from Ogre. Use \"\" to suppress log file creation.");
+    SetConfigValue(ogreLogLevelTrivial_ , 5).description("Corresponding orxonox debug level for ogre Trivial");
+    SetConfigValue(ogreLogLevelNormal_  , 4).description("Corresponding orxonox debug level for ogre Normal");
+    SetConfigValue(ogreLogLevelCritical_, 2).description("Corresponding orxonox debug level for ogre Critical");
   }
 
@@ -89,5 +99,5 @@
   void GraphicsEngine::destroy()
   {
-    COUT(4) << "*** GraphicsEngine: Destroying objects..." << std::endl;
+    CCOUT(4) << "Destroying objects..." << std::endl;
     Ogre::WindowEventUtilities::removeWindowEventListener(this->renderWindow_, this);
     if (this->root_)
@@ -103,16 +113,5 @@
       delete Ogre::LogManager::getSingletonPtr();
     }
-    COUT(4) << "*** GraphicsEngine: Destroying objects done" << std::endl;
-  }
-
-  void GraphicsEngine::setConfigValues()
-  {
-    SetConfigValue(dataPath_, "../../Media/").description("relative path to media data");
-    SetConfigValue(ogreLogfile_, "ogre.log").description("Logfile for messages from Ogre. Use \"\" to suppress log file creation.");
-    SetConfigValue(ogreLogLevelTrivial_ , 5).description("Corresponding orxonox debug level for ogre Trivial");
-    SetConfigValue(ogreLogLevelNormal_  , 4).description("Corresponding orxonox debug level for ogre Normal");
-    SetConfigValue(ogreLogLevelCritical_, 2).description("Corresponding orxonox debug level for ogre Critical");
-
-    TclBind::getInstance().setDataPath(this->dataPath_);
+    CCOUT(4) << "Destroying objects done" << std::endl;
   }
 
@@ -120,13 +119,16 @@
     @brief Creates the Ogre Root object and sets up the ogre log.
   */
-  void GraphicsEngine::setup()
-  {
+  bool GraphicsEngine::setup(std::string& dataPath)
+  {
+    CCOUT(3) << "Setting up..." << std::endl;
+    // temporary overwrite of dataPath, change ini file for permanent change
+    if (dataPath != "")
+      dataPath_ = dataPath;
+    if (dataPath_ == "")
+      return false;
+    if (dataPath_[dataPath_.size() - 1] != '/')
+      dataPath_ += "/";
+
     //TODO: Check if file exists (maybe not here)
-/*#ifndef OGRE_STATIC_LIB
-    root_ = new Ogre::Root(configPath_ + "plugins.cfg", configPath_ + "ogre.cfg",
-                     configPath_ + "Ogre.log");
-#else
-    root_ = new Ogre::Root(NULL, configPath_ + "ogre.cfg", configPath_ + "Ogre.log");
-#endif*/
 #if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC && defined(_DEBUG)
     std::string plugin_filename = "plugins_d.cfg";
@@ -135,11 +137,9 @@
 #endif
 
-    // create a logManager
-    Ogre::LogManager *logger;
-		if (Ogre::LogManager::getSingletonPtr() == 0)
-			logger = new Ogre::LogManager();
-    else
-      logger = Ogre::LogManager::getSingletonPtr();
-    COUT(4) << "*** GraphicsEngine: Ogre LogManager created/assigned" << std::endl;
+/*    // create a logManager
+    // note: If there's already a logManager, Ogre will complain by a failed assertation.
+    // but that shouldn't happen, since this is the first time to create a logManager..
+    Ogre::LogManager* logger = new Ogre::LogManager();
+    CCOUT(4) << "Ogre LogManager created" << std::endl;
 
     // create our own log that we can listen to
@@ -148,56 +148,30 @@
       myLog = logger->createLog("ogre.log", true, false, true);
     else
-      myLog = logger->createLog(this->ogreLogfile_, true, false, false);
-    COUT(4) << "*** GraphicsEngine: Ogre Log created" << std::endl;
+          myLog = logger->createLog(this->ogreLogfile_, true, false, false);
+    CCOUT(4) << "Ogre Log created" << std::endl;
 
     myLog->setLogDetail(Ogre::LL_BOREME);
-    myLog->addListener(this);
+    myLog->addListener(this);*/
 
     // Root will detect that we've already created a Log
-    COUT(4) << "*** GraphicsEngine: Creating Ogre Root..." << std::endl;
+    CCOUT(4) << "Creating Ogre Root..." << std::endl;
     root_ = new Ogre::Root(plugin_filename);
-    COUT(4) << "*** GraphicsEngine: Creating Ogre Root done" << std::endl;
-  }
-
-  /**
-   * @return scene manager
-   */
-  Ogre::SceneManager* GraphicsEngine::getSceneManager()
-  {
-    if(!scene_)
-    {
-      scene_ = root_->createSceneManager(Ogre::ST_GENERIC, "Default SceneManager");
-      COUT(3) << "Info: Created SceneMan: " << scene_ << std::endl;
-    }
-    return scene_;
-  }
-
-  bool GraphicsEngine::load(std::string dataPath)
-  {
-    // temporary overwrite of dataPath, change ini file for permanent change
-    if( dataPath != "" )
-      dataPath_ = dataPath + "/";
-    loadRessourceLocations(this->dataPath_);
-    if (!root_->restoreConfig() && !root_->showConfigDialog())
-      return false;
+    CCOUT(4) << "Creating Ogre Root done" << std::endl;
+
+    // specify where Ogre has to look for resources. This call doesn't parse anything yet!
+    declareRessourceLocations();
+
+    CCOUT(3) << "Set up done." << std::endl;
     return true;
   }
 
-  void GraphicsEngine::initialise()
-  {
-    this->renderWindow_ = root_->initialise(true, "OrxonoxV2");
-    Ogre::WindowEventUtilities::addWindowEventListener(this->renderWindow_, this);
-    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
-    //TODO: Do NOT load all the groups, why are we doing that? And do we really do that? initialise != load...
-    Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
-  }
-
-  void GraphicsEngine::loadRessourceLocations(std::string dataPath)
-  {
+  void GraphicsEngine::declareRessourceLocations()
+  {
+    CCOUT(4) << "Declaring Resources" << std::endl;
     //TODO: Specify layout of data file and maybe use xml-loader
     //TODO: Work with ressource groups (should be generated by a special loader)
     // Load resource paths from data file using configfile ressource type
     Ogre::ConfigFile cf;
-    cf.load(dataPath + "resources.cfg");
+    cf.load(dataPath_ + "resources.cfg");
 
     // Go through all sections & settings in the file
@@ -216,8 +190,64 @@
 
         Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
-                                           std::string(dataPath + archName),
+                                           std::string(dataPath_ + archName),
                                            typeName, secName);
       }
     }
+  }
+
+  bool GraphicsEngine::loadRenderer()
+  {
+    CCOUT(4) << "Configuring Renderer" << std::endl;
+    if (!root_->restoreConfig() && !root_->showConfigDialog())
+      return false;
+
+    CCOUT(4) << "Creating render window" << std::endl;
+    this->renderWindow_ = root_->initialise(true, "OrxonoxV2");
+    if (!root_->isInitialised())
+    {
+      CCOUT(2) << "Error: Creating Ogre root object failed" << std::endl;
+      return false;
+    }
+    Ogre::WindowEventUtilities::addWindowEventListener(this->renderWindow_, this);
+    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
+    return true;
+  }
+
+  bool GraphicsEngine::initialiseResources()
+  {
+    CCOUT(4) << "Initialising resources" << std::endl;
+    //TODO: Do NOT load all the groups, why are we doing that? And do we really do that? initialise != load...
+    try
+    {
+      Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+      /*Ogre::StringVector str = Ogre::ResourceGroupManager::getSingleton().getResourceGroups();
+      for (unsigned int i = 0; i < str.size(); i++)
+      {
+        Ogre::ResourceGroupManager::getSingleton().loadResourceGroup(str[i]);
+      }*/
+    }
+    catch (Ogre::Exception e)
+    {
+      CCOUT(2) << "Error: There was an Error when initialising the resources." << std::endl;
+      CCOUT(2) << "ErrorMessage: " << e.getFullDescription() << std::endl;
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * @brief Creates the SceneManager
+   */
+  bool GraphicsEngine::createNewScene()
+  {
+    CCOUT(4) << "Creating new SceneManager" << std::endl;
+    if (scene_)
+    {
+      CCOUT(2) << "SceneManager already exists! Skipping." << std::endl;
+      return false;
+    }
+    scene_ = root_->createSceneManager(Ogre::ST_GENERIC, "Default SceneManager");
+    CCOUT(3) << "Created SceneManager: " << scene_ << std::endl;
+    return true;
   }
 
@@ -291,23 +321,47 @@
     }
     OutputHandler::getOutStream().setOutputLevel(orxonoxLevel)
-        << "*** Ogre: " << message << std::endl;
-  }
-
-    void GraphicsEngine::windowMoved(Ogre::RenderWindow *rw){
-        int w = rw->getWidth();
-        int h = rw->getHeight();
-        InputManager::setWindowExtents(w, h);
-    }
-
-    void GraphicsEngine::windowResized(Ogre::RenderWindow *rw){
-        int w = rw->getWidth();
-        int h = rw->getHeight();
-        InputManager::setWindowExtents(w, h);
-    }
-
-    void GraphicsEngine::windowFocusChanged(Ogre::RenderWindow *rw){
-        int w = rw->getWidth();
-        int h = rw->getHeight();
-        InputManager::setWindowExtents(w, h);
-    }
+        << "Ogre: " << message << std::endl;
+  }
+
+  /**
+  * Window has resized.
+  * @param rw The render window it occured in
+  */
+  void GraphicsEngine::windowMoved(Ogre::RenderWindow *rw)
+  {
+    // note: this doesn't change the window extents
+  }
+
+  /**
+  * Window has resized.
+  * @param rw The render window it occured in
+  * @note GraphicsEngine has a render window stored itself. This is the same
+  *       as rw. But we have to be careful when using multiple render windows!
+  */
+  void GraphicsEngine::windowResized(Ogre::RenderWindow *rw)
+  {
+    // change the mouse clipping size for absolute mouse movements
+    int w = rw->getWidth();
+    int h = rw->getHeight();
+    InputManager::setWindowExtents(w, h);
+  }
+
+  /**
+  * Window has resized.
+  * @param rw The render window it occured in
+  */
+  void GraphicsEngine::windowFocusChanged(Ogre::RenderWindow *rw)
+  {
+    // note: this doesn't change the window extents
+  }
+
+  /**
+  * Window has resized.
+  * @param rw The render window it occured in
+  */
+  void GraphicsEngine::windowClosed(Ogre::RenderWindow *rw)
+  {
+    // using CommandExecutor in order to avoid depending on Orxonox class.
+    CommandExecutor::execute("exit", false);
+  }
 }
Index: code/trunk/src/orxonox/GraphicsEngine.h
===================================================================
--- code/trunk/src/orxonox/GraphicsEngine.h	(revision 1227)
+++ code/trunk/src/orxonox/GraphicsEngine.h	(revision 1293)
@@ -52,16 +52,18 @@
     @brief Graphics engine manager class
     */
-    class _OrxonoxExport GraphicsEngine : public Ogre::WindowEventListener, public OrxonoxClass, public Ogre::LogListener
+    class _OrxonoxExport GraphicsEngine : public Ogre::WindowEventListener, public Ogre::LogListener, public OrxonoxClass
     {
-        friend class ClassIdentifier<GraphicsEngine>;
         public:
-            void setConfigPath(std::string path) { this->configPath_ = path; };
             void setConfigValues();
-            void setup();
-            bool load(std::string path);
-            void loadRessourceLocations(std::string path);
-            Ogre::SceneManager* getSceneManager();
-            void initialise();
+            bool setup(std::string& dataPath);
+            void declareRessourceLocations();
+            bool loadRenderer();
+            bool initialiseResources();
+            bool createNewScene();
+
             void destroy();
+
+            Ogre::SceneManager* getSceneManager() { return scene_; }
+            std::string& getDataPath() { return dataPath_; }
 
             // several window properties
@@ -71,10 +73,11 @@
             int getWindowHeight() const;
 
+            void windowMoved       (Ogre::RenderWindow* rw);
+            void windowResized     (Ogre::RenderWindow* rw);
+            void windowFocusChanged(Ogre::RenderWindow* rw);
+            void windowClosed      (Ogre::RenderWindow* rw);
+
             static GraphicsEngine& getSingleton();
             static GraphicsEngine* getSingletonPtr() { return &getSingleton(); }
-
-            void windowMoved(Ogre::RenderWindow* rw);
-            void windowResized(Ogre::RenderWindow* rw);
-            void windowFocusChanged(Ogre::RenderWindow* rw);
 
         private:
@@ -92,5 +95,5 @@
             Ogre::RenderWindow* renderWindow_;//!< the current render window
             //bool               bOverwritePath_; //!< overwrites path
-            std::string         configPath_;  //!< path to config file
+            //std::string         configPath_;  //!< path to config file
             std::string         dataPath_;    //!< path to data file
             std::string         ogreLogfile_; //!< log file name for Ogre log messages
Index: code/trunk/src/orxonox/Main.cc
===================================================================
--- code/trunk/src/orxonox/Main.cc	(revision 1227)
+++ code/trunk/src/orxonox/Main.cc	(revision 1293)
@@ -78,11 +78,13 @@
     Orxonox* orx = Orxonox::getSingleton();
 
+    bool res = false;
 #if ORXONOX_PLATFORM == ORXONOX_PLATFORM_APPLE
-    orx->init(argc, argv, macBundlePath());
+    res = orx->init(argc, argv, macBundlePath());
 #else
-    orx->init(argc, argv, "");
+    res = orx->init(argc, argv, "");
 #endif
 
-    orx->start();
+    if (res)
+      orx->start();
     orx->destroySingleton();
   /*}
Index: code/trunk/src/orxonox/Orxonox.cc
===================================================================
--- code/trunk/src/orxonox/Orxonox.cc	(revision 1227)
+++ code/trunk/src/orxonox/Orxonox.cc	(revision 1293)
@@ -37,10 +37,7 @@
 
 //****** STD *******
-//#include <iostream>
-//#include <exception>
 #include <deque>
 
 //****** OGRE ******
-//#include <OgreException.h>
 #include <OgreFrameListener.h>
 #include <OgreOverlay.h>
@@ -65,4 +62,5 @@
 #include "core/InputBuffer.h"
 #include "core/InputManager.h"
+#include "core/TclBind.h"
 
 // audio
@@ -158,24 +156,23 @@
 
   /**
-   * create a new instance of Orxonox
-   */
-  Orxonox::Orxonox()
-  {
-    this->mode_ = STANDALONE;
-    this->serverIp_ = "";
-    this->ogre_ = &GraphicsEngine::getSingleton();
-    this->timer_ = 0;
-    this->dataPath_ = "";
-    this->auMan_ = 0;
-    this->orxonoxHUD_ = 0;
-    this->inputHandler_ = 0;
+   * Create a new instance of Orxonox. Avoid doing any actual work here.
+   */
+  Orxonox::Orxonox() :
+    ogre_(0),
+    //auMan_(0),
+    timer_(0),
     // turn on frame smoothing by setting a value different from 0
-    this->frameSmoothingTime_ = 0.0f;
-    this->bAbort_ = false;
-    this->timefactor_ = 1.0f;
-  }
-
-  /**
-   * destruct Orxonox
+    frameSmoothingTime_(0.0f),
+    orxonoxConsole_(0),
+    orxonoxHUD_(0),
+    bAbort_(false),
+    timefactor_(1.0f),
+    mode_(STANDALONE),
+    serverIp_("")
+  {
+  }
+
+  /**
+   * Destruct Orxonox.
    */
   Orxonox::~Orxonox()
@@ -186,25 +183,16 @@
     Loader::close();
     InputManager::destroy();
-    if (this->auMan_)
-      delete this->auMan_;
+    //if (this->auMan_)
+    //  delete this->auMan_;
     if (this->timer_)
       delete this->timer_;
     GraphicsEngine::getSingleton().destroy();
 
-    if (client_g)
-      delete client_g;
+    if (network::Client::getSingleton())
+      network::Client::destroySingleton();
     if (server_g)
       delete server_g;
   }
 
-  /**
-    @brief Immediately deletes the orxonox object.
-    Never use if you can help it while rendering!
-  */
-  void Orxonox::abortImmediateForce()
-  {
-    COUT(1) << "*** Orxonox Error: Orxonox object was unexpectedly destroyed." << std::endl;
-    delete this;
-  }
 
   /**
@@ -213,10 +201,10 @@
   void Orxonox::abortRequest()
   {
-    COUT(3) << "*** Orxonox: Abort requested." << std::endl;
+    COUT(3) << "Orxonox: Abort requested." << std::endl;
     bAbort_ = true;
   }
 
   /**
-   * @return singleton object
+   * @return singleton reference
    */
   Orxonox* Orxonox::getSingleton()
@@ -243,5 +231,5 @@
    * @param path path to config (in home dir or something)
    */
-  void Orxonox::init(int argc, char **argv, std::string path)
+  bool Orxonox::init(int argc, char **argv, std::string path)
   {
     //TODO: find config file (assuming executable directory)
@@ -249,57 +237,40 @@
     //TODO: give config file to Ogre
     std::string mode;
+    std::string dataPath;
 
     ArgReader ar(argc, argv);
     ar.checkArgument("mode", mode, false);
-    ar.checkArgument("data", this->dataPath_, false);
+    ar.checkArgument("data", dataPath, false);
     ar.checkArgument("ip", serverIp_, false);
-    if(ar.errorHandling()) abortImmediateForce();
-    if(mode == std::string("client"))
+    if(ar.errorHandling())
+      return false;
+
+    if (mode == "client")
+      mode_ = CLIENT;
+    else if (mode == "server")
+      mode_ = SERVER;
+    else
     {
-      mode_ = CLIENT;
-      clientInit(path);
+      mode = "standalone";
+      mode_ = STANDALONE;
     }
-    else if(mode== std::string("server")){
-      mode_ = SERVER;
-      serverInit(path);
-    }
-    else{
-      mode_ = STANDALONE;
-      standaloneInit(path);
-    }
-  }
-
-  void Orxonox::serverInit(std::string path)
-  {
-    COUT(2) << "initialising server" << std::endl;
-
-    ogre_->setConfigPath(path);
-    ogre_->setup();
-    //root_ = ogre_->getRoot();
-    if(!ogre_->load(this->dataPath_)) abortImmediateForce(/* unable to load */);
-
-    server_g = new network::Server();
-  }
-
-  void Orxonox::clientInit(std::string path)
-  {
-    COUT(2) << "initialising client" << std::endl;\
-
-    ogre_->setConfigPath(path);
-    ogre_->setup();
-    if(serverIp_.compare("")==0)
-      client_g = new network::Client();
-    else
-      client_g = new network::Client(serverIp_, NETWORK_PORT);
-    if(!ogre_->load(this->dataPath_)) abortImmediateForce(/* unable to load */);
-  }
-
-  void Orxonox::standaloneInit(std::string path)
-  {
-    COUT(2) << "initialising standalone mode" << std::endl;
-
-    ogre_->setConfigPath(path);
-    ogre_->setup();
-    if(!ogre_->load(this->dataPath_)) abortImmediateForce(/* unable to load */);
+    COUT(3) << "Orxonox: Mode is " << mode << "." << std::endl;
+
+    //if (mode_ == DEDICATED)
+      // TODO: decide what to do here
+    //else
+
+    // for playable server, client and standalone, the startup
+    // procedure until the GUI is identical
+
+    TclBind::getInstance().setDataPath(dataPath);
+    ConfigFileManager::getSingleton()->setFile(CFT_Settings, "orxonox.ini");
+    Factory::createClassHierarchy();
+
+    ogre_ = &GraphicsEngine::getSingleton();
+    if (!ogre_->setup(path))       // creates ogre root and other essentials
+      return false;
+
+    return true;
   }
 
@@ -307,26 +278,73 @@
    * start modules
    */
-  void Orxonox::start()
-  {
-    switch(mode_){
+  bool Orxonox::start()
+  {
+    //if (mode == DEDICATED)
+    // do something else
+    //else
+
+    if (!ogre_->loadRenderer())    // creates the render window
+      return false;
+
+    // Calls the InputManager which sets up the input devices.
+    // The render window width and height are used to set up the mouse movement.
+    if (!InputManager::initialise(ogre_->getWindowHandle(),
+          ogre_->getWindowWidth(), ogre_->getWindowHeight(), true, true, true))
+      return false;
+
+    // TODO: Spread this so that this call only initialises things needed for the GUI
+    if (!ogre_->initialiseResources())
+      return false;
+
+    // TOOD: load the GUI here
+    // set InputManager to GUI mode
+    InputManager::setInputState(InputManager::IS_GUI);
+    // TODO: run GUI here
+
+    // The following lines depend very much on the GUI output, so they're probably misplaced here..
+
+    InputManager::setInputState(InputManager::IS_NONE);
+
+    if (!loadPlayground())
+      return false;
+
+    switch (mode_)
+    {
+    case SERVER:
+      if (!serverLoad())
+        return false;
+      break;
     case CLIENT:
-      clientStart();
-      break;
-    case SERVER:
-      serverStart();
+      if (!clientLoad())
+        return false;
       break;
     default:
-      standaloneStart();
+      if (!standaloneLoad())
+        return false;
     }
-  }
-
-  void Orxonox::clientStart(){
-    ogre_->initialise();
-    ConfigFileManager::getSingleton()->setFile(CFT_Settings, "orxonox.ini");
-    Factory::createClassHierarchy();
-
-
-    auMan_ = new audio::AudioManager();
-
+
+    InputManager::setInputState(InputManager::IS_NORMAL);
+
+    return startRenderLoop();
+  }
+
+  /**
+   * Loads everything in the scene except for the actual objects.
+   * This includes HUD, Console..
+   */
+  bool Orxonox::loadPlayground()
+  {
+    ogre_->createNewScene();
+
+	  // Init audio
+    //auMan_ = new audio::AudioManager();
+    //auMan_->ambientAdd("a1");
+    //auMan_->ambientAdd("a2");
+    //auMan_->ambientAdd("a3");
+    //auMan->ambientAdd("ambient1");
+    //auMan_->ambientStart();
+
+    // Load the HUD
+    COUT(3) << "Orxonox: Loading HUD..." << std::endl;
     Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2");
     orxonoxHUD_ = new HUD();
@@ -335,91 +353,5 @@
     hudOverlay->show();
 
-    client_g->establishConnection();
-    client_g->tick(0);
-
-
-    //setupInputSystem();
-
-    startRenderLoop();
-  }
-
-  void Orxonox::serverStart(){
-    //TODO: start modules
-    ogre_->initialise();
-    //TODO: run engine
-    ConfigFileManager::getSingleton()->setFile(CFT_Settings, "orxonox.ini");
-    Factory::createClassHierarchy();
-    createScene();
-    setupInputSystem();
-
-    server_g->open();
-
-    startRenderLoop();
-  }
-
-  void Orxonox::standaloneStart(){
-    //TODO: start modules
-    ogre_->initialise();
-    //TODO: run engine
-    ConfigFileManager::getSingleton()->setFile(CFT_Settings, "orxonox.ini");
-    Factory::createClassHierarchy();
-    createScene();
-    setupInputSystem();
-
-    startRenderLoop();
-  }
-
-  void Orxonox::createScene(void)
-  {
-	  // Init audio
-    auMan_ = new audio::AudioManager();
-
-    // load this file from config
-    Level* startlevel = new Level("levels/sample.oxw");
-    Loader::open(startlevel);
-
-    Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2");
-    orxonoxHUD_ = new HUD();
-    orxonoxHUD_->setEnergyValue(20);
-    orxonoxHUD_->setEnergyDistr(20,20,60);
-    hudOverlay->show();
-
-	/*
-    auMan_->ambientAdd("a1");
-    auMan_->ambientAdd("a2");
-    auMan_->ambientAdd("a3");
-    //auMan->ambientAdd("ambient1");
-    auMan_->ambientStart();
-  */
-  }
-
-  /**
-    @brief Calls the InputHandler which sets up the input devices.
-    The render window width and height are used to set up the mouse movement.
-  */
-  void Orxonox::setupInputSystem()
-  {
-    if (!InputManager::initialise(ogre_->getWindowHandle(),
-          ogre_->getWindowWidth(), ogre_->getWindowHeight()))
-      abortImmediateForce();
-    InputManager::setInputState(InputManager::IS_NORMAL);
-  }
-
-  /**
-    Main loop of the orxonox game.
-    This is a new solution, using the ogre engine instead of being used by it.
-    An alternative solution would be to simply use the timer of the Root object,
-    but that implies using Ogre in any case. There would be no way to test
-    our code without the help of the root object.
-    There's even a chance that we can dispose of the root object entirely
-    in server mode.
-    About the loop: The design is almost exactly like the one in ogre, so that
-    if any part of ogre registers a framelisteners, it will still behave
-    correctly. Furthermore the time smoothing feature from ogre has been
-    implemented too. If turned on (see orxonox constructor), it will calculate
-    the dt_n by means of the recent most dt_n-1, dt_n-2, etc.
-  */
-  void Orxonox::startRenderLoop()
-  {
+    COUT(3) << "Orxonox: Loading Console..." << std::endl;
     InputBuffer* ib = dynamic_cast<InputBuffer*>(InputManager::getKeyHandler("buffer"));
     /*
@@ -432,5 +364,4 @@
     ib->registerListener(console, &Testconsole::exit, (char)0x1B, true);
     */
-
     orxonoxConsole_ = new InGameConsole(ib);
     ib->registerListener(orxonoxConsole_, &InGameConsole::listen, true);
@@ -441,9 +372,82 @@
     ib->registerListener(orxonoxConsole_, &InGameConsole::exit, (char)0x1B, true);
 
+    return true;
+  }
+
+  /**
+   * Level loading method for server mode.
+   */
+  bool Orxonox::serverLoad()
+  {
+    COUT(2) << "Loading level in server mode" << std::endl;
+
+    server_g = new network::Server();
+
+    if (!loadScene())
+      return false;
+
+    server_g->open();
+
+    return true;
+  }
+
+  /**
+   * Level loading method for client mode.
+   */
+  bool Orxonox::clientLoad()
+  {
+    COUT(2) << "Loading level in client mode" << std::endl;\
+
+    if (serverIp_.compare("") == 0)
+      client_g = network::Client::createSingleton();
+    else
+      client_g = network::Client::createSingleton(serverIp_, NETWORK_PORT);
+
+    client_g->establishConnection();
+    client_g->tick(0);
+
+    return true;
+  }
+
+  /**
+   * Level loading method for standalone mode.
+   */
+  bool Orxonox::standaloneLoad()
+  {
+    COUT(2) << "Loading level in standalone mode" << std::endl;
+
+    if (!loadScene())
+      return false;
+
+    return true;
+  }
+
+  /**
+   * Helper method to load a level.
+   */
+  bool Orxonox::loadScene()
+  {
+    Level* startlevel = new Level("levels/sample.oxw");
+    Loader::open(startlevel);
+
+    return true;
+  }
+
+
+  /**
+    Main loop of the orxonox game.
+    About the loop: The design is almost exactly like the one in ogre, so that
+    if any part of ogre registers a framelisteners, it will still behave
+    correctly. Furthermore the time smoothing feature from ogre has been
+    implemented too. If turned on (see orxonox constructor), it will calculate
+    the dt_n by means of the recent most dt_n-1, dt_n-2, etc.
+  */
+  bool Orxonox::startRenderLoop()
+  {
     // first check whether ogre root object has been created
     if (Ogre::Root::getSingletonPtr() == 0)
     {
-      COUT(2) << "*** Orxonox Error: Could not start rendering. No Ogre root object found" << std::endl;
-      return;
+      COUT(2) << "Orxonox Error: Could not start rendering. No Ogre root object found" << std::endl;
+      return false;
     }
     Ogre::Root& ogreRoot = Ogre::Root::getSingleton();
@@ -465,4 +469,5 @@
     timer_->reset();
 
+    COUT(3) << "Orxonox: Starting the main loop." << std::endl;
 	  while (!bAbort_)
 	  {
@@ -490,5 +495,8 @@
       for (Iterator<Tickable> it = ObjectList<Tickable>::start(); it; ++it)
         it->tick((float)evt.timeSinceLastFrame * this->timefactor_);
-      orxonoxConsole_->tick((float)evt.timeSinceLastFrame * this->timefactor_);
+      // Iterate through all TickableReals and call their tick(dt) function
+      for (Iterator<TickableReal> it = ObjectList<TickableReal>::start(); it; ++it)
+        it->tick((float)evt.timeSinceLastFrame);
+      orxonoxConsole_->tick((float)evt.timeSinceLastFrame);
 
       // don't forget to call _fireFrameStarted in ogre to make sure
@@ -510,4 +518,10 @@
       ogreRoot._fireFrameEnded(evt);
 	  }
+
+    if(mode_==CLIENT)
+      network::Client::getSingleton()->closeConnection();
+    else if(mode_==SERVER)
+      server_g->close();
+    return true;
   }
 
@@ -550,6 +564,10 @@
   }
 
+  /**
+   * Static function that shows the console in game mode.
+   */
   void Orxonox::activateConsole()
   {
+    // currently, the console shows itself when feeded with input.
     InputManager::setInputState(InputManager::IS_CONSOLE);
   }
Index: code/trunk/src/orxonox/Orxonox.h
===================================================================
--- code/trunk/src/orxonox/Orxonox.h	(revision 1227)
+++ code/trunk/src/orxonox/Orxonox.h	(revision 1293)
@@ -57,9 +57,9 @@
   {
     public:
-      void init(int argc, char **argv, std::string path);
-      void start();
-      void abortImmediateForce();
+      bool init(int argc, char **argv, std::string path);
+      bool start();
+
       void abortRequest();
-      inline audio::AudioManager* getAudioManagerPointer() { return auMan_; };
+      //inline audio::AudioManager* getAudioManagerPointer() { return auMan_; };
 
       static Orxonox* getSingleton();
@@ -79,24 +79,19 @@
       ~Orxonox();
 
-      // init functions
-      void serverInit(std::string path);
-      void clientInit(std::string path);
-      void standaloneInit(std::string path);
+      bool loadPlayground();
 
-      // run functions
-      void serverStart();
-      void clientStart();
-      void standaloneStart();
+      bool serverLoad();
+      bool clientLoad();
+      bool standaloneLoad();
 
-      void createScene();
-      void setupInputSystem();
-      void startRenderLoop();
+      bool loadScene();
+
+      bool startRenderLoop();
+
       float calculateEventTime(unsigned long, std::deque<unsigned long>&);
 
     private:
       GraphicsEngine*       ogre_;          //!< our dearest graphics engine <3
-      std::string           dataPath_;      //!< path to data
-      audio::AudioManager*  auMan_;         //!< audio manager
-      InputManager*         inputHandler_;  //!< Handles input with key bindings
+      //audio::AudioManager*  auMan_;         //!< audio manager
       Ogre::Timer*          timer_;         //!< Main loop timer
       // TODO: make this a config-value by creating a config class for orxonox
Index: code/trunk/src/orxonox/OrxonoxPlatform.h
===================================================================
--- code/trunk/src/orxonox/OrxonoxPlatform.h	(revision 1227)
+++ code/trunk/src/orxonox/OrxonoxPlatform.h	(revision 1293)
@@ -21,5 +21,5 @@
  *
  *   Author:
- *      An unknown man from the Ogre development crew
+ *      ...
  *   Co-authors:
  *      Reto Grieder
Index: code/trunk/src/orxonox/console/InGameConsole.cc
===================================================================
--- code/trunk/src/orxonox/console/InGameConsole.cc	(revision 1227)
+++ code/trunk/src/orxonox/console/InGameConsole.cc	(revision 1293)
@@ -54,9 +54,18 @@
     const float BLINK = 0.25;
 
-    InGameConsole::InGameConsole(InputBuffer* ib){
+    InGameConsole::InGameConsole(InputBuffer* ib) :
+        windowW(0), windowH(0),
+        scroll(0), scrollTimer(0.0f),
+        cursor(0.0f),
+        active(false),
+        ib_(ib),
+        om(0),
+        consoleOverlay(0),
+        consoleOverlayContainer(0),
+        consoleOverlayNoise(0),
+        consoleOverlayBorder(0),
+        consoleOverlayTextAreas(0)
+    {
         //RegisterObject(InGameConsole);
-        ib_ = ib;
-        active = false;
-        cursor = 0.0;
         init();
     }
Index: code/trunk/src/orxonox/objects/Ambient.cc
===================================================================
--- code/trunk/src/orxonox/objects/Ambient.cc	(revision 1227)
+++ code/trunk/src/orxonox/objects/Ambient.cc	(revision 1293)
@@ -57,4 +57,5 @@
         RegisterObject(Ambient);
         Ambient::instance_s = this;
+        registerAllVariables();
     }
 
@@ -63,4 +64,14 @@
     }
 
+    bool Ambient::create(){
+      GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(ambientLight_);
+      return true;
+    }
+    
+    void Ambient::registerAllVariables(){
+      registerVar(&ambientLight_, sizeof(ColourValue), network::DATA);
+      
+    }
+    
     void Ambient::loadParams(TiXmlElement* xmlElem)
     {
@@ -83,4 +94,5 @@
    {
     	GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(colour);
+      ambientLight_=colour;	
    }
 
@@ -96,4 +108,5 @@
 
         XMLPortParamLoadOnly(Ambient, "colourvalue", setAmbientLight, xmlelement, mode);
+        create();
     }
 }
Index: code/trunk/src/orxonox/objects/Ambient.h
===================================================================
--- code/trunk/src/orxonox/objects/Ambient.h	(revision 1227)
+++ code/trunk/src/orxonox/objects/Ambient.h	(revision 1293)
@@ -34,8 +34,9 @@
 #include "util/Math.h"
 #include "core/BaseObject.h"
+#include "network/Synchronisable.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport Ambient : public BaseObject
+    class _OrxonoxExport Ambient : public BaseObject, network::Synchronisable
     {
         public:
@@ -46,4 +47,6 @@
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             void setAmbientLight(const ColourValue& colour);
+            bool create();
+            void registerAllVariables();
 
             static void setAmbientLightTest(const ColourValue& colour)
@@ -52,4 +55,5 @@
         private:
             static Ambient* instance_s;
+            ColourValue ambientLight_;
 
     };
Index: code/trunk/src/orxonox/objects/Camera.cc
===================================================================
--- code/trunk/src/orxonox/objects/Camera.cc	(revision 1227)
+++ code/trunk/src/orxonox/objects/Camera.cc	(revision 1293)
@@ -23,5 +23,5 @@
  *      Fabian 'x3n' Landau
  *   Co-authors:
- *      ...
+ *      Benjamin Knecht
  *
  */
@@ -29,4 +29,5 @@
 #include "OrxonoxStableHeaders.h"
 #include "Camera.h"
+#include "CameraHandler.h"
 
 #include <string>
@@ -47,56 +48,69 @@
 namespace orxonox
 {
-    CreateFactory(Camera);
 
-    Camera::Camera()
+  Camera::Camera(Ogre::SceneNode* node)
+  {
+    this->bHasFocus_ = false;
+    this->cameraNode_ = GraphicsEngine::getSingleton().getSceneManager()->getRootSceneNode()->createChildSceneNode(node->getName() + "Camera");
+    if( node != NULL )
+      this->setPositionNode(node);
+  }
+
+  Camera::~Camera()
+  {
+    CameraHandler::getInstance()->releaseFocus(this);
+  }
+
+  void Camera::setPositionNode(Ogre::SceneNode* node)
+  {
+    this->positionNode_ = node;
+    // set camera to node values according to camera mode
+  }
+
+  void Camera::setTargetNode(Ogre::SceneNode* obj)
+  {
+    this->targetNode_ = obj;
+  }
+
+  void Camera::tick(float dt)
+  {
+    if(this->positionNode_ != NULL) {
+      // this stuff here may need some adjustments
+      Vector3 offset = this->positionNode_->getWorldPosition() - this->cameraNode_->getPosition();
+      this->cameraNode_->translate(15*dt*offset);
+
+      this->cameraNode_->setOrientation(Quaternion::Slerp(0.7, this->positionNode_->getWorldOrientation(), this->cameraNode_->getWorldOrientation(), false));
+    }
+  }
+
+  /**
+    don't move anything before here! here the Ogre camera is set to values of this camera
+    always call update after changes
+  */
+  void Camera::update()
+  {
+    if(this->positionNode_ != NULL)
     {
-        RegisterObject(Camera);
+      this->cameraNode_->setPosition(this->positionNode_->getWorldPosition());
+      this->cameraNode_->setOrientation(this->positionNode_->getWorldOrientation());
     }
+  }
 
-    Camera::~Camera()
-    {
-    }
+  /**
+    what to do when camera loses focus (do not request focus in this function!!)
+    this is called by the CameraHandler singleton class to notify the camera
+  */
+  void Camera::removeFocus()
+  {
+    this->bHasFocus_ = false;
+    this->cameraNode_->detachObject(this->cam_);
+  }
 
-    void Camera::loadParams(TiXmlElement* xmlElem)
-    {
-      Ogre::SceneManager* mgr = GraphicsEngine::getSingleton().getSceneManager();
-
-      if (xmlElem->Attribute("name") && xmlElem->Attribute("pos") && xmlElem->Attribute("lookat") && xmlElem->Attribute("node"))
-      {
-        //    <Camera name="Camera" pos="0,0,-250" lookat="0,0,0" />
-
-        std::string name = xmlElem->Attribute("name");
-        std::string pos = xmlElem->Attribute("pos");
-        std::string lookat = xmlElem->Attribute("lookat");
-
-        Ogre::Camera *cam = mgr->createCamera(name);
-
-        float x, y, z;
-        SubString posVec(xmlElem->Attribute("pos"), ',');
-        convertValue<std::string, float>(&x, posVec[0]);
-        convertValue<std::string, float>(&y, posVec[1]);
-        convertValue<std::string, float>(&z, posVec[2]);
-
-        cam->setPosition(Vector3(x,y,z));
-
-        posVec = SubString(xmlElem->Attribute("lookat"), ',');
-        convertValue<std::string, float>(&x, posVec[0]);
-        convertValue<std::string, float>(&y, posVec[1]);
-        convertValue<std::string, float>(&z, posVec[2]);
-
-        cam->lookAt(Vector3(x,y,z));
-
-        std::string node = xmlElem->Attribute("node");
-
-        Ogre::SceneNode* sceneNode = (Ogre::SceneNode*)mgr->getRootSceneNode()->createChildSceneNode(node); //getChild(node);
-        sceneNode->attachObject((Ogre::MovableObject*)cam);
-
-        // FIXME: unused var
-        //Ogre::Viewport* vp = 
-        GraphicsEngine::getSingleton().getRenderWindow()->addViewport(cam);
-
-
-        COUT(4) << "Loader: Created camera "<< name  << std::endl << std::endl;
-      }
-   }
+  void Camera::setFocus(Ogre::Camera* ogreCam)
+  {
+    this->bHasFocus_ = true;
+    this->cam_ = ogreCam;
+    this->cam_->setOrientation(this->cameraNode_->getWorldOrientation());
+    this->cameraNode_->attachObject(this->cam_);
+  }
 }
Index: code/trunk/src/orxonox/objects/Camera.h
===================================================================
--- code/trunk/src/orxonox/objects/Camera.h	(revision 1227)
+++ code/trunk/src/orxonox/objects/Camera.h	(revision 1293)
@@ -23,5 +23,5 @@
  *      Fabian 'x3n' Landau
  *   Co-authors:
- *      ...
+ *      Benjamin Knecht
  *
  */
@@ -30,22 +30,39 @@
 #define _Camera_H__
 
+#include <OgrePrerequisites.h>
+#include <OgreSceneNode.h>
+#include <OgreCamera.h>
+
 #include "OrxonoxPrereqs.h"
-
-#include "core/BaseObject.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport Camera : public BaseObject
+    class _OrxonoxExport Camera
     {
-        public:
-            Camera();
-            virtual ~Camera();
+      friend class CameraHandler;
+      public:
+        Camera(Ogre::SceneNode* node = NULL);
+        virtual ~Camera();
 
+        void setPositionNode(Ogre::SceneNode* node);
+        inline Ogre::SceneNode* getCameraNode() { return this->positionNode_; }
+        // maybe also BaseObject
+        void setTargetNode(Ogre::SceneNode* obj);
 
-            void loadParams(TiXmlElement* xmlElem);
+        void tick(float dt);
+        void update();
+        inline bool hasFocus() { return this->bHasFocus_; }
 
-        private:
+      private:
+        void removeFocus();
+        void setFocus(Ogre::Camera* ogreCam);
 
-
+      private:
+        Ogre::SceneNode* targetNode_;
+        Ogre::SceneNode* positionNode_;
+        Ogre::SceneNode* cameraNode_;
+        Ogre::Vector3 oldPos;
+        Ogre::Camera* cam_;
+        bool bHasFocus_;
     };
 }
Index: code/trunk/src/orxonox/objects/CameraHandler.cc
===================================================================
--- code/trunk/src/orxonox/objects/CameraHandler.cc	(revision 1293)
+++ code/trunk/src/orxonox/objects/CameraHandler.cc	(revision 1293)
@@ -0,0 +1,94 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Benjamin Knecht
+ *   Co-authors:
+ *      ...
+ *
+ */
+#include <OgreSceneManager.h>
+#include <OgreRenderWindow.h>
+
+#include "OrxonoxStableHeaders.h"
+#include "core/ObjectList.h"
+#include "CameraHandler.h"
+#include "Camera.h"
+#include "GraphicsEngine.h"
+
+#include <OgreCamera.h>
+
+namespace orxonox {
+
+  CameraHandler* CameraHandler::singletonRef = NULL;
+
+  CameraHandler::CameraHandler()
+  {
+    this->cam_ = GraphicsEngine::getSingleton().getSceneManager()->createCamera("Cam");
+    GraphicsEngine::getSingleton().getRenderWindow()->addViewport(this->cam_);
+    /*this->activeCamera_ = *ObjectList<Camera>::begin();
+    this->activeCamera_->cam_ = this->cam_;*/
+  }
+
+  void CameraHandler::requestFocus(Camera* requestCam)
+  {
+    // notify old camera (if it exists)
+    if(focusList_.size() > 0)
+      focusList_.back()->removeFocus();
+    // add to list
+    focusList_.push_back(requestCam);
+    // set focus to new camera and update (if necessary)
+    if(!requestCam->hasFocus()) {
+      requestCam->setFocus(this->cam_);
+      requestCam->update();
+    }
+    // delete dublicates
+    focusList_.unique();
+  }
+
+  void CameraHandler::releaseFocus(Camera* cam)
+  {
+    // notify the cam of releasing the focus
+    if(cam->hasFocus())
+      cam->removeFocus();
+    // delete camera from list
+    focusList_.remove(cam);
+    // set new focus if necessary
+    if(focusList_.size() > 0 && !(focusList_.back()->hasFocus()))
+      focusList_.back()->setFocus(this->cam_);
+  }
+/*
+  void CameraHandler::changeActiveCamera(Camera* setCam)
+  {
+    cam_->getParentSceneNode()->detachObject(cam_);
+    //setCam->attachCamera(cam_);
+    activeCamera_ = setCam;
+  }
+*/
+/*  bool isInVector(Camera* cam)
+  {
+    for(std::vector<Camera*>::iterator it = cams_.begin(); it != cams_.end(); it++)
+    {
+      if (*it == cam) return true;
+    }
+    return false;
+  }*/
+}
Index: code/trunk/src/orxonox/objects/CameraHandler.h
===================================================================
--- code/trunk/src/orxonox/objects/CameraHandler.h	(revision 1293)
+++ code/trunk/src/orxonox/objects/CameraHandler.h	(revision 1293)
@@ -0,0 +1,75 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Benjamin Knecht
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+ /**
+ @file  CameraHandler.h
+ @brief Handles the instances of Camera class
+ @author Benjamin Knecht <beni_at_orxonox.net>
+  */
+
+#ifndef _Camera_Handler_H__
+#define _Camera_Handler_H__
+
+#include <list>
+
+#include <OgreCamera.h>
+
+#include "OrxonoxPrereqs.h"
+
+#include "core/BaseObject.h"
+
+#include "Camera.h"
+
+namespace orxonox
+{
+  class _OrxonoxExport CameraHandler
+  {
+
+    public:
+      inline static CameraHandler* getInstance() { if (!CameraHandler::singletonRef) CameraHandler::singletonRef = new CameraHandler(); return CameraHandler::singletonRef; }
+      inline ~CameraHandler() { CameraHandler::singletonRef = NULL; }
+      inline Camera* getActiveCamera() { return this->focusList_.back(); }
+      /*void registerCamera(Camera* newCam);
+      void changeActiveCamera(Camera* setCam);*/
+      void requestFocus(Camera* requestCam);
+      void releaseFocus(Camera* cam);
+
+    private:
+      CameraHandler();
+      //bool isInVector(Camera* cam);
+
+    private:
+      static CameraHandler* singletonRef;
+      Ogre::Camera* cam_;
+      std::list<Camera*> focusList_;
+      //std::vector<Camera*> cams_;
+
+  };
+}
+
+#endif /* _Camera_Handler_H__ */
Index: code/trunk/src/orxonox/objects/Explosion.cc
===================================================================
--- code/trunk/src/orxonox/objects/Explosion.cc	(revision 1227)
+++ code/trunk/src/orxonox/objects/Explosion.cc	(revision 1293)
@@ -45,10 +45,9 @@
     CreateFactory(Explosion);
 
-    Explosion::Explosion(WorldEntity* owner)
+    Explosion::Explosion(WorldEntity* owner) :
+      lifetime_(0.4),
+      particle_(0)
     {
         RegisterObject(Explosion);
-
-        this->particle_ = 0;
-        this->lifetime_ = 0.4;
 
         if (owner)
Index: code/trunk/src/orxonox/objects/Model.cc
===================================================================
--- code/trunk/src/orxonox/objects/Model.cc	(revision 1227)
+++ code/trunk/src/orxonox/objects/Model.cc	(revision 1293)
@@ -49,15 +49,4 @@
     }
 
-    void Model::loadParams(TiXmlElement* xmlElem)
-    {
-        WorldEntity::loadParams(xmlElem);
-
-        if (xmlElem->Attribute("mesh"))
-        {
-            meshSrc_ = xmlElem->Attribute("mesh");
-        }
-        create();
-    }
-
     /**
         @brief XML loading and saving.
@@ -73,5 +62,5 @@
         XMLPortParamLoadOnly(Model, "mesh", setMesh, xmlelement, mode);
 
-        create();
+        Model::create();
     }
 
@@ -82,10 +71,11 @@
 
     bool Model::create(){
-      WorldEntity::create();
+      if(!WorldEntity::create())
+        return false;
       if ((this->meshSrc_ != "") && (this->meshSrc_.size() > 0))
       {
         this->mesh_.setMesh(meshSrc_);
         this->attachObject(this->mesh_.getEntity());
-        COUT(4) << "Loader: Created model" << std::endl;
+        COUT(4) << "Loader (Model.cc): Created model" << std::endl;
       }
       return true;
@@ -93,5 +83,6 @@
 
     void Model::registerAllVariables(){
-      WorldEntity::registerAllVariables();
+//       WorldEntity::registerAllVariables();
+      COUT(5) << "Model.cc:registering new meshsrc with size: " << meshSrc_.length()+1 << " this: " << this << std::endl;
       registerVar(&meshSrc_, meshSrc_.length() + 1, network::STRING);
     }
Index: code/trunk/src/orxonox/objects/Model.h
===================================================================
--- code/trunk/src/orxonox/objects/Model.h	(revision 1227)
+++ code/trunk/src/orxonox/objects/Model.h	(revision 1293)
@@ -43,5 +43,4 @@
             Model();
             virtual ~Model();
-            virtual void loadParams(TiXmlElement* xmlElem);
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             void setMesh(const std::string& meshname);
Index: code/trunk/src/orxonox/objects/NPC.cc
===================================================================
--- code/trunk/src/orxonox/objects/NPC.cc	(revision 1227)
+++ code/trunk/src/orxonox/objects/NPC.cc	(revision 1293)
@@ -36,8 +36,9 @@
   CreateFactory(NPC);
 
-  NPC::NPC()
+  NPC::NPC() :
+    movable_(true)
   {
     RegisterObject(NPC);
-    movable_ = true;
+    registerAllVariables();
   }
 
@@ -59,4 +60,14 @@
     this->translate(location);
     movable_ = movable;
+  }
+  
+  void NPC::registerAllVariables(){
+    Model::registerAllVariables();
+    registerVar(&movable_, sizeof(movable_), network::DATA);
+  }
+  
+  bool NPC::create(){
+    Model::create();
+    return true;
   }
 
Index: code/trunk/src/orxonox/objects/NPC.h
===================================================================
--- code/trunk/src/orxonox/objects/NPC.h	(revision 1227)
+++ code/trunk/src/orxonox/objects/NPC.h	(revision 1293)
@@ -52,4 +52,6 @@
       void update();
       void setValues(Vector3 location, Vector3 speed, Vector3 acceleration, bool movable);
+      void registerAllVariables();
+      bool create();
 
     private:
Index: code/trunk/src/orxonox/objects/Projectile.cc
===================================================================
--- code/trunk/src/orxonox/objects/Projectile.cc	(revision 1227)
+++ code/trunk/src/orxonox/objects/Projectile.cc	(revision 1293)
@@ -42,11 +42,10 @@
     CreateFactory(Projectile);
 
-    Projectile::Projectile(SpaceShip* owner)
+    Projectile::Projectile(SpaceShip* owner) :
+      owner_(owner)
     {
         RegisterObject(Projectile);
 
         this->setConfigValues();
-
-        this->owner_ = owner;
 
         this->billboard_.setBillboardSet("Examples/Flare", ColourValue(1.0, 1.0, 0.5), 1);
Index: code/trunk/src/orxonox/objects/Skybox.cc
===================================================================
--- code/trunk/src/orxonox/objects/Skybox.cc	(revision 1227)
+++ code/trunk/src/orxonox/objects/Skybox.cc	(revision 1293)
@@ -47,4 +47,5 @@
     {
         RegisterObject(Skybox);
+        registerAllVariables();
     }
 
@@ -57,8 +58,8 @@
     	if (xmlElem->Attribute("src"))
     	{
-    		std::string skyboxSrc = xmlElem->Attribute("src");
-	    	this->setSkybox(skyboxSrc);
+    		skyboxSrc_ = xmlElem->Attribute("src");
+        this->create();
 
-	    	COUT(4) << "Loader: Set skybox: "<< skyboxSrc << std::endl << std::endl;
+	    	COUT(4) << "Loader: Set skybox: "<< skyboxSrc_ << std::endl << std::endl;
     	}
    }
@@ -69,4 +70,8 @@
    }
 
+   void Skybox::setSkyboxSrc(const std::string& src){
+     skyboxSrc_ = src;
+   }
+   
     /**
         @brief XML loading and saving.
@@ -79,5 +84,16 @@
         BaseObject::XMLPort(xmlelement, mode);
 
-        XMLPortParamLoadOnly(Skybox, "src", setSkybox, xmlelement, mode);
+        XMLPortParamLoadOnly(Skybox, "src", setSkyboxSrc, xmlelement, mode);
+        create();
     }
+    
+    bool Skybox::create(){
+      this->setSkybox(skyboxSrc_);
+      return true;
+    }
+    
+    void Skybox::registerAllVariables(){
+      registerVar(&skyboxSrc_, skyboxSrc_.length()+1 ,network::STRING);
+    }
+    
 }
Index: code/trunk/src/orxonox/objects/Skybox.h
===================================================================
--- code/trunk/src/orxonox/objects/Skybox.h	(revision 1227)
+++ code/trunk/src/orxonox/objects/Skybox.h	(revision 1293)
@@ -33,8 +33,9 @@
 
 #include "core/BaseObject.h"
+#include "network/Synchronisable.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport Skybox : public BaseObject
+    class _OrxonoxExport Skybox : public BaseObject, public network::Synchronisable
     {
         public:
@@ -45,6 +46,11 @@
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             void setSkybox(const std::string& skyboxname);
+            
+            bool create();
+            void registerAllVariables();
+            void setSkyboxSrc(const std::string &src);
 
         private:
+            std::string skyboxSrc_;
 
 
Index: code/trunk/src/orxonox/objects/SpaceShip.cc
===================================================================
--- code/trunk/src/orxonox/objects/SpaceShip.cc	(revision 1227)
+++ code/trunk/src/orxonox/objects/SpaceShip.cc	(revision 1293)
@@ -23,5 +23,5 @@
  *      Fabian 'x3n' Landau
  *   Co-authors:
- *      ...
+ *      Benjamin Knecht
  *
  */
@@ -37,4 +37,5 @@
 #include <OgreSceneNode.h>
 
+#include "CameraHandler.h"
 #include "tinyxml/tinyxml.h"
 #include "ois/OIS.h"
@@ -50,4 +51,5 @@
 #include "core/XMLPort.h"
 #include "core/ConsoleCommand.h"
+#include "network/Client.h"
 
 namespace orxonox
@@ -62,5 +64,38 @@
     SpaceShip* SpaceShip::instance_s;
 
-    SpaceShip::SpaceShip()
+    SpaceShip::SpaceShip() :
+      //testvector_(0,0,0),
+      //bInvertYAxis_(false),
+      setMouseEventCallback_(false),
+      bLMousePressed_(false),
+      bRMousePressed_(false),
+      camNode_(0),
+      cam_(0),
+      camName_("CamNode"),
+      tt_(0),
+      redNode_(0),
+      greenNode_(0),
+      blinkTime_(0.0f),
+      chNearNode_(0),
+      chFarNode_(0),
+      timeToReload_(0.0f),
+      //reloadTime_(0.0f),
+      maxSideAndBackSpeed_(0.0f),
+      maxSpeed_(0.0f),
+      maxRotation_(0.0f),
+      translationAcceleration_(0.0f),
+      rotationAcceleration_(0.0f),
+      translationDamping_(0.0f),
+      rotationDamping_(0.0f),
+      maxRotationRadian_(0),
+      rotationAccelerationRadian_(0),
+      rotationDampingRadian_(0),
+      zeroRadian_(0),
+      mouseXRotation_(0),
+      mouseYRotation_(0),
+      mouseX_(0.0f),
+      mouseY_(0.0f),
+      emitterRate_(0.0f),
+      server_(false)
     {
         RegisterObject(SpaceShip);
@@ -71,72 +106,7 @@
         this->setConfigValues();
 
-        this->setMouseEventCallback_ = false;
-        this->bLMousePressed_ = false;
-        this->bRMousePressed_ = false;
-        this->mouseX_ = 0;
-        this->mouseY_ = 0;
-
-        this->camNode_ = 0;
-
-        this->tt_ = 0;
-        this->redNode_ = 0;
-        this->greenNode_ = 0;
-        this->blinkTime_ = 0;
-
-        this->timeToReload_ = 0;
-
-        this->maxSpeed_ = 0;
-        this->maxSideAndBackSpeed_ = 0;
-        this->maxRotation_ = 0;
-        this->translationAcceleration_ = 0;
-        this->rotationAcceleration_ = 0;
-        this->translationDamping_ = 0;
-        this->rotationDamping_ = 0;
-
-        this->maxRotationRadian_ = 0;
-        this->rotationAccelerationRadian_ = 0;
-        this->rotationDampingRadian_ = 0;
-        this->zeroRadian_ = Radian(0);
 
         this->setRotationAxis(1, 0, 0);
         this->setStatic(false);
-/*
-        this->moveForward_ = 0;
-        this->rotateUp_ = 0;
-        this->rotateDown_ = 0;
-        this->rotateRight_ = 0;
-        this->rotateLeft_ = 0;
-        this->loopRight_ = 0;
-        this->loopLeft_ = 0;
-        this->brakeForward_ = 0;
-        this->brakeRotate_ = 0;
-        this->brakeLoop_ = 0;
-        this->speedForward_ = 0;
-        this->speedRotateUpDown_ = 0;
-        this->speedRotateRightLeft_ = 0;
-        this->speedLoopRightLeft_ = 0;
-        this->maxSpeedForward_ = 0;
-        this->maxSpeedRotateUpDown_ = 0;
-        this->maxSpeedRotateRightLeft_ = 0;
-        this->maxSpeedLoopRightLeft_ = 0;
-        this->accelerationForward_ = 0;
-        this->accelerationRotateUpDown_ = 0;
-        this->accelerationRotateRightLeft_ = 0;
-        this->accelerationLoopRightLeft_ = 0;
-
-        this->speed = 250;
-        this->loop = 100;
-        this->rotate = 10;
-        this->mouseX = 0;
-        this->mouseY = 0;
-        this->maxMouseX = 0;
-        this->minMouseX = 0;
-        this->moved = false;
-
-        this->brakeRotate(rotate*10);
-        this->brakeLoop(loop);
-*/
-//         this->create();
-
 
         COUT(3) << "Info: SpaceShip was loaded" << std::endl;
@@ -147,4 +117,8 @@
         if (this->tt_)
             delete this->tt_;
+        if(setMouseEventCallback_)
+          InputManager::removeMouseHandler("SpaceShip");
+        if (this->cam_)
+          delete this->cam_;
     }
 
@@ -158,7 +132,14 @@
 
     void SpaceShip::registerAllVariables(){
-      Model::registerAllVariables();
-
-
+      registerVar( &camName_, camName_.length()+1, network::STRING, 0x1);
+      registerVar( &maxSpeed_, sizeof(maxSpeed_), network::DATA, 0x1);
+      registerVar( &maxSideAndBackSpeed_, sizeof(maxSideAndBackSpeed_), network::DATA, 0x1);
+      registerVar( &maxRotation_, sizeof(maxRotation_), network::DATA, 0x1);
+      registerVar( &translationAcceleration_, sizeof(translationAcceleration_), network::DATA, 0x1);
+      registerVar( &rotationAcceleration_, sizeof(rotationAcceleration_), network::DATA, 0x1);
+      registerVar( &rotationAccelerationRadian_, sizeof(rotationAccelerationRadian_), network::DATA, 0x1);
+      registerVar( &translationDamping_, sizeof(translationDamping_), network::DATA, 0x1);
+      registerVar( &rotationDamping_, sizeof(rotationDamping_), network::DATA, 0x1);
+      registerVar( &rotationDampingRadian_, sizeof(rotationDampingRadian_), network::DATA, 0x1);
 
     }
@@ -166,4 +147,13 @@
     void SpaceShip::init()
     {
+    if ((server_ || ( network::Client::getSingleton() && network::Client::getSingleton()->getShipID()==objectID ) ))
+    {
+          if (!setMouseEventCallback_)
+          {
+              InputManager::addMouseHandler(this, "SpaceShip");
+              setMouseEventCallback_ = true;
+          }
+    }
+
         // START CREATING THRUSTER
         this->tt_ = new ParticleInterface(GraphicsEngine::getSingleton().getSceneManager(),"twinthruster" + this->getName(),"Orxonox/engineglow");
@@ -191,7 +181,7 @@
         this->greenBillboard_.setBillboardSet("Examples/Flare", ColourValue(0.0, 1.0, 0.0), 1);
 
-        this->redNode_ = this->getNode()->createChildSceneNode(this->getName() + "red", Vector3(0.3, 4.7, -0.3));
+        this->redNode_ = this->getNode()->createChildSceneNode(this->getName() + "red", Vector3(0.3, 4.0, -0.3));
         this->redNode_->setInheritScale(false);
-        this->greenNode_ = this->getNode()->createChildSceneNode(this->getName() + "green", Vector3(0.3, -4.7, -0.3));
+        this->greenNode_ = this->getNode()->createChildSceneNode(this->getName() + "green", Vector3(0.3, -4.0, -0.3));
         this->greenNode_->setInheritScale(false);
 
@@ -218,4 +208,5 @@
         this->chFarNode_->setScale(0.4, 0.4, 0.4);
 
+        createCamera();
         // END of testing crosshair
     }
@@ -232,4 +223,5 @@
         Model::loadParams(xmlElem);
         this->create();
+        this->getFocus();
 /*
         if (xmlElem->Attribute("forward") && xmlElem->Attribute("rotateupdown") && xmlElem->Attribute("rotaterightleft") && xmlElem->Attribute("looprightleft"))
@@ -246,5 +238,5 @@
 
             COUT(4) << "Loader: Initialized spaceship steering with values " << maxSpeedForward_ << " " << maxSpeedRotateUpDown_ << " " << maxSpeedRotateRightLeft_ << " " << maxSpeedLoopRightLeft_ << " " << std::endl;
-    	}
+      }
 */
         if (xmlElem->Attribute("maxSpeed") && xmlElem->Attribute("maxSideAndBackSpeed") && xmlElem->Attribute("maxRotation") && xmlElem->Attribute("transAcc") && xmlElem->Attribute("rotAcc") && xmlElem->Attribute("transDamp") && xmlElem->Attribute("rotDamp"))
@@ -272,30 +264,43 @@
 
             COUT(4) << "Loader: Initialized SpaceShip" << std::endl;
-    	}
-
-    	if (xmlElem->Attribute("camera"))
-    	{
-    	    this->setCamera();
-    	}
+        }
+
+        if (xmlElem->Attribute("camera"))
+        {
+            this->setCamera();
+        }
     }
 
     void SpaceShip::setCamera(const std::string& camera)
     {
-        Ogre::Camera *cam = GraphicsEngine::getSingleton().getSceneManager()->createCamera("ShipCam");
-        this->camNode_ = this->getNode()->createChildSceneNode("CamNode");
-/*
-//        node->setInheritOrientation(false);
-        cam->setPosition(Vector3(0,50,-150));
-        cam->lookAt(Vector3(0,20,0));
-        cam->roll(Degree(0));
-*/
-
-        cam->setPosition(Vector3(-200,0,35));
+      camName_=camera;
+      // change camera attributes here, if you want to ;)
+    }
+    
+    void SpaceShip::getFocus(){
+      COUT(4) << "requesting focus" << std::endl;
+      if(network::Client::getSingleton()==0 || network::Client::getSingleton()->getShipID()==objectID)
+        CameraHandler::getInstance()->requestFocus(cam_);
+      
+    }
+    
+    void SpaceShip::createCamera(){
+//       COUT(4) << "begin camera creation" << std::endl;
+      this->camNode_ = this->getNode()->createChildSceneNode(camName_);
+      COUT(4) << "position: (this)" << this->getNode()->getPosition() << std::endl;
+      this->camNode_->setPosition(Vector3(-50,0,10));
+      Quaternion q1 = Quaternion(Radian(Degree(90)),Vector3(0,-1,0));
+      Quaternion q2 = Quaternion(Radian(Degree(90)),Vector3(0,0,-1));
+      camNode_->setOrientation(q1*q2);
+      COUT(4) << "position: (cam)" << this->camNode_->getPosition() << std::endl;
+      cam_ = new Camera(this->camNode_);
+
+      cam_->setTargetNode(this->getNode());
 //        cam->setPosition(Vector3(0,-350,0));
-        cam->lookAt(Vector3(0,0,35));
-        cam->roll(Degree(-90));
-
-        this->camNode_->attachObject(cam);
-        GraphicsEngine::getSingleton().getRenderWindow()->addViewport(cam);
+      if(network::Client::getSingleton()!=0 && network::Client::getSingleton()->getShipID()==objectID){
+        this->setBacksync(true);
+        CameraHandler::getInstance()->requestFocus(cam_);
+      }
+
     }
 
@@ -333,4 +338,7 @@
         XMLPortParamLoadOnly(SpaceShip, "transDamp", setTransDamp, xmlelement, mode);
         XMLPortParamLoadOnly(SpaceShip, "rotDamp", setRotDamp, xmlelement, mode);
+        server_=true; // TODO: this is only a hack
+        SpaceShip::create();
+        getFocus();
     }
 
@@ -343,5 +351,5 @@
     }
 
-    bool SpaceShip::mouseMoved(const OIS::MouseEvent &e)
+    bool SpaceShip::mouseMoved(const MouseState& state)
     {
 /*
@@ -360,14 +368,14 @@
         if (this->bRMousePressed_)
         {
-            this->camNode_->roll(Degree(-e.state.X.rel * 0.10));
-            this->camNode_->yaw(Degree(e.state.Y.rel * 0.10));
-        }
-        else
-        {
-            float minDimension = e.state.height;
-            if (e.state.width < minDimension)
-                minDimension = e.state.width;
-
-            this->mouseX_ += e.state.X.rel;
+            this->camNode_->roll(Degree(-state.X.rel * 0.10));
+            this->camNode_->yaw(Degree(state.Y.rel * 0.10));
+        }
+        else
+        {
+            float minDimension = state.height;
+            if (state.width < minDimension)
+                minDimension = state.width;
+
+            this->mouseX_ += state.X.rel;
             if (this->mouseX_ < -minDimension)
                 this->mouseX_ = -minDimension;
@@ -375,5 +383,5 @@
                 this->mouseX_ = minDimension;
 
-            this->mouseY_ += e.state.Y.rel;
+            this->mouseY_ += state.Y.rel;
             if (this->mouseY_ < -minDimension)
                 this->mouseY_ = -minDimension;
@@ -403,9 +411,9 @@
     }
 
-    bool SpaceShip::mousePressed(const OIS::MouseEvent &e, OIS::MouseButtonID id)
-    {
-        if (id == OIS::MB_Left)
+    bool SpaceShip::mouseButtonPressed(const MouseState& state, MouseButton::Enum id)
+    {
+        if (id == MouseButton::Left)
             this->bLMousePressed_ = true;
-        else if (id == OIS::MB_Right)
+        else if (id == MouseButton::Right)
             this->bRMousePressed_ = true;
 
@@ -413,9 +421,9 @@
     }
 
-    bool SpaceShip::mouseReleased(const OIS::MouseEvent &e, OIS::MouseButtonID id)
-    {
-        if (id == OIS::MB_Left)
+    bool SpaceShip::mouseButtonReleased(const MouseState& state, MouseButton::Enum id)
+    {
+        if (id == MouseButton::Left)
             this->bLMousePressed_ = false;
-        else if (id == OIS::MB_Right)
+        else if (id == MouseButton::Right)
         {
             this->bRMousePressed_ = false;
@@ -428,9 +436,6 @@
     void SpaceShip::tick(float dt)
     {
-        if (!setMouseEventCallback_)
-        {
-          InputManager::addMouseHandler(this, "SpaceShip");
-          setMouseEventCallback_ = true;
-        }
+        if (this->cam_)
+            this->cam_->tick(dt);
 
         if (this->redNode_ && this->greenNode_)
@@ -450,9 +455,8 @@
         if (this->bLMousePressed_ && this->timeToReload_ <= 0)
         {
-            new Projectile(this);
+            Projectile *p = new Projectile(this);
+            p->setBacksync(true);
             this->timeToReload_ = this->reloadTime_;
         }
-
-        OIS::Keyboard* mKeyboard = InputManager::getKeyboard();
 
 
@@ -522,24 +526,29 @@
         }
 
-        if (mKeyboard->isKeyDown(OIS::KC_UP) || mKeyboard->isKeyDown(OIS::KC_W))
+        if( (network::Client::getSingleton() &&  network::Client::getSingleton()->getShipID() == objectID) || server_ )
+        {
+          COUT(4) << "steering our ship: " << objectID << std::endl;
+          if (InputManager::isKeyDown(KeyCode::Up) || InputManager::isKeyDown(KeyCode::W))
             this->acceleration_.x = this->translationAcceleration_;
-        else if(mKeyboard->isKeyDown(OIS::KC_DOWN) || mKeyboard->isKeyDown(OIS::KC_S))
+          else if(InputManager::isKeyDown(KeyCode::Down) || InputManager::isKeyDown(KeyCode::S))
             this->acceleration_.x = -this->translationAcceleration_;
-        else
+          else
             this->acceleration_.x = 0;
 
-        if (mKeyboard->isKeyDown(OIS::KC_RIGHT) || mKeyboard->isKeyDown(OIS::KC_D))
+          if (InputManager::isKeyDown(KeyCode::Right) || InputManager::isKeyDown(KeyCode::D))
             this->acceleration_.y = -this->translationAcceleration_;
-        else if (mKeyboard->isKeyDown(OIS::KC_LEFT) || mKeyboard->isKeyDown(OIS::KC_A))
+          else if (InputManager::isKeyDown(KeyCode::Left) || InputManager::isKeyDown(KeyCode::A))
             this->acceleration_.y = this->translationAcceleration_;
-        else
+          else
             this->acceleration_.y = 0;
 
-        if (mKeyboard->isKeyDown(OIS::KC_DELETE) || mKeyboard->isKeyDown(OIS::KC_Q))
+          if (InputManager::isKeyDown(KeyCode::Delete) || InputManager::isKeyDown(KeyCode::Q))
             this->momentum_ = Radian(-this->rotationAccelerationRadian_);
-        else if (mKeyboard->isKeyDown(OIS::KC_PGDOWN) || mKeyboard->isKeyDown(OIS::KC_E))
+          else if (InputManager::isKeyDown(KeyCode::PageDown) || InputManager::isKeyDown(KeyCode::E))
             this->momentum_ = Radian(this->rotationAccelerationRadian_);
-        else
+          else
             this->momentum_ = 0;
+        }/*else
+          COUT(4) << "not steering ship: " << objectID << " our ship: " << network::Client::getSingleton()->getShipID() << std::endl;*/
 
         WorldEntity::tick(dt);
Index: code/trunk/src/orxonox/objects/SpaceShip.h
===================================================================
--- code/trunk/src/orxonox/objects/SpaceShip.h	(revision 1227)
+++ code/trunk/src/orxonox/objects/SpaceShip.h	(revision 1293)
@@ -23,5 +23,5 @@
  *      Fabian 'x3n' Landau
  *   Co-authors:
- *      ...
+ *      Benjamin Knecht
  *
  */
@@ -34,5 +34,6 @@
 #include <OgrePrerequisites.h>
 
-#include "core/InputHandler.h"
+#include "core/InputInterfaces.h"
+#include "Camera.h"
 #include "Model.h"
 #include "../tools/BillboardSet.h"
@@ -62,14 +63,18 @@
             void setRotDamp(float value);
 
+            void getFocus();
+
             static void setMaxSpeedTest(float value)
                 { SpaceShip::instance_s->setMaxSpeed(value); }
 
-            bool mouseMoved(const OIS::MouseEvent &e);
-            bool mousePressed(const OIS::MouseEvent &e, OIS::MouseButtonID id);
-            bool mouseReleased(const OIS::MouseEvent &e, OIS::MouseButtonID id);
-            bool mouseHeld(const OIS::MouseEvent &e, OIS::MouseButtonID id) { return true; }
+            bool mouseButtonPressed (const MouseState& state, MouseButton::Enum id);
+            bool mouseButtonReleased(const MouseState& state, MouseButton::Enum id);
+            bool mouseButtonHeld    (const MouseState& state, MouseButton::Enum id) { return true; }
+            bool mouseMoved         (const MouseState& state);
+            bool mouseScrolled      (const MouseState& state) { return true; }
 
 
         private:
+            void createCamera();
             static SpaceShip* instance_s;
 
@@ -81,4 +86,7 @@
 
             Ogre::SceneNode* camNode_;
+            Camera* cam_;  
+            std::string camName_;
+
 
             ParticleInterface* tt_;
@@ -117,4 +125,5 @@
 
             float emitterRate_;
+            bool server_;
     };
 }
Index: code/trunk/src/orxonox/objects/WorldEntity.cc
===================================================================
--- code/trunk/src/orxonox/objects/WorldEntity.cc	(revision 1227)
+++ code/trunk/src/orxonox/objects/WorldEntity.cc	(revision 1293)
@@ -45,16 +45,14 @@
     unsigned int WorldEntity::worldEntityCounter_s = 0;
 
-    WorldEntity::WorldEntity()
+    WorldEntity::WorldEntity() :
+      velocity_    (0, 0, 0),
+      acceleration_(0, 0, 0),
+      rotationAxis_(0, 1, 0),
+      rotationRate_(0),
+      momentum_    (0),
+      node_        (0),
+      bStatic_     (true)
     {
         RegisterObject(WorldEntity);
-
-        //create();
-
-        this->bStatic_ = true;
-        this->velocity_ = Vector3(0, 0, 0);
-        this->acceleration_ = Vector3(0, 0, 0);
-        this->rotationAxis_ = Vector3(0, 1, 0);
-        this->rotationRate_ = 0;
-        this->momentum_ = 0;
 
         if (GraphicsEngine::getSingleton().getSceneManager())
@@ -67,12 +65,12 @@
           registerAllVariables();
         }
-        else
-        {
-          this->node_ = 0;
-        }
     }
+    
 
     WorldEntity::~WorldEntity()
     {
+      // just to make sure we clean out all scene nodes
+      if(this->getNode())
+        this->getNode()->removeAndDestroyAllChildren();
     }
 
@@ -81,4 +79,5 @@
         if (!this->bStatic_)
         {
+//             COUT(4) << "acceleration: " << this->acceleration_ << " velocity: " << this->velocity_ << std::endl;
             this->velocity_ += (dt * this->acceleration_);
             this->translate(dt * this->velocity_, Ogre::Node::TS_LOCAL);
@@ -94,72 +93,6 @@
         BaseObject::loadParams(xmlElem);
         create();
-/*
-        if (xmlElem->Attribute("position"))
-        {
-            std::vector<std::string> pos = tokenize(xmlElem->Attribute("position"),",");
-            float x, y, z;
-            String2Number<float>(x, pos[0]);
-            String2Number<float>(y, pos[1]);
-            String2Number<float>(z, pos[2]);
-            this->setPosition(x, y, z);
-        }
-
-        if (xmlElem->Attribute("direction"))
-        {
-            std::vector<std::string> pos = tokenize(xmlElem->Attribute("direction"),",");
-            float x, y, z;
-            String2Number<float>(x, pos[0]);
-            String2Number<float>(y, pos[1]);
-            String2Number<float>(z, pos[2]);
-            this->setDirection(x, y, z);
-        }
-
-        if (xmlElem->Attribute("yaw") || xmlElem->Attribute("pitch") || xmlElem->Attribute("roll"))
-        {
-            float yaw = 0.0, pitch = 0.0, roll = 0.0;
-            if (xmlElem->Attribute("yaw"))
-                String2Number<float>(yaw,xmlElem->Attribute("yaw"));
-
-            if (xmlElem->Attribute("pitch"))
-                String2Number<float>(pitch,xmlElem->Attribute("pitch"));
-
-            if (xmlElem->Attribute("roll"))
-                String2Number<float>(roll,xmlElem->Attribute("roll"));
-
-            this->yaw(Degree(yaw));
-            this->pitch(Degree(pitch));
-            this->roll(Degree(roll));
-        }
-
-        if (xmlElem->Attribute("scale"))
-        {
-            std::string scaleStr = xmlElem->Attribute("scale");
-            float scale;
-            String2Number<float>(scale, scaleStr);
-            this->setScale(scale);
-        }
-
-        if (xmlElem->Attribute("rotationAxis"))
-        {
-            std::vector<std::string> pos = tokenize(xmlElem->Attribute("rotationAxis"),",");
-            float x, y, z;
-            String2Number<float>(x, pos[0]);
-            String2Number<float>(y, pos[1]);
-            String2Number<float>(z, pos[2]);
-            this->setRotationAxis(x, y, z);
-        }
-
-        if (xmlElem->Attribute("rotationRate"))
-        {
-            float rotationRate;
-            String2Number<float>(rotationRate, xmlElem->Attribute("rotationRate"));
-            this->setRotationRate(Degree(rotationRate));
-            if (rotationRate != 0)
-                this->setStatic(false);
-        }
-
-        create();
-*/
     }
+    
 
     void WorldEntity::setYawPitchRoll(const Degree& yaw, const Degree& pitch, const Degree& roll)
@@ -188,4 +121,6 @@
 
         XMLPortObject(WorldEntity, WorldEntity, "attached", attachWorldEntity, getAttachedWorldEntity, xmlelement, mode, false, true);
+        
+        WorldEntity::create();
     }
 
@@ -194,22 +129,32 @@
     {
       // register coordinates
-      registerVar( (void*) &(this->getPosition().x), sizeof(this->getPosition().x), network::DATA);
-      registerVar( (void*) &(this->getPosition().y), sizeof(this->getPosition().y), network::DATA);
-      registerVar( (void*) &(this->getPosition().z), sizeof(this->getPosition().z), network::DATA);
+      registerVar( (void*) &(this->getPosition().x), sizeof(this->getPosition().x), network::DATA, 0x3);
+      registerVar( (void*) &(this->getPosition().y), sizeof(this->getPosition().y), network::DATA, 0x3);
+      registerVar( (void*) &(this->getPosition().z), sizeof(this->getPosition().z), network::DATA, 0x3);
       // register orientation
-      registerVar( (void*) &(this->getOrientation().w), sizeof(this->getOrientation().w), network::DATA);
-      registerVar( (void*) &(this->getOrientation().x), sizeof(this->getOrientation().x), network::DATA);
-      registerVar( (void*) &(this->getOrientation().y), sizeof(this->getOrientation().y), network::DATA);
-      registerVar( (void*) &(this->getOrientation().z), sizeof(this->getOrientation().z), network::DATA);
-      // not needed at the moment, because we don't have prediction yet
+      registerVar( (void*) &(this->getOrientation().w), sizeof(this->getOrientation().w), network::DATA, 0x3);
+      registerVar( (void*) &(this->getOrientation().x), sizeof(this->getOrientation().x), network::DATA, 0x3);
+      registerVar( (void*) &(this->getOrientation().y), sizeof(this->getOrientation().y), network::DATA, 0x3);
+      registerVar( (void*) &(this->getOrientation().z), sizeof(this->getOrientation().z), network::DATA, 0x3);
       // register velocity_
-      registerVar( (void*) &(this->getVelocity().x), sizeof(this->getVelocity().x), network::DATA);
-      registerVar( (void*) &(this->getVelocity().y), sizeof(this->getVelocity().y), network::DATA);
-      registerVar( (void*) &(this->getVelocity().z), sizeof(this->getVelocity().z), network::DATA);
-      // register rotationAxis/rate
-      registerVar( (void*) &(this->getRotationRate()), sizeof(this->getRotationRate()), network::DATA);
-      registerVar( (void*) &(this->getRotationAxis().x), sizeof(this->getRotationAxis().x), network::DATA);
-      registerVar( (void*) &(this->getRotationAxis().y), sizeof(this->getRotationAxis().y), network::DATA);
-      registerVar( (void*) &(this->getRotationAxis().z), sizeof(this->getRotationAxis().z), network::DATA);
+//       registerVar( (void*) &(this->getVelocity().x), sizeof(this->getVelocity().x), network::DATA, 0x3);
+//       registerVar( (void*) &(this->getVelocity().y), sizeof(this->getVelocity().y), network::DATA, 0x3);
+//       registerVar( (void*) &(this->getVelocity().z), sizeof(this->getVelocity().z), network::DATA, 0x3);
+//       // register rotationAxis/rate
+//       registerVar( (void*) &(this->getRotationRate()), sizeof(this->getRotationRate()), network::DATA, 0x3);
+//       registerVar( (void*) &(this->getRotationAxis().x), sizeof(this->getRotationAxis().x), network::DATA, 0x3);
+//       registerVar( (void*) &(this->getRotationAxis().y), sizeof(this->getRotationAxis().y), network::DATA, 0x3);
+//       registerVar( (void*) &(this->getRotationAxis().z), sizeof(this->getRotationAxis().z), network::DATA, 0x3);
+      // register scale of node
+      registerVar( (void*) &(this->getScale().x), sizeof(this->getScale().x), network::DATA, 0x3);
+      registerVar( (void*) &(this->getScale().y), sizeof(this->getScale().y), network::DATA, 0x3);
+      registerVar( (void*) &(this->getScale().z), sizeof(this->getScale().z), network::DATA, 0x3);
+      //register staticity
+      registerVar( (void*) &(this->bStatic_), sizeof(this->bStatic_), network::DATA, 0x3);
+      //register acceleration
+      // register velocity_
+//       registerVar( (void*) &(this->getAcceleration().x), sizeof(this->getAcceleration().x), network::DATA, 0x3);
+//       registerVar( (void*) &(this->getAcceleration().y), sizeof(this->getAcceleration().y), network::DATA, 0x3);
+//       registerVar( (void*) &(this->getAcceleration().z), sizeof(this->getAcceleration().z), network::DATA, 0x3);
     }
 
Index: code/trunk/src/orxonox/particle/ParticleInterface.cc
===================================================================
--- code/trunk/src/orxonox/particle/ParticleInterface.cc	(revision 1227)
+++ code/trunk/src/orxonox/particle/ParticleInterface.cc	(revision 1293)
@@ -63,4 +63,6 @@
   ParticleInterface::~ParticleInterface(void)
   {
+    while(particleSystem_->getNumEmitters()>0)
+      particleSystem_->removeEmitter(particleSystem_->getNumEmitters()-1);
     sceneManager_->destroyParticleSystem(particleSystem_);
   }
Index: code/trunk/src/orxonox/tools/Timer.cc
===================================================================
--- code/trunk/src/orxonox/tools/Timer.cc	(revision 1227)
+++ code/trunk/src/orxonox/tools/Timer.cc	(revision 1293)
@@ -68,6 +68,4 @@
     TimerBase::TimerBase()
     {
-        RegisterRootObject(TimerBase);
-
         this->executor_ = 0;
         this->interval_ = 0;
@@ -76,4 +74,6 @@
 
         this->time_ = 0;
+
+        RegisterRootObject(TimerBase);
     }
 
@@ -83,5 +83,6 @@
     TimerBase::~TimerBase()
     {
-        delete this->executor_;
+      if (this->executor_)
+          delete this->executor_;
     }
 
