Index: /branches/proxy/src/lib/network/handshake.cc
===================================================================
--- /branches/proxy/src/lib/network/handshake.cc	(revision 9472)
+++ /branches/proxy/src/lib/network/handshake.cc	(revision 9473)
@@ -76,5 +76,5 @@
   remoteState.orxId = 0;
   remoteState.version = 0;
-  remoteState.nodeType = NET_CLIENT;
+  remoteState.nodeType = NET_UNASSIGNED;
   remoteState.canDel = 0;
 
Index: /branches/proxy/src/lib/network/netdefs.h
===================================================================
--- /branches/proxy/src/lib/network/netdefs.h	(revision 9472)
+++ /branches/proxy/src/lib/network/netdefs.h	(revision 9473)
@@ -47,5 +47,7 @@
 //!< enum indicating the type of the node
 typedef enum {
-  NET_MASTER_SERVER,
+  NET_UNASSIGNED              = -1,
+
+  NET_MASTER_SERVER           =  0,
   NET_PROXY_SERVER_ACTIVE,
   NET_PROXY_SERVER_PASSIVE,
Index: /branches/proxy/src/lib/network/network_stream.cc
===================================================================
--- /branches/proxy/src/lib/network/network_stream.cc	(revision 9472)
+++ /branches/proxy/src/lib/network/network_stream.cc	(revision 9473)
@@ -65,5 +65,5 @@
   this->init();
   /* initialize the references */
-  this->pInfo->nodeType = NET_CLIENT;
+  this->pInfo->nodeType = NET_UNASSIGNED;
 }
 
@@ -552,15 +552,21 @@
         if ( it->second.handshake->ok() )
         {
+          // write the first informations into the node so they can be read from there for case differentiation
+          it->second.nodeType = it->second.handshake->getRemoteNodeType();
+          it->second.ip = it->second.socket->getRemoteAddress();
+
           // the counter part didn't mark it free for deletion yet
           if ( !it->second.handshake->allowDel() )
           {
-            // make sure this is a client
-            if(  SharedNetworkData::getInstance()->isClient() || SharedNetworkData::getInstance()->isProxyServerActive())
+            // make sure this is a connection:
+            // - client       <==> master server
+            // - proxy server <==> master server
+            if(  SharedNetworkData::getInstance()->isClient() || SharedNetworkData::getInstance()->isProxyServerActive() && it->second.isMasterServer())
             {
               SharedNetworkData::getInstance()->setHostID( it->second.handshake->getHostId() );
               this->pInfo->userId = SharedNetworkData::getInstance()->getHostID();
 
-              it->second.nodeType = it->second.handshake->getRemoteNodeType();
-              it->second.ip = it->second.socket->getRemoteAddress();
+//               it->second.nodeType = it->second.handshake->getRemoteNodeType();
+//               it->second.ip = it->second.socket->getRemoteAddress();
               // add the new server to the nodes list (it can be a NET_MASTER_SERVER or NET_PROXY_SERVER)
               this->networkMonitor->addNode(&it->second);
@@ -595,7 +601,4 @@
               if (  SharedNetworkData::getInstance()->isMasterServer() )
               {
-                it->second.nodeType = it->second.handshake->getRemoteNodeType();
-                it->second.ip = it->second.socket->getRemoteAddress();
-
                 this->networkMonitor->addNode(&it->second);
 
@@ -753,5 +756,7 @@
 
       // if we are a server (both master and proxy servers) and this is not our handshake
-      if ( ( SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive()*/ ) && sync.getLeafClassID() == CL_HANDSHAKE && sync.getUniqueID() != peer->second.userId )
+      if ( ( SharedNetworkData::getInstance()->isMasterServer() ||
+             SharedNetworkData::getInstance()->isProxyServerActive() &&  peer->second.isClient())
+             && sync.getLeafClassID() == CL_HANDSHAKE && sync.getUniqueID() != peer->second.userId )
         continue;
 
@@ -767,5 +772,6 @@
 
       // server fakes uniqueid == 0 for handshake
-      if ( ( SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive() */) &&
+      if ( ( SharedNetworkData::getInstance()->isMasterServer() ||
+             SharedNetworkData::getInstance()->isProxyServerActive() &&  peer->second.isClient() ) &&
              sync.getUniqueID() <= SharedNetworkData::getInstance()->getMaxPlayer() + 1) // plus one to handle one client more than the max to redirect it
         n = Converter::intToByteArray( 0, buf + offset, UDP_PACKET_SIZE - offset );
