Index: branches/proxy/src/lib/network/network_stream.cc
===================================================================
--- branches/proxy/src/lib/network/network_stream.cc	(revision 9416)
+++ branches/proxy/src/lib/network/network_stream.cc	(revision 9419)
@@ -80,5 +80,4 @@
       // init the shared network data
       SharedNetworkData::getInstance()->setHostID(0);
-//       SharedNetworkData::getInstance()->setNodeType(NET_MASTER_SERVER);
       break;
 
@@ -86,13 +85,10 @@
       // init the shared network data
       SharedNetworkData::getInstance()->setHostID(0);
-//       SharedNetworkData::getInstance()->setNodeType(NET_PROXY_SERVER_ACTIVE);
       break;
     case NET_PROXY_SERVER_PASSIVE:
-            // init the shared network data
+      // init the shared network data
       SharedNetworkData::getInstance()->setHostID(0);
-//       SharedNetworkData::getInstance()->setNodeType(NET_PROXY_SERVER_PASSIVE);
       break;
     case NET_CLIENT:
-//       SharedNetworkData::getInstance()->setNodeType(NET_CLIENT);
       break;
   }
@@ -323,17 +319,6 @@
     if ( peers[0].socket && ( !peers[0].socket->isOk() || peers[0].connectionMonitor->hasTimedOut() ) )
     {
+      this->handleDisconnect( 0);
       PRINTF(1)("lost connection to server\n");
-
-      peers[0].socket->disconnectServer();
-      delete peers[0].socket;
-      peers[0].socket = NULL;
-
-      if ( peers[0].handshake )
-        delete peers[0].handshake;
-      peers[0].handshake = NULL;
-
-      if ( peers[0].connectionMonitor )
-        delete peers[0].connectionMonitor;
-      peers[0].connectionMonitor = NULL;
     }
   }
@@ -404,5 +389,5 @@
 
     // check if the connecting client should reconnect to a proxy server
-    peers[clientId].handshake->setRedirect(/*this->networkMonitor->isReconnectNextClient()*/false);
+    peers[clientId].handshake->setRedirect(/*this->networkMonitor->isReconnectNextClient()*/true);
 
     // the connecting node of course is a client
@@ -446,20 +431,7 @@
       PRINTF(0)("Client is gone: %d (%s)\n", it->second.userId, reason.c_str());
 
-
-      // clean up the network data
-      it->second.socket->disconnectServer();
-      delete it->second.socket;
-      it->second.socket = NULL;
-
-      // remove the old connectin monitor
-      if ( it->second.connectionMonitor )
-        delete it->second.connectionMonitor;
-      it->second.connectionMonitor = NULL;
-
-      // remove the handshake
-      if ( it->second.handshake )
-        delete it->second.handshake;
-      it->second.handshake = NULL;
-
+      this->handleDisconnect( it->second.userId);
+
+#warning this is some more disconnct handling, consider doing it in the handleDisconnect() funciton
       // and cleanup the user infos
       for ( SynchronizeableList::iterator it2 = synchronizeables.begin(); it2 != synchronizeables.end(); it2++ )
@@ -563,4 +535,6 @@
                 this->handleReconnect( it->second.userId);
 
+              PRINTF(0)("redirection: %i\n\n\n", it->second.handshake->redirect());
+
               // create the new network game manager and init it
               this->networkGameManager = NetworkGameManager::getInstance();
@@ -659,5 +633,27 @@
 
 /**
+ * handles the disconnect event
+ * @param userId id of the user to remove
+ */
+void NetworkStream::handleDisconnect( int userId )
+{
+  peers[userId].socket->disconnectServer();
+  delete peers[userId].socket;
+  peers[userId].socket = NULL;
+
+  if ( peers[userId].handshake )
+    delete peers[userId].handshake;
+  peers[userId].handshake = NULL;
+
+  if ( peers[userId].connectionMonitor )
+    delete peers[userId].connectionMonitor;
+  peers[userId].connectionMonitor = NULL;
+}
+
+
+
+/**
  * handle upstream network traffic
+ * @param tick: seconds elapsed since last update
  */
 void NetworkStream::handleUpstream( int tick )
Index: branches/proxy/src/lib/network/network_stream.h
===================================================================
--- branches/proxy/src/lib/network/network_stream.h	(revision 9416)
+++ branches/proxy/src/lib/network/network_stream.h	(revision 9419)
@@ -80,4 +80,5 @@
 
     void updateConnectionList();
+
     /* handle processes */
     void handleHandshakes();
@@ -88,4 +89,5 @@
     void handleNewClient( int userId );
     void handleReconnect( int userId );
+    void handleDisconnect( int userId );
 
     void writeToNewDict( byte * data, int length, bool upstream );
