Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7011 for code/branches


Ignore:
Timestamp:
May 30, 2010, 12:26:27 PM (14 years ago)
Author:
scheusso
Message:

merged a fix from presentation3 in order to be able to test with network

Location:
code/branches/rocket2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/rocket2

  • code/branches/rocket2/src/libraries/network/packet/ClassID.cc

    r6417 r7011  
    6565    tempQueue.push( std::pair<unsigned int, std::string>(network_id, classname) );
    6666    ++nrOfClasses;
    67     packetSize += (classname.size()+1)+sizeof(uint32_t)+sizeof(uint32_t);
     67    packetSize += (classname.size()+1)+sizeof(network_id)+sizeof(uint32_t);
    6868  }
    6969
     
    8080  // now save all classids and classnames
    8181  std::pair<uint32_t, std::string> tempPair;
     82  uint32_t tempsize = 2*sizeof(uint32_t); // packetid and nrOfClasses
    8283  while( !tempQueue.empty() ){
    8384    tempPair = tempQueue.front();
     
    8788    memcpy(temp+2*sizeof(uint32_t), tempPair.second.c_str(), tempPair.second.size()+1);
    8889    temp+=2*sizeof(uint32_t)+tempPair.second.size()+1;
     90    tempsize+=2*sizeof(uint32_t)+tempPair.second.size()+1;
    8991  }
     92  assert(tempsize=packetSize);
    9093
    9194  COUT(5) << "classid packetSize is " << packetSize << endl;
     
    111114  for(unsigned int i=0; i<nrOfClasses; i++){
    112115    totalsize += 2*sizeof(uint32_t) + *(uint32_t*)(temp + sizeof(uint32_t));
     116    temp += 2*sizeof(uint32_t) + *(uint32_t*)(temp + sizeof(uint32_t));
    113117  }
    114118  return totalsize;
Note: See TracChangeset for help on using the changeset viewer.