Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 13, 2006, 2:13:29 PM (19 years ago)
Author:
patrick
Message:

processing the node type through the framework

File:
1 edited

Legend:

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

    r9269 r9270  
    6464  this->init();
    6565  /* initialize the references */
    66   this->type = NET_CLIENT;
     66  this->nodeType = NET_CLIENT;
    6767}
    6868
     
    7575NetworkStream::NetworkStream( std::string host, int port )
    7676{
    77   this->type = NET_CLIENT;
     77  this->nodeType = NET_CLIENT;
    7878  this->init();
    7979  this->peers[0].socket = new UdpSocket( host, port );
     
    9090NetworkStream::NetworkStream( int port )
    9191{
    92   this->type = NET_MASTER_SERVER;
     92  this->nodeType = NET_MASTER_SERVER;
    9393  this->init();
    9494  this->serverSocket = new UdpServerSocket(port);
     
    173173void NetworkStream::startHandshake()
    174174{
    175   Handshake* hs = new Handshake(false);
     175  Handshake* hs = new Handshake(this->nodeType);
    176176  hs->setUniqueID( 0 );
    177177  assert( peers[0].handshake == NULL );
     
    229229  }
    230230
    231   if ( this->type == NET_MASTER_SERVER )
     231  if ( this->nodeType == NET_MASTER_SERVER )
    232232  {
    233233    // execute everytthing the master server shoudl do
     
    237237    this->updateConnectionList();
    238238  }
    239   else if( this->type == NET_PROXY_SERVER)
     239  else if( this->nodeType == NET_PROXY_SERVER)
    240240  {
    241241    // execute everything the proxy server should do
     
    292292      freeSocketSlots.pop_back();
    293293      peers[clientId].socket = tempNetworkSocket;
    294       peers[clientId].handshake = new Handshake(true, clientId, this->networkGameManager->getUniqueID(), MessageManager::getInstance()->getUniqueID() );
     294      peers[clientId].handshake = new Handshake(this->nodeType, clientId, this->networkGameManager->getUniqueID(), MessageManager::getInstance()->getUniqueID() );
    295295      peers[clientId].connectionMonitor = new ConnectionMonitor( clientId );
    296296      peers[clientId].handshake->setUniqueID(clientId);
     
    307307
    308308      peers[clientId].socket = tempNetworkSocket;
    309       peers[clientId].handshake = new Handshake(true, clientId, this->networkGameManager->getUniqueID(), MessageManager::getInstance()->getUniqueID());
     309      peers[clientId].handshake = new Handshake(this->nodeType, clientId, this->networkGameManager->getUniqueID(), MessageManager::getInstance()->getUniqueID());
    310310      peers[clientId].handshake->setUniqueID(clientId);
    311311      peers[clientId].connectionMonitor = new ConnectionMonitor( clientId );
     
    437437          if ( !it->second.handshake->allowDel() )
    438438          {
    439             if ( type == NET_CLIENT )
     439            if ( this->nodeType == NET_CLIENT )
    440440            {
    441441              SharedNetworkData::getInstance()->setHostID( it->second.handshake->getHostId() );
    442442              myHostId = SharedNetworkData::getInstance()->getHostID();
     443
     444              PRINTF(0)("remote host is a %i\n", it->second.handshake->getRemoteNodeType());
    443445
    444446              this->networkGameManager = NetworkGameManager::getInstance();
     
    457459            if ( it->second.handshake->canDel() )
    458460            {
    459               if ( type == NET_MASTER_SERVER )
     461              if ( this->nodeType == NET_MASTER_SERVER )
    460462              {
    461463                handleNewClient( it->second.userId );
Note: See TracChangeset for help on using the changeset viewer.