Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 19, 2010, 2:27:06 PM (13 years ago)
Author:
scheusso
Message:

some () structural changes
some functional changes (GamestateClient replaced through GamestateManager on client)
reliable packets get buffered until a recent gamestate arrived and got processed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network5/src/libraries/network/packet/FunctionCalls.cc

    r7759 r7777  
    5858
    5959
    60 bool FunctionCalls::process(){
     60bool FunctionCalls::process(orxonox::Host* host)
     61{
    6162  assert(isDataENetAllocated());
    6263 
     
    7071    FunctionCall fctCall;
    7172    fctCall.loadData(temp);
    72     if( this->minGamestateID_ > GamestateHandler::getInstance()->getLastProcessedGamestateID(this->getClientID()) || !fctCall.execute() )
     73    if( this->minGamestateID_ > host->getLastProcessedGamestateID(this->getPeerID()) || !fctCall.execute() )
    7374    {
    74       FunctionCallManager::bufferIncomingFunctionCall( fctCall, minGamestateID_, this->getClientID() );
     75      FunctionCallManager::bufferIncomingFunctionCall( fctCall, minGamestateID_, this->getPeerID() );
    7576    }
    7677  }
     
    8081}
    8182
    82 void FunctionCalls::addCallStatic( uint32_t networkID, const MultiType* mt1, const MultiType* mt2, const MultiType* mt3, const MultiType* mt4, const MultiType* mt5){
     83void FunctionCalls::addCallStatic( uint32_t networkID, const MultiType* mt1, const MultiType* mt2, const MultiType* mt3, const MultiType* mt4, const MultiType* mt5)
     84{
    8385  assert(!isDataENetAllocated());
    8486 
     
    8890}
    8991
    90 void FunctionCalls::addCallMember( uint32_t networkID, uint32_t objectID, const MultiType* mt1, const MultiType* mt2, const MultiType* mt3, const MultiType* mt4, const MultiType* mt5){
     92void FunctionCalls::addCallMember( uint32_t networkID, uint32_t objectID, const MultiType* mt1, const MultiType* mt2, const MultiType* mt3, const MultiType* mt4, const MultiType* mt5)
     93{
    9194  assert(!isDataENetAllocated());
    9295 
     
    9699}
    97100
    98 bool FunctionCalls::send()
     101bool FunctionCalls::send(orxonox::Host* host)
    99102{
    100   this->minGamestateID_ = GamestateHandler::getInstance()->getCurrentGamestateID();
     103  this->minGamestateID_ = host->getCurrentGamestateID();
    101104  assert(this->functionCalls_.size());
    102105  data_=new uint8_t[ currentSize_ ];
     
    114117  assert( temp==data_+currentSize_ );
    115118 
    116   Packet::send();
     119  Packet::send(host);
    117120  return true;
    118121}
Note: See TracChangeset for help on using the changeset viewer.