- Timestamp:
- Apr 7, 2011, 4:37:29 PM (14 years ago)
- Location:
- code/branches/masterserver2/src/libraries/network
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/masterserver2/src/libraries/network/MasterServer.cc
r8203 r8204 104 104 */ 105 105 void 106 MasterServer::helper_cleanupServers( )106 MasterServer::helper_cleanupServers( void ) 107 107 { 108 108 /* get an iterator */ … … 115 115 for( i = mainlist.serverlist.begin(); i 116 116 != mainlist.serverlist.end(); ++i ) 117 { 117 { /* see if we have a disconnected peer */ 118 118 if( (*i).peer && 119 119 ((*i).peer->state == ENET_PEER_STATE_DISCONNECTED || 120 120 (*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 */ 123 131 break; 124 132 } … … 263 271 } 264 272 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 */ 268 274 helper_cleanupServers(); 269 275 -
code/branches/masterserver2/src/libraries/network/MasterServer.h
r8163 r8204 69 69 /* helpers */ 70 70 void helper_sendlist( ENetEvent *event ); 71 void helper_pingServers( void ); 72 void helper_cleanupServers(); 71 void helper_cleanupServers( void ); 73 72 74 73 /* members */
Note: See TracChangeset
for help on using the changeset viewer.