Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 14, 2009, 6:01:05 PM (16 years ago)
Author:
scheusso
Message:

fixed a problem with gamestate caching and diffing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation/src/network/GamestateClient.cc

    r2655 r2660  
    7575    if(tempGamestate_==NULL)
    7676      return false;
     77    bool isDiffed = tempGamestate_->isDiffed();
    7778    int id = GAMESTATEID_INITIAL;
    7879    packet::Gamestate *processed = processGamestate(tempGamestate_);
     
    8384   
    8485    if (!processed){
    85 //      sendAck(0);
     86      sendAck(0);
    8687      return false;
    8788    }
     
    8990    tempGamestate_=NULL;
    9091    gamestateMap_[processed->getID()]=processed;
    91     last_diff_ = processed->getID();
     92    if(isDiffed)
     93      last_diff_ = processed->getBaseID();
    9294    id = processed->getID();
    93 //     sendAck(id);
     95    sendAck(id);
    9496    return true;
    9597  }
     
    160162      packet::Gamestate *base = gamestateMap_[gs->getBaseID()];
    161163      if(!base){
    162 COUT(0) << "could not find base gamestate id: " << gs->getBaseID() << endl;
     164        COUT(3) << "could not find base gamestate id: " << gs->getBaseID() << endl;
    163165        delete gs;
    164166        return 0;
     
    173175      return gs;
    174176    else
    175 COUT(0) << "could not spread gamestate" << endl;
     177    {
     178      COUT(3) << "could not spread gamestate" << endl;
    176179      return NULL;
     180    }
    177181  }
    178182
Note: See TracChangeset for help on using the changeset viewer.