Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2669 for code/trunk


Ignore:
Timestamp:
Feb 15, 2009, 5:38:12 PM (16 years ago)
Author:
scheusso
Message:

minor change in classID

Location:
code/trunk/src/network/packet
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/network/packet/ClassID.cc

    r2171 r2669  
    3737namespace packet {
    3838
    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
    4440
    4541  ClassID::ClassID( unsigned int classID, std::string className )
     
    7268
    7369bool ClassID::process(){
    74   COUT(3) << "processing classid: " << getClassID() << " name: " << (const char*)(data_+_CLASSNAME) << std::endl;
    75   Identifier *id=ClassByID( std::string((const char*)(data_+_CLASSNAME) ));
     70  COUT(3) << "processing classid: " << getClassID() << " name: " << getClassName() << std::endl;
     71  Identifier *id=ClassByString( std::string(getClassName()) );
    7672  if(id==NULL)
    7773    return false;
     
    8177}
    8278
     79
    8380unsigned int ClassID::getClassID(){
    8481  return *(uint32_t *)(data_ + _CLASSID);
  • code/trunk/src/network/packet/ClassID.h

    r2171 r2669  
    3838namespace packet {
    3939
     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 
    4046/**
    4147        @author
     
    5359  unsigned int getClassID();
    5460  unsigned int getClassNameLength(){ return classNameLength_; }
    55   unsigned char *getClassName();
     61  const char *getClassName(){ return (const char*)(data_+_CLASSNAME); }
    5662private:
    5763  uint32_t classNameLength_;
Note: See TracChangeset for help on using the changeset viewer.