Index: code/branches/netp5/src/network/Client.cc
===================================================================
--- code/branches/netp5/src/network/Client.cc	(revision 3201)
+++ code/branches/netp5/src/network/Client.cc	(revision 3202)
@@ -50,9 +50,6 @@
 #include "FunctionCallManager.h"
 
-// #include "packet/Acknowledgement.h"
-
 namespace orxonox
 {
-//   SetConsoleCommandShortcut(Client, chat);
 
 
@@ -61,9 +58,8 @@
   * initializes the address and the port to default localhost:NETWORK_PORT
   */
-  Client::Client(): client_connection(NETWORK_PORT,"127.0.0.1"){
-    // set server address to localhost
-    isConnected=false;
-    isSynched_=false;
-    gameStateFailure_=false;
+  Client::Client():
+      isSynched_(false),
+      gameStateFailure_(false)
+  {
   }
 
@@ -73,23 +69,12 @@
   * @param port port of the application on the server
   */
-  Client::Client(const std::string& address, int port) : client_connection(port, address){
-    isConnected=false;
-    isSynched_=false;
-    gameStateFailure_=false;
-  }
-
-  /**
-  * Constructor for the Client class
-  * @param address the server address
-  * @param port port of the application on the server
-  */
-  Client::Client(const char *address, int port) : client_connection(port, address){
-    isConnected=false;
-    isSynched_=false;
-    gameStateFailure_=false;
+  Client::Client(const std::string& address, int port):
+      isSynched_(false),
+      gameStateFailure_(false)
+  {
   }
 
   Client::~Client(){
-    if(isConnected)
+    if ( ClientConnection::isConnected() )
       closeConnection();
   }
@@ -101,8 +86,5 @@
   bool Client::establishConnection(){
     Synchronisable::setClient(true);
-    isConnected=client_connection.createConnection();
-    if(!isConnected)
-      COUT(1) << "could not create connection laber" << std::endl;
-    return isConnected;
+    return ClientConnection::establishConnection();
   }
 
@@ -112,10 +94,11 @@
   */
   bool Client::closeConnection(){
-    isConnected=false;
-    return client_connection.closeConnection();
+    return ClientConnection::closeConnection();
   }
 
   bool Client::queuePacket(ENetPacket *packet, int clientID){
-    return client_connection.addPacket(packet);
+    bool b = ClientConnection::addPacket(packet);
+    assert(b);
+    return b;
   }
 
@@ -143,8 +126,10 @@
     //this steers our network frequency
     timeSinceLastUpdate_+=time.getDeltaTime();
-    if(timeSinceLastUpdate_>=NETWORK_PERIOD){
+    if(timeSinceLastUpdate_>=NETWORK_PERIOD)
+    {
       timeSinceLastUpdate_ -= static_cast<unsigned int>( timeSinceLastUpdate_ / NETWORK_PERIOD ) * NETWORK_PERIOD;
       //     COUT(3) << ".";
-      if(client_connection.isConnected() && isSynched_){
+      if ( isConnected() && isSynched_ )
+      {
         COUT(4) << "popping partial gamestate: " << std::endl;
         packet::Gamestate *gs = gamestate.getGamestate();
@@ -159,16 +144,7 @@
       }
     }
+    sendPackets(); // flush the enet queue
     
-    ENetEvent *event;
-    // stop if the packet queue is empty
-    while(!(client_connection.queueEmpty())){
-      event = client_connection.getEvent();
-      COUT(5) << "tick packet size " << event->packet->dataLength << std::endl;
-      packet::Packet *packet = packet::Packet::createPacket(event->packet, event->peer);
-      // note: packet commits suicide here except for the GameState. That is then deleted by a GamestateHandler
-      bool b = packet->process();
-      assert(b);
-      delete event;
-    }
+    Connection::processQueue();
     if(gamestate.processGamestates())
     {
Index: code/branches/netp5/src/network/Client.h
===================================================================
--- code/branches/netp5/src/network/Client.h	(revision 3201)
+++ code/branches/netp5/src/network/Client.h	(revision 3202)
@@ -61,9 +61,8 @@
   *
   */
-  class _NetworkExport Client : public Host{
+  class _NetworkExport Client : public Host, public ClientConnection{
   public:
     Client();
     Client(const std::string& address, int port);
-    Client(const char *address, int port);
     ~Client();
 
@@ -74,5 +73,4 @@
     virtual bool chat(const std::string& message);
     virtual bool broadcast(const std::string& message) { return false; }
-    //bool sendChat(packet::Chat *chat);
 
     void update(const Clock& time);
@@ -82,7 +80,5 @@
     virtual bool isServer_(){return false;}
 
-    ClientConnection client_connection;
     GamestateClient gamestate;
-    bool isConnected;
     bool isSynched_;
 
Index: code/branches/netp5/src/network/ClientConnection.cc
===================================================================
--- code/branches/netp5/src/network/ClientConnection.cc	(revision 3201)
+++ code/branches/netp5/src/network/ClientConnection.cc	(revision 3202)
@@ -27,218 +27,49 @@
  */
 
-//
-// C++ Interface: ClientConnection
-//
-// Description: The Class ClientConnection manages the servers conenctions to the clients.
-// each connection is provided by a new process. communication between master process and
-// connection processes is provided by ...
-//
-//
-// Author:  Oliver Scheuss
-//
-
 #include "ClientConnection.h"
 
-#include <enet/enet.h>
 #include <iostream>
 #include <cassert>
-// boost.thread library for multithreading support
-#include <boost/thread/thread.hpp>
-#include <boost/bind.hpp>
-#include <boost/thread/recursive_mutex.hpp>
 
-#include "util/Sleep.h"
 #include "util/Debug.h"
 
 namespace orxonox
 {
-  //static boost::thread_group network_threads;
+  const unsigned int NETWORK_CLIENT_WAIT_TIME = 1;
+  const unsigned int NETWORK_CLIENT_CONNECTION_TIMEOUT = 3000; //millisecs
+  const unsigned int NETWORK_CLIENT_MAX_CONNECTIONS = 5;
+  const unsigned int NETWORK_CLIENT_CHANNELS = 2;
 
-  static boost::recursive_mutex enet_mutex_g;
 
-  ClientConnection::ClientConnection(int port, const std::string& address) {
-    quit_=false;
-    server=NULL;
-    serverAddress = new ENetAddress();
-    enet_address_set_host(serverAddress, address.c_str());
-    serverAddress->port = port;
-    established=false;
-  }
-
-  ClientConnection::ClientConnection(int port, const char *address) {
-    quit_=false;
-    server=NULL;
-    serverAddress = new ENetAddress();
-    enet_address_set_host(serverAddress, address);
-    serverAddress->port = port;
-    established=false;
-  }
-
-  bool ClientConnection::waitEstablished(int milisec) {
-    for(int i=0; i<=milisec && !established; i++)
-      msleep(1);
-
-    return established;
+  ClientConnection::ClientConnection():
+    server_(NULL),
+    established_(false)
+  {
+    this->serverAddress_ = new ENetAddress();
+    //set standard address and port
+    enet_address_set_host(this->serverAddress_, "127.0.0.1");
+    serverAddress_->port = NETWORK_PORT;
   }
 
   ClientConnection::~ClientConnection(){
-    if(established)
+    if(this->established_)
       closeConnection();
-    delete serverAddress; // surely was created
+    delete this->serverAddress_; // surely was created
   }
 
-  ENetEvent *ClientConnection::getEvent(){
-    if(!buffer.isEmpty())
-      return buffer.pop();
-    else
-      return NULL;
-  }
-
-  bool ClientConnection::queueEmpty() {
-    return buffer.isEmpty();
-  }
-
-  bool ClientConnection::createConnection() {
-    receiverThread_ = new boost::thread(boost::bind(&ClientConnection::receiverThread, this));
-    //network_threads.create_thread(boost::bind(boost::mem_fn(&ClientConnection::receiverThread), this));
-    // wait 10 seconds for the connection to be established
-    return waitEstablished(NETWORK_CLIENT_CONNECT_TIMEOUT);
-  }
-
-  bool ClientConnection::closeConnection() {
-    quit_=true;
-    //network_threads.join_all();
-    receiverThread_->join();
-    established=false;
-    return true;
-  }
-
-
-  bool ClientConnection::addPacket(ENetPacket *packet) {
-    if(server==NULL)
-      return false;
-    if(packet==NULL){
-      COUT(3) << "Cl.con: addpacket: invalid packet" << std::endl;
+  bool ClientConnection::establishConnection()
+  {
+    ENetEvent event;
+    
+    this->host_ = enet_host_create(NULL, NETWORK_CLIENT_MAX_CONNECTIONS, 0, 0);
+    if ( this->host_ == NULL )
+    {
+      COUT(2) << "ClientConnection: host_ == NULL" << std::endl;
+      // error handling
       return false;
     }
-    boost::recursive_mutex::scoped_lock lock(enet_mutex_g);
-    if(enet_peer_send(server, 0, packet)<0)
-      return false;
-    else
-      return true;
-  }
-
-  bool ClientConnection::sendPackets() {
-    if(server==NULL)
-      return false;
-    boost::recursive_mutex::scoped_lock lock(enet_mutex_g);
-    enet_host_flush(client);
-    lock.unlock();
-    return true;
-  }
-
-  void ClientConnection::receiverThread() {
-    // what about some error-handling here ?
-    atexit(enet_deinitialize);
-    ENetEvent *event;
+    this->server_ = enet_host_connect(this->host_, serverAddress_, NETWORK_CLIENT_CHANNELS);
+    if ( this->server_==NULL )
     {
-      boost::recursive_mutex::scoped_lock lock(enet_mutex_g);
-      enet_initialize();
-      client = enet_host_create(NULL, NETWORK_CLIENT_MAX_CONNECTIONS, 0, 0);
-      lock.unlock();
-    }
-    if(client==NULL) {
-      COUT(2) << "ClientConnection: could not create client host" << std::endl;
-      // add some error handling here ==========================
-      quit_=true;
-    }
-    //connect to the server
-    if(!establishConnection()){
-      COUT(2) << "clientConn: receiver thread: could not establishConnection" << std::endl;
-      quit_=true;
-      return;
-    }
-    event = new ENetEvent;
-    //main loop
-    while(!quit_){
-      //std::cout << "connection loop" << std::endl;
-      {
-        boost::recursive_mutex::scoped_lock lock(enet_mutex_g);
-        if(enet_host_service(client, event, NETWORK_CLIENT_WAIT_TIME)<0){
-          // we should never reach this point
-// 	        assert(0);
-          printf("ClientConnection: ENet returned with an error!\n");
-//           quit_=true;
-          continue;
-          // add some error handling here ========================
-        }
-        lock.unlock();
-      }
-      switch(event->type){
-        // log handling ================
-      case ENET_EVENT_TYPE_CONNECT:
-        break;
-      case ENET_EVENT_TYPE_RECEIVE:
-        //COUT(5) << "Cl.Con: receiver-Thread while loop: got new packet" << std::endl;
-        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:
-        quit_=true;
-        printf("Received disconnect Packet from Server!\n");
-        // server closed the connection
-        return;
-        break;
-      case ENET_EVENT_TYPE_NONE:
-        //receiverThread_->yield();
-        msleep(1);
-        break;
-      }
-    }
-    delete event;
-    // now disconnect
-
-    if(!disconnectConnection())
-    {
-      printf("could not disconnect properly\n");
-      // if disconnecting failed destroy conn.
-      boost::recursive_mutex::scoped_lock lock(enet_mutex_g);
-      enet_peer_reset(server);
-    }
-    else
-      printf("properly disconnected\n");
-    return;
-  }
-
-  bool ClientConnection::disconnectConnection() {
-    ENetEvent event;
-    if(this->quit_)
-      return true;
-    boost::recursive_mutex::scoped_lock lock(enet_mutex_g);
-    enet_peer_disconnect(server, 0);
-    while(enet_host_service(client, &event, NETWORK_CLIENT_WAIT_TIME) >= 0){
-      switch (event.type)
-      {
-      case ENET_EVENT_TYPE_NONE:
-      case ENET_EVENT_TYPE_CONNECT:
-      case ENET_EVENT_TYPE_RECEIVE:
-        enet_packet_destroy(event.packet);
-        break;
-      case ENET_EVENT_TYPE_DISCONNECT:
-        printf("received disconnect confirmation from server");
-        return true;
-      }
-    }
-    enet_peer_reset(server);
-    return false;
-  }
-
-  bool ClientConnection::establishConnection() {
-    ENetEvent event;
-    // connect to peer (server is type ENetPeer*)
-    boost::recursive_mutex::scoped_lock lock(enet_mutex_g);
-    server = enet_host_connect(client, serverAddress, NETWORK_CLIENT_CHANNELS);
-    if(server==NULL) {
       COUT(2) << "ClientConnection: server == NULL" << std::endl;
       // error handling
@@ -246,19 +77,60 @@
     }
     // handshake
-    while(enet_host_service(client, &event, NETWORK_CLIENT_WAIT_TIME)>=0 && !quit_){
-      if( event.type == ENET_EVENT_TYPE_CONNECT ){
-        established=true;
+    for( unsigned int i=0; i<NETWORK_CLIENT_CONNECTION_TIMEOUT/NETWORK_CLIENT_WAIT_TIME; i++ )
+    {
+      if( enet_host_service(this->host_, &event, NETWORK_CLIENT_WAIT_TIME)>=0 && event.type == ENET_EVENT_TYPE_CONNECT )
+      {
+        this->established_=true;
         return true;
       }
     }
-    COUT(2) << "ClientConnection: enet_host_service < 0 or event.type != ENET_EVENT_TYPE_CONNECT # EVENT:" << event.type << std::endl;
+    COUT(1) << "Could not connect to server" << endl;
+  }
+
+  bool ClientConnection::closeConnection() {
+    ENetEvent event;
+    
+    if ( !this->established_ )
+      return true;
+    this->established_ = false;
+    enet_peer_disconnect(this->server_, 0);
+    for( unsigned int i=0; i<NETWORK_CLIENT_CONNECTION_TIMEOUT/NETWORK_CLIENT_WAIT_TIME; i++)
+    {
+      if ( enet_host_service(this->host_, &event, NETWORK_CLIENT_WAIT_TIME) >= 0 )
+      {
+        switch (event.type)
+        {
+          case ENET_EVENT_TYPE_NONE:
+          case ENET_EVENT_TYPE_CONNECT:
+            break;
+          case ENET_EVENT_TYPE_RECEIVE:
+            enet_packet_destroy(event.packet);
+            break;
+          case ENET_EVENT_TYPE_DISCONNECT:
+            COUT(4) << "received disconnect confirmation from server" << endl;
+            return true;
+        }
+      }
+    }
+    enet_peer_reset( this->server_ );
     return false;
   }
 
-  bool ClientConnection::processData(ENetEvent *event) {
-    COUT(5) << "Cl.Con: got packet, pushing to queue" << std::endl;
-    // just add packet to the buffer
-    // this can be extended with some preprocessing
-    return buffer.push(event);
+
+  bool ClientConnection::addPacket(ENetPacket *packet) {
+    assert( this->server_ );
+    assert( packet );
+    return Connection::addPacket( packet, this->server_ );
+  }
+
+  void ClientConnection::addClient(ENetEvent* event)
+  {
+    assert(0);
+  }
+  void ClientConnection::disconnectPeer(ENetEvent* event)
+  {
+    this->established_=false;
+    COUT(1) << "Received disconnect Packet from Server!" << endl;
+        // server closed the connection
   }
 
Index: code/branches/netp5/src/network/ClientConnection.h
===================================================================
--- code/branches/netp5/src/network/ClientConnection.h	(revision 3201)
+++ code/branches/netp5/src/network/ClientConnection.h	(revision 3202)
@@ -26,74 +26,43 @@
  *
  */
-
-//
-// C++ Interface: ClientConnection
-//
-// Description:
-//
-//
-// Author:  Oliver Scheuss, (C) 2007
-//
-// Copyright: See COPYING file that comes with this distribution
-//
-//
+ 
 #ifndef _ClientConnection_H__
 #define _ClientConnection_H__
 
+#include <string>
+
 #include "NetworkPrereqs.h"
-
-#include <string>
-#include "PacketBuffer.h"
-
-namespace boost { class thread; }
+#include "Connection.h"
 
 namespace orxonox
 {
 
-    const int NETWORK_PORT = 55556;
-    const int NETWORK_CLIENT_MAX_CONNECTIONS = 5;
-    const int NETWORK_CLIENT_WAIT_TIME = 10;
-    const int NETWORK_CLIENT_CONNECT_TIMEOUT = 3000; // miliseconds
-    const int NETWORK_CLIENT_CHANNELS = 2;
-
-
-  class _NetworkExport ClientConnection{
+  class _NetworkExport ClientConnection: public Connection{
   public:
-    ClientConnection(int port, const std::string& address);
-    ClientConnection(int port, const char* address);
+    ClientConnection();
     ~ClientConnection();
+    
+    void setServerAddress( const std::string& serverAddress ){ enet_address_set_host (this->serverAddress_, serverAddress.c_str()); }
+    void setPort( unsigned int port ){ this->serverAddress_->port = port; }
+    
     ENetEvent *getEvent();
     // check wheter the packet queue is empty
     bool queueEmpty();
     // create a new listener thread
-    bool createConnection();
-    bool closeConnection();
+    virtual bool establishConnection();
+    virtual bool closeConnection();
     // add a packet to queue for the server
     bool addPacket(ENetPacket *packet);
-    // send out all queued packets
-    bool sendPackets();
-    // send out all queued packets and save result in event
-    //bool sendPackets(ENetEvent *event);
-    bool waitEstablished(int milisec);
-    inline bool isConnected(){return established;}
-    inline bool checkConnection(){ return !quit_ && isConnected(); }
+    inline bool isConnected(){ return this->established_; }
   private:
-    ClientConnection(const ClientConnection& copy); // not used
-    bool processData(ENetEvent *event);
-    // implementation of the listener
-    void receiverThread(); //thread2
-    //packetbuffer
-    bool establishConnection();
+    virtual void addClient(ENetEvent* event);
+    virtual void disconnectPeer(ENetEvent* event);
+    
     bool disconnectConnection();
-    PacketBuffer buffer;
     // enet stuff
-    ENetHost *client;
-    ENetAddress *serverAddress;
-    // quit-variable (communication with threads)
-    bool quit_;
-    bool established;
+    ENetAddress *serverAddress_;
+    bool established_;
     // clientlist
-    ENetPeer *server;
-    boost::thread *receiverThread_;
+    ENetPeer *server_;
 };
 
Index: code/branches/netp5/src/network/Connection.cc
===================================================================
--- code/branches/netp5/src/network/Connection.cc	(revision 3201)
+++ code/branches/netp5/src/network/Connection.cc	(revision 3202)
@@ -31,4 +31,5 @@
 #include <iostream>
 #include <cassert>
+#include <OgreTimer.h>
 
 #include "util/Debug.h"
@@ -48,4 +49,6 @@
     assert(instance_==0);
     Connection::instance_=this;
+    enet_initialize();
+    atexit(enet_deinitialize);
   }
 
@@ -72,6 +75,7 @@
     
     assert(this->host_);
+    Ogre::Timer timer;
 
-    if( enet_host_service( this->host_, &event, NETWORK_WAIT_TIMEOUT ) > 0 )
+    while( timer.getMilliseconds()<NETWORK_MAX_QUEUE_PROCESS_TIME && enet_host_service( this->host_, &event, NETWORK_WAIT_TIMEOUT ) > 0 )
     {
       switch(event.type){
@@ -81,5 +85,5 @@
           break;
         case ENET_EVENT_TYPE_DISCONNECT:
-          disconnectClient( &event );
+          disconnectPeer( &event );
           break;
         case ENET_EVENT_TYPE_RECEIVE:
Index: code/branches/netp5/src/network/Connection.h
===================================================================
--- code/branches/netp5/src/network/Connection.h	(revision 3201)
+++ code/branches/netp5/src/network/Connection.h	(revision 3202)
@@ -53,12 +53,7 @@
     const int NETWORK_PORT = 55556;
     const int NETWORK_MAX_CONNECTIONS = 50;
-    const int NETWORK_WAIT_TIMEOUT = 1;
+    const int NETWORK_WAIT_TIMEOUT = 0;
     const int NETWORK_DEFAULT_CHANNEL = 0;
-
-//   struct _NetworkExport ClientList{
-//     ENetEvent *event;
-//     int ID;
-//     ClientList *next;
-//   };
+    const int NETWORK_MAX_QUEUE_PROCESS_TIME = 5;
 
   class _NetworkExport Connection{
@@ -79,5 +74,5 @@
     void processQueue();
     virtual void addClient(ENetEvent* event)=0;
-    virtual void disconnectClient(ENetEvent* event)=0;
+    virtual void disconnectPeer(ENetEvent* event)=0;
     virtual bool processPacket(ENetEvent* event){ packet::Packet *p = packet::Packet::createPacket(event->packet, event->peer); return p->process(); }
     
Index: code/branches/netp5/src/network/Server.cc
===================================================================
--- code/branches/netp5/src/network/Server.cc	(revision 3201)
+++ code/branches/netp5/src/network/Server.cc	(revision 3202)
@@ -144,13 +144,15 @@
   */
   void Server::update(const Clock& time) {
-    ServerConnection::processQueue();
+    Connection::processQueue();
     gamestates_->processGamestates();
     //this steers our network frequency
     timeSinceLastUpdate_+=time.getDeltaTime();
-    if(timeSinceLastUpdate_>=NETWORK_PERIOD){
+    if(timeSinceLastUpdate_>=NETWORK_PERIOD)
+    {
       timeSinceLastUpdate_ -= static_cast<unsigned int>( timeSinceLastUpdate_ / NETWORK_PERIOD ) * NETWORK_PERIOD;
       updateGamestate();
       FunctionCallManager::sendCalls();
     }
+    sendPackets(); // flush the enet queue
   }
 
Index: code/branches/netp5/src/network/ServerConnection.cc
===================================================================
--- code/branches/netp5/src/network/ServerConnection.cc	(revision 3201)
+++ code/branches/netp5/src/network/ServerConnection.cc	(revision 3202)
@@ -53,6 +53,4 @@
 
   bool ServerConnection::openListener() {
-    enet_initialize();
-    atexit(enet_deinitialize);
     this->host_ = enet_host_create(this->bindAddress_, NETWORK_MAX_CONNECTIONS, 0, 0);
     if ( this->host_ == NULL )
@@ -91,9 +89,9 @@
   void ServerConnection::disconnectClient(ClientInformation *client)
   {
-    disconnectPeer( client->getPeer() );
+    Connection::disconnectPeer( client->getPeer() );
     delete client;
   }
   
-  void ServerConnection::disconnectClient( ENetEvent* event )
+  void ServerConnection::disconnectPeer( ENetEvent* event )
   {
     COUT(4) << "removing client from list" << std::endl;
@@ -115,5 +113,5 @@
     ClientInformation *temp = ClientInformation::getBegin();
     while(temp!=0){
-      disconnectPeer( temp->getPeer() );
+      disconnectPeer( &event );
       temp = temp->next();
     }
Index: code/branches/netp5/src/network/ServerConnection.h
===================================================================
--- code/branches/netp5/src/network/ServerConnection.h	(revision 3201)
+++ code/branches/netp5/src/network/ServerConnection.h	(revision 3202)
@@ -60,5 +60,5 @@
     static bool addPacketAll(ENetPacket *packet);
     virtual void disconnectClient(ClientInformation *client);
-    void disconnectClient( ENetEvent* event );
+    void disconnectPeer( ENetEvent* event );
     void disconnectClient(int clientID);
   protected:
Index: code/branches/netp5/src/network/packet/FunctionCalls.cc
===================================================================
--- code/branches/netp5/src/network/packet/FunctionCalls.cc	(revision 3201)
+++ code/branches/netp5/src/network/packet/FunctionCalls.cc	(revision 3202)
@@ -66,4 +66,5 @@
 
 bool FunctionCalls::process(){
+  printf("process function calls\n");
   assert(isDataENetAllocated());
   uint8_t* temp = data_+sizeof(uint32_t); //skip packetid
Index: code/branches/netp5/src/network/packet/Packet.cc
===================================================================
--- code/branches/netp5/src/network/packet/Packet.cc	(revision 3201)
+++ code/branches/netp5/src/network/packet/Packet.cc	(revision 3202)
@@ -32,8 +32,5 @@
 #include <cassert>
 #include <enet/enet.h>
-#include <boost/bind.hpp>
-#include <boost/thread/recursive_mutex.hpp>
-
-#include "network/ConnectionManager.h"
+
 #include "network/ClientInformation.h"
 
@@ -58,5 +55,4 @@
 std::map<size_t, Packet *> Packet::packetMap_;
 //! Static mutex for any packetMap_ access
-static boost::recursive_mutex packetMap_mutex_g;
 
 Packet::Packet(){
@@ -142,5 +138,4 @@
       // Assures we don't create a packet and destroy it right after in another thread
       // without having a reference in the packetMap_
-      boost::recursive_mutex::scoped_lock lock(packetMap_mutex_g);
       packetMap_[(size_t)(void*)enetPacket_] = this;
     }
@@ -228,5 +223,4 @@
 */
 void Packet::deletePacket(ENetPacket *enetPacket){
-  boost::recursive_mutex::scoped_lock lock(packetMap_mutex_g);
   // Get our Packet from a gloabal map with all Packets created in the send() method of Packet.
   std::map<size_t, Packet*>::iterator it = packetMap_.find((size_t)enetPacket);
Index: code/branches/netp5/src/orxonox/objects/worldentities/pawns/Pawn.cc
===================================================================
--- code/branches/netp5/src/orxonox/objects/worldentities/pawns/Pawn.cc	(revision 3201)
+++ code/branches/netp5/src/orxonox/objects/worldentities/pawns/Pawn.cc	(revision 3202)
@@ -59,6 +59,4 @@
         PawnManager::touch();
         this->bAlive_ = true;
-        this->fire_ = 0x0;
-        this->firehack_ = 0x0;
         this->bReload_ = false;
 
@@ -122,5 +120,4 @@
         registerVariable(this->health_,        variableDirection::toclient);
         registerVariable(this->initialHealth_, variableDirection::toclient);
-        registerVariable(this->fire_,          variableDirection::toserver);
         registerVariable(this->bReload_,       variableDirection::toserver);
     }
@@ -130,16 +127,4 @@
         SUPER(Pawn, tick, dt);
 
-//        if (this->weaponSystem_ && GameMode::isMaster())
-//        {
-//            for (unsigned int firemode = 0; firemode < WeaponSystem::MAX_FIRE_MODES; firemode++)
-//                if (this->fire_ & WeaponSystem::getFiremodeMask(firemode))
-//                    this->weaponSystem_->fire(firemode);
-//
-//            if (this->bReload_)
-//                this->weaponSystem_->reload();
-//        }
-//
-//        this->fire_ = this->firehack_;
-//        this->firehack_ = 0x0;
         this->bReload_ = false;
 
Index: code/branches/netp5/src/orxonox/objects/worldentities/pawns/Pawn.h
===================================================================
--- code/branches/netp5/src/orxonox/objects/worldentities/pawns/Pawn.h	(revision 3201)
+++ code/branches/netp5/src/orxonox/objects/worldentities/pawns/Pawn.h	(revision 3202)
@@ -137,6 +137,4 @@
 
             WeaponSystem* weaponSystem_;
-            unsigned int fire_;
-            unsigned int firehack_;
             bool bReload_;
 
