Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 18, 2007, 5:51:47 PM (16 years ago)
Author:
scheusso
Message:

gamestatehandling, error correction

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/network/GameStateClient.cc

    r567 r620  
    3939}
    4040
    41 bool GameStateClient::pushGameState(GameStateCompressed compstate){
    42   if(compstate.diffed)
    43     return loadSnapshot(decode(reference, compstate));
     41bool GameStateClient::pushGameState(GameStateCompressed *compstate){
     42  if(compstate->diffed)
     43    return loadSnapshot(decode(reference, *compstate));
    4444  else
    45     return loadSnapshot(decode(compstate));
     45    return loadSnapshot(decode(*compstate));
    4646}
    4747
     
    6565{
    6666  unsigned char *data=state.data;
     67  std::cout << "loadSnapshot: loading gs: " << state.id << std::endl;
    6768  // get the start of the Synchronisable list
    6869  orxonox::Iterator<Synchronisable> it=orxonox::ObjectList<Synchronisable>::start();
     
    7172  while(data < state.data+state.size){
    7273    // prepare the syncData struct
    73     sync.length = *(int *)data;
     74    sync.length = (int)*data;
    7475    data+=sizeof(int);
    75     sync.objectID = *(int *)data;
     76    sync.objectID = (int)*data;
    7677    data+=sizeof(int);
    77     sync.classID = *(int *)data;
     78    sync.classID = (int)*data;
    7879    data+=sizeof(int);
    7980    sync.data = data;
     
    150151
    151152  switch ( retval ) {
    152     case Z_OK: std::cout << "successfully compressed" << std::endl; break;
     153    case Z_OK: std::cout << "successfully decompressed" << std::endl; break;
    153154    case Z_MEM_ERROR: std::cout << "not enough memory available" << std::endl; break;
    154155    case Z_BUF_ERROR: std::cout << "not enough memory available in the buffer" << std::endl; break;
Note: See TracChangeset for help on using the changeset viewer.