Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9433 in orxonox.OLD


Ignore:
Timestamp:
Jul 24, 2006, 4:36:28 PM (18 years ago)
Author:
patrick
Message:

new approach: the reconnection is handled from a different point in the network process

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

Legend:

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

    r9430 r9433  
    120120  this->pInfo->lastRecvedState = 0;
    121121
     122  this->bRedirect = false;
    122123
    123124  this->currentState = 0;
     
    328329      PRINTF(1)("lost connection to server\n");
    329330    }
    330   }
    331 
    332   cleanUpOldSyncList();
    333   handleHandshakes();
     331    // check if there is a redirection command
     332    if( this->bRedirect)
     333    {
     334      this->handleReconnect( 0);
     335    }
     336  }
     337
     338  this->cleanUpOldSyncList();
     339  this->handleHandshakes();
    334340
    335341  // update the network monitor
     
    338344  // order of up/downstream is important!!!!
    339345  // don't change it
    340   handleDownstream( tick );
    341   handleUpstream( tick );
     346  this->handleDownstream( tick );
     347  this->handleUpstream( tick );
    342348}
    343349
     
    519525        if ( it->second.handshake->ok() )
    520526        {
    521           // the server gave it free for deletion
     527          // the counter part didn't mark it free for deletion yet
    522528          if ( !it->second.handshake->allowDel() )
    523529          {
     
    538544
    539545              // now check if the server accepted the connection
     546              if( it->second.handshake->redirect() )
     547              {
     548                this->bRedirect = true;
     549              }
    540550
    541551              // create the new network game manager and init it
     
    627637  PRINTF(0)("Client is redirected to the other proxy servers\n");
    628638  PRINTF(0)("  user id: %i\n", userId);
    629   PRINTF(0)("  connecting to: %s\n", pInfo->handshake->getProxy1Address().ipString().c_str());
     639  PRINTF(0)("  connecting to: %s\n", this->networkMonitor->getFirstChoiceProxy()->ip.ipString().c_str());
    630640  PRINTF(0)("===============================================\n");
    631641
     
    671681
    672682
    673 //   for ( SynchronizeableList::iterator it2 = synchronizeables.begin(); it2 != synchronizeables.end(); it2++ )  {
    674 //     (*it2)->cleanUpUser( userId );
    675 //   }
     683  for ( SynchronizeableList::iterator it2 = synchronizeables.begin(); it2 != synchronizeables.end(); it2++ )  {
     684    (*it2)->cleanUpUser( userId );
     685  }
    676686//
    677687// //   NetworkGameManager::getInstance()->signalLeftPlayer(userId);
  • branches/proxy/src/lib/network/network_stream.h

    r9422 r9433  
    115115    int                        dictServer;                  //!< the zip dict for the server
    116116    int                        dictClient;                  //!< the zip dict for the client
     117
     118    bool                       bRedirect;                   //!< true if the master server sent a redirect command
    117119};
    118120#endif /* _NETWORK_STREAM */
Note: See TracChangeset for help on using the changeset viewer.