Changeset 1708
- Timestamp:
- Sep 4, 2008, 10:07:14 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/network/packet/ClassID.cc
r1705 r1708 21 21 assert(getSize()); 22 22 data_=new unsigned char[ getSize() ]; 23 if(!data_) 24 return; 23 assert(data_); 25 24 *(packet::ENUM::Type *)&data_[ _PACKETID ] = packet::ENUM::ClassID; 26 25 *(unsigned int *)&data_[ _CLASSID ] = classID; … … 32 31 : PacketContent(data, clientID) 33 32 { 34 memcpy( (void *)&classNameLength_, &data[ sizeof(ENUM::Type) + sizeof(int)], sizeof(classNameLength_) );33 memcpy( (void *)&classNameLength_, &data[ _CLASSNAMELENGTH ], sizeof(classNameLength_) ); 35 34 } 36 35 … … 44 43 45 44 unsigned int ClassID::getSize() const{ 46 return sizeof(network::packet::ENUM::Type) + sizeof(int) + classNameLength_;45 return sizeof(network::packet::ENUM::Type) + 2*sizeof(unsigned int) + classNameLength_; 47 46 } 48 47
Note: See TracChangeset
for help on using the changeset viewer.