Changeset 9582 in orxonox.OLD for branches/proxy/src/lib
- Timestamp:
- Jul 28, 2006, 9:56:44 PM (18 years ago)
- Location:
- branches/proxy/src/lib/network
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/monitor/network_node.cc
r9494 r9582 148 148 149 149 150 151 /** 152 * gets the peer info by user id 153 * @param userId the user id of the node to look up 154 * @return the peer info of this node NULL if nothing found 155 */ 156 PeerInfo* NetworkNode::getNodeByUserId( int userId) 157 { 158 // look through the master server lists 159 std::list<PeerInfo*>::const_iterator it = this->masterServerList.begin(); 160 for( ;it != this->masterServerList.end(); it++) 161 { 162 if( (*it)->userId == userId) 163 return (*it); 164 } 165 166 // look through the active proxy server list 167 it = this->activeProxyServerList.begin(); 168 for( ; it != this->activeProxyServerList.end(); it++) 169 { 170 if( (*it)->userId == userId) 171 return (*it); 172 } 173 174 // look through the passive server list 175 it = this->passiveProxyServerList.begin(); 176 for( ; it != this->passiveProxyServerList.end(); it++) 177 { 178 if( (*it)->userId == userId) 179 return (*it); 180 } 181 182 // look through the client list 183 it = this->clientList.begin(); 184 for( ; it != this->clientList.end(); it++) 185 { 186 if( (*it)->userId == userId) 187 return (*it); 188 } 189 190 return NULL; 191 } 192 193 150 194 /** 151 195 * @param index index to the client … … 154 198 PeerInfo* NetworkNode::getClient(int index) const 155 199 { 156 if( this->clientList.size() < index)200 if( (int)this->clientList.size() < index) 157 201 return NULL; 158 202 … … 174 218 PeerInfo* NetworkNode::getActiveProxyServer(int index) const 175 219 { 176 if( this->activeProxyServerList.size() < index)220 if( (int)this->activeProxyServerList.size() < index) 177 221 return NULL; 178 222 … … 194 238 PeerInfo* NetworkNode::getPassiveProxyServer(int index) const 195 239 { 196 if( this->passiveProxyServerList.size() < index)240 if( (int)this->passiveProxyServerList.size() < index) 197 241 return NULL; 198 242 … … 214 258 PeerInfo* NetworkNode::getMasterServer(int index) const 215 259 { 216 if( this->masterServerList.size() < index)260 if( (int)this->masterServerList.size() < index) 217 261 return NULL; 218 262 -
branches/proxy/src/lib/network/monitor/network_node.h
r9494 r9582 46 46 inline std::list<PeerInfo*> getClient() const { return this->clientList; } 47 47 48 PeerInfo* getNodeByUserId( int userId); 48 49 49 50 /** @returns the number of players */ -
branches/proxy/src/lib/network/network_game_manager.h
r9521 r9582 19 19 class PNode; 20 20 21 typedef enum NetworkGameManagerProtocol {22 NET_CREATE_ENTITY = 0,23 NET_REMOVE_ENTITY,24 NET_CREATE_ENTITY_LIST,25 NET_REMOVE_ENTITY_LIST,26 NET_REQUEST_CREATE,27 NET_REQUEST_REMOVE,28 NET_YOU_ARE_ENTITY,29 NET_REQUEST_ENTITY_LIST,30 21 31 NET_NUMBER32 };33 22 34 23 struct clientBuffer -
branches/proxy/src/lib/network/proxy/proxy_control.cc
r9572 r9582 29 29 #include "debug.h" 30 30 31 31 #include "monitor/network_monitor.h" 32 32 33 33 … … 85 85 assert(SharedNetworkData::getInstance()->isProxyServerActive()); 86 86 87 byte data[INTSIZE]; 87 byte data[2 * INTSIZE]; 88 // write the userId in the message 89 assert( Converter::intToByteArray( userId, data, INTSIZE ) == INTSIZE ); 90 // and the ip as an int 88 91 89 92 assert( Converter::intToByteArray( userId, data, INTSIZE ) == INTSIZE );
Note: See TracChangeset
for help on using the changeset viewer.