Index: code/branches/network/src/network/Client.cc
===================================================================
--- code/branches/network/src/network/Client.cc	(revision 1498)
+++ code/branches/network/src/network/Client.cc	(revision 1499)
@@ -153,20 +153,8 @@
     if(!isConnected)
       return false;
-    if(client_connection.addPacket(pck_gen.chatMessage( message.c_str() )))
-      return client_connection.sendPackets();
+    return client_connection.addPacket(pck_gen.chatMessage( message.c_str() ));
+      //return client_connection.sendPackets();
     // send packets
     return false;
-  }
-
-
-  /**
-  * Sends out all the packets queued by addXXX
-  */
-  bool Client::sendPackets(){
-    if(!isConnected)
-      return false;
-    // send packets
-    client_connection.sendPackets();
-    return true;
   }
 
@@ -215,6 +203,6 @@
     }// otherwise we had no gamestate to load
     gamestate.cleanup();
-    if(!client_connection.sendPackets())
-      COUT(3) << "Problem sending packets to server" << std::endl;
+    /*if(!client_connection.sendPackets())
+      COUT(3) << "Problem sending packets to server" << std::endl;*/
     return;
   }
Index: code/branches/network/src/network/Client.h
===================================================================
--- code/branches/network/src/network/Client.h	(revision 1498)
+++ code/branches/network/src/network/Client.h	(revision 1499)
@@ -77,6 +77,4 @@
     bool sendChat( std::string message );
     
-    bool sendPackets();
-    
     int getShipID(){return shipID_;}
     int getClientID(){return clientID_;}
Index: code/branches/network/src/network/ClientConnection.cc
===================================================================
--- code/branches/network/src/network/ClientConnection.cc	(revision 1498)
+++ code/branches/network/src/network/ClientConnection.cc	(revision 1499)
@@ -163,7 +163,7 @@
       return;
     }
+    event = new ENetEvent;
     //main loop
     while(!quit){
-      event = new ENetEvent;
       //std::cout << "connection loop" << std::endl;
       {
@@ -185,4 +185,5 @@
         if ( !processData(event) ) COUT(2) << "Current packet was not pushed to packetBuffer -> ev ongoing SegFault" << std::endl;
         COUT(5) << "Cl.Con: processed Data in receiver-thread while loop" << std::endl;
+        event = new ENetEvent;
         break;
       case ENET_EVENT_TYPE_DISCONNECT:
@@ -192,7 +193,8 @@
         break;
       case ENET_EVENT_TYPE_NONE:
-        continue;
+        //receiverThread_->yield();
+        usleep(1000);
+        break;
       }
-      receiverThread_->yield();
     }
     // now disconnect
Index: code/branches/network/src/network/ClientConnection.h
===================================================================
--- code/branches/network/src/network/ClientConnection.h	(revision 1498)
+++ code/branches/network/src/network/ClientConnection.h	(revision 1499)
@@ -54,5 +54,5 @@
 #define NETWORK_PORT 55556
 #define NETWORK_CLIENT_MAX_CONNECTIONS 5
-#define NETWORK_CLIENT_TIMEOUT 10
+#define NETWORK_CLIENT_TIMEOUT 1
 #define NETWORK_CLIENT_CHANNELS 2
 
Index: code/branches/network/src/network/ConnectionManager.cc
===================================================================
--- code/branches/network/src/network/ConnectionManager.cc	(revision 1498)
+++ code/branches/network/src/network/ConnectionManager.cc	(revision 1499)
@@ -169,4 +169,5 @@
   }
 
+  // we actually dont need that function, because host_service does that for us
   bool ConnectionManager::sendPackets() {
     if(server==NULL)
@@ -194,6 +195,6 @@
     }
 
+    event = new ENetEvent;
     while(!quit){
-      event = new ENetEvent;
       { //mutex scope
         boost::recursive_mutex::scoped_lock lock(enet_mutex_);
@@ -221,4 +222,5 @@
           //if(head_->findClient(&event->peer->address))
             processData(event);
+            event = new ENetEvent;
 //           else
 //             COUT(3) << "received a packet from a client we don't know" << std::endl;
@@ -228,6 +230,6 @@
           //break;
         case ENET_EVENT_TYPE_NONE:
-          delete event;
-          receiverThread_->yield();
+          //receiverThread_->yield();
+          usleep(1000);
           break;
       }
@@ -287,25 +289,5 @@
   }
 
-/**
-This function adds a client that connects to the clientlist of the server
-NOTE: if you change this, don't forget to change the test function
-addClientTest in diffTest.cc since addClient is not good for testing because of syncClassid
-*/
-  /*bool ConnectionManager::addClient(ENetEvent *event) {
-    ClientInformation *temp = head_->insertBack(new ClientInformation);
-    if(!temp){
-      COUT(2) << "Conn.Man. could not add client" << std::endl;
-      return false;
-    }
-    if(temp->prev()->getHead()) { //not good if you use anything else than insertBack
-      temp->prev()->setID(0); //bugfix: not necessary but usefull
-      temp->setID(1);
-    }
-    else
-      temp->setID(temp->prev()->getID()+1);
-    temp->setPeer(event->peer);
-    COUT(3) << "Con.Man: added client id: " << temp->getID() << std::endl;
-    return true;
-  }*/
+
 
   int ConnectionManager::getClientID(ENetPeer peer) {
@@ -341,74 +323,9 @@
       ++it;
     }
-    sendPackets();
+    //sendPackets();
     COUT(4) << "syncClassid:\tall synchClassID packets have been sent" << std::endl;
   }
 
-  /*bool ConnectionManager::createClient(int clientID){
-    ClientInformation *temp = head_->findClient(clientID);
-    if(!temp){
-      COUT(2) << "Conn.Man. could not create client with id: " << clientID << std::endl;
-      return false;
-    }
-    COUT(4) << "Con.Man: creating client id: " << temp->getID() << std::endl;
-    syncClassid(temp->getID());
-    COUT(4) << "creating spaceship for clientid: " << temp->getID() << std::endl;
-    // TODO: this is only a hack, until we have a possibility to define default player-join actions
-    if(!createShip(temp))
-      COUT(2) << "Con.Man. could not create ship for clientid: " << clientID << std::endl;
-    else
-      COUT(3) << "created spaceship" << std::endl;
-    temp->setSynched(true);
-    COUT(3) << "sending welcome" << std::endl;
-    sendWelcome(temp->getID(), temp->getShipID(), true);
-    return true;
-  }*/
-  
-  /*bool ConnectionManager::removeClient(int clientID){
-    boost::recursive_mutex::scoped_lock lock(head_->mutex_);
-    orxonox::Iterator<orxonox::SpaceShip> it = orxonox::ObjectList<orxonox::SpaceShip>::start();
-    ClientInformation *client = head_->findClient(clientID);
-    if(!client)
-      return false;
-    while(it){
-      if(it->objectID!=client->getShipID()){
-        ++it;
-        continue;
-      }
-      orxonox::Iterator<orxonox::SpaceShip> temp=it;
-      ++it;
-      delete  *temp;
-      return head_->removeClient(clientID);
-    }
-    return false;
-  }*/
-  
-/*  bool ConnectionManager::createShip(ClientInformation *client){
-    if(!client)
-      return false;
-    orxonox::Identifier* id = ID("SpaceShip");
-    if(!id){
-      COUT(4) << "We could not create the SpaceShip for client: " << client->getID() << std::endl;
-      return false;
-    }
-    orxonox::SpaceShip *no = dynamic_cast<orxonox::SpaceShip *>(id->fabricate());
-    no->setPosition(orxonox::Vector3(0,0,80));
-    no->setScale(10);
-    //no->setYawPitchRoll(orxonox::Degree(-90),orxonox::Degree(-90),orxonox::Degree(0));
-    no->setMesh("assff.mesh");
-    no->setMaxSpeed(500);
-    no->setMaxSideAndBackSpeed(50);
-    no->setMaxRotation(1.0);
-    no->setTransAcc(200);
-    no->setRotAcc(3.0);
-    no->setTransDamp(75);
-    no->setRotDamp(1.0);
-    no->setCamera("cam_"+client->getID());
-    no->classID = id->getNetworkID();
-    no->create();
-    
-    client->setShipID(no->objectID);
-    return true;
-  }*/
+  
   
   bool ConnectionManager::removeShip(ClientInformation *client){
@@ -425,5 +342,5 @@
   bool ConnectionManager::sendWelcome(int clientID, int shipID, bool allowed){
     if(addPacket(packet_gen.generateWelcome(clientID, shipID, allowed),clientID)){
-      sendPackets();
+      //sendPackets();
       return true;
     }else
@@ -448,36 +365,4 @@
   
   
-//   int ConnectionManager::getNumberOfClients() {
-//     
-//     return clientsShip.size();
-//   }
-  
-  /*void ConnectionManager::addClientsObjectID( int clientID, int objectID ) {
-  COUT(4) << "ship of client: " << clientID << ": " << objectID << " mapped" << std::endl;
-  clientsShip.insert( std::make_pair( clientID, objectID ) );
+
 }
-
-  int ConnectionManager::getClientsShipID( int clientID ) {
-  return clientsShip[clientID];
-}
-
-  int ConnectionManager::getObjectsClientID( int objectID ) {
-  std::map<int, int>::iterator iter;
-  for( iter = clientsShip.begin(); iter != clientsShip.end(); iter++ ) {
-  if( iter->second == objectID ) return iter->first;
-}
-  return -99;
-}
-
-  void ConnectionManager::deleteClientIDReg( int clientID ) {
-  clientsShip.erase( clientID );
-}
-
-  void ConnectionManager::deleteObjectIDReg( int objectID ) {
-  std::map<int, int>::iterator iter = clientsShip.begin();
-  for( iter = clientsShip.begin(); iter != clientsShip.end(); iter++ ) {
-  if( iter->second == objectID ) break;
-}
-  clientsShip.erase( iter->first );
-}*/
-}
Index: code/branches/network/src/network/ConnectionManager.h
===================================================================
--- code/branches/network/src/network/ConnectionManager.h	(revision 1498)
+++ code/branches/network/src/network/ConnectionManager.h	(revision 1499)
@@ -62,5 +62,5 @@
 #define NETWORK_PORT 55556
 #define NETWORK_MAX_CONNECTIONS 50
-#define NETWORK_WAIT_TIMEOUT 10
+#define NETWORK_WAIT_TIMEOUT 1
 
   struct ClientList{
Index: code/branches/network/src/network/Server.cc
===================================================================
--- code/branches/network/src/network/Server.cc	(revision 1498)
+++ code/branches/network/src/network/Server.cc	(revision 1499)
@@ -130,9 +130,5 @@
     ENetPacket *packet = packet_gen.chatMessage(msg.c_str());
     //std::cout <<"adding packets" << std::endl;
-    if(connection->addPacketAll(packet))
-    //std::cout <<"added packets" << std::endl;
-      return connection->sendPackets();
-    else
-      return false;
+    return connection->addPacketAll(packet);
   }
 
@@ -145,11 +141,5 @@
     ENetPacket *packet = packet_gen.chatMessage(msg);
     COUT(4) <<"Server: adding Packets" << std::endl;
-    connection->addPacketAll(packet);
-    //std::cout <<"added packets" << std::endl;
-    if (connection->sendPackets()){
-      COUT(4) << "Server: Sucessfully" << std::endl;
-      return true;
-    }
-    return false;
+    return connection->addPacketAll(packet);
   }
 
@@ -184,4 +174,5 @@
       if(!event)
         continue;
+      assert(event->type != ENET_EVENT_TYPE_NONE);
       switch( event->type ) {
       case ENET_EVENT_TYPE_CONNECT:
@@ -265,10 +256,10 @@
       delete gs;
     }
-    if(added) {
+    /*if(added) {
       //std::cout << "send gamestates from server.cc in sendGameState" << std::endl;
       return connection->sendPackets();
-    }
-    COUT(5) << "Server: had no gamestates to send" << std::endl;
-    return false;
+    }*/
+    //COUT(5) << "Server: had no gamestates to send" << std::endl;
+    return true;
   }
 
