- Timestamp:
- Jan 30, 2006, 4:33:38 PM (19 years ago)
- Location:
- branches/network/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/network_stream.cc
r6737 r6867 263 263 if ( reciever!=0 ) 264 264 { 265 if ( networkSockets[reciever] != NULL ) 266 { 267 PRINTF(5)("write %d bytes to socket %d\n", dataLength, reciever); 268 networkSockets[reciever]->writePacket(downBuffer, dataLength); 265 if ( reciever < 0) 266 { 267 for ( int i = 0; i<networkSockets.size(); i++) 268 { 269 if ( i!=-reciever && networkSockets[i] != NULL ) 270 { 271 PRINTF(5)("write %d bytes to socket %d\n", dataLength, i); 272 networkSockets[i]->writePacket(downBuffer, dataLength); 273 } 274 } 269 275 } 270 276 else 271 277 { 272 PRINTF(1)("networkSockets[reciever] == NULL\n"); 278 if ( networkSockets[reciever] != NULL ) 279 { 280 PRINTF(5)("write %d bytes to socket %d\n", dataLength, reciever); 281 networkSockets[reciever]->writePacket(downBuffer, dataLength); 282 } 283 else 284 { 285 PRINTF(1)("networkSockets[reciever] == NULL\n"); 286 } 273 287 } 274 288 } -
branches/network/src/world_entities/space_ships/space_ship.cc
r6866 r6867 563 563 564 564 } 565 else 566 assert(false); 565 567 566 568 continue; … … 576 578 SYNCHELP_READ_FLOAT( mouseDir.v.z, NWT_SS_MOUSEDIRZ ); 577 579 } 580 else 581 assert(false); 578 582 579 583 continue; … … 583 587 { 584 588 if ( this->getOwner() != this->getHostID() ) 589 { 585 590 SYNCHELP_READ_FKT( PNode::writeSync, NWT_SS_PN_SYNC ); 591 } 592 else 593 assert(false); 586 594 587 595 continue; … … 595 603 SYNCHELP_READ_FLOAT( velocity.y, NWT_SS_VELY ); 596 604 SYNCHELP_READ_FLOAT( velocity.z, NWT_SS_VELZ ); 597 } 605 } 606 else 607 assert(false); 598 608 599 609 continue; … … 603 613 { 604 614 if ( this->getOwner() != this->getHostID() ) 615 { 605 616 SYNCHELP_READ_FKT( Playable::writeSync, NWT_SS_PL_SYNC ); 617 } 618 else 619 assert(false); 606 620 } 607 621 } … … 637 651 } 638 652 639 *reciever = 0; 653 *reciever = -this->getOwner(); 654 bool sentSomething = false; 640 655 641 656 if ( ( this->getHostID()==0 || this->getOwner() == this->getHostID() ) && PNode::needsReadSync() ) … … 668 683 { 669 684 oldMask = mask; 685 sentSomething = true; 670 686 SYNCHELP_WRITE_BYTE( DATA_flags, NWT_SS_B ); 671 687 SYNCHELP_WRITE_BYTE( mask, NWT_SS_FLAGS ); … … 682 698 SYNCHELP_WRITE_BYTE( DATA_mouse, NWT_SS_B ); 683 699 PRINTF(0)("SENDING mousedir\n"); 700 sentSomething = true; 684 701 SYNCHELP_WRITE_FLOAT( mouseDir.w, NWT_SS_MOUSEDIRW ); 685 702 SYNCHELP_WRITE_FLOAT( mouseDir.v.x, NWT_SS_MOUSEDIRX ); … … 693 710 { 694 711 oldVelocity = velocity; 695 PRINTF(0)("SENDING velocity\n");696 SYNCHELP_WRITE_BYTE( DATA_velocity, NWT_SS_B );697 SYNCHELP_WRITE_FLOAT( velocity.x, NWT_SS_VELX );698 SYNCHELP_WRITE_FLOAT( velocity.y, NWT_SS_VELY );699 SYNCHELP_WRITE_FLOAT( velocity.z, NWT_SS_VELZ );712 //PRINTF(0)("SENDING velocity\n"); 713 //SYNCHELP_WRITE_BYTE( DATA_velocity, NWT_SS_B ); 714 //SYNCHELP_WRITE_FLOAT( velocity.x, NWT_SS_VELX ); 715 //SYNCHELP_WRITE_FLOAT( velocity.y, NWT_SS_VELY ); 716 //SYNCHELP_WRITE_FLOAT( velocity.z, NWT_SS_VELZ ); 700 717 } 701 718 702 719 if ( Playable::needsReadSync() ) 703 720 { 721 sentSomething = true; 704 722 SYNCHELP_WRITE_BYTE( DATA_playables, NWT_SS_B ); 705 723 SYNCHELP_WRITE_FKT( Playable::readSync, NWT_SS_PL_SYNC ); … … 707 725 708 726 } 727 728 if ( !sentSomething ) 729 reciever = 0; 709 730 710 731 return SYNCHELP_WRITE_N;
Note: See TracChangeset
for help on using the changeset viewer.