Changeset 6526 in orxonox.OLD for branches/network/src/world_entities/space_ships
- Timestamp:
- Jan 18, 2006, 1:01:27 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/world_entities/space_ships/space_ship.cc
r6503 r6526 292 292 293 293 //hoover effect 294 cycle += time;295 this->shiftCoor(Vector(0,1,0)*cos(this->cycle*2.0)*0.02);294 //cycle += time; 295 //this->shiftCoor(Vector(0,1,0)*cos(this->cycle*2.0)*0.02); 296 296 297 297 //readjust … … 531 531 SYNCHELP_READ_BYTE( b ); 532 532 533 if ( b == DATA_state && this->getHostID()!=this->getOwner() ) 534 { 533 if ( b == DATA_state /*&& (this->getHostID()!=this->getOwner() || sender==0)*/ ) 534 { 535 PRINTF(0)("GOT STATE %d\n", this->getUniqueID()); 535 536 setRequestedSync( false ); 536 537 setIsOutOfSync( false ); 537 538 SYNCHELP_READ_FKT( WorldEntity::writeState ); 538 SYNCHELP_READ_FLOAT( cycle ); 539 } 540 541 return SYNCHELP_READ_N; 542 543 if ( b == DATA_flags && this->getHostID()!=this->getOwner() ) 539 //SYNCHELP_READ_FLOAT( cycle ); 540 541 return SYNCHELP_READ_N; 542 } 543 544 545 if ( b == DATA_flags /*&& this->getHostID()!=this->getOwner()*/ ) 544 546 { 545 547 int flags; 546 SYNCHELP_READ_INT( flags ); 547 548 bUp = flags & MASK_bUp != 0; 549 bDown = flags & MASK_bDown != 0; 550 bLeft = flags & MASK_bLeft != 0; 551 bRight = flags & MASK_bRight != 0; 552 bAscend = flags & MASK_bAscend != 0; 553 bDescend = flags & MASK_bDescend != 0; 554 bFire = flags & MASK_bFire != 0; 555 bRollL = flags & MASK_bRollL != 0; 556 bRollR = flags & MASK_bRollR != 0; 557 } 558 559 if ( b == DATA_mouse && this->getHostID()!=this->getOwner() ) 548 //SYNCHELP_READ_INT( flags ); 549 550 bUp = (flags & MASK_bUp) != 0; 551 bDown = (flags & MASK_bDown) != 0; 552 bLeft = (flags & MASK_bLeft) != 0; 553 bRight = (flags & MASK_bRight) != 0; 554 bAscend = (flags & MASK_bAscend) != 0; 555 bDescend = (flags & MASK_bDescend) != 0; 556 bFire = (flags & MASK_bFire) != 0; 557 bRollL = (flags & MASK_bRollL) != 0; 558 bRollR = (flags & MASK_bRollR) != 0; 559 560 } 561 562 /*if ( b == DATA_mouse && this->getHostID()!=this->getOwner() ) 560 563 { 561 564 SYNCHELP_READ_FLOAT( xMouse ); … … 563 566 SYNCHELP_READ_FLOAT( mouseSensitivity ); 564 567 SYNCHELP_READ_FLOAT( cycle ); 565 } 568 }*/ 569 570 SYNCHELP_READ_FKT( PNode::writeSync ); 566 571 567 572 return SYNCHELP_READ_N; … … 574 579 SYNCHELP_WRITE_BEGIN(); 575 580 576 if ( isOutOfSync() && !requestedSync() && this->getHostID()!=this->getOwner())581 if ( isOutOfSync() && !requestedSync() /*&& this->getHostID()!=this->getOwner()*/ ) 577 582 { 578 583 (NetworkGameManager::getInstance())->sync( this->getUniqueID(), this->getOwner() ); 579 584 setRequestedSync( true ); 585 PRINTF(0)("REQUESTED STATE %d\n", this->getUniqueID()); 580 586 } 581 587 … … 585 591 *reciever = rec; 586 592 593 PRINTF(0)("SEND STATE %d %d\n", this->getUniqueID(), rec); 594 587 595 SYNCHELP_WRITE_BYTE( (byte)DATA_state ); 588 596 589 597 SYNCHELP_WRITE_FKT( WorldEntity::readState ); 590 SYNCHELP_WRITE_FLOAT( cycle );598 //SYNCHELP_WRITE_FLOAT( cycle ); 591 599 592 600 return SYNCHELP_WRITE_N; 593 601 } 594 595 return 0;596 602 597 603 *reciever = 0; … … 619 625 620 626 static int oldMask = mask+1; //so it is different the first time! 621 static float oldxMouse = xMouse + 1.0;622 static float oldyMouse = yMouse + 1.0;627 //static float oldxMouse = xMouse + 1.0; 628 //static float oldyMouse = yMouse + 1.0; 623 629 624 630 if ( mask != oldMask ) … … 626 632 oldMask = mask; 627 633 SYNCHELP_WRITE_BYTE( DATA_flags ); 628 SYNCHELP_WRITE_INT( mask ); 629 } 630 631 if ( oldxMouse != xMouse || oldyMouse != yMouse ) 634 //SYNCHELP_WRITE_INT( mask ); 635 } 636 else 637 { 638 SYNCHELP_WRITE_BYTE( 0 ); 639 } 640 641 /*if ( oldxMouse != xMouse || oldyMouse != yMouse ) 632 642 { 633 643 oldxMouse = xMouse; … … 638 648 SYNCHELP_WRITE_FLOAT( mouseSensitivity ); 639 649 SYNCHELP_WRITE_FLOAT( cycle ); 640 } 641 } 650 }*/ 651 } 652 else 653 { 654 SYNCHELP_WRITE_BYTE( 0 ); 655 } 656 657 SYNCHELP_WRITE_FKT( PNode::readSync ); 642 658 643 659 return SYNCHELP_WRITE_N;
Note: See TracChangeset
for help on using the changeset viewer.