Index: /code/branches/network/src/network/CMakeLists.txt
===================================================================
--- /code/branches/network/src/network/CMakeLists.txt	(revision 1665)
+++ /code/branches/network/src/network/CMakeLists.txt	(revision 1666)
@@ -11,4 +11,11 @@
   Server.cc
   Synchronisable.cc
+  Host.cc
+  packet/Packet.cc
+  packet/Chat.cc
+  packet/ClassID.cc
+  packet/Acknowledgement.cc
+  packet/Gamestate.cc
+  Host.cc
 )
 
Index: /code/branches/network/src/network/Client.cc
===================================================================
--- /code/branches/network/src/network/Client.cc	(revision 1665)
+++ /code/branches/network/src/network/Client.cc	(revision 1666)
@@ -40,44 +40,14 @@
 
 #include "Client.h"
+#include "Host.h"
 #include "Synchronisable.h"
 #include "core/CoreIncludes.h"
 #include "core/ConsoleCommand.h"
-#include "Server.h"
+#include "packet/Packet.h"
 
 namespace network
 {
-  SetConsoleCommandShortcut(Client, Chat);
-  
-  Client* Client::_sClient = 0;
-  
-  Client* Client::createSingleton(){
-    if(!_sClient){
-      _sClient = new Client();
-    }
-    return _sClient;
-  }
-  
-  Client* Client::createSingleton(std::string address, int port){
-    if(!_sClient)
-      _sClient = new Client(address, port);
-    return _sClient;
-  }
-  
-  Client* Client::createSingleton(const char *address, int port){
-    if(!_sClient)
-      _sClient = new Client(address, port);
-    return _sClient;
-  }
-  
-  void Client::destroySingleton(){
-    if(_sClient){
-      delete _sClient;
-      _sClient = 0;
-    }
-  }
-  
-  Client* Client::getSingleton(){
-    return _sClient; 
-  }
+//   SetConsoleCommandShortcut(Client, chat);
+  
   
   /**
@@ -144,15 +114,17 @@
   }
 
-  
-
-  void Client::Chat( std::string message ){
-    if(Client::getSingleton())
-      Client::getSingleton()->sendChat(message);
-    else if(Server::getSingleton())
-      Server::getSingleton()->sendChat(message);
-    else
-      COUT(1) << "do you want to monologize ??" << std::endl;
-  }
-  
+  bool Client::queuePacket(ENetPacket *packet, int clientID){
+    return client_connection.addPacket(packet);
+  }
+  
+  bool Client::processChat(packet::Chat *message, unsigned int clientID){
+    return message->process();
+  }
+  
+  bool Client::sendChat(packet::Chat *chat){
+    chat->process();
+    packet::Packet *p = new packet::Packet(chat);
+    return p->send();
+  }
 
   /**
@@ -236,9 +208,9 @@
   }
 
-  void Client::processChat( chat *data, int clientId){
-    COUT(1) << data->message << std::endl;
-    delete[] data->message;
-    delete data;
-  }
+//   void Client::processChat( chat *data, int clientId){
+//     COUT(1) << data->message << std::endl;
+//     delete[] data->message;
+//     delete data;
+//   }
   
   bool Client::processWelcome( welcome *w ){
Index: /code/branches/network/src/network/Client.h
===================================================================
--- /code/branches/network/src/network/Client.h	(revision 1665)
+++ /code/branches/network/src/network/Client.h	(revision 1666)
@@ -46,4 +46,6 @@
 #include <string>
 
+#include "Host.h"
+#include "packet/Chat.h"
 #include "ClientConnection.h"
 #include "PacketManager.h"
@@ -62,24 +64,6 @@
   *
   */
-  class _NetworkExport Client : PacketDecoder{
+  class _NetworkExport Client : PacketDecoder, public Host{
   public:
-    
-    static Client* createSingleton();
-    static Client* createSingleton(std::string address, int port);
-    static Client* createSingleton(const char *address, int port);
-    static void destroySingleton();
-    static Client *getSingleton();
-    
-    bool establishConnection();
-    bool closeConnection();
-
-    static void Chat( std::string message );
-    
-    int getShipID(){return shipID_;}
-    int getClientID(){return clientID_;}
-
-    void tick(float time);
-
-  private:
     Client();
     Client(std::string address, int port);
@@ -87,5 +71,18 @@
     ~Client();
     
-    static Client* _sClient;
+    bool establishConnection();
+    bool closeConnection();
+    bool queuePacket(ENetPacket *packet, int clientID);
+    bool processChat(packet::Chat *message, unsigned int clientID);
+    bool sendChat(packet::Chat *chat);
+    
+//    static void Chat( std::string message );
+    
+    int shipID(){return shipID_;}
+    int playerID(){return clientID_;}
+
+    void tick(float time);
+
+  private:
     
     ClientConnection client_connection;
@@ -100,5 +97,5 @@
     void processGamestate( GameStateCompressed *data, int clientID);
     void processClassid(classid *clid);
-    void processChat( chat *data, int clientId );
+//     void processChat( chat *data, int clientId );
     bool processWelcome( welcome *w );
     int clientID_;     // this is the id the server gave to us
Index: /code/branches/network/src/network/ClientInformation.cc
===================================================================
--- /code/branches/network/src/network/ClientInformation.cc	(revision 1665)
+++ /code/branches/network/src/network/ClientInformation.cc	(revision 1666)
@@ -46,41 +46,19 @@
 {
   
+  ClientInformation *ClientInformation::head_=0;
+  
   ClientInformation::ClientInformation() {
+    if(!head_)
+      head_=this;
     gamestateID_=GAMESTATEID_INITIAL;
     preve=0;
     nexte=0;
     partialGamestateID_=GAMESTATEID_INITIAL-1;
-    this->head_=false;
     synched_=false;
   }
 
-  ClientInformation::ClientInformation(bool head) {
-    gamestateID_=GAMESTATEID_INITIAL;
-    preve=0;
-    nexte=0;
-    partialGamestateID_=GAMESTATEID_INITIAL-1;
-    this->head_=head;
-    synched_=false;
-  }
-
-  // ClientInformation::ClientInformation(ClientInformation *prev) {
-  //   if(prev->next()!=0){
-  //     this->nexte=prev->next();
-  //     this->nexte->setPrev(this);
-  //   }
-  //   else
-  //     this->nexte = 0;
-  //   prev->setNext(this);
-  //   this->preve = pref;
-  // }
-  //
-  // ClientInformation::ClientInformation(ClientInformation *prev, ClientInformation *next){
-  //   this->nexte = next;
-  //   this->preve = prev;
-  //   this->preve->setNext(this);
-  //   this->nexte->setPrev(this);
-  // }
-
   ClientInformation::~ClientInformation() {
+    if(this==head_)
+      head_=next();
     if(prev()!=0)
       prev()->setNext(this->next());
@@ -103,8 +81,7 @@
 
   bool ClientInformation::setPrev(ClientInformation *prev) {
-    if(!head_)
-      this->preve = prev;
-    else
-      return false;
+    if(this==head_)
+      head_=prev;
+    this->preve = prev;
     return true;
   }
@@ -174,12 +151,4 @@
   }
   
-  bool ClientInformation::getHead(){
-    return head_;
-  }
-  
-  void ClientInformation::setHead(bool h){
-    head_=h;
-  }
-  
   int ClientInformation::getFailures(){
     return failures_;
@@ -215,7 +184,8 @@
 
   ClientInformation *ClientInformation::insertBack(ClientInformation *ins) {
-    if(!this)
-      return NULL;
-    ClientInformation *temp = this;
+    ClientInformation *temp = head_;
+    if(temp==head_){
+      return head_;
+    }
     while(temp->next()!=0){
       temp = temp->next();
@@ -227,7 +197,7 @@
 
   bool ClientInformation::removeClient(int clientID) {
-    if(!this || clientID==CLIENTID_UNKNOWN)
-      return false;
-    ClientInformation *temp = this;
+    if(clientID==CLIENTID_UNKNOWN)
+      return false;
+    ClientInformation *temp = head_;
     while(temp!=0 && temp->getID()!=clientID)
       temp = temp->next();
@@ -239,11 +209,10 @@
 
   bool ClientInformation::removeClient(ENetPeer *peer) {
-    if(!this || !peer)
-      return false;
-    ClientInformation *temp = this;
+    if(!peer)
+      return false;
+    ClientInformation *temp = head_;
     while(temp!=0){
-      if(!temp->head_)
-        if(temp->getPeer()->address.host==peer->address.host && temp->getPeer()->address.port==peer->address.port)
-          break;
+      if(temp->getPeer()->address.host==peer->address.host && temp->getPeer()->address.port==peer->address.port)
+        break;
       temp = temp->next();
     }
@@ -261,7 +230,5 @@
   */
   ClientInformation *ClientInformation::findClient(int clientID, bool look_backwards) {
-    ClientInformation *temp = this;
-    if (temp->head_)
-      temp=temp->next();
+    ClientInformation *temp = head_;
     while(temp!=0 && temp->getID()!=clientID){
       temp = temp->next();
@@ -278,10 +245,6 @@
   */
   ClientInformation *ClientInformation::findClient(ENetAddress *address, bool look_backwards) {
-    ClientInformation *temp = this;
+    ClientInformation *temp = head_;
     while(temp!=0){
-      if(temp->head_){
-        temp = temp->next();
-        continue;
-      }
       if(temp->getPeer()->address.host==address->host && temp->getPeer()->address.port == address->port)
         break;
Index: /code/branches/network/src/network/ClientInformation.h
===================================================================
--- /code/branches/network/src/network/ClientInformation.h	(revision 1665)
+++ /code/branches/network/src/network/ClientInformation.h	(revision 1666)
@@ -60,5 +60,4 @@
   public:
     ClientInformation();
-    ClientInformation(bool head);
     //   ClientInformation(ClientInformation *prev, ClientInformation *next);
     //   ClientInformation(ClientInformation *prev);
@@ -66,5 +65,5 @@
     ClientInformation *next();
     ClientInformation *prev();
-    ClientInformation *insertBack(ClientInformation *ins);
+    static ClientInformation *insertBack(ClientInformation *ins);
     
     // set functions
@@ -81,6 +80,4 @@
     int getPartialGamestateID();
     ENetPeer *getPeer();
-    bool getHead();
-    void setHead(bool h);
     
     int getFailures();
@@ -90,10 +87,9 @@
     enet_uint32 getPacketLoss();
     
-    bool removeClient(int clientID);
-    bool removeClient(ENetPeer *peer);
-    //## add bool mask-function eventually
-    ClientInformation *findClient(int clientID, bool look_backwards=false);
-    //## add bool mask-function eventually
-    ClientInformation *findClient(ENetAddress *address, bool look_backwards=false);
+    static bool removeClient(int clientID);
+    static bool removeClient(ENetPeer *peer);
+    static ClientInformation *findClient(int clientID, bool look_backwards=false);
+    static ClientInformation *findClient(ENetAddress *address, bool look_backwards=false);
+    static ClientInformation *getBegin(){return head_;}
 
     bool setSynched(bool s);
@@ -101,7 +97,9 @@
 
 
-    private:
-      bool setNext(ClientInformation *next);
-      bool setPrev(ClientInformation *prev);
+  private:
+    static ClientInformation *head_;
+    
+    bool setNext(ClientInformation *next);
+    bool setPrev(ClientInformation *prev);
     ClientInformation *insertAfter(ClientInformation *ins);
     ClientInformation *insertBefore(ClientInformation *ins);
@@ -116,5 +114,4 @@
     int ShipID_;   // this is the unique objectID
     bool synched_;
-    bool head_;
     unsigned short failures_;
     
Index: /code/branches/network/src/network/ConnectionManager.cc
===================================================================
--- /code/branches/network/src/network/ConnectionManager.cc	(revision 1665)
+++ /code/branches/network/src/network/ConnectionManager.cc	(revision 1666)
@@ -39,4 +39,5 @@
 
 #include <iostream>
+#include <assert.h>
 // boost.thread library for multithreading support
 #include <boost/bind.hpp>
@@ -65,33 +66,51 @@
   //boost::thread_group network_threads;
   
-  ConnectionManager::ConnectionManager():receiverThread_(0){}
-  boost::recursive_mutex ConnectionManager::enet_mutex_;
-  
-  ConnectionManager::ConnectionManager(ClientInformation *head) : receiverThread_(0) {
+  ConnectionManager *ConnectionManager::instance_=0;
+  
+  ConnectionManager::ConnectionManager():receiverThread_(0){
+    assert(instance_==0);
+    instance_=this;
     quit=false;
     bindAddress.host = ENET_HOST_ANY;
     bindAddress.port = NETWORK_PORT;
-    head_ = head;
-  }
-  
-  ConnectionManager::ConnectionManager(ClientInformation *head, int port){
+  }
+  boost::recursive_mutex ConnectionManager::enet_mutex_;
+  
+//   ConnectionManager::ConnectionManager(ClientInformation *head) : receiverThread_(0) {
+//     assert(instance_==0);
+//     instance_=this;
+//     quit=false;
+//     bindAddress.host = ENET_HOST_ANY;
+//     bindAddress.port = NETWORK_PORT;
+//   }
+  
+  ConnectionManager::ConnectionManager(int port){
+    assert(instance_==0);
+    instance_=this;
     quit=false;
     bindAddress.host = ENET_HOST_ANY;
     bindAddress.port = port;
-    head_ = head;
-  }
-
-  ConnectionManager::ConnectionManager(int port, std::string address, ClientInformation *head) :receiverThread_(0) {
+  }
+
+  ConnectionManager::ConnectionManager(int port, std::string address) :receiverThread_(0) {
+    assert(instance_==0);
+    instance_=this;
     quit=false;
     enet_address_set_host (& bindAddress, address.c_str());
     bindAddress.port = NETWORK_PORT;
-    head_ = head;
-  }
-
-  ConnectionManager::ConnectionManager(int port, const char *address, ClientInformation *head) : receiverThread_(0) {
+  }
+
+  ConnectionManager::ConnectionManager(int port, const char *address) : receiverThread_(0) {
+    assert(instance_==0);
+    instance_=this;
     quit=false;
     enet_address_set_host (& bindAddress, address);
     bindAddress.port = NETWORK_PORT;
-    head_ = head;
+  }
+  
+  ConnectionManager::~ConnectionManager(){
+    instance_=0;
+    if(!quit)
+      quitListener();
   }
 
@@ -140,11 +159,19 @@
     return true;
   }
-
+  
+//   bool ConnectionManager::addPacket(Packet::Packet *packet){
+//     ClientInformation *temp = instance_->head_->findClient(packet->getClientID());
+//     if(!temp){
+//       COUT(3) << "C.Man: addPacket findClient failed" << std::endl;
+//       return false;
+//     }
+//     ENetPacket *packet = new ENetPacket;
+//     //  TODO: finish implementation
+//   }
+//   
+  
   bool ConnectionManager::addPacket(ENetPacket *packet, ENetPeer *peer) {
-    ClientInformation *temp = head_->findClient(&(peer->address));
-    if(!temp)
-      return false;
-    boost::recursive_mutex::scoped_lock lock(enet_mutex_);
-    if(enet_peer_send(peer, (enet_uint8)temp->getID() , packet)!=0)
+    boost::recursive_mutex::scoped_lock lock(instance_->enet_mutex_);
+    if(enet_peer_send(peer, NETWORK_DEFAULT_CHANNEL, packet)!=0)
       return false;
     return true;
@@ -152,20 +179,17 @@
 
   bool ConnectionManager::addPacket(ENetPacket *packet, int clientID) {
-    ClientInformation *temp = head_->findClient(clientID);
+    ClientInformation *temp = ClientInformation::findClient(clientID);
     if(!temp){
       COUT(3) << "C.Man: addPacket findClient failed" << std::endl;
       return false;
     }
-    boost::recursive_mutex::scoped_lock lock(enet_mutex_);
-    if(enet_peer_send(temp->getPeer(), 0, packet)!=0){
-      COUT(3) << "C.Man: addPacket enet_peer_send failed" << std::endl;
-      return false;
-    }
-    return true;
+    return addPacket(packet, temp->getPeer());
   }
 
   bool ConnectionManager::addPacketAll(ENetPacket *packet) {
-    boost::recursive_mutex::scoped_lock lock(enet_mutex_);
-    for(ClientInformation *i=head_->next(); i!=0; i=i->next()){
+    if(!instance_)
+      return false;
+    boost::recursive_mutex::scoped_lock lock(instance_->enet_mutex_);
+    for(ClientInformation *i=ClientInformation::getBegin()->next(); i!=0; i=i->next()){
       COUT(3) << "adding broadcast packet for client: " << i->getID() << std::endl;
       if(enet_peer_send(i->getPeer(), 0, packet)!=0)
@@ -177,5 +201,5 @@
   // we actually dont need that function, because host_service does that for us
   bool ConnectionManager::sendPackets() {
-    if(server==NULL)
+    if(server==NULL || !instance_)
       return false;
     boost::recursive_mutex::scoped_lock lock(enet_mutex_);
@@ -257,5 +281,5 @@
   void ConnectionManager::disconnectClients() {
     ENetEvent event;
-    ClientInformation *temp = head_->next();
+    ClientInformation *temp = ClientInformation::getBegin()->next();
     while(temp!=0){
       {
@@ -267,5 +291,5 @@
     }
     //bugfix: might be the reason why server crashes when clients disconnects
-    temp = head_->next();
+    temp = ClientInformation::getBegin()->next();
     boost::recursive_mutex::scoped_lock lock(enet_mutex_);
     while( temp!=0 && enet_host_service(server, &event, NETWORK_WAIT_TIMEOUT) >= 0){
@@ -279,6 +303,6 @@
       case ENET_EVENT_TYPE_DISCONNECT:
         COUT(4) << "disconnecting all clients" << std::endl;
-        if(head_->findClient(&(event.peer->address)))
-          delete head_->findClient(&(event.peer->address));
+        if(ClientInformation::findClient(&(event.peer->address)))
+          delete ClientInformation::findClient(&(event.peer->address));
         //maybe needs bugfix: might also be a reason for the server to crash
         temp = temp->next();
@@ -302,9 +326,9 @@
 
   int ConnectionManager::getClientID(ENetAddress address) {
-    return head_->findClient(&address)->getID();
+    return ClientInformation::findClient(&address)->getID();
   }
 
   ENetPeer *ConnectionManager::getClientPeer(int clientID) {
-    return head_->findClient(clientID)->getPeer();
+    return ClientInformation::findClient(clientID)->getPeer();
   }
 
Index: /code/branches/network/src/network/ConnectionManager.h
===================================================================
--- /code/branches/network/src/network/ConnectionManager.h	(revision 1665)
+++ /code/branches/network/src/network/ConnectionManager.h	(revision 1666)
@@ -52,4 +52,5 @@
 #include "PacketBuffer.h"
 #include "PacketManager.h"
+#include "packet/Packet.h"
 
 namespace std
@@ -63,4 +64,5 @@
 #define NETWORK_MAX_CONNECTIONS 50
 #define NETWORK_WAIT_TIMEOUT 1
+#define NETWORK_DEFAULT_CHANNEL 0
 
   struct ClientList{
@@ -73,8 +75,9 @@
   public:
     ConnectionManager();
-    ConnectionManager(ClientInformation *head);
-    ConnectionManager(ClientInformation *head, int port);
-    ConnectionManager(int port, const char *address, ClientInformation *head);
-    ConnectionManager(int port, std::string address, ClientInformation *head);
+    //ConnectionManager(ClientInformation *head);
+    ConnectionManager(int port);
+    ConnectionManager(int port, const char *address);
+    ConnectionManager(int port, std::string address);
+    ~ConnectionManager();
     //ENetPacket *getPacket(ENetAddress &address); // thread1
     //ENetPacket *getPacket(int &clientID);
@@ -83,7 +86,8 @@
     void createListener();
     bool quitListener();
-    bool addPacket(ENetPacket *packet, ENetPeer *peer);
-    bool addPacket(ENetPacket *packet, int ID);
-    bool addPacketAll(ENetPacket *packet);
+//     bool addPacket(Packet::Packet *packet);
+    static bool addPacket(ENetPacket *packet, ENetPeer *peer);
+    static bool addPacket(ENetPacket *packet, int ID);
+    static bool addPacketAll(ENetPacket *packet);
   //  bool sendPackets(ENetEvent *event);
     bool sendPackets();
@@ -113,16 +117,9 @@
 
     bool quit; // quit-variable (communication with threads)
-    ClientInformation *head_;
 
     boost::thread *receiverThread_;
     static boost::recursive_mutex enet_mutex_;
-//     int getNumberOfClients();
-    //functions to map what object every clients uses
-    /*std::map<int, int> clientsShip;
-    void addClientsObjectID( int clientID, int objectID );
-    int getClientsShipID( int clientID );
-    int getObjectsClientID( int objectID );
-    void deleteClientIDReg( int clientID );
-    void deleteObjectIDReg( int objectID );*/
+    static ConnectionManager *instance_;
+
   };
 
Index: /code/branches/network/src/network/GameStateManager.cc
===================================================================
--- /code/branches/network/src/network/GameStateManager.cc	(revision 1665)
+++ /code/branches/network/src/network/GameStateManager.cc	(revision 1666)
@@ -53,7 +53,6 @@
 namespace network
 {
-  GameStateManager::GameStateManager(ClientInformation *head) {
+  GameStateManager::GameStateManager() {
     id_=0;
-    head_=head;
   }
 
@@ -130,5 +129,5 @@
     //why are we searching the same client's gamestate id as we searched in
     //Server::sendGameState?
-    int gID = head_->findClient(clientID)->getGamestateID();
+    int gID = ClientInformation::findClient(clientID)->getGamestateID();
     COUT(4) << "G.St.Man: popgamestate: sending gstate_id: " << id_ << " diffed from: " << gID << std::endl;
 //     COUT(3) << "gamestatemap: " << &gameStateMap << std::endl;
@@ -467,5 +466,5 @@
 
   void GameStateManager::ackGameState(int clientID, int gamestateID) {
-    ClientInformation *temp = head_->findClient(clientID);
+    ClientInformation *temp = ClientInformation::findClient(clientID);
     if(temp==0)
       return;
@@ -524,5 +523,5 @@
     if(client->getGamestateID()>=0)
       gameStateUsed[client->getGamestateID()]--;
-    head_->removeClient(client->getID());
+    ClientInformation::removeClient(client->getID());
   }
 
Index: /code/branches/network/src/network/GameStateManager.h
===================================================================
--- /code/branches/network/src/network/GameStateManager.h	(revision 1665)
+++ /code/branches/network/src/network/GameStateManager.h	(revision 1666)
@@ -69,5 +69,5 @@
   class GameStateManager{
   public:
-    GameStateManager(ClientInformation *head);
+    GameStateManager();
     ~GameStateManager();
     
@@ -96,5 +96,4 @@
     std::map<int, GameStateCompressed*> gameStateQueue;
     GameState *reference;
-    ClientInformation *head_;
     int id_;
     
Index: /code/branches/network/src/network/Host.cc
===================================================================
--- /code/branches/network/src/network/Host.cc	(revision 1666)
+++ /code/branches/network/src/network/Host.cc	(revision 1666)
@@ -0,0 +1,56 @@
+#include <assert.h>
+
+#include "Host.h"
+#include "packet/Packet.h"
+
+namespace network {
+
+Host *Host::instance_=0;
+  
+Host::Host()
+{
+  assert(instance_==0);
+  instance_=this;
+}
+
+
+Host::~Host()
+{
+  instance_=0;
+}
+
+bool Host::addPacket(ENetPacket *packet, int clientID){
+  if(instance_)
+    return instance_->queuePacket(packet, clientID);
+  else
+    return false;
+}
+
+
+bool Host::chat(std::string& message){
+  if(!instance_)
+    return false;
+  packet::Chat *c = new packet::Chat(message);
+  return instance_->sendChat(c);
+}
+
+bool Host::receiveChat(network::packet::Chat *message, unsigned int clientID){
+  if(instance_)
+    return instance_->processChat(message, clientID);
+  else
+    return false;
+}
+
+int Host::getPlayerID(){ 
+  if(!instance_)
+    return 0;
+  return instance_->playerID();
+}
+
+int Host::getShipID(){ 
+  if(!instance_)
+    return 0;
+  return instance_->shipID();
+}
+
+}//namespace network
Index: /code/branches/network/src/network/Host.h
===================================================================
--- /code/branches/network/src/network/Host.h	(revision 1666)
+++ /code/branches/network/src/network/Host.h	(revision 1666)
@@ -0,0 +1,68 @@
+/*
+ *   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 NETWORKHOST_H
+#define NETWORKHOST_H
+
+#include <string>
+
+#include "packet/Chat.h"
+#include "Node.h"
+
+namespace network {
+
+/**
+	@author Oliver Scheuss
+*/
+class Host{
+  private:
+    //TODO add theese functions or adequate
+    virtual bool processChat(packet::Chat *message, unsigned int clientID)=0;
+    virtual bool sendChat(packet::Chat *chat)=0;
+    virtual bool queuePacket(ENetPacket *packet, int clientID)=0;
+    virtual int shipID()=0;
+    virtual int playerID()=0;
+    
+    static Host *instance_;
+    
+    
+  protected:
+    Host();
+    ~Host();
+    
+  public:
+    static bool running(){return instance_!=0;}
+    static bool addPacket(ENetPacket *packet, int clientID=0);
+    static bool chat(std::string& message);
+    static bool receiveChat(packet::Chat *message, unsigned int clientID);
+    static int getPlayerID();
+    static int getShipID();
+};
+
+}
+
+#endif
Index: /code/branches/network/src/network/Node.h
===================================================================
--- /code/branches/network/src/network/Node.h	(revision 1666)
+++ /code/branches/network/src/network/Node.h	(revision 1666)
@@ -0,0 +1,54 @@
+/*
+ *   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 NETWORKNODE_H
+#define NETWORKNODE_H
+
+#include <assert.h>
+#include "packet/Chat.h"
+
+namespace network{
+  
+  class Node
+  {
+    private:
+    protected:
+      
+      Node(){}
+      ~Node(){}
+    public:
+      virtual bool chat(packet::Chat *message)=0;
+  };
+  
+  
+  
+  
+}
+
+
+#endif
Index: /code/branches/network/src/network/Server.cc
===================================================================
--- /code/branches/network/src/network/Server.cc	(revision 1665)
+++ /code/branches/network/src/network/Server.cc	(revision 1666)
@@ -48,8 +48,9 @@
 #include "GameStateManager.h"
 #include "ClientInformation.h"
-//#include "NetworkFrameListener.h"
 #include "util/Sleep.h"
 #include "objects/SpaceShip.h"
 #include "core/ConsoleCommand.h"
+#include "packet/Chat.h"
+#include "packet/Packet.h"
 
 namespace network
@@ -58,32 +59,4 @@
   #define NETWORK_FREQUENCY 30
   
-  Server *Server::instance_=0;
-  
-  Server *Server::createSingleton(){
-    if(!instance_)
-      instance_ = new Server();
-    return instance_;
-  }
-  Server *Server::createSingleton(int port){
-    if(!instance_)
-      instance_ = new Server(port);
-    return instance_;
-  }
-  Server *Server::createSingleton(int port, std::string bindAddress){
-    if(!instance_)
-      instance_ = new Server(port, bindAddress);
-    return instance_;
-  }
-  Server *Server::createSingleton(int port, const char *bindAddress){
-    if(!instance_)
-      instance_ = new Server(port, bindAddress);
-    return instance_;
-  }
-  
-  Server *Server::getSingleton(){
-    return instance_;
-  }
-  
-  
   /**
   * Constructor for default values (bindaddress is set to ENET_HOST_ANY
@@ -93,7 +66,6 @@
     timeSinceLastUpdate_=0;
     packet_gen = PacketGenerator();
-    clients = new ClientInformation(true);
-    connection = new ConnectionManager(clients);
-    gamestates = new GameStateManager(clients);
+    connection = new ConnectionManager();
+    gamestates = new GameStateManager();
   }
   
@@ -101,7 +73,6 @@
     timeSinceLastUpdate_=0;
     packet_gen = PacketGenerator();
-    clients = new ClientInformation(true);
-    connection = new ConnectionManager(clients, port);
-    gamestates = new GameStateManager(clients);
+    connection = new ConnectionManager(port);
+    gamestates = new GameStateManager();
   }
 
@@ -114,7 +85,6 @@
     timeSinceLastUpdate_=0;
     packet_gen = PacketGenerator();
-    clients = new ClientInformation();
-    connection = new ConnectionManager(port, bindAddress, clients);
-    gamestates = new GameStateManager(clients);
+    connection = new ConnectionManager(port, bindAddress);
+    gamestates = new GameStateManager();
   }
 
@@ -127,7 +97,6 @@
     timeSinceLastUpdate_=0;
     packet_gen = PacketGenerator();
-    clients = new ClientInformation();
-    connection = new ConnectionManager(port, bindAddress, clients);
-    gamestates = new GameStateManager(clients);
+    connection = new ConnectionManager(port, bindAddress);
+    gamestates = new GameStateManager();
   }
 
@@ -148,4 +117,16 @@
   }
 
+  bool Server::processChat(packet::Chat *message, unsigned int clientID){
+    ClientInformation *temp = ClientInformation::getBegin();
+    packet::Packet *pkt;
+    while(temp){
+      pkt = new packet::Packet(message);
+      pkt->setClientID(temp->getID());
+      if(!pkt->send())
+        COUT(3) << "could not send Chat message to client ID: " << temp->getID() << std::endl;
+    }
+    return message->process();
+  }
+  
   /**
   * This function sends out a message to all clients
@@ -153,6 +134,15 @@
   * @return true/false
   */
-  bool Server::sendChat(std::string msg) {
-    return sendChat(msg.c_str());
+  bool Server::sendChat(packet::Chat *chat) {
+    //TODO: change this (no informations about who wrote a message)
+    ClientInformation *temp = ClientInformation::getBegin();
+    packet::Packet *pkt;
+    while(temp){
+      pkt = new packet::Packet(chat);
+      pkt->setClientID(temp->getID());
+      if(!pkt->send())
+        COUT(3) << "could not send Chat message to client ID: " << temp->getID() << std::endl;
+    }
+    return chat->process();
   }
 
@@ -162,12 +152,12 @@
   * @return true/false
   */
-  bool Server::sendChat(const char *msg) {
-    char *message = new char [strlen(msg)+10+1];
-    sprintf(message, "Player %d: %s", CLIENTID_SERVER, msg);
-    COUT(1) << message << std::endl;
-    ENetPacket *packet = packet_gen.chatMessage(message);
-    COUT(5) <<"Server: adding Packets" << std::endl;
-    return connection->addPacketAll(packet);
-  }
+//   bool Server::sendChat(const char *msg) {
+//     char *message = new char [strlen(msg)+10+1];
+//     sprintf(message, "Player %d: %s", CLIENTID_SERVER, msg);
+//     COUT(1) << message << std::endl;
+//     ENetPacket *packet = packet_gen.chatMessage(message);
+//     COUT(5) <<"Server: adding Packets" << std::endl;
+//     return connection->addPacketAll(packet);
+//   }
 
   /**
@@ -190,4 +180,8 @@
 //     usleep(5000); // TODO remove
     return;
+  }
+  
+  bool Server::queuePacket(ENetPacket *packet, int clientID){
+    return connection->addPacket(packet, clientID);
   }
 
@@ -211,10 +205,10 @@
         break;
       case ENET_EVENT_TYPE_DISCONNECT:
-        if(clients->findClient(&event->peer->address))
+        if(ClientInformation::findClient(&event->peer->address))
           disconnectClient(event);
         break;
       case ENET_EVENT_TYPE_RECEIVE:
-        if(clients->findClient(&event->peer->address)){
-          clientID = clients->findClient(&event->peer->address)->getID();
+        if(ClientInformation::findClient(&event->peer->address)){
+          clientID = ClientInformation::findClient(&event->peer->address)->getID();
           if( !elaborate(event->packet, clientID) ) 
             COUT(3) << "Server: could not elaborate" << std::endl;
@@ -247,15 +241,12 @@
   bool Server::sendGameState() {
     COUT(5) << "Server: starting function sendGameState" << std::endl;
-    ClientInformation *temp = clients;
+    ClientInformation *temp = ClientInformation::getBegin();
     bool added=false;
     while(temp != NULL){
-      if(temp->getHead()){
-        temp=temp->next();
-        //think this works without continue
-        continue;
-      }
       if( !(temp->getSynched()) ){
         COUT(5) << "Server: not sending gamestate" << std::endl;
         temp=temp->next();
+        if(!temp)
+          break;
         //think this works without continue
         continue;
@@ -320,21 +311,21 @@
   }
   
-  void Server::processChat( chat *data, int clientId){
-    char *message = new char [strlen(data->message)+10+1];
-    sprintf(message, "Player %d: %s", clientId, data->message);
-    COUT(1) << message << std::endl;
-    ENetPacket *pck = packet_gen.chatMessage(message);
-    connection->addPacketAll(pck);
-    delete[] data->message;
-    delete data;
-  }
+//   void Server::processChat( chat *data, int clientId){
+//     char *message = new char [strlen(data->message)+10+1];
+//     sprintf(message, "Player %d: %s", clientId, data->message);
+//     COUT(1) << message << std::endl;
+//     ENetPacket *pck = packet_gen.chatMessage(message);
+//     connection->addPacketAll(pck);
+//     delete[] data->message;
+//     delete data;
+//   }
   
   bool Server::addClient(ENetEvent *event){
-    ClientInformation *temp = clients->insertBack(new ClientInformation);
+    ClientInformation *temp = ClientInformation::insertBack(new ClientInformation);
     if(!temp){
       COUT(2) << "Server: could not add client" << std::endl;
       return false;
     }
-    if(temp->prev()->getHead()) { //not good if you use anything else than insertBack
+    if(temp->prev()->getBegin()) { //not good if you use anything else than insertBack
       temp->prev()->setID(0); //bugfix: not necessary but usefull
       temp->setID(1);
@@ -348,5 +339,5 @@
   
   bool Server::createClient(int clientID){
-    ClientInformation *temp = clients->findClient(clientID);
+    ClientInformation *temp = ClientInformation::findClient(clientID);
     if(!temp){
       COUT(2) << "Conn.Man. could not create client with id: " << clientID << std::endl;
@@ -376,4 +367,6 @@
     }
     orxonox::SpaceShip *no = dynamic_cast<orxonox::SpaceShip *>(id->fabricate());
+    no->classID = id->getNetworkID();
+    client->setShipID(no->objectID);
     no->setPosition(orxonox::Vector3(0,0,80));
     no->setScale(10);
@@ -388,8 +381,7 @@
     no->setRotDamp(1.0);
     no->setCamera("cam_"+client->getID());
-    no->classID = id->getNetworkID();
     no->create();
+    no->setBacksync(true);
     
-    client->setShipID(no->objectID);
     return true;
   }
@@ -401,5 +393,5 @@
     //boost::recursive_mutex::scoped_lock lock(head_->mutex_);
     orxonox::Iterator<orxonox::SpaceShip> it = orxonox::ObjectList<orxonox::SpaceShip>::start();
-    ClientInformation *client = clients->findClient(&event->peer->address);
+    ClientInformation *client = ClientInformation::findClient(&event->peer->address);
     if(!client)
       return false;
@@ -412,5 +404,5 @@
       ++it;
       delete  *temp;
-      return clients->removeClient(event->peer);
+      return ClientInformation::removeClient(event->peer);
     }
     return false;
@@ -418,5 +410,5 @@
 
   void Server::disconnectClient(int clientID){
-    ClientInformation *client = clients->findClient(clientID);
+    ClientInformation *client = ClientInformation::findClient(clientID);
     if(client)
       disconnectClient(client);
Index: /code/branches/network/src/network/Server.h
===================================================================
--- /code/branches/network/src/network/Server.h	(revision 1665)
+++ /code/branches/network/src/network/Server.h	(revision 1666)
@@ -46,4 +46,5 @@
 #include <string>
 
+#include "Host.h"
 #include "PacketManager.h"
 
@@ -58,17 +59,16 @@
   * It implements all functions necessary for a Server
   */
-  class _NetworkExport Server : public PacketDecoder{
+  class _NetworkExport Server : public PacketDecoder, public Host{
   public:
-    static Server *createSingleton();
-    static Server *createSingleton(int port);
-    static Server *createSingleton(int port, std::string bindAddress);
-    static Server *createSingleton(int port, const char *bindAddress);
-    
-    static Server *getSingleton();
+    Server();
+    Server(int port);
+    Server(int port, std::string bindAddress);
+    Server(int port, const char *bindAddress);
     
     void open();
     void close();
-    bool sendChat(std::string msg);
-    bool sendChat(const char *msg);
+    bool processChat(packet::Chat *message, unsigned int clientID);
+    bool sendChat(packet::Chat *chat);
+    bool queuePacket(ENetPacket *packet, int clientID);
     void tick(float time);
   protected:
@@ -76,10 +76,6 @@
     void updateGamestate();
   private:
-    Server();
-    Server(int port);
-    Server(int port, std::string bindAddress);
-    Server(int port, const char *bindAddress);
-    
-    static Server *instance_;
+    int shipID(){return 0;}
+    int playerID(){return 0;}
     
     bool addClient(ENetEvent *event);
@@ -93,10 +89,10 @@
     bool processConnectRequest( connectRequest *con, int clientID );
     void processGamestate( GameStateCompressed *data, int clientID);
-    void processChat( chat *data, int clientId);
+    //void processChat( chat *data, int clientId);
     ConnectionManager *connection;
     GameStateManager *gamestates;
     PacketGenerator packet_gen;
 
-    ClientInformation *clients;
+    
     float timeSinceLastUpdate_;
   };
Index: de/branches/network/src/network/dummyclient.cc
===================================================================
--- /code/branches/network/src/network/dummyclient.cc	(revision 1665)
+++ 	(revision )
@@ -1,124 +1,0 @@
-/*
- *   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, (C) 2007
- *   Co-authors:
- *      ...
- *
- */
-
-//o
-// Dummy client to test ConnectionManager and PacketBuffer classes
-//
-// Author: Oliver Scheuss
-
-#include <iostream>
-#include <string>
-#include <enet/enet.h>
-
-#include "util/Sleep.h"
-#include "PacketManager.h"
-#include "PacketTypes.h"
-
-using namespace std;
-
-int main(){
-  ENetHost * client;
-  ENetAddress address;
-  ENetEvent event;
-  ENetPeer *peer;
-  network::PacketGenerator pck;
-
-  enet_initialize();
-  atexit(enet_deinitialize);
-
-  cout << "Enter address of the server xxx.xxx.xxx.xxx (enter for localhost)" << endl;
-  string str;
-  getline(cin, str);
-  cout << "You entered: " << str << endl;
-  if(str.compare("")==0)
-    str="127.0.0.1";
-
-  enet_address_set_host(&address, str.c_str());
-  address.port = 55556;
-
-  // create client object
-  client = enet_host_create(NULL, 2, 0, 0);
-
-  if(client==NULL){
-    fprintf(stderr, "An error occured");
-    exit(EXIT_FAILURE);
-  }
-  // connect peer
-  peer = enet_host_connect(client, &address, 2);
-  if(peer==NULL){
-    fprintf(stderr, "Peer establishing error");
-    exit(EXIT_FAILURE);
-  }
-  // wait 5 seconds for the connection attempt to succeed
-  if(enet_host_service(client, &event, 5000) > 0 && event.type == ENET_EVENT_TYPE_CONNECT){
-    cout << "Connection to " << str << " succeeded." << endl;
-    //puts("Connection to localhost:5555 succeeded.");
-  }else{
-    enet_peer_reset(peer);
-    cout << "Connection to " << str << " failed." << endl;
-    //puts("Connection to localhost:5555 failed.");
-    exit(EXIT_FAILURE);
-  }
-
-  for(int i=0; i<10; i++){
-    // weihnachtsmann bringt packete
-    //ENetPacket *packet = enet_packet_create ("packet1234", strlen("packet1234") + 1, ENET_PACKET_FLAG_RELIABLE);
-    // extend the packet and append the string foo to it
-    // send packet to peer on channel id 0
-    enet_peer_send(peer, 1, pck.chatMessage("test2"));
-    // keep the timeout very small for low delay
-    if(enet_host_service(client, &event, 1)==0){
-      cout << "successfully sent: " << event.type << endl;
-    }else{
-      cout << "failed sending" << endl;
-    }
-    usleep(1000000);
-  }
-
-  // now disconnect
-  //   enet_peer_disconnect (peer);
-  enet_peer_disconnect (peer, 0);
-  // 3 seconds timeout
-  while(enet_host_service(client, &event, 3000) > 0){
-    switch (event.type)
-    {
-    case ENET_EVENT_TYPE_RECEIVE:
-      enet_packet_destroy(event.packet);
-      break;
-    case ENET_EVENT_TYPE_DISCONNECT:
-      puts("Disconnection succeeded.");
-      return 0;
-    }
-  }
-  // if disconnect failed
-  enet_peer_reset(peer);
-
-
-
-  return 0;
-}
Index: de/branches/network/src/network/dummyclient2.cc
===================================================================
--- /code/branches/network/src/network/dummyclient2.cc	(revision 1665)
+++ 	(revision )
@@ -1,92 +1,0 @@
-/*
- *   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, (C) 2007
- *   Co-authors:
- *      ...
- *
- */
-
-//
-// Dummy client to test ConnectionManager, PacketBuffer, ClientConnection and other classes
-//
-// Author: Oliver Scheuss
-
-#include <iostream>
-#include <string>
-#include <enet/enet.h>
-
-#include "util/Sleep.h"
-#include "PacketManager.h"
-#include "PacketTypes.h"
-#include "ClientConnection.h"
-
-using namespace network;
-
-int main(){
-  network::PacketGenerator pck;
-
-  std::cout << "Enter address of the server xxx.xxx.xxx.xxx (enter for localhost)" << std::endl;
-  std::string str;
-  std::getline(std::cin, str);
-  std::cout << "You entered: " << str << std::endl;
-  if(str.compare("")==0)
-    str="127.0.0.1";
-
-  ClientConnection client = ClientConnection(55556, str);
-
-  client.createConnection();
-
-  if(client.waitEstablished(10000))
-    std::cout << "Connection established" << std::endl;
-  else
-    std::cout << "Connection failed" << std::endl;
-
-  ENetPacket *packet;  //FIXME: unused var!
-  ENetEvent event;
-
-
-
-  for(int i=0; i<10; i++){
-    // weihnachtsmann bringt packete
-    // extend the packet and append the string foo to it
-    // send packet to peer on channel id 0
-    client.addPacket(pck.chatMessage("test"));
-    // keep the timeout very small for low delay
-    if(client.sendPackets(&event)){
-      std::cout << "successfully sent: " << event.type << std::endl;
-    }else{
-      std::cout << "failed sending" << std::endl;
-    }
-    //    usleep(1000000);
-  }
-  usleep(1000000);
-  // now disconnect
-  if(client.closeConnection())
-    std::cout << "Connection successfully closed" << std::endl;
-  else
-    std::cout << "Connection closing failed" << std::endl;
-
-  // 3 seconds timeout
-  return 0;
-}
-
Index: de/branches/network/src/network/dummyclient3.cc
===================================================================
--- /code/branches/network/src/network/dummyclient3.cc	(revision 1665)
+++ 	(revision )
@@ -1,115 +1,0 @@
-/*
- *   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:
- *      ...
- *   Co-authors:
- *      ...
- *
- */
-
-#include "Client.h"
-
-#include <iostream>
-#include <string>
-
-#include "util/Sleep.h"
-#include "PacketManager.h"
-#include "PacketTypes.h"
-
-using namespace network;
-
-void sender(){
-
-  network::PacketGenerator pck;
-  const int PORT = 55556;
-  COUT(0) << "Enter address of the server xxx.xxx.xxx.xxx (enter for localhost)" << std::endl;
-  std::string str;
-  std::getline(std::cin, str);
-  COUT(3) << "You entered: " << str << std::endl;
-  if(str.compare("")==0)
-    str="127.0.0.1";
-
-  Client client( str, PORT );
-  if ( client.establishConnection() )
-  {
-    COUT(3) << "connection established" << std::endl;
-  }
-  else
-  {
-    COUT(0) << "problems establishing connection" << std::endl;
-  }
-  char message[10000];
-  char signs[] = "abcdefghijklmnopqrstuvwxy";
-  while (true) {
-    client.tick(0);
-
-    std::cout << "your message2: ";
-    for ( int i=0; i<9999; i++ ) {
-      message[i] = signs[0];
-    }
-    message[9999] = 'z';
-    std::string str( message );
-    client.sendChat( str );
-    std::cout << str << std::endl;
-    std::cin.get(); std::cin.get();
-  }
-
-
-
-}
-
-void listener(){
-
-  const int PORT = 55556;
-  std::cout << "Enter address of the server xxx.xxx.xxx.xxx (enter for localhost)" << std::endl;
-  std::string str;
-  std::getline(std::cin, str);
-  std::cout << "You entered: " << str << std::endl;
-  if(str.compare("")==0)
-    str="127.0.0.1";
-
-  Client client( str, PORT );
-  if ( client.establishConnection() )
-    std::cout << "connection established" << std::endl;
-  else std::cout << "problems establishing connection" << std::endl;
-
-  while (true) {
-    client.tick(0);
-    usleep(100);
-  }
-
-
-
-}
-
-
-int main(int argc, char **argv[]){
-  std::string in;
-  std::cout << "Please choose: sender(s) oder listener(l)" << std::endl;
-  std::getline(std::cin, in);
-  if(in.compare("l")==0)
-    listener();
-  else if(in.compare("s")==0)
-    sender();
-  else
-    std::cout << "wrong answer" << std::endl;
-}
Index: de/branches/network/src/network/dummyclient4.cc
===================================================================
--- /code/branches/network/src/network/dummyclient4.cc	(revision 1665)
+++ 	(revision )
@@ -1,29 +1,0 @@
-#include <iostream>
-#include <string>
-#include <enet/enet.h>
-#include <network/PacketManager.h>
-#include <network/PacketTypes.h>
-#include <network/Client.h>
-#include "core/Tickable.h"
-#include "core/BaseObject.h"
-#include "Synchronisable.h"
-#include "core/CoreIncludes.h"
-#include "objects/SpaceShip.h"
-
-int main() {
-  std::cout << "dummyclient4" << std::endl;
-  network::Client* client;
-  client = network::Client::createSingleton( "127.0.0.1", 55556 );
-  if(client->establishConnection())
-    std::cout << "established connection" << std::endl;
-  else{
-    std::cout << "could not establish connection" << std::endl;
-    return -1;
-  }
-  if(client->closeConnection())
-    std::cout << "closed connection" << std::endl;
-  else
-    std::cout << "could not close connection" << std::endl;
-}
-
-
Index: de/branches/network/src/network/dummyserver.cc
===================================================================
--- /code/branches/network/src/network/dummyserver.cc	(revision 1665)
+++ 	(revision )
@@ -1,74 +1,0 @@
-/*
- *   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, (C) 2007
- *   Co-authors:
- *      ...
- *
- */
-
-//
-// Dummy server to test ConnectionManager and PacketBuffer classes
-//
-// Author: Oliver Scheuss
-
-#include <iostream>
-#include <enet/enet.h>
-
-#include "util/Sleep.h"
-#include "ConnectionManager.h"
-#include "PacketManager.h"
-#include "PacketTypes.h"
-#include "ClientInformation.h"
-
-using namespace network;
-
-int main(){
-  bool quit=false;
-  ENetPacket *packet;
-  ClientInformation clients;
-  ConnectionManager server = ConnectionManager(&clients);
-  server.createListener();
-
-  PacketDecoder dec;
-
-  while(!quit){
-    if(server.queueEmpty())
-      // Warning: usleep(100) is Sleep(100/1000) = Sleep(0), which is nothing!
-      usleep(1);
-    else{
-      ENetAddress addr;
-      packet=server.getPacket(addr);
-      if(packet==NULL){
-        // there was some error
-        //std::cout << "null pointer" << std::endl;
-        quit=true;
-      }
-      else{
-        //std::cout << "We received: " << packet->data << std::endl;
-        dec.elaborate(packet, 1);
-      }
-    }
-  }
-  server.quitListener();
-  return 0;
-}
Index: de/branches/network/src/network/dummyserver3.cc
===================================================================
--- /code/branches/network/src/network/dummyserver3.cc	(revision 1665)
+++ 	(revision )
@@ -1,81 +1,0 @@
-/*
- *   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, (C) 2007
- *   Co-authors:
- *      ...
- *
- */
-
-#include "Server.h"
-
-#include <iostream>
-
-#include "util/Sleep.h"
-#include "PacketManager.h"
-#include "PacketTypes.h"
-
-namespace network
-{
-
-  class dummyserver3 : public Server
-  {
-  public:
-    dummyserver3();
-    ~dummyserver3();
-    void loop();
-  private:
-    void tick();
-    void processChat( chat *data, int clientId);
-
-
-  };
-
-  dummyserver3::dummyserver3(){
-  }
-  dummyserver3::~dummyserver3(){
-  }
-
-  void dummyserver3::loop(){
-    open();
-    while(true){
-      tick();
-      usleep(100);
-    }
-  }
-
-  void dummyserver3::processChat( chat *data, int clientId){
-    std::cout << "Client " << clientId << " sent: " << data->message << std::endl;
-    sendMSG(data->message);
-  }
-
-  void dummyserver3::tick(){
-    processQueue();
-  }
-
-}
-
-int main(int argc, char **argv[]){
-  network::dummyserver3 server;
-  server.loop();
-  return 0;
-}
Index: de/branches/network/src/network/dummyserver4.cc
===================================================================
--- /code/branches/network/src/network/dummyserver4.cc	(revision 1665)
+++ 	(revision )
@@ -1,22 +1,0 @@
-#include <iostream>
-#include <string>
-#include <enet/enet.h>
-#include <network/PacketManager.h>
-#include <network/PacketTypes.h>
-#include <network/Server.h>
-#include "core/Tickable.h"
-#include "core/BaseObject.h"
-#include "Synchronisable.h"
-#include "core/CoreIncludes.h"
-#include "objects/SpaceShip.h"
-#include "util/Sleep.h"
-
-int main() {
-  network::Server *server = new network::Server();
-  server->open();
-  while(true){
-    usleep( 1000 );
-  }
-  server->close();
-  return 0;
-}
