Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9436 in orxonox.OLD for branches/proxy


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

the server does not segfault anymore on client disconnect, but the client does

File:
1 edited

Legend:

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

    r9434 r9436  
    447447#warning this is some more disconnct handling, consider doing it in the handleDisconnect() funciton
    448448      // and cleanup the user infos
    449       for ( SynchronizeableList::iterator it2 = synchronizeables.begin(); it2 != synchronizeables.end(); it2++ )
    450       {
    451         (*it2)->cleanUpUser( it->second.userId );
    452       }
    453 
    454       NetworkGameManager::getInstance()->signalLeftPlayer(it->second.userId);
    455 
    456       freeSocketSlots.push_back( it->second.userId );
    457 
    458       PeerList::iterator delit = it;
     449//       for ( SynchronizeableList::iterator it2 = synchronizeables.begin(); it2 != synchronizeables.end(); it2++ )
     450//       {
     451//         (*it2)->cleanUpUser( it->second.userId );
     452//       }
     453//
     454//       NetworkGameManager::getInstance()->signalLeftPlayer(it->second.userId);
     455//
     456//       freeSocketSlots.push_back( it->second.userId );
     457
     458//       PeerList::iterator delit = it;
    459459      it++;
    460460
    461       peers.erase( delit );
     461//       peers.erase( delit );
    462462
    463463      continue;
     
    610610    }
    611611  }
    612 
    613 
    614 //   for ( PeerList::iterator it = peers.begin(); it != peers.end(); it++ )
    615 //   {
    616 //     if( !it->second.handshake->redirect())
    617 //     {
    618 //       if( SharedNetworkData::getInstance()->isClient())
    619 //       {
    620 //         this->handleReconnect( it->second.userId);
    621 //         return;
    622 //       }
    623 //     }
    624 //   }
    625612}
    626613
     
    640627  PRINTF(0)("===============================================\n");
    641628
    642   // reject the server
    643 //   pInfo->handshake->doReject( "redirected to different server");
    644 //   pInfo->handshake->del();
    645 
    646629  // flush the old synchronization states, since the numbering could be completely different
    647630  pInfo->lastAckedState = 0;
     
    654637//   pInfo->socket->reconnectToServer( proxyIP.ipString(), proxyIP.port());
    655638  this->handleDisconnect( userId);
    656 //   this->connectToProxyServer(proxyIP.ipString(), 9999);
     639  this->connectToProxyServer(proxyIP.ipString(), 9999);
    657640#warning the ports are not yet integrated correctly in the ip class
    658641
     
    684667    (*it2)->cleanUpUser( userId );
    685668  }
    686 //
    687 // //   NetworkGameManager::getInstance()->signalLeftPlayer(userId);
    688 //
    689 //   this->freeSocketSlots.push_back( userId );
    690 //
    691 //   peers.erase( userId );
     669
     670  if( SharedNetworkData::getInstance()->isMasterServer())
     671    NetworkGameManager::getInstance()->signalLeftPlayer(userId);
     672
     673  this->freeSocketSlots.push_back( userId );
     674
     675  peers.erase( userId );
    692676
    693677//   this->pInfo->userId = 0;
Note: See TracChangeset for help on using the changeset viewer.