Changeset 7614 in orxonox.OLD for branches/network
- Timestamp:
- May 13, 2006, 6:11:22 PM (19 years ago)
- Location:
- branches/network/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/network_stream.cc
r7613 r7614 465 465 466 466 PRINT(0)("handshake finished id=%d\n", it->second.handshake->getNetworkGameManagerId()); 467 assert(false);468 467 469 468 delete it->second.handshake; … … 474 473 PRINT(1)("handshake failed!\n"); 475 474 it->second.socket->disconnectServer(); 476 assert(false);477 475 } 478 476 } … … 521 519 522 520 if ( isServer() && sync.getLeafClassID() == CL_HANDSHAKE && sync.getUniqueID() != peer->second.userId ) 521 continue; 522 523 //do not sync null parent 524 if ( sync.getLeafClassID() == CL_NULL_PARENT ) 523 525 continue; 524 526 … … 535 537 //make space for size 536 538 offset += INTSIZE; 537 539 538 540 n = sync.getStateDiff( peer->second.userId, buf + offset, UDP_PACKET_SIZE-offset, currentState, peer->second.lastAckedState, 0 ); 539 541 offset += n; 540 542 541 assert( Converter::intToByteArray( n, buf + offset - n , INTSIZE ) == INTSIZE );543 assert( Converter::intToByteArray( n, buf + offset - n - INTSIZE, INTSIZE ) == INTSIZE ); 542 544 } 543 545 … … 545 547 546 548 assert( peer->second.socket->writePacket( buf, offset ) ); 547 PRINTF(0)("send packet: %d userId = %d %x %d\n", offset, peer->second.userId, peer->second.handshake->getLeafClassID(), peer->second.handshake->getUniqueID()); 548 assert( peer->second.handshake->getLeafClassID() == CL_HANDSHAKE ); 549 PRINTF(0)("send packet: %d userId = %d\n", offset, peer->second.userId); 549 550 } 550 551 } … … 568 569 for ( PeerList::iterator peer = peers.begin(); peer != peers.end(); peer++ ) 569 570 { 571 570 572 if ( !peer->second.socket ) 571 573 continue; … … 598 600 continue; 599 601 } 600 602 601 603 while ( offset < length ) 602 604 { … … 666 668 } 667 669 } 670 668 671 offset += sync->setStateDiff( peer->second.userId, buf+offset, length-offset, state, fromState ); 669 672 } … … 676 679 peer->second.lastAckedState = ackedState; 677 680 } 678 } 679 680 681 682 683 684 681 682 } 683 684 685 686 687 688 -
branches/network/src/lib/network/synchronizeable.cc
r7602 r7614 285 285 else 286 286 stateFrom = (*it); 287 287 288 288 std::list<int> changes; 289 289 … … 302 302 //add state to state history 303 303 recvStates[userId].push_back( stateTo ); 304 304 305 305 int i = 0; 306 306 … … 309 309 i += (*it)->readFromBuf( stateTo->data + i, stateTo->dataLength - i ); 310 310 } 311 311 312 312 this->varChangeHandler( changes ); 313 313 … … 322 322 void Synchronizeable::varChangeHandler( std::list<int> & id ) 323 323 { 324 for ( std::list<int>::iterator it = id.begin(); it != id.end(); it++ )325 assert( *it != mLeafClassId );326 324 } 327 325 -
branches/network/src/lib/network/synchronizeable_var/synchronizeable_quaternion.cc
r7578 r7614 83 83 int n = 0; 84 84 85 res += Converter::byteArrayToFloat( buf + n, &x );85 res = Converter::byteArrayToFloat( buf + n, &x ); 86 86 assert( res > 0 ); 87 87 n += res; 88 88 89 res += Converter::byteArrayToFloat( buf + n, &y );89 res = Converter::byteArrayToFloat( buf + n, &y ); 90 90 assert( res > 0 ); 91 91 n += res; 92 92 93 res += Converter::byteArrayToFloat( buf + n, &z );93 res = Converter::byteArrayToFloat( buf + n, &z ); 94 94 assert( res > 0 ); 95 95 n += res; 96 96 97 res += Converter::byteArrayToFloat( buf + n, &w );97 res = Converter::byteArrayToFloat( buf + n, &w ); 98 98 assert( res > 0 ); 99 99 n += res; … … 101 101 *vPtrOut = Quaternion( Vector(x, y, z), w ); 102 102 103 assert( res== 4*FLOATSIZE );104 return res;103 assert( n == 4*FLOATSIZE ); 104 return n; 105 105 } 106 106 -
branches/network/src/lib/network/synchronizeable_var/synchronizeable_vector.cc
r7578 r7614 80 80 int n = 0; 81 81 82 res += Converter::byteArrayToFloat( buf + n, &x );82 res = Converter::byteArrayToFloat( buf + n, &x ); 83 83 assert( res > 0 ); 84 84 n += res; 85 85 86 res += Converter::byteArrayToFloat( buf + n, &y );86 res = Converter::byteArrayToFloat( buf + n, &y ); 87 87 assert( res > 0 ); 88 88 n += res; 89 89 90 res += Converter::byteArrayToFloat( buf + n, &z );90 res = Converter::byteArrayToFloat( buf + n, &z ); 91 91 assert( res > 0 ); 92 92 n += res; … … 94 94 *vPtrOut = Vector( x, y, z ); 95 95 96 assert( res== 3*FLOATSIZE );97 return res;96 assert( n == 3*FLOATSIZE ); 97 return n; 98 98 } 99 99 -
branches/network/src/subprojects/network/simple_sync.cc
r7613 r7614 31 31 : Synchronizeable() 32 32 { 33 setName( name ); 33 34 in = 0; 34 35 out = 1;
Note: See TracChangeset
for help on using the changeset viewer.