Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 28, 2007, 4:07:13 PM (17 years ago)
Author:
scheusso
Message:

gamestate changes

Location:
code/branches/network/src/network
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/network/GameStateManager.cc

    r314 r324  
    9090    if(it->objectID!=sync.objectID){
    9191      // bad luck ;)
     92      // delete the synchronisable (obviously seems to be deleted on the server)
     93      while(it=!0 && it->objectID!=sync.objectID){
     94        it=removeObject(it);
     95      }
     96      if(it==0){  // add the new object
     97       
     98      }
    9299    } else {
    93100      // we have our object
    94101      if(! it->updateData(sync))
    95         std::cout << "We couldn't update objectID: " << sync.objectID << "; classID: " << sync.classID << std::endl;
     102        std::cout << "We couldn't update objectID: " \
     103          << sync.objectID << "; classID: " << sync.classID << std::endl;
    96104    }
     105   
    97106  }
     107 
    98108 
    99109}
    100110
    101 
     111/**
     112 * This function removes a Synchronisable out of the universe
     113 * @param it iterator of the list pointing to the object
     114 * @return iterator pointing to the next object in the list
     115 */
     116Iterator<Synchronisable> removeObject(Iterator<Synchronisable> it){
     117  Iterator<Synchronisable> temp=it;
     118  it++;
     119  delete  temp;
     120  return it;
     121}
    102122
    103123
  • code/branches/network/src/network/Synchronisable.h

    r314 r324  
    4343  Synchronisable();
    4444
    45   ~Synchronisable();
     45  virtual ~Synchronisable();
    4646  int objectID;
    4747  int classID;
     
    5555
    5656private:
     57  bool removeObject(Iterator<Synchronisable> it);
     58 
    5759  std::list<SYNCVAR> syncList;
    5860  int datasize;
Note: See TracChangeset for help on using the changeset viewer.