Changeset 620 for code/branches/FICN/src/network/GameStateClient.cc
- Timestamp:
- Dec 18, 2007, 5:51:47 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/network/GameStateClient.cc
r567 r620 39 39 } 40 40 41 bool GameStateClient::pushGameState(GameStateCompressed compstate){42 if(compstate .diffed)43 return loadSnapshot(decode(reference, compstate));41 bool GameStateClient::pushGameState(GameStateCompressed *compstate){ 42 if(compstate->diffed) 43 return loadSnapshot(decode(reference, *compstate)); 44 44 else 45 return loadSnapshot(decode( compstate));45 return loadSnapshot(decode(*compstate)); 46 46 } 47 47 … … 65 65 { 66 66 unsigned char *data=state.data; 67 std::cout << "loadSnapshot: loading gs: " << state.id << std::endl; 67 68 // get the start of the Synchronisable list 68 69 orxonox::Iterator<Synchronisable> it=orxonox::ObjectList<Synchronisable>::start(); … … 71 72 while(data < state.data+state.size){ 72 73 // prepare the syncData struct 73 sync.length = *(int *)data;74 sync.length = (int)*data; 74 75 data+=sizeof(int); 75 sync.objectID = *(int *)data;76 sync.objectID = (int)*data; 76 77 data+=sizeof(int); 77 sync.classID = *(int *)data;78 sync.classID = (int)*data; 78 79 data+=sizeof(int); 79 80 sync.data = data; … … 150 151 151 152 switch ( retval ) { 152 case Z_OK: std::cout << "successfully compressed" << std::endl; break;153 case Z_OK: std::cout << "successfully decompressed" << std::endl; break; 153 154 case Z_MEM_ERROR: std::cout << "not enough memory available" << std::endl; break; 154 155 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.