Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 28, 2006, 9:56:44 PM (18 years ago)
Author:
patrick
Message:

extending networknode interface, removed some compiler warnings and some old network stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/lib/network/monitor/network_node.cc

    r9494 r9582  
    148148
    149149
     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 */
     156PeerInfo* 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
    150194/**
    151195 * @param index index to the client
     
    154198PeerInfo* NetworkNode::getClient(int index) const
    155199{
    156   if( this->clientList.size() < index)
     200  if( (int)this->clientList.size() < index)
    157201    return NULL;
    158202
     
    174218PeerInfo* NetworkNode::getActiveProxyServer(int index) const
    175219{
    176   if( this->activeProxyServerList.size() < index)
     220  if( (int)this->activeProxyServerList.size() < index)
    177221    return NULL;
    178222
     
    194238PeerInfo* NetworkNode::getPassiveProxyServer(int index) const
    195239{
    196   if( this->passiveProxyServerList.size() < index)
     240  if( (int)this->passiveProxyServerList.size() < index)
    197241    return NULL;
    198242
     
    214258PeerInfo* NetworkNode::getMasterServer(int index) const
    215259{
    216   if( this->masterServerList.size() < index)
     260  if( (int)this->masterServerList.size() < index)
    217261    return NULL;
    218262
Note: See TracChangeset for help on using the changeset viewer.