Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 21, 2009, 1:18:36 PM (15 years ago)
Author:
rgrieder
Message:

Found some non empty new lines.

Location:
code/branches/presentation2/src/libraries/network/packet
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/libraries/network/packet/Acknowledgement.cc

    r5781 r6387  
    3838#define _PACKETID           0
    3939#define _ACKID              _PACKETID + sizeof(packet::Type::Value)
    40  
     40
    4141Acknowledgement::Acknowledgement( unsigned int id, unsigned int clientID )
    4242 : Packet()
  • code/branches/presentation2/src/libraries/network/packet/Chat.cc

    r5781 r6387  
    3535namespace orxonox {
    3636namespace packet {
    37  
     37
    3838#define   PACKET_FLAGS_CHAT PacketFlag::Reliable
    3939#define   _PACKETID         0
  • code/branches/presentation2/src/libraries/network/packet/ClassID.h

    r6073 r6387  
    3636namespace packet {
    3737
    38  
     38
    3939/**
    4040    @author
  • code/branches/presentation2/src/libraries/network/packet/DeleteObjects.cc

    r6192 r6387  
    4141#define _QUANTITY           _PACKETID + sizeof(Type::Value)
    4242#define _OBJECTIDS          _QUANTITY + sizeof(uint32_t)
    43  
     43
    4444DeleteObjects::DeleteObjects()
    4545 : Packet()
  • code/branches/presentation2/src/libraries/network/packet/FunctionCalls.cc

    r5781 r6387  
    3636namespace orxonox {
    3737namespace packet {
    38  
     38
    3939#define   PACKET_FLAGS_FUNCTIONCALLS PacketFlag::Reliable
    4040#define   _PACKETID         0
    4141const unsigned int FUNCTIONCALLS_MEM_ALLOCATION = 1000;
    42    
     42
    4343FunctionCalls::FunctionCalls()
    4444 : Packet()
     
    171171void FunctionCalls::addCallStatic( uint32_t networkID, const MultiType* mt1, const MultiType* mt2, const MultiType* mt3, const MultiType* mt4, const MultiType* mt5){
    172172  assert(!isDataENetAllocated());
    173  
     173
    174174  // first determine the size that has to be reserved for this call
    175175  uint32_t callsize = 2*sizeof(uint32_t)+sizeof(uint8_t); //size for network-function-id and nrOfArguments and for bool isStatic
     
    200200    }
    201201  }
    202  
     202
    203203  // now allocated mem if neccessary
    204204  if( currentSize_ + callsize > currentMemBlocks_*FUNCTIONCALLS_MEM_ALLOCATION )
     
    210210    data_ = temp;
    211211  }
    212  
     212
    213213  // now serialise the mt values and copy the function id and isStatic
    214214  uint8_t* temp = data_+currentSize_;
     
    240240  //currentSize_ += callsize;
    241241  currentSize_ = temp-data_;
    242  
     242
    243243}
    244244
    245245void FunctionCalls::addCallMember( uint32_t networkID, uint32_t objectID, const MultiType* mt1, const MultiType* mt2, const MultiType* mt3, const MultiType* mt4, const MultiType* mt5){
    246246  assert(!isDataENetAllocated());
    247  
     247
    248248  // first determine the size that has to be reserved for this call
    249249  uint32_t callsize = 3*sizeof(uint32_t)+sizeof(uint8_t); //size for network-function-id and nrOfArguments and the objectID
     
    274274    }
    275275  }
    276  
     276
    277277  // now allocated mem if neccessary
    278278  if( currentSize_ + callsize > currentMemBlocks_*FUNCTIONCALLS_MEM_ALLOCATION )
     
    284284    data_ = temp;
    285285  }
    286  
     286
    287287  // now serialise the mt values and copy the function id
    288288  uint8_t* temp = data_+currentSize_;
     
    314314  }
    315315  currentSize_ += callsize;
    316  
     316
    317317}
    318318
  • code/branches/presentation2/src/libraries/network/packet/FunctionIDs.cc

    r5781 r6387  
    5353  flags_ = flags_ | PACKET_FLAGS_FUNCTIONIDS;
    5454  std::queue<std::pair<uint32_t, std::string> > tempQueue;
    55  
     55
    5656  //calculate total needed size (for all strings and integers)
    5757  ObjectList<NetworkFunctionBase>::iterator it;
     
    6464    packetSize += (functionname.size()+1)+sizeof(uint32_t)+sizeof(uint32_t); // reserver size for the functionname string, the functionname length and the networkID
    6565  }
    66  
     66
    6767  this->data_=new uint8_t[ packetSize ];
    6868  //set the appropriate packet id
    6969  assert(this->data_);
    7070  *(Type::Value *)(this->data_ + _PACKETID ) = Type::FunctionIDs;
    71  
     71
    7272  uint8_t *temp=data_+sizeof(uint32_t);
    7373  // save the number of all classes
    7474  *(uint32_t*)temp = nrOfFunctions;
    7575  temp += sizeof(uint32_t);
    76  
     76
    7777  // now save all classids and classnames
    7878  std::pair<uint32_t, std::string> tempPair;
     
    8585    temp+=2*sizeof(uint32_t)+tempPair.second.size()+1;
    8686  }
    87  
     87
    8888  COUT(5) << "FunctionIDs packetSize is " << packetSize << endl;
    89  
     89
    9090}
    9191
     
    106106  temp += sizeof(uint32_t);
    107107  totalsize += sizeof(uint32_t); // storage size for nr of all classes
    108  
     108
    109109  for(unsigned int i=0; i<nrOfFunctions; i++){
    110110    totalsize += 2*sizeof(uint32_t) + *(uint32_t*)(temp + sizeof(uint32_t)); // for each network function add size for id, sizeof(string) and length of string itself to totalsize
     
    121121  uint32_t stringsize;
    122122  unsigned char *functionname;
    123  
     123
    124124  COUT(4) << "=== processing functionids: " << endl;
    125125  std::pair<uint32_t, std::string> tempPair;
     
    127127  nrOfFunctions = *(uint32_t*)temp;
    128128  temp += sizeof(uint32_t);
    129  
     129
    130130  for( int i=0; i<nrOfFunctions; i++){
    131131    networkID = *(uint32_t*)temp;
  • code/branches/presentation2/src/libraries/network/packet/FunctionIDs.h

    r6073 r6387  
    3636namespace packet {
    3737
    38  
     38
    3939/**
    4040    @author
  • code/branches/presentation2/src/libraries/network/packet/Gamestate.cc

    r5929 r6387  
    9595    return false;
    9696  }
    97  
     97
    9898  // create the header object
    9999  assert( header_ == 0 );
     
    105105  ObjectList<Synchronisable>::iterator it;
    106106  for(it = ObjectList<Synchronisable>::begin(); it; ++it){
    107    
     107
    108108//     tempsize=it->getSize(id, mode);
    109109
     
    111111    if ( tempsize != 0 )
    112112      dataVector_.push_back( obj(it->getObjectID(), it->getCreatorID(), tempsize, mem-data_) );
    113    
     113
    114114#ifndef NDEBUG
    115115    if(currentsize+tempsize > size){
     
    362362  assert(!header_->isCompressed() && !base->header_->isCompressed());
    363363  assert(!header_->isDiffed());
    364  
     364
    365365  uint8_t *basep = GAMESTATE_START(base->data_);
    366366  uint8_t *gs = GAMESTATE_START(this->data_);
    367367  uint32_t dest_length = header_->getDataSize();
    368  
     368
    369369  if(dest_length==0)
    370370    return NULL;
    371  
     371
    372372  uint8_t *ndata = new uint8_t[dest_length*sizeof(uint8_t)+GamestateHeader::getSize()];
    373373  uint8_t *dest = GAMESTATE_START(ndata);
    374  
     374
    375375  rawDiff( dest, gs, basep, header_->getDataSize(), base->header_->getDataSize() );
    376376#ifndef NDEBUG
     
    398398  assert(!header_->isCompressed() && !base->header_->isCompressed());
    399399  assert(header_->isDiffed());
    400  
     400
    401401  uint8_t *basep = GAMESTATE_START(base->data_);
    402402  uint8_t *gs = GAMESTATE_START(this->data_);
    403403  uint32_t dest_length = header_->getDataSize();
    404  
     404
    405405  if(dest_length==0)
    406406    return NULL;
    407  
     407
    408408  uint8_t *ndata = new uint8_t[dest_length*sizeof(uint8_t)+GamestateHeader::getSize()];
    409409  uint8_t *dest = ndata + GamestateHeader::getSize();
    410  
     410
    411411  rawDiff( dest, gs, basep, header_->getDataSize(), base->header_->getDataSize() );
    412  
     412
    413413  Gamestate *g = new Gamestate(ndata, getClientID());
    414414  assert(g->header_);
     
    481481  uint64_t* bd = (uint64_t*)basedata;
    482482  uint64_t* nd = (uint64_t*)newdata;
    483  
     483
    484484  unsigned int i;
    485485  for( i=0; i<datalength/8; i++ )
  • code/branches/presentation2/src/libraries/network/packet/Packet.cc

    r6105 r6387  
    101101@brief
    102102    Destroys a packet completely.
    103    
     103
    104104    That also means destroying the ENetPacket if one exists. There
    105105*/
Note: See TracChangeset for help on using the changeset viewer.