Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9589 in orxonox.OLD for branches/proxy/src/lib/network/monitor


Ignore:
Timestamp:
Jul 28, 2006, 11:32:05 PM (18 years ago)
Author:
patrick
Message:

now the nodes get added in hirarchical way

Location:
branches/proxy/src/lib/network/monitor
Files:
2 edited

Legend:

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

    r9586 r9589  
    227227
    228228/**
     229 * @param userId of the searched node
     230 * @returns the PeerInfo of the userId peer
     231 */
     232PeerInfo* NetworkMonitor::getPeerByUserId( int userId)
     233{
     234  PeerInfo* pInfo;
     235  std::list<NetworkNode*>::iterator it = this->nodeList.begin();
     236  for(; it != this->nodeList.end(); it++)
     237  {
     238    pInfo = (*it)->getPeerByUserId(userId);
     239    if( pInfo != NULL)
     240      return pInfo;
     241  }
     242  return NULL;
     243}
     244
     245/**
     246 * searches for a given NetworkNode
     247 * @param userId of the searched node
     248 * @returns the PeerInfo of the userId peer
     249 */
     250NetworkNode* NetworkMonitor::getNodeByUserId( int userId)
     251{
     252  std::list<NetworkNode*>::iterator it = this->nodeList.begin();
     253  for(; it != this->nodeList.end(); it++)
     254  {
     255    if( (*it)->getPeerInfo()->userId == userId)
     256      return (*it);
     257  }
     258  return NULL;
     259}
     260
     261
     262/**
    229263 * this displays the network monitor gui
    230264 */
  • branches/proxy/src/lib/network/monitor/network_monitor.h

    r9586 r9589  
    7979
    8080    inline const std::list<NetworkNode*>& getNodeList() const { return this->nodeList; };
    81     /** @param userId of the searched node @returns the PeerInfo of the userId peer */
    82     inline PeerInfo* getPeerByUserId( int userId) { return this->localNode->getPeerByUserId(userId); }
     81    PeerInfo* getPeerByUserId( int userId);
     82    NetworkNode* getNodeByUserId( int userId);
    8383
    8484
Note: See TracChangeset for help on using the changeset viewer.