Changeset 7755 for code/branches/network4
- Timestamp:
- Dec 11, 2010, 4:12:21 PM (14 years ago)
- Location:
- code/branches/network4/src/libraries/network
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network4/src/libraries/network/GamestateManager.cc
r7284 r7755 219 219 assert(b); 220 220 clock.capture(); 221 COUT( 0) << "difftime: " << clock.getDeltaTime() << endl;221 COUT(4) << "diff and compress time: " << clock.getDeltaTime() << endl; 222 222 // COUT(5) << "sending gamestate with id " << gs->getID(); 223 223 // if(gamestate->isDiffed()) -
code/branches/network4/src/libraries/network/packet/Gamestate.cc
r7754 r7755 65 65 66 66 Gamestate::Gamestate(): 67 header_( 0)67 header_() 68 68 { 69 69 flags_ = flags_ | PACKET_FLAG_GAMESTATE; … … 176 176 uint8_t *mem=data_+GamestateHeader::getSize(); 177 177 Synchronisable *s; 178 178 179 179 // update the data of the objects we received 180 180 while(mem < data_+GamestateHeader::getSize()+header_.getDataSize()) … … 191 191 else 192 192 { 193 // COUT(4) << "not creating object of classid " << objectheader.getClassID() << endl; 193 194 mem += objectheader.getDataSize() + ( objectheader.isDiffed() ? SynchronisableHeaderLight::getSize() : SynchronisableHeader::getSize() ); 194 195 } … … 196 197 else 197 198 { 199 // COUT(4) << "updating object of classid " << objectheader.getClassID() << endl; 198 200 bool b = s->updateData(mem, mode); 199 201 assert(b); … … 303 305 header_.setCompSize( buffer ); 304 306 header_.setCompressed( true ); 305 COUT( 0) << "gamestate compress datasize: " << header_.getDataSize() << " compsize: " << header_.getCompSize() << std::endl;307 COUT(4) << "gamestate compress datasize: " << header_.getDataSize() << " compsize: " << header_.getCompSize() << std::endl; 306 308 return true; 307 309 } -
code/branches/network4/src/libraries/network/packet/Gamestate.h
r7754 r7755 48 48 class _NetworkExport GamestateHeader{ 49 49 public: 50 GamestateHeader() ;50 GamestateHeader(){ data_=0; } 51 51 GamestateHeader(uint8_t* data) 52 52 { assert(data); data_ = data; *(uint32_t*)data_ = Type::Gamestate; } -
code/branches/network4/src/libraries/network/synchronisable/Synchronisable.cc
r7754 r7755 222 222 * length of varx: size saved int syncvarlist 223 223 * @param mem pointer to allocated memory with enough size 224 * @param sizes FIXME - add doc!224 * @param sizes vector containing sizes of all objects in gamestate (to be appended) 225 225 * @param id gamestateid of the gamestate to be saved (important for priorities) 226 226 * @param mode defines the direction in which the data will be send/received 227 227 * 0x1: server->client 228 * 0x2: client->server (not recommended)228 * 0x2: client->server 229 229 * 0x3: bidirectional 230 230 * @return true: if !doSync or if everything was successfully saved … … 270 270 //tempsize += (*i)->getSize( mode ); 271 271 } 272 assert(tempsize!=0); // if this happens an empty object (with no variables) would be transmitted 272 273 // COUT(4) << endl; 273 274
Note: See TracChangeset
for help on using the changeset viewer.