Index: branches/proxy/src/lib/network/monitor/network_monitor.cc
===================================================================
--- branches/proxy/src/lib/network/monitor/network_monitor.cc	(revision 9451)
+++ branches/proxy/src/lib/network/monitor/network_monitor.cc	(revision 9452)
@@ -143,5 +143,5 @@
   if( pInfo->isClient())
     this->localNode->addClient(pInfo);
-  else if( pInfo->isProxyServer())
+  else if( pInfo->isProxyServerActive())
   {
     this->localNode->addActiveProxyServer(pInfo);
@@ -169,5 +169,5 @@
   if( pInfo->isClient())
     node->addClient(pInfo);
-  else if( pInfo->isProxyServer())
+  else if( pInfo->isProxyServerActive())
     node->addActiveProxyServer(pInfo);
   else if( pInfo->isMasterServer())
Index: branches/proxy/src/lib/network/network_game_manager.cc
===================================================================
--- branches/proxy/src/lib/network/network_game_manager.cc	(revision 9451)
+++ branches/proxy/src/lib/network/network_game_manager.cc	(revision 9452)
@@ -91,5 +91,5 @@
 bool NetworkGameManager::signalNewPlayer( int userId )
 {
-  assert( SharedNetworkData::getInstance()->isMasterServer() ||  SharedNetworkData::getInstance()->isProxyServer());
+  assert( SharedNetworkData::getInstance()->isMasterServer() ||  SharedNetworkData::getInstance()->isProxyServerActive());
   assert( State::getGameRules() );
   assert( State::getGameRules()->isA( CL_NETWORK_GAME_RULES ) );
@@ -168,5 +168,5 @@
 bool NetworkGameManager::delSynchronizeableHandler( MessageId messageId, byte * data, int dataLength, void * someData, int userId )
 {
-  if ( SharedNetworkData::getInstance()->isMasterServer() ||  SharedNetworkData::getInstance()->isProxyServer())
+  if ( SharedNetworkData::getInstance()->isMasterServer() ||  SharedNetworkData::getInstance()->isProxyServerActive())
   {
     PRINTF(2)("Recieved DeleteSynchronizeable message from client %d!\n", userId);
@@ -229,5 +229,5 @@
 bool NetworkGameManager::preferedTeamHandler( MessageId messageId, byte * data, int dataLength, void * someData, int userId )
 {
-  assert( SharedNetworkData::getInstance()->isMasterServer() ||  SharedNetworkData::getInstance()->isProxyServer());
+  assert( SharedNetworkData::getInstance()->isMasterServer() ||  SharedNetworkData::getInstance()->isProxyServerActive());
 
   int teamId = 0;
@@ -261,5 +261,5 @@
 void NetworkGameManager::prefereTeam( int teamId )
 {
-  if ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServer())
+  if ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive())
     setPreferedTeam( SharedNetworkData::getInstance()->getHostID(), teamId );
   else
@@ -305,5 +305,5 @@
 {
   PRINTF(0)("NetworkGameManager::chatMessageHandler %d %d\n", userId, SharedNetworkData::getInstance()->getHostID() );
-  if ( (SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServer()) && userId !=  SharedNetworkData::getInstance()->getHostID() )
+  if ( (SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive()) && userId !=  SharedNetworkData::getInstance()->getHostID() )
   {
     MessageManager::getInstance()->sendMessage( messageId, data, dataLength, RT_ALL_NOT_ME, 0, MP_HIGHBANDWIDTH );
@@ -347,5 +347,5 @@
   assert( Converter::stringToByteArray(message, buf+2*INTSIZE, message.length()+INTSIZE) == message.length()+INTSIZE );
 
-  if ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServer())
+  if ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive())
     MessageManager::getInstance()->sendMessage( MSGID_CHATMESSAGE, buf, message.length()+3*INTSIZE, RT_ALL_ME, 0, MP_HIGHBANDWIDTH );
   else
Index: branches/proxy/src/lib/network/network_manager.cc
===================================================================
--- branches/proxy/src/lib/network/network_manager.cc	(revision 9451)
+++ branches/proxy/src/lib/network/network_manager.cc	(revision 9452)
@@ -129,9 +129,12 @@
   NetworkSettings::getInstance()->loadData();
 
-  // create the network stream
+  // create the network stream af
   this->networkStream = new NetworkStream(NET_PROXY_SERVER_ACTIVE);
+  // first connect to the master server for synchronization
+  this->networkStream->connectToMasterServer(NetworkSettings::getInstance()->getMasterAddr().ipString(), 9999);
+  // start the handshake with the master server
+  this->networkStream->startHandshake(NET_ID_MASTER_SERVER);
+  // then start the server
   this->networkStream->createServer( port);
-  // and connect to the master server for synchronization
-  this->networkStream->connectToMasterServer(NetworkSettings::getInstance()->getMasterAddr().ipString(), 9999);
   // and to the other proxy servers also, this would be very nice if its works
 
Index: branches/proxy/src/lib/network/network_stream.cc
===================================================================
--- branches/proxy/src/lib/network/network_stream.cc	(revision 9451)
+++ branches/proxy/src/lib/network/network_stream.cc	(revision 9452)
@@ -79,16 +79,17 @@
     case NET_MASTER_SERVER:
       // init the shared network data
-      SharedNetworkData::getInstance()->setHostID(0);
+      SharedNetworkData::getInstance()->setHostID(NET_ID_MASTER_SERVER);
       break;
 
     case NET_PROXY_SERVER_ACTIVE:
       // init the shared network data
-      SharedNetworkData::getInstance()->setHostID(0);
+      SharedNetworkData::getInstance()->setHostID(NET_ID_PROXY_SERVER_01);
       break;
     case NET_PROXY_SERVER_PASSIVE:
       // init the shared network data
-      SharedNetworkData::getInstance()->setHostID(0);
+      SharedNetworkData::getInstance()->setHostID(NET_ID_PROXY_SERVER_01);
       break;
     case NET_CLIENT:
+      SharedNetworkData::getInstance()->setHostID(NET_ID_UNASSIGNED);
       break;
   }
@@ -312,5 +313,5 @@
     this->updateConnectionList();
   }
-  else if( this->pInfo->isProxyServer())
+  else if( this->pInfo->isProxyServerActive())
   {
     // execute everything the proxy server should do
@@ -464,5 +465,5 @@
     PRINT(0)(" Host ist Master Server with ID: %i\n", this->pInfo->userId);
   }
-  else if( SharedNetworkData::getInstance()->isProxyServer()) {
+  else if( SharedNetworkData::getInstance()->isProxyServerActive()) {
     PRINT(0)(" Host ist Proxy Server with ID: %i\n", this->pInfo->userId);
   }
@@ -568,5 +569,5 @@
                 }
               }
-              else if ( this->pInfo->isProxyServer() )
+              else if ( this->pInfo->isProxyServerActive() )
               {
                 it->second.nodeType = it->second.handshake->getRemoteNodeType();
@@ -714,5 +715,5 @@
 
       // if we are a server (both master and proxy servers) and this is not our handshake
-      if ( ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServer() ) && sync.getLeafClassID() == CL_HANDSHAKE && sync.getUniqueID() != peer->second.userId )
+      if ( ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive() ) && sync.getLeafClassID() == CL_HANDSHAKE && sync.getUniqueID() != peer->second.userId )
         continue;
 
@@ -728,5 +729,5 @@
 
       // server fakes uniqueid == 0 for handshake
-      if ( ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServer() ) &&
+      if ( ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive() ) &&
              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 );
@@ -780,5 +781,5 @@
     // now compress the data with the zip library
     int compLength = 0;
-    if ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServer())
+    if ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive())
       compLength = Zip::getInstance()->zip( buf, offset, compBuf, UDP_PACKET_SIZE, dictServer );
     else
Index: branches/proxy/src/lib/network/network_stream.h
===================================================================
--- branches/proxy/src/lib/network/network_stream.h	(revision 9451)
+++ branches/proxy/src/lib/network/network_stream.h	(revision 9452)
@@ -57,5 +57,5 @@
     inline bool isUserIdActive( int userID ) { return (peers.find(userID) != peers.end()); }
     inline bool isUserMasterServer( int userID ){ if ( !isUserIdActive(userID) ) return false; return peers[userID].isMasterServer(); }
-    inline bool isUserProxyServer( int userID ){ if ( !isUserIdActive(userID) ) return false; return peers[userID].isProxyServer(); }
+    inline bool isUserProxyServer( int userID ){ if ( !isUserIdActive(userID) ) return false; return peers[userID].isProxyServerActive(); }
     inline bool isUserClient( int userID ){ if ( !isUserIdActive(userID) ) return false; return peers[userID].isClient(); }
 
Index: branches/proxy/src/lib/network/peer_info.h
===================================================================
--- branches/proxy/src/lib/network/peer_info.h	(revision 9451)
+++ branches/proxy/src/lib/network/peer_info.h	(revision 9452)
@@ -23,6 +23,6 @@
 
     inline bool isMasterServer() const { return this->nodeType == NET_MASTER_SERVER; }
-    inline bool isProxyServer() const { return this->nodeType == NET_PROXY_SERVER_ACTIVE; }
-    inline bool isProxyServerPassive() const { return this->nodeType == NET_PROXY_SERVER_PASSIVE; }
+    inline bool isProxyServerActive() const { return this->nodeType == NET_PROXY_SERVER_ACTIVE; }
+    inline bool isProxyServerActivePassive() const { return this->nodeType == NET_PROXY_SERVER_PASSIVE; }
     inline bool isClient() const { return this->nodeType == NET_CLIENT; }
 
Index: branches/proxy/src/lib/network/player_stats.cc
===================================================================
--- branches/proxy/src/lib/network/player_stats.cc	(revision 9451)
+++ branches/proxy/src/lib/network/player_stats.cc	(revision 9452)
@@ -191,5 +191,5 @@
 void PlayerStats::setNickName( std::string nick )
 {
-  if ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServer() )
+  if ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive() )
   {
     this->nickName = nick;
Index: branches/proxy/src/lib/network/shared_network_data.h
===================================================================
--- branches/proxy/src/lib/network/shared_network_data.h	(revision 9451)
+++ branches/proxy/src/lib/network/shared_network_data.h	(revision 9452)
@@ -35,5 +35,5 @@
     inline bool isMasterServer() { return this->nodeType == NET_MASTER_SERVER; }
     /** @returns true is this node is a proxy server */
-    inline bool isProxyServer() { return this->nodeType == NET_PROXY_SERVER_ACTIVE; }
+    inline bool isProxyServerActive() { return this->nodeType == NET_PROXY_SERVER_ACTIVE; }
     /** @returns true is this node is a client*/
     inline bool isClient() { return this->nodeType == NET_CLIENT; }
Index: branches/proxy/src/lib/network/synchronizeable.cc
===================================================================
--- branches/proxy/src/lib/network/synchronizeable.cc	(revision 9451)
+++ branches/proxy/src/lib/network/synchronizeable.cc	(revision 9452)
@@ -72,5 +72,5 @@
     this->networkStream->disconnectSynchronizeable(*this);
 
-    if ( (SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServer() )
+    if ( (SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive() )
            && this->beSynchronized() && this->getUniqueID() > 0 && !this->isA( CL_MESSAGE_MANAGER ) )
       NetworkGameManager::getInstance()->removeSynchronizeable( this->getUniqueID() );
@@ -213,5 +213,5 @@
       hasPermission = true;
     // now check PROXY_SERVER permissions
-    else if( SharedNetworkData::getInstance()->isProxyServer() && (*it)->checkPermission( PERMISSION_MASTER_SERVER ))
+    else if( SharedNetworkData::getInstance()->isProxyServerActive() && (*it)->checkPermission( PERMISSION_MASTER_SERVER ))
       hasPermission = true;
     // now check OWNER permissions
@@ -225,5 +225,5 @@
       hasPermission = true;
     // SPECIAL: get write permissions if i am proxy server and i am able to overwrite the client stuff
-    else if( SharedNetworkData::getInstance()->isProxyServer()  && this->owner != userId && (*it)->checkPermission( PERMISSION_OWNER ))
+    else if( SharedNetworkData::getInstance()->isProxyServerActive()  && this->owner != userId && (*it)->checkPermission( PERMISSION_OWNER ))
       hasPermission = true;
     else
