Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1767 for code/trunk/src


Ignore:
Timestamp:
Sep 11, 2008, 2:31:14 PM (16 years ago)
Author:
scheusso
Message:

problems of the merge should be solved now (hopefully)

Location:
code/trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/network/Client.cc

    r1752 r1767  
    100100    Synchronisable::setClient(true);
    101101    isConnected=client_connection.createConnection();
    102     if(isConnected){
    103 //       COUT(3) << "sending connectrequest" << std::endl;
    104 //       if(!client_connection.addPacket(pck_gen.generateConnectRequest()) || !client_connection.sendPackets())
    105 //         COUT(1) << "could not send connection request !!!!!!!!!" << std::endl;
    106     }else
     102    if(!isConnected)
    107103      COUT(1) << "could not create connection laber" << std::endl;
    108104    return isConnected;
  • code/trunk/src/network/GamestateClient.cc

    r1763 r1767  
    7676    bool b = saveShipCache();
    7777    packet::Gamestate *processed = processGamestate(tempGamestate_);
    78     assert(processed);
     78    if(!processed)
     79      return GAMESTATEID_INITIAL;
     80//    assert(processed);
    7981    //successfully loaded data from gamestate. now save gamestate for diff and delete the old gs
    8082    tempGamestate_=0;
    8183    gamestateMap_[processed->getID()]=processed;
    82     last_diff_ = processed->getBaseID();
    83     last_gamestate_ = processed->getID();
     84    last_diff_ = processed->getID();
    8485    if(b)
    8586      loadShipCache();
     
    103104  packet::Gamestate *GamestateClient::getGamestate(){
    104105    packet::Gamestate *gs = new packet::Gamestate();
    105     gs->collectData(GAMESTATEID_INITIAL);
     106    gs->collectData(0);
    106107    return gs;
    107108  }
     
    133134    if(myShip_==NULL){
    134135      myShip_ = orxonox::SpaceShip::getLocalShip();
     136//      COUT(2) << "myShip_: " << myShip_ << " getLocalShip(): " << orxonox::SpaceShip::getLocalShip() << std::endl;
    135137      if(!myShip_)
    136138        return false;
     
    151153
    152154  bool GamestateClient::loadShipCache(){
     155    myShip_=orxonox::SpaceShip::getLocalShip(); //TODO: remove this (only a hack)
    153156    if(myShip_ && shipCache_){
     157      assert(myShip_->getIdentifier());
    154158      unsigned char *temp = shipCache_;
    155159      myShip_->updateData(temp, 0x2);
     
    165169    if(gs->isDiffed()){
    166170      packet::Gamestate *base = gamestateMap_[gs->getBaseID()];
    167       assert(base);
     171      if(!base)
     172        return 0;
     173//      assert(base); //TODO: fix this
    168174      packet::Gamestate *undiffed = gs->undiff(base);
    169175      delete gs;
  • code/trunk/src/network/packet/Gamestate.cc

    r1763 r1767  
    144144          return false;
    145145        it=orxonox::ObjectList<Synchronisable>::end();
     146      }else{
     147        if(! it->updateData(mem, mode))
     148        {
     149          COUT(1) << "We couldn't update objectID: " \
     150            << objectID << "; classID: " << classID << std::endl;
     151        }
    146152      }
    147153    } else
  • code/trunk/src/orxonox/objects/SpaceShip.cc

    r1758 r1767  
    7777      for(it = ObjectList<SpaceShip>::begin(); it; ++it){
    7878        assert(it->isA(Class(SpaceShip)));
    79         if( (it)->myShip_ || (network::Host::running() && network::Host::getShipID()==(it)->objectID) )
     79        if( (it)->myShip_ || (network::Host::running() && network::Host::getShipID()==(it)->objectID) ){
     80//        COUT(1) << "^^^^^^^^^^ myShip_:" << *it << " classname: " << (*it)->getIdentifier()->getName() << " objectid: " << (*it)->objectID << std::endl;
    8081          return *it;
     82        }
    8183      }
    82       return 0;
    8384      return 0;
    8485    }
     
    167168      if(!myShip_){
    168169        if(network::Host::running())
    169           COUT(3) << "this id: " << this->objectID << " myShipID: " << network::Host::getShipID() << std::endl;
     170//          COUT(3) << "this id: " << this->objectID << " myShipID: " << network::Host::getShipID() << std::endl;
    170171        if(network::Host::running() && objectID == network::Host::getShipID()){
    171172          if(!network::Host::isServer())
Note: See TracChangeset for help on using the changeset viewer.