Changeset 7792 in orxonox.OLD for branches/network/src
- Timestamp:
- May 24, 2006, 11:38:51 AM (18 years ago)
- Location:
- branches/network/src/lib/network
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/connection_monitor.cc
r7778 r7792 81 81 ackDelay.push_back( tick - sentStateTicks[ackedState] ); 82 82 } 83 84 while ( sentStateTicks.begin() ->first <= ackedState )83 84 while ( sentStateTicks.begin() != sentStateTicks.end() && sentStateTicks.begin()->first <= ackedState ) 85 85 sentStateTicks.erase( sentStateTicks.begin() ); 86 86 -
branches/network/src/lib/network/handshake.cc
r7778 r7792 41 41 errorString_handler = registerVarId( new SynchronizeableString( &localState.errorString, &remoteState.errorString, "errorString", PERMISSION_ALL ) ); 42 42 43 localState.completed = false;43 localState.completed = 0; 44 44 localState.error = 0; 45 45 localState.errorString = ""; … … 50 50 localState.version = _ORXONOX_VERSION; 51 51 52 remoteState.completed = false;52 remoteState.completed = 0; 53 53 remoteState.error = 0; 54 54 remoteState.errorString = ""; … … 76 76 { 77 77 localState.error = 1; 78 localState.completed = true;78 localState.completed = 1; 79 79 localState.errorString = "Seems not to be orxonox!"; 80 return;80 continue; 81 81 } 82 else 83 localState.completed = true; 82 84 83 } 85 84 … … 89 88 { 90 89 localState.error = 2; 91 localState.completed = true;90 localState.completed = 1; 92 91 localState.errorString = "Versions of server and client do not match!"; 93 return;92 continue; 94 93 } 95 else 96 localState.completed = true; 94 97 95 } 98 96 99 97 } 98 99 if ( 100 remoteState.orxId == _ORXONOX_ID && 101 remoteState.version == _ORXONOX_VERSION 102 ) 103 localState.completed = true; 100 104 } 101 105 -
branches/network/src/lib/network/network_stream.cc
r7778 r7792 196 196 cleanUpOldSyncList(); 197 197 handleHandshakes(); 198 199 handleDownstream(); 198 200 handleUpstream(); 199 handleDownstream();200 201 201 202 } … … 250 251 } 251 252 252 253 253 //check if connections are ok else remove them 254 254 for ( PeerList::iterator it = peers.begin(); it != peers.end(); it++ ) 255 255 { 256 //TODO check for timeout257 256 if ( 258 (it->second.socket && !it->second.socket->isOk() ) || 259 it->second.connectionMonitor->hasTimedOut() 257 it->second.socket && 258 ( 259 !it->second.socket->isOk() || 260 it->second.connectionMonitor->hasTimedOut() 261 ) 260 262 ) 261 263 { … … 337 339 MessageManager::getInstance()->setUniqueID( it->second.handshake->getMessageManagerId() ); 338 340 } 341 else 342 handleNewClient( it->second.userId ); 339 343 340 344 PRINT(0)("handshake finished id=%d\n", it->second.handshake->getNetworkGameManagerId()); … … 342 346 delete it->second.handshake; 343 347 it->second.handshake = NULL; 344 345 handleNewClient( it->second.userId ); 348 346 349 } 347 350 else … … 504 507 if ( sync == NULL ) 505 508 { 509 PRINTF(0)("could not find sync with id %d. try to create it\n", uniqueId); 506 510 if ( oldSynchronizeables.find( uniqueId ) != oldSynchronizeables.end() ) 507 511 { … … 524 528 525 529 Converter::byteArrayToInt( buf + offset, &leafClassId ); 530 531 assert( leafClassId != 0 ); 526 532 527 BaseObject * b ;533 BaseObject * b = NULL; 528 534 /* These are some small exeptions in creation: Not all objects can/should be created via Factory */ 529 535 /* Exception 1: NullParent */ 530 if( leafClassId == CL_NULL_PARENT || leafClassId == CL_SYNCHRONIZEABLE )536 if( leafClassId == CL_NULL_PARENT || leafClassId == CL_SYNCHRONIZEABLE || leafClassId == CL_NETWORK_GAME_MANAGER ) 531 537 { 532 538 PRINTF(1)("Can not create Class with ID %x!\n", (int)leafClassId); … … 573 579 574 580 peer->second.lastAckedState = ackedState; 581 575 582 peer->second.lastRecvedState = state; 576 583
Note: See TracChangeset
for help on using the changeset viewer.