Index: /branches/proxy/src/lib/network/message_manager.h
===================================================================
--- /branches/proxy/src/lib/network/message_manager.h	(revision 9598)
+++ /branches/proxy/src/lib/network/message_manager.h	(revision 9599)
@@ -37,5 +37,6 @@
 
   MSGID_PROXY_NEWCLIENT,                       //!< informs the master server about a new client
-  MSGID_PROXY_LEAVECLIENT                      //!< informs the master and other proxy servers about a leaving client
+  MSGID_PROXY_LEAVECLIENT,                     //!< informs the master and other proxy servers about a leaving client
+  MSGID_PROXY_COMMAND,                         //!< command handler: delivers commands from and to proxies/clients
 };
 
Index: /branches/proxy/src/lib/network/proxy/proxy_control.cc
===================================================================
--- /branches/proxy/src/lib/network/proxy/proxy_control.cc	(revision 9598)
+++ /branches/proxy/src/lib/network/proxy/proxy_control.cc	(revision 9599)
@@ -45,4 +45,5 @@
   MessageManager::getInstance()->registerMessageHandler( MSGID_PROXY_NEWCLIENT, messageHandlerNewClient, NULL );
   MessageManager::getInstance()->registerMessageHandler( MSGID_PROXY_LEAVECLIENT, messageHandlerLeaveClient, NULL );
+  MessageManager::getInstance()->registerMessageHandler( MSGID_PROXY_COMMAND, messageHandlerCommand, NULL );
 
 
@@ -197,5 +198,5 @@
   netMon->removeNode(nNode, netMon->getPeerByUserId(leaveClientId));
 
-  PRINTF(0)("Got Signal: from %i new player left with userId: %i\n", senderId, leaveClientId);
+  PRINTF(0)("Got Signal: from %i player left with userId: %i\n", senderId, leaveClientId);
   // part for the master server
   if( SharedNetworkData::getInstance()->isMasterServer())
@@ -211,2 +212,146 @@
   return true;
 }
+
+
+
+/**
+ * forces a client to reconnect to another server
+ * @param userId the userId of the client/user :D
+ * @param newAddress the addresss the client should connect to (fully quali dns)
+ */
+void ProxyControl::forceReconnection(int userId, const std::string& newAddress)
+{
+  IP ipAddr = IP(newAddress, 9999);
+  this->forceReconnection(userId, newAddress);
+}
+
+
+
+/**
+ * forces a client to reconnect to another server
+ * @param userId the userId of the client/user :D
+ * @param serverId the userId of the server to connect to
+ */
+void ProxyControl::forceReconnection(int userId, int serverId)
+{
+  PeerInfo* serverInfo = SharedNetworkData::getInstance()->getNetworkMonitor()->getPeerByUserId(serverId);
+  if( serverInfo == NULL)
+  {
+    PRINTF(0)("There is no node with userId %i registered in this network. Check the uid again\n");
+    return;
+  }
+  else if( serverInfo->isMasterServer() || serverInfo->isProxyServerActive())
+  {
+    PRINTF(0)("You can't connecto to a client (userId %i)\n", serverId);
+    return;
+  }
+
+
+  this->forceReconnection(userId, serverInfo->ip);
+}
+
+
+/**
+ * forces a client to reconnect to another server
+ * @param userId the userId of the client/user :D
+ * @param newAddress the addresss the client should connect to
+ */
+void ProxyControl::forceReconnection(int userId, IP newAddress)
+{
+  PRINTF(0)("forcing reconnection: userId %i to %s\n", userId, newAddress.ipString().c_str());
+  // make sure we are a proxy server
+
+  if( SharedNetworkData::getInstance()->isClient())
+  {
+    PRINTF(1)("I am client, got no right to force reconnection\n");
+    return;
+  }
+
+
+  byte data[3 * INTSIZE];
+
+  // write type of message
+  int type = PXY_RECONNECT;
+  assert( Converter::intToByteArray( type, data, INTSIZE ) == INTSIZE );
+  // write the userId in the message
+  assert( Converter::intToByteArray( userId, data + INTSIZE, INTSIZE ) == INTSIZE );
+  // and the ip as an int
+  PeerInfo* pInfo = SharedNetworkData::getInstance()->getNetworkMonitor()->getPeerByUserId(userId);
+  if( pInfo == NULL)
+  {
+    PRINTF(0)("There is no node with userId %i registered in this network. Check the uid again\n");
+    return;
+  }
+  else if( pInfo->isMasterServer() || pInfo->isProxyServerActive())
+  {
+    PRINTF(0)("You cannont reconnect a %s, abording\n", pInfo->getNodeTypeString().c_str());
+    return;
+  }
+  assert( Converter::intToByteArray( newAddress.host(), data + 2 * INTSIZE, INTSIZE ) == INTSIZE );
+
+  MessageManager::getInstance()->sendMessage( MSGID_PROXY_COMMAND, data, 3*INTSIZE, RT_ALL_ME, NET_UNASSIGNED, MP_HIGHBANDWIDTH );
+}
+
+
+/**
+ * this is the handler for proxy commands
+ *
+ * @param messageType the type of the message
+ * @param data message data
+ * @param dataLength length of the message data
+ * @param someData some other atteched data
+ * @param senderId id of the sender client
+ * @param destinationId id of the destination client
+ * @return true if succeeded
+ */
+bool ProxyControl::messageHandlerCommand( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId  )
+{
+  // body data length correct?
+  if ( dataLength != 3 * INTSIZE )
+  {
+    PRINTF(1)("leave client message has wrong size: %d\n", dataLength );
+    return true;
+  }
+
+  // read the command type
+  int type = 0;
+  assert( Converter::byteArrayToInt( data, &type) == INTSIZE );
+  PRINTF(0)("got command from %i with code %i\n", senderId, type);
+
+  // now distingush all different sorts of commands
+  switch( type)
+  {
+    case PXY_RECONNECT:
+    {
+      // now read the user id
+      int userId;
+      assert( Converter::byteArrayToInt( data + INTSIZE, &userId) == INTSIZE );
+      // and read the dest address
+      int ipHost = 0;
+      assert( Converter::byteArrayToInt( data + INTSIZE, &ipHost) == INTSIZE );
+
+      // handle it
+      if( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive())
+      {
+      }
+      break;
+    }
+    default:
+      PRINTF(0)("Command not known with id %i\n", type);
+  }
+
+
+  // part for the master server
+  if( SharedNetworkData::getInstance()->isMasterServer())
+  {
+    // we now create the new player ship and stuff...
+//     NetworkGameManager::getInstance()->signalLeftPlayer(leaveClientId);
+  }
+  else if(SharedNetworkData::getInstance()->isProxyServerActive())
+  {
+
+  }
+
+  return true;
+}
+
Index: /branches/proxy/src/lib/network/proxy/proxy_control.h
===================================================================
--- /branches/proxy/src/lib/network/proxy/proxy_control.h	(revision 9598)
+++ /branches/proxy/src/lib/network/proxy/proxy_control.h	(revision 9599)
@@ -16,4 +16,9 @@
 
 
+typedef enum proxyCommand {
+  PXY_RECONNECT              = 0,              //!< forces a reconnection of the node
+
+  PXY_NUMBER
+};
 
 
@@ -30,4 +35,5 @@
     virtual void varChangeHandler( std::list<int> & id );
 
+    /* connection signal handling */
     void signalNewClient(int userId);
     static bool messageHandlerNewClient( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId  );
@@ -36,4 +42,9 @@
     static bool messageHandlerLeaveClient( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId  );
 
+    /* proxy server network control */
+    void forceReconnection(int userId, int serverId);
+    void forceReconnection(int userId, IP newAddress);
+    void forceReconnection(int userId, const std::string& newAddress);
+    static bool messageHandlerCommand( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId  );
 
   private:
