Changeset 9449 in orxonox.OLD for branches/proxy
- Timestamp:
- Jul 25, 2006, 10:15:18 AM (18 years ago)
- Location:
- branches/proxy/src/lib/network
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/README.NETWORK
r9406 r9449 9 9 UserId: 10 10 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) 11 WARNING: 12 There is some correlation between userids and the maxplayer, do not touch this. 11 12 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. 13 14 There are some reserved id's, don't mess with them: 15 0 : Master Server 16 1 : First Proxy Server 17 2 : Second Proxy Server 18 3 : Third Proxy Server 19 4 : Fourth Proxy Server 20 . 21 . 22 . 23 NET_MAX_PROXY The maximal number of proxy servers 24 NET_MAX... + 1 First Client 25 NET_MAX... + 2 Second Client 26 . 27 . 28 . 29 NET_MAX_CONNECTION Last client 30 13 31 14 32 -
branches/proxy/src/lib/network/netdefs.h
r9406 r9449 43 43 44 44 45 46 45 47 //!< enum indicating the type of the node 46 48 typedef enum { … … 67 69 } UidType; 68 70 71 72 //!< the id of the node 73 typedef enum nodeId { 74 NET_ID_UNASSIGNED =-1, 75 76 NET_ID_MASTER_SERVER = 0, 77 78 NET_ID_PROXY_SERVER_01 = 1, 79 NET_ID_PROXY_SERVER_02, 80 NET_ID_PROXY_SERVER_03, 81 NET_ID_PROXY_SERVER_04, 82 NET_ID_PROXY_SERVER_05, 83 NET_ID_PROXY_SERVER_06, 84 NET_ID_PROXY_SERVER_07, 85 NET_ID_PROXY_SERVER_08 = 8, 86 87 NET_ID_PROXY_MAX = 8, 88 89 NET_ID_CLIENT_01 = 9, 90 NET_ID_CLIENT_02, 91 NET_ID_CLIENT_03, 92 NET_ID_CLIENT_04, 93 NET_ID_CLIENT_05, 94 NET_ID_CLIENT_06, 95 NET_ID_CLIENT_07, 96 NET_ID_CLIENT_08, 97 NET_ID_CLIENT_09, 98 NET_ID_CLIENT_10, 99 NET_ID_CLIENT_11, 100 NET_ID_CLIENT_12, 101 NET_ID_CLIENT_13, 102 NET_ID_CLIENT_14, 103 NET_ID_CLIENT_15, 104 NET_ID_CLIENT_16, 105 NET_ID_CLIENT_17, 106 NET_ID_CLIENT_18, 107 NET_ID_CLIENT_19, 108 NET_ID_CLIENT_20, 109 NET_ID_CLIENT_21, 110 NET_ID_CLIENT_22, 111 NET_ID_CLIENT_23, 112 NET_ID_CLIENT_24, 113 NET_ID_CLIENT_25, 114 NET_ID_CLIENT_26, 115 NET_ID_CLIENT_27, 116 NET_ID_CLIENT_28, 117 NET_ID_CLIENT_29, 118 NET_ID_CLIENT_30, 119 NET_ID_CLIENT_31, 120 NET_ID_CLIENT_32, 121 NET_ID_CLIENT_33, 122 NET_ID_CLIENT_34, 123 NET_ID_CLIENT_35, 124 NET_ID_CLIENT_36, 125 NET_ID_CLIENT_37, 126 NET_ID_CLIENT_38, 127 NET_ID_CLIENT_39, 128 NET_ID_CLIENT_40, 129 130 NET_ID_CLIENT_MAX = 40 131 132 }; 69 133 #endif /* _NETDEFS_H */ -
branches/proxy/src/lib/network/network_manager.cc
r9448 r9449 133 133 this->networkStream->createServer( port); 134 134 // and connect to the master server for synchronization 135 this->networkStream->connectToMasterServer(NetworkSettings::getInstance()->getMasterAddr().ipString(), 9999);135 int userId = this->networkStream->connectToMasterServer(NetworkSettings::getInstance()->getMasterAddr().ipString(), 9999); 136 136 // and to the other proxy servers also, this would be very nice if its works 137 137 -
branches/proxy/src/lib/network/network_stream.cc
r9447 r9449 182 182 * @param port: the port number 183 183 */ 184 voidNetworkStream::connectToMasterServer(std::string host, int port)184 int NetworkStream::connectToMasterServer(std::string host, int port) 185 185 { 186 186 int node = this->peers.size(); … … 192 192 this->peers[node].connectionMonitor = new ConnectionMonitor( 0 ); 193 193 this->peers[node].ip = this->peers[node].socket->getRemoteAddress(); 194 195 return node; 194 196 } 195 197 … … 200 202 * @param port: the port number 201 203 */ 202 voidNetworkStream::connectToProxyServer(std::string host, int port)204 int NetworkStream::connectToProxyServer(std::string host, int port) 203 205 { 204 206 int node = this->peers.size(); … … 212 214 this->peers[node].connectionMonitor = new ConnectionMonitor( 0 ); 213 215 this->peers[node].ip = this->peers[node].socket->getRemoteAddress(); 216 217 return node; 214 218 } 215 219 -
branches/proxy/src/lib/network/network_stream.h
r9433 r9449 41 41 void init(); 42 42 43 voidconnectToMasterServer(std::string host, int port);44 voidconnectToProxyServer(std::string host, int port);43 int connectToMasterServer(std::string host, int port); 44 int connectToProxyServer(std::string host, int port); 45 45 void createServer(int port); 46 46
Note: See TracChangeset
for help on using the changeset viewer.