Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 14, 2011, 9:00:48 AM (13 years ago)
Author:
scheusso
Message:

improving gamestate processing and generation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network6/src/libraries/network/GamestateManager.cc

    r7878 r7882  
    5757
    5858namespace orxonox
    59 {
     59{ 
    6060  GamestateManager::GamestateManager() :
    6161  currentGamestate_(0), id_(0)
     
    110110      bool b = processGamestate(it->second);
    111111      assert(b);
    112 //       sendAck( it->second->getID(), it->second->getPeerID() );
     112      sendAck( it->second->getID(), it->second->getPeerID() );
    113113      delete it->second;
    114114    }
     
    140140    if ( currentGamestate_ != 0 )
    141141      delete currentGamestate_;
    142     currentGamestate_ = new packet::Gamestate();
    143142    uint8_t gsMode;
    144143    if( GameMode::isMaster() )
     
    153152      assert(peerMap_.size()!=0);
    154153      newID = peerMap_[NETWORK_PEER_ID_SERVER].lastReceivedGamestateID;
     154      if( newID == GAMESTATEID_INITIAL )
     155      {
     156        return false;
     157      }
    155158    }
    156159   
    157     if(!currentGamestate_->collectData(newID, gsMode)){ //we have no data to send
     160    currentGamestate_ = new packet::Gamestate();
     161   
     162    if(!currentGamestate_->collectData(newID, gsMode))
     163    { //we have no data to send
    158164      delete currentGamestate_;
    159165      currentGamestate_=0;
     166      return false;
    160167    }
    161168    return true;
Note: See TracChangeset for help on using the changeset viewer.