Index: code/branches/network/src/orxonox/Orxonox.cc
===================================================================
--- code/branches/network/src/orxonox/Orxonox.cc	(revision 1668)
+++ code/branches/network/src/orxonox/Orxonox.cc	(revision 1669)
@@ -126,8 +126,8 @@
     GraphicsEngine::getSingleton().destroy();
 
-    if (network::Client::getSingleton())
-      network::Client::destroySingleton();
+    if (client_g)
+      delete client_g;
     if (server_g)
-      delete network::Server::getSingleton();
+      delete server_g;
   }
 
@@ -346,7 +346,6 @@
     COUT(0) << "Loading level in server mode" << std::endl;
 
-    //server_g = new network::Server(serverPort_);
-    server_g = network::Server::createSingleton(serverPort_);
-
+    server_g = new network::Server(serverPort_);
+    COUT(0) << "Loading scene in server mode" << std::endl;
     if (!loadScene())
       return false;
@@ -365,8 +364,8 @@
 
     if (serverIp_.compare("") == 0)
-      client_g = network::Client::createSingleton();
+      client_g = new network::Client();
     else
 
-      client_g = network::Client::createSingleton(serverIp_, serverPort_);
+      client_g = new network::Client(serverIp_, serverPort_);
 
     if(!client_g->establishConnection())
@@ -509,5 +508,5 @@
 
     if (mode_ == CLIENT)
-      network::Client::getSingleton()->closeConnection();
+      client_g->closeConnection();
     else if (mode_ == SERVER)
       server_g->close();
Index: code/branches/network/src/orxonox/objects/SpaceShip.cc
===================================================================
--- code/branches/network/src/orxonox/objects/SpaceShip.cc	(revision 1668)
+++ code/branches/network/src/orxonox/objects/SpaceShip.cc	(revision 1669)
@@ -48,5 +48,5 @@
 #include "core/XMLPort.h"
 #include "core/ConsoleCommand.h"
-#include "network/Client.h"
+#include "network/Host.h"
 #include "hud/HUD.h"
 
@@ -158,5 +158,5 @@
     bool SpaceShip::create(){
       if(!myShip_){
-        if(network::Client::getSingleton() && objectID == network::Client::getSingleton()->getShipID())
+        if(network::Host::running() && objectID == network::Host::getShipID())
           myShip_=true;
         else
@@ -282,5 +282,4 @@
     void SpaceShip::setCamera(const std::string& camera)
     {
-      myShip_=true; // TODO: this is only a hack
       camName_=camera;
       // change camera attributes here, if you want to ;)
@@ -289,5 +288,6 @@
     void SpaceShip::getFocus(){
       COUT(4) << "requesting focus" << std::endl;
-      if(network::Client::getSingleton()==0 || network::Client::getSingleton()->getShipID()==objectID)
+      //if(!network::Host::running() || network::Host::getShipID()==objectID)
+      if(myShip_)
         CameraHandler::getInstance()->requestFocus(cam_);
 
@@ -311,10 +311,17 @@
       cam_->setTargetNode(this->getNode());
 //        cam->setPosition(Vector3(0,-350,0));
+//      Quaternion q1 = Quaternion(Radian(Degree(90)),Vector3(0,0,1));
+//      Quaternion q2 = Quaternion(Radian(Degree(90)),Vector3(0,1,0));
       Quaternion q1 = Quaternion(Radian(Degree(90)),Vector3(0,-1,0));
       Quaternion q2 = Quaternion(Radian(Degree(90)),Vector3(1,0,0));
-      this->camNode_->setOrientation(q2*q1);
-      if(network::Client::getSingleton()!=0 && network::Client::getSingleton()->getShipID()==objectID){
+
+       this->camNode_->setOrientation(q2*q1);
+      //if(!network::Host::running() || network::Host::getShipID()==objectID){ //TODO: check this
+      if(myShip_){
+        COUT(3) << "requesting focus for camera" << std::endl;
         this->setBacksync(true);
-        CameraHandler::getInstance()->requestFocus(cam_);
+        //CameraHandler::getInstance()->requestFocus(cam_);
+        if(this->isExactlyA(Class(SpaceShip)))
+          getFocus();
       }
 
@@ -355,7 +362,8 @@
         XMLPortParamLoadOnly(SpaceShip, "rotDamp", setRotDamp, xmlelement, mode);
 
+        myShip_=true; //TODO: this is a hack
         SpaceShip::create();
-        if (this->isExactlyA(Class(SpaceShip)))
-            getFocus();
+        /*if (this->isExactlyA(Class(SpaceShip)))
+            getFocus();*/
     }
 
Index: code/branches/network/src/util/Bytestream.cc
===================================================================
--- code/branches/network/src/util/Bytestream.cc	(revision 1669)
+++ code/branches/network/src/util/Bytestream.cc	(revision 1669)
@@ -0,0 +1,58 @@
+#include "Bytestream.h"
+#include <assert.h>
+
+#define DEFAULT_SIZE 100 // bytes
+#define RESIZE_AMOUNT 100
+
+  Bytestream::Bytestream(){
+    data_ = new DATA_TYPE[DEFAULT_SIZE+1];
+    readIterator_ = 0;
+    writeIterator_ = 0;
+    maxSize_ = DEFAULT_SIZE;
+  }
+  
+  Bytestream::Bytestream( unsigned int size ){
+    data_ = new DATA_TYPE[ size+1 ];
+    readIterator_ = 0;
+    writeIterator_ = 0;
+    maxSize_ = size;
+  }
+  
+  Bytestream::Bytestream( DATA_TYPE *data, unsigned int size, bool empty ){
+    data_ = data;
+    if(empty)
+      writeIterator_ = 0;
+    else
+      writeIterator_ = size;
+    readIterator_ = 0;
+    maxSize_ = size;
+  }
+  
+  Bytestream::~Bytestream(){
+    delete [] data_;
+  }
+  
+  
+  void Bytestream::write( void *data, unsigned int length ){
+    if(writeIterator_+length > maxSize_){
+      maxSize_ += RESIZE_AMOUNT;
+      data_ = (DATA_TYPE* )realloc(data_, maxSize_);
+    }
+    memcpy( &data_[writeIterator_], &data, length );
+    writeIterator_+= length;
+  }
+  
+  void Bytestream::read( void *data, unsigned int length ){
+    assert(readIterator_+length <= maxSize_);
+    memcpy( &data, &data_[readIterator_], length );
+    readIterator_ += length;
+    assert(readIterator_<=maxSize_);
+  }
+  
+  void Bytestream::readString(std::string& s){
+    void readString(std::string& s);
+    readIterator_ += s.length()+1;
+    assert(readIterator_<=maxSize_);
+  }
+  
+  
Index: code/branches/network/src/util/Bytestream.h
===================================================================
--- code/branches/network/src/util/Bytestream.h	(revision 1669)
+++ code/branches/network/src/util/Bytestream.h	(revision 1669)
@@ -0,0 +1,74 @@
+/*
+ *   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:
+ *      Oliver Scheuss <scheusso [at] ee.ethz.ch>, (C) 2008
+ *   Co-authors:
+ *      ...
+ *
+ */
+#ifndef NETWORKBYTESTREAM_H
+#define NETWORKBYTESTREAM_H
+
+#define DATA_TYPE unsigned char
+
+#include <string>
+
+  
+/**
+	@author Oliver Scheuss <scheusso [at] ee.ethz.ch>
+*/
+class Bytestream{
+  public:
+    Bytestream();
+    Bytestream( unsigned int size );
+    Bytestream( DATA_TYPE *data, unsigned int size, bool empty=false );
+    ~Bytestream();
+    
+    template <class T> Bytestream& operator<< ( T& data )
+        { write(&data, sizeof(T)); return *this; }
+    template <class T> Bytestream& operator>> ( T& data )
+        { read(&data, sizeof(T)); return *this; }
+    void write(void *data, unsigned int length);
+    void read(void *data, unsigned int length);
+    void readString(std::string& s);
+    
+    // specialisations
+    template <std::string&> Bytestream& operator<< ( std::string& s ){ write( s.c_str(), s.length()+1); return *this; }
+    template <std::string&> Bytestream& operator>> ( std::string& s ){ readString(s); return *this; }
+    
+    DATA_TYPE *getData(){ return data_; }
+    unsigned int getSize(){ return writeIterator_; }
+    
+  private:
+    
+
+// Membervariables
+  
+  private:
+    DATA_TYPE *data_;
+    unsigned int writeIterator_;
+    unsigned int readIterator_;
+    unsigned int maxSize_;
+};
+
+
+#endif
Index: code/branches/network/src/util/CMakeLists.txt
===================================================================
--- code/branches/network/src/util/CMakeLists.txt	(revision 1668)
+++ code/branches/network/src/util/CMakeLists.txt	(revision 1669)
@@ -1,4 +1,5 @@
 SET(UTIL_SRC_FILES
   ArgReader.cc
+  Bytestream.cc
   Clipboard.cc
   ExprParser.cc
Index: code/branches/network/src/util/UtilPrereqs.h
===================================================================
--- code/branches/network/src/util/UtilPrereqs.h	(revision 1668)
+++ code/branches/network/src/util/UtilPrereqs.h	(revision 1669)
@@ -61,4 +61,5 @@
 //-----------------------------------------------------------------------
 class ArgReader;
+class Bytestream;
 class Convert;
 class MultiTypePrimitive;
@@ -68,4 +69,3 @@
 class String2Number;
 class SubString;
-
 #endif /* _UtilPrereqs_H__ */
