Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 12, 2008, 12:15:30 PM (16 years ago)
Author:
scheusso
Message:

Lots of changes:
Some fixes/hacks in objects
Changes in Gamestates and bugfixes
Removed some asserts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/network/packet/DeleteObjects.cc

    r1890 r1901  
    3737namespace packet {
    3838
    39 #define PACKET_FLAGS_DELETE    ENET_PACKET_FLAG_RELIABLE
     39#define PACKET_FLAG_DELETE  ENET_PACKET_FLAG_RELIABLE
    4040#define _PACKETID           0
    4141#define _QUANTITY           _PACKETID + sizeof(ENUM::Type)
     
    4545 : Packet()
    4646{
    47   flags_ = flags_ | PACKET_FLAGS_DELETE;
     47  flags_ = flags_ | PACKET_FLAG_DELETE;
    4848}
    4949
     
    6161  if(number==0)
    6262    return false;
     63  COUT(3) << "sending DeleteObjects: ";
    6364  unsigned int size = sizeof(ENUM::Type) + sizeof(uint32_t)*(number+1);
    6465  data_ = new uint8_t[size];
    65   *(ENUM::Type *)(data_ + _PACKETID ) = ENUM::DeleteObjects;
    66   *(uint32_t *)(data_ + _QUANTITY) = number;
     66  uint8_t *tdata = data_;
     67  *(ENUM::Type *)(tdata) = ENUM::DeleteObjects;
     68  tdata += sizeof(ENUM::Type);
     69  *(uint32_t *)tdata = number;
     70  tdata += sizeof(uint32_t);
    6771  for(unsigned int i=0; i<number; i++){
    68     *(uint32_t *)(data_ + sizeof(ENUM::Type) + (i+1)*sizeof(uint32_t)) = Synchronisable::popDeletedObject();
     72    unsigned int temp = Synchronisable::popDeletedObject();
     73//     assert(temp<10000); //ugly hack
     74    *(uint32_t *)(tdata) = temp;
     75    COUT(3) << temp << " ";
     76    tdata += sizeof(uint32_t);
    6977  }
     78  COUT(3) << std::endl;
    7079  return true;
    7180}
Note: See TracChangeset for help on using the changeset viewer.