Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 30, 2006, 11:19:24 PM (18 years ago)
Author:
patrick
Message:

yet another weekend commit, quite much work done:

  • introduced a new PERMISSION layer: PERMISSION_SERVER: the nearest server hast authority
  • tightening up permissions: brand new implementation to prevent sending unused variables in the network (less smog in the net:D_
  • removed some compiler warnings from some central modules
  • networkmonitor interface changed to work with networknodes mainly
  • better debug output for the network monitor
  • networnode inteface standardisation
  • force reconnection commands integration
File:
1 edited

Legend:

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

    r9589 r9625  
    1010
    1111### File Specific:
    12    main-programmer: Patrick Boenzli
     12   main-programmer: Patrick Boenzli (patrick@orxonox.ethz.ch)
    1313*/
    1414
     
    4949  this->networkStream = networkStream;
    5050  this->playerNumber = 0;
     51  this->connectionNumber = 0;
    5152  // create the localnode, init it and add it to the nodes list
    5253  this->localNode = new NetworkNode( this->networkStream->getPeerInfo());
     
    6970      peer->userId = -1;
    7071
    71       NetworkNode* node = new NetworkNode(peer);
    72       this->addNode( node);
    7372      this->addActiveProxyServer( this->localNode, peer);
    7473    }
     
    141140    return;
    142141
     142  PRINTF(0)("^^^^^^^^^^^^^^^^^^^^^^^^^^ adding node: %i with type: %s\n\n", pInfo->userId, pInfo->getNodeTypeString().c_str());
     143
    143144  if( pInfo->isClient())
    144     this->localNode->addClient(pInfo);
     145  {
     146    this->localNode->addClient(new NetworkNode(pInfo));
     147  }
    145148  else if( pInfo->isProxyServerActive())
    146149  {
    147     this->localNode->addActiveProxyServer(pInfo);
    148     // create a new node, since a proxy can connect clients again
    149     NetworkNode* node = new NetworkNode(pInfo);
    150     this->nodeList.push_back(node);
     150    this->localNode->addActiveProxyServer(new NetworkNode(pInfo));
     151  }
     152  else if( pInfo->isProxyServerActivePassive())
     153  {
     154    this->localNode->addPassiveProxyServer(new NetworkNode(pInfo));
    151155  }
    152156  else if( pInfo->isMasterServer())
    153157  {
    154     this->localNode->addMasterServer(pInfo);
    155   }
     158    this->localNode->addMasterServer(new NetworkNode(pInfo));
     159  }
     160  else
     161    assert(false);
    156162}
    157163
     
    168174
    169175  if( pInfo->isClient())
    170     node->addClient(pInfo);
     176    node->addClient(new NetworkNode(pInfo));
    171177  else if( pInfo->isProxyServerActive())
    172     node->addActiveProxyServer(pInfo);
     178    node->addActiveProxyServer(new NetworkNode(pInfo));
    173179  else if( pInfo->isMasterServer())
    174     node->addMasterServer(pInfo);
     180    node->addMasterServer(new NetworkNode(pInfo));
    175181}
    176182
     
    198204
    199205  if( pInfo->isClient())
    200     node->removeClient(pInfo);
     206    node->removeClient(pInfo->userId);
    201207  else if( pInfo->isProxyServerActive())
    202     node->removeActiveProxyServer(pInfo);
     208    node->removeActiveProxyServer(pInfo->userId);
    203209  else if( pInfo->isMasterServer())
    204     node->removeMasterServer(pInfo);
     210    node->removeMasterServer(pInfo->userId);
    205211}
    206212
     
    253259  for(; it != this->nodeList.end(); it++)
    254260  {
     261    PRINTF(0)("comparing %i to %i\n", (*it)->getPeerInfo()->userId, userId);
    255262    if( (*it)->getPeerInfo()->userId == userId)
    256263      return (*it);
     
    308315  for(; it != this->nodeList.end(); it++)
    309316  {
    310     (*it)->debug(0);
     317    (*it)->debug(1);
    311318  }
    312319
Note: See TracChangeset for help on using the changeset viewer.