Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

gamestate changes

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.