Changeset 9300 in orxonox.OLD for branches/proxy/src/lib/network/monitor/network_node.cc
- Timestamp:
- Jul 17, 2006, 10:15:33 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/monitor/network_node.cc
r9292 r9300 147 147 148 148 149 /** 150 * @param index index to the client 151 * @return the client in the list or NULL if none 152 */ 153 PeerInfo* NetworkNode::getClient(int index) 154 { 155 if( this->clientList.size() < index) 156 return NULL; 157 158 std::list<PeerInfo*>::iterator it = this->clientList.begin(); 159 for(int i = 0; it != this->clientList.end(); it++, i++) 160 { 161 if( i == index) 162 return (*it); 163 } 164 165 return NULL; 166 } 167 168 169 /** 170 * @param index index to the client 171 * @return the active proxy server in the list or NULL if none 172 */ 173 PeerInfo* NetworkNode::getActiveProxyServer(int index) 174 { 175 if( this->activeProxyServerList.size() < index) 176 return NULL; 177 178 std::list<PeerInfo*>::iterator it = this->activeProxyServerList.begin(); 179 for(int i = 0; it != this->activeProxyServerList.end(); it++, i++) 180 { 181 if( i == index) 182 return (*it); 183 } 184 185 return NULL; 186 } 187 188 189 /** 190 * @param index index to the client 191 * @return the passive proxy server in the list or NULL if none 192 */ 193 PeerInfo* NetworkNode::getPassiveProxyServer(int index) 194 { 195 if( this->passiveProxyServerList.size() < index) 196 return NULL; 197 198 std::list<PeerInfo*>::iterator it = this->passiveProxyServerList.begin(); 199 for(int i = 0; it != this->passiveProxyServerList.end(); it++, i++) 200 { 201 if( i == index) 202 return (*it); 203 } 204 205 return NULL; 206 } 207 208 209 /** 210 * @param index index to the client 211 * @return the master server in the list or NULL if none 212 */ 213 PeerInfo* NetworkNode::getMasterServer(int index) 214 { 215 if( this->masterServerList.size() < index) 216 return NULL; 217 218 std::list<PeerInfo*>::iterator it = this->masterServerList.begin(); 219 for(int i = 0; it != this->masterServerList.end(); it++, i++) 220 { 221 if( i == index) 222 return (*it); 223 } 224 225 return NULL; 226 } 227 149 228 150 229 /**
Note: See TracChangeset
for help on using the changeset viewer.