Index: /branches/proxy/src/lib/network/README.NETWORK
===================================================================
--- /branches/proxy/src/lib/network/README.NETWORK	(revision 9448)
+++ /branches/proxy/src/lib/network/README.NETWORK	(revision 9449)
@@ -9,6 +9,24 @@
 UserId:
 containing the id of a user (==client). This id must be unique within a orxonox network its used especialy in the NetworkStream for node identification and also in the Synchronizeable base class for permissions checking (PERMISSION_OWNER)
-WARNING:
-There is some correlation between userids and the maxplayer, do not touch this.
+
+the connections belonging tu toe userId's are stored in the NetworkStream::peers std::map. As a keyvalue the userId's are used. Therefore the usage of this peers map is very delicate. Don't ever try to add anything you are not sure about the id stuff.
+
+There are some reserved id's, don't mess with them:
+0 :                  Master Server
+1 :                  First Proxy Server
+2 :                  Second Proxy Server
+3 :                  Third Proxy Server
+4 :                  Fourth Proxy Server
+.
+.
+.
+NET_MAX_PROXY        The maximal number of proxy servers
+NET_MAX... + 1       First Client
+NET_MAX... + 2       Second Client
+.
+.
+.
+NET_MAX_CONNECTION   Last client
+
 
 
Index: /branches/proxy/src/lib/network/netdefs.h
===================================================================
--- /branches/proxy/src/lib/network/netdefs.h	(revision 9448)
+++ /branches/proxy/src/lib/network/netdefs.h	(revision 9449)
@@ -43,4 +43,6 @@
 
 
+
+
 //!< enum indicating the type of the node
 typedef enum {
@@ -67,3 +69,65 @@
 } UidType;
 
+
+//!< the id of the node
+typedef enum nodeId {
+  NET_ID_UNASSIGNED       =-1,
+
+  NET_ID_MASTER_SERVER    = 0,
+
+  NET_ID_PROXY_SERVER_01  = 1,
+  NET_ID_PROXY_SERVER_02,
+  NET_ID_PROXY_SERVER_03,
+  NET_ID_PROXY_SERVER_04,
+  NET_ID_PROXY_SERVER_05,
+  NET_ID_PROXY_SERVER_06,
+  NET_ID_PROXY_SERVER_07,
+  NET_ID_PROXY_SERVER_08  = 8,
+
+  NET_ID_PROXY_MAX        = 8,
+
+  NET_ID_CLIENT_01        = 9,
+  NET_ID_CLIENT_02,
+  NET_ID_CLIENT_03,
+  NET_ID_CLIENT_04,
+  NET_ID_CLIENT_05,
+  NET_ID_CLIENT_06,
+  NET_ID_CLIENT_07,
+  NET_ID_CLIENT_08,
+  NET_ID_CLIENT_09,
+  NET_ID_CLIENT_10,
+  NET_ID_CLIENT_11,
+  NET_ID_CLIENT_12,
+  NET_ID_CLIENT_13,
+  NET_ID_CLIENT_14,
+  NET_ID_CLIENT_15,
+  NET_ID_CLIENT_16,
+  NET_ID_CLIENT_17,
+  NET_ID_CLIENT_18,
+  NET_ID_CLIENT_19,
+  NET_ID_CLIENT_20,
+  NET_ID_CLIENT_21,
+  NET_ID_CLIENT_22,
+  NET_ID_CLIENT_23,
+  NET_ID_CLIENT_24,
+  NET_ID_CLIENT_25,
+  NET_ID_CLIENT_26,
+  NET_ID_CLIENT_27,
+  NET_ID_CLIENT_28,
+  NET_ID_CLIENT_29,
+  NET_ID_CLIENT_30,
+  NET_ID_CLIENT_31,
+  NET_ID_CLIENT_32,
+  NET_ID_CLIENT_33,
+  NET_ID_CLIENT_34,
+  NET_ID_CLIENT_35,
+  NET_ID_CLIENT_36,
+  NET_ID_CLIENT_37,
+  NET_ID_CLIENT_38,
+  NET_ID_CLIENT_39,
+  NET_ID_CLIENT_40,
+
+  NET_ID_CLIENT_MAX        = 40
+
+};
 #endif /* _NETDEFS_H */
Index: /branches/proxy/src/lib/network/network_manager.cc
===================================================================
--- /branches/proxy/src/lib/network/network_manager.cc	(revision 9448)
+++ /branches/proxy/src/lib/network/network_manager.cc	(revision 9449)
@@ -133,5 +133,5 @@
   this->networkStream->createServer( port);
   // and connect to the master server for synchronization
-  this->networkStream->connectToMasterServer(NetworkSettings::getInstance()->getMasterAddr().ipString(), 9999);
+  int userId = 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 9448)
+++ /branches/proxy/src/lib/network/network_stream.cc	(revision 9449)
@@ -182,5 +182,5 @@
  * @param port: the port number
  */
-void NetworkStream::connectToMasterServer(std::string host, int port)
+int NetworkStream::connectToMasterServer(std::string host, int port)
 {
   int node = this->peers.size();
@@ -192,4 +192,6 @@
   this->peers[node].connectionMonitor = new ConnectionMonitor( 0 );
   this->peers[node].ip = this->peers[node].socket->getRemoteAddress();
+
+  return node;
 }
 
@@ -200,5 +202,5 @@
  * @param port: the port number
  */
-void NetworkStream::connectToProxyServer(std::string host, int port)
+int NetworkStream::connectToProxyServer(std::string host, int port)
 {
   int node = this->peers.size();
@@ -212,4 +214,6 @@
   this->peers[node].connectionMonitor = new ConnectionMonitor( 0 );
   this->peers[node].ip = this->peers[node].socket->getRemoteAddress();
+
+  return node;
 }
 
Index: /branches/proxy/src/lib/network/network_stream.h
===================================================================
--- /branches/proxy/src/lib/network/network_stream.h	(revision 9448)
+++ /branches/proxy/src/lib/network/network_stream.h	(revision 9449)
@@ -41,6 +41,6 @@
     void init();
 
-    void connectToMasterServer(std::string host, int port);
-    void connectToProxyServer(std::string host, int port);
+    int connectToMasterServer(std::string host, int port);
+    int connectToProxyServer(std::string host, int port);
     void createServer(int port);
 
