Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 1, 2009, 9:47:34 AM (16 years ago)
Author:
scheusso
Message:

this is another commit for testing purpose
still trying to get network function calls to work (first success)

File:
1 edited

Legend:

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

    r2938 r2944  
    7272  {
    7373    uint32_t functionID = *(uint32_t*)temp;
    74     bool isStatic = NetworkFunctionBase::isStatic( functionID );
     74    bool isStatic = *(uint8_t*)(temp+sizeof(uint32_t));
    7575    if( isStatic )
    7676    {
    7777      MultiType mt1, mt2, mt3, mt4, mt5;
    7878      NetworkFunctionStatic *fct = NetworkFunctionStatic::getFunction( functionID );
    79       uint32_t nrOfArguments = *(uint32_t*)(temp+sizeof(uint32_t));
    80       temp+=2*sizeof(uint32_t);
     79      uint32_t nrOfArguments = *(uint32_t*)(temp+sizeof(uint32_t)+sizeof(uint8_t));
     80      temp+=2*sizeof(uint32_t)+sizeof(uint8_t);
    8181      switch(nrOfArguments)
    8282      {
     
    122122      MultiType mt1, mt2, mt3, mt4, mt5;
    123123      NetworkMemberFunctionBase *fct = NetworkMemberFunctionBase::getFunction( functionID );
    124       uint32_t nrOfArguments = *(uint32_t*)(temp+sizeof(uint32_t));
    125       uint32_t objectID = *(uint32_t*)(temp+2*sizeof(uint32_t));
    126       temp+=3*sizeof(uint32_t);
     124      uint32_t nrOfArguments = *(uint32_t*)(temp+sizeof(uint32_t)+sizeof(uint8_t));
     125      uint32_t objectID = *(uint32_t*)(temp+2*sizeof(uint32_t)+sizeof(uint8_t));
     126      temp+=3*sizeof(uint32_t)+sizeof(uint8_t);
    127127      switch(nrOfArguments)
    128128      {
     
    166166    }
    167167  }
     168  delete this;
    168169  return true;
    169170}
     
    173174 
    174175  // first determine the size that has to be reserved for this call
    175   uint32_t callsize = 2*sizeof(uint32_t); //size for network-function-id and nrOfArguments
     176  uint32_t callsize = 2*sizeof(uint32_t)+sizeof(uint8_t); //size for network-function-id and nrOfArguments and for bool isStatic
    176177  uint32_t nrOfArguments = 0;
    177178  if(mt1)
     
    211212  }
    212213 
    213   // now serialise the mt values and copy the function id
     214  // now serialise the mt values and copy the function id and isStatic
    214215  uint8_t* temp = data_+currentSize_;
    215216  *(uint32_t*)(data_+sizeof(uint32_t)) = *(uint32_t*)(data_+sizeof(uint32_t))+1; // increase number of calls
    216217  *(uint32_t*)temp = networkID;
    217   *(uint32_t*)(temp+sizeof(uint32_t)) = nrOfArguments;
    218   temp += 2*sizeof(uint32_t);
     218  *(uint8_t*)(temp+sizeof(uint32_t)) = true;
     219  *(uint32_t*)(temp+sizeof(uint32_t)+sizeof(uint8_t)) = nrOfArguments;
     220  temp += 2*sizeof(uint32_t)+sizeof(uint8_t);
    219221  if(mt1)
    220222  {
     
    237239    }
    238240  }
    239   currentSize_ += callsize;
     241  //currentSize_ += callsize;
     242  currentSize_ = temp-data_;
    240243 
    241244}
     
    245248 
    246249  // first determine the size that has to be reserved for this call
    247   uint32_t callsize = 3*sizeof(uint32_t); //size for network-function-id and nrOfArguments and the objectID
     250  uint32_t callsize = 3*sizeof(uint32_t)+sizeof(uint8_t); //size for network-function-id and nrOfArguments and the objectID
    248251  uint32_t nrOfArguments = 0;
    249252  if(mt1)
     
    287290  *(uint32_t*)(data_+sizeof(uint32_t)) = *(uint32_t*)(data_+sizeof(uint32_t))+1; // increase number of calls
    288291  *(uint32_t*)temp = networkID;
    289   *(uint32_t*)(temp+sizeof(uint32_t)) = nrOfArguments;
    290   *(uint32_t*)(temp+2*sizeof(uint32_t)) = objectID;
    291   temp += 3*sizeof(uint32_t);
     292  *(uint8_t*)(temp+sizeof(uint32_t)) = false;
     293  *(uint32_t*)(temp+sizeof(uint32_t)+sizeof(uint8_t)) = nrOfArguments;
     294  *(uint32_t*)(temp+2*sizeof(uint32_t)+sizeof(uint8_t)) = objectID;
     295  temp += 3*sizeof(uint32_t)+sizeof(uint8_t);
    292296  if(mt1)
    293297  {
Note: See TracChangeset for help on using the changeset viewer.