Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 7, 2011, 4:37:29 PM (14 years ago)
Author:
smerkli
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/masterserver2/src/libraries/network/MasterServer.cc

    r8203 r8204  
    104104   */
    105105  void
    106   MasterServer::helper_cleanupServers()
     106  MasterServer::helper_cleanupServers( void )
    107107  {
    108108    /* get an iterator */
     
    115115    for( i = mainlist.serverlist.begin(); i
    116116        != mainlist.serverlist.end(); ++i )
    117     {
     117    { /* see if we have a disconnected peer */
    118118      if( (*i).peer &&
    119119         ((*i).peer->state == ENET_PEER_STATE_DISCONNECTED ||
    120120          (*i).peer->state == ENET_PEER_STATE_ZOMBIE ))
    121       { mainlist.delServerByName( (*i).ServerInfo.getServerName() );
    122         COUT(2) << "someone timed out.\n";
     121      {
     122        /* Remove it from the list */
     123        COUT(2) << (char*)(*i).peer->data << " timed out.\n";
     124        mainlist.delServerByName( (*i).ServerInfo.getServerName() );
     125
     126        /* stop iterating, we manipulated the list */
     127        /* TODO note: this only removes one dead server per loop
     128         * iteration. not beautiful, but one iteration is ~100ms,
     129         * so not really relevant for the moment.
     130         */
    123131        break;
    124132      }
     
    263271    }
    264272
    265     /* check for timed out pings and remove those guys from
    266      * the server list
    267      */
     273    /* check for timed out peers and remove those from * the server list */
    268274    helper_cleanupServers();
    269275
Note: See TracChangeset for help on using the changeset viewer.