Changeset 2669 for code/trunk/src
- Timestamp:
- Feb 15, 2009, 5:38:12 PM (16 years ago)
- Location:
- code/trunk/src/network/packet
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/network/packet/ClassID.cc
r2171 r2669 37 37 namespace packet { 38 38 39 #define PACKET_FLAGS_CLASSID ENET_PACKET_FLAG_RELIABLE 40 #define _PACKETID 0 41 #define _CLASSID _PACKETID + sizeof(ENUM::Type) 42 #define _CLASSNAMELENGTH _CLASSID + sizeof(uint32_t) 43 #define _CLASSNAME _CLASSNAMELENGTH + sizeof(classNameLength_) 39 44 40 45 41 ClassID::ClassID( unsigned int classID, std::string className ) … … 72 68 73 69 bool ClassID::process(){ 74 COUT(3) << "processing classid: " << getClassID() << " name: " << (const char*)(data_+_CLASSNAME) << std::endl;75 Identifier *id=ClassBy ID( std::string((const char*)(data_+_CLASSNAME) ));70 COUT(3) << "processing classid: " << getClassID() << " name: " << getClassName() << std::endl; 71 Identifier *id=ClassByString( std::string(getClassName()) ); 76 72 if(id==NULL) 77 73 return false; … … 81 77 } 82 78 79 83 80 unsigned int ClassID::getClassID(){ 84 81 return *(uint32_t *)(data_ + _CLASSID); -
code/trunk/src/network/packet/ClassID.h
r2171 r2669 38 38 namespace packet { 39 39 40 #define PACKET_FLAGS_CLASSID ENET_PACKET_FLAG_RELIABLE 41 #define _PACKETID 0 42 #define _CLASSID _PACKETID + sizeof(ENUM::Type) 43 #define _CLASSNAMELENGTH _CLASSID + sizeof(uint32_t) 44 #define _CLASSNAME _CLASSNAMELENGTH + sizeof(classNameLength_) 45 40 46 /** 41 47 @author … … 53 59 unsigned int getClassID(); 54 60 unsigned int getClassNameLength(){ return classNameLength_; } 55 unsigned char *getClassName();61 const char *getClassName(){ return (const char*)(data_+_CLASSNAME); } 56 62 private: 57 63 uint32_t classNameLength_;
Note: See TracChangeset
for help on using the changeset viewer.