Changeset 2062 for code/branches/objecthierarchy/src/network
- Timestamp:
- Oct 29, 2008, 5:19:02 PM (16 years ago)
- Location:
- code/branches/objecthierarchy/src/network
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/network/Synchronisable.cc
r2041 r2062 147 147 synchronisableHeader *header = (synchronisableHeader *)mem; 148 148 149 if(!header->dataAvailable) 150 { 151 mem += header->size; 152 return 0; 153 } 154 149 155 COUT(4) << "fabricating object with id: " << header->objectID << std::endl; 150 156 … … 314 320 } 315 321 // if the variable gets synchronised bidirectional, then add the reference to the bytestream 316 if( ( (*i)->mode & direction::bidirectional ) )322 if( ( (*i)->mode & direction::bidirectional ) == direction::bidirectional ) 317 323 { 318 324 *(uint8_t*)mem = (*i)->varReference; 319 325 mem += sizeof( (*i)->varReference ); 326 tempsize += sizeof( (*i)->varReference ); 320 327 } 321 328 switch((*i)->type){ … … 323 330 memcpy( (void *)(mem), (void*)((*i)->var), (*i)->size); 324 331 mem+=(*i)->size; 325 tempsize+=(*i)->size + sizeof( (*i)->varReference );332 tempsize+=(*i)->size; 326 333 break; 327 334 case STRING: … … 332 339 COUT(5) << "synchronisable: char: " << (const char *)(mem) << " data: " << data << " string: " << *(std::string *)((*i)->var) << std::endl; 333 340 mem+=(*i)->size; 334 tempsize+=(*i)->size + sizeof( (*i)->varReference ) + sizeof(size_t);341 tempsize+=(*i)->size + sizeof(size_t); 335 342 break; 336 343 } … … 381 388 switch((*i)->type){ 382 389 case DATA: 383 if( ( (*i)->mode & direction::bidirectional ) )390 if( ( (*i)->mode & direction::bidirectional ) == direction::bidirectional ) 384 391 { 385 392 if( ( mode == 0x1 && (*i)->mode == direction::serverMaster ) || \ … … 406 413 break; 407 414 case STRING: 408 if( ( (*i)->mode & direction::bidirectional ) )415 if( ( (*i)->mode & direction::bidirectional ) == direction::bidirectional ) 409 416 { 410 417 if( ( mode == 0x1 && (*i)->mode == direction::serverMaster ) || \ … … 469 476 break; 470 477 } 471 if( ( (*i)->mode & direction::bidirectional ) != 0)478 if( ( (*i)->mode & direction::bidirectional ) == direction::bidirectional ) 472 479 { 473 480 tsize+=sizeof( (*i)->varReference ); -
code/branches/objecthierarchy/src/network/packet/Gamestate.cc
r2041 r2062 357 357 assert(it->second->objectID==oldobjectheader->objectID); 358 358 *newobjectheader = *oldobjectheader; 359 objectOffset=sizeof(uint8_t)+sizeof(bool); //skip the size and the availableDat evariables in the objectheader359 objectOffset=sizeof(uint8_t)+sizeof(bool); //skip the size and the availableData variables in the objectheader 360 360 if(it->second->doSelection(HEADER->id)){ 361 361 newobjectheader->dataAvailable=true; //TODO: probably not neccessary
Note: See TracChangeset
for help on using the changeset viewer.