Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 22, 2008, 2:02:06 PM (16 years ago)
Author:
rgrieder
Message:

merged merge branch back to trunk

File:
1 edited

Legend:

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

    r1293 r1360  
    4747    COUT(5) << "this: " << this << std::endl;
    4848    last_diff_=0;
     49    last_gamestate_=GAMESTATEID_INITIAL-1;
    4950  }
    5051
     
    5657    printGameStateMap();
    5758    GameState *gs, *reference;
     59    /*if(compstate->id<last_gamestate_){
     60      // network packets got messed up
     61      COUT(3) << "received an obsolete gamestate" << std::endl;
     62      return false;
     63    }*/
    5864    if(compstate->diffed && compstate->base_id!=GAMESTATEID_INITIAL){
    5965      std::map<int, GameState*>::iterator it = gameStateMap.find(compstate->base_id);
     
    7783        COUT(4) << "adding decoded gs with id: " << gs->id << " diffed from: " << gs->base_id << std::endl;
    7884        last_diff_=gs->base_id;
     85        //last_gamestate_=gs->id;
    7986        return true;
    8087      }else{
     
    145152          if(!id){
    146153            COUT(4) << "We could not identify a new object; classid: " << sync.classID << std::endl;
    147             continue;
     154            return false;
    148155          }
    149156          Synchronisable *no = dynamic_cast<Synchronisable *>(id->fabricate());
    150157          COUT(4) << "loadsnapshot: classid: " << sync.classID << " objectID: " << sync.objectID << " length: " << sync.length << std::endl;
     158          if(!no){
     159            COUT(2) << "coudl not frabricate classid: " << sync.classID << " objectID: " << sync.objectID << " identifier: " << id << std::endl;
     160            break;
     161          }
    151162          no->objectID=sync.objectID;
    152163          no->classID=sync.classID;
    153164          // update data and create object/entity...
    154           if( !no->updateData(sync) )
     165          if( !no->updateData(sync) ){
    155166            COUT(1) << "We couldn't update the object: " << sync.objectID << std::endl;
     167            return false;
     168          }
    156169          if( !no->create() )
    157170            COUT(1) << "We couldn't manifest (create() ) the object: " << sync.objectID << std::endl;
     
    349362    COUT(4) << "using diffed gamestate" << std::endl;
    350363    GameState *t = decode(diff);
     364    if(!t)
     365      return NULL;
    351366    GameState *r = undiff(old, t);
    352367    delete[] t->data;
Note: See TracChangeset for help on using the changeset viewer.