Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 656


Ignore:
Timestamp:
Dec 19, 2007, 1:33:30 PM (17 years ago)
Author:
scheusso
Message:

some errors corrected in gamestatehandling

Location:
code/branches/FICN/src/network
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/network/ClientConnection.h

    r620 r656  
    2828#define NETWORK_PORT 55556
    2929#define NETWORK_CLIENT_MAX_CONNECTIONS 5
    30 #define NETWORK_CLIENT_TIMEOUT 5
     30#define NETWORK_CLIENT_TIMEOUT 10
    3131#define NETWORK_SEND_WAIT 5
    3232#define NETWORK_CLIENT_CHANNELS 2
  • code/branches/FICN/src/network/GameStateManager.cc

    r632 r656  
    126126
    127127    // run Synchronisable::getData with offset and additional place for 3 ints in between (for ids and length)
    128     sync=it->getData(retval->data+offset+3*sizeof(int));
     128    sync=it->getData((retval->data)+offset+3*sizeof(int));
    129129    *(retval->data+offset)=sync.length;
    130130    *(retval->data+offset+sizeof(int))=sync.objectID;
  • code/branches/FICN/src/network/Synchronisable.cc

    r630 r656  
    110110  retVal.objectID=this->objectID;
    111111  retVal.classID=this->classID;
    112   retVal.length=datasize;
     112  retVal.length=getSize();
    113113  retVal.data=mem;
    114114  // copy to location
     
    117117    //COUT(2) << "size of variable: " << i->size << std::endl;
    118118    //(std::memcpy(retVal.data+n, (const void*)(&(i->size)), sizeof(int));
    119     *((int *)(retVal.data+n)) = i->size;
     119    memcpy( (void *)(retVal.data+n), (const void*)&(i->size), sizeof(int) );
    120120    n+=sizeof(int);
    121121    switch(i->type){
    122122      case DATA:
    123         std::memcpy(retVal.data+n, (const void*)(i->var), i->size);
     123        std::memcpy( (void *)(retVal.data+n), (const void*)(i->var), i->size);
    124124        n+=i->size;
    125125        break;
     
    172172    switch(i->type){
    173173    case DATA:
     174      tsize+=sizeof(int);
    174175      tsize+=i->size;
    175176      break;
    176177    case STRING:
     178      tsize+=sizeof(int);
    177179      tsize+=((std::string *)i->var)->length()+1;
    178180      break;
Note: See TracChangeset for help on using the changeset viewer.