Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 28, 2010, 8:29:32 PM (15 years ago)
Author:
scheusso
Message:

some new features:
-Orxonox servers announce themselves now inside a LAN (and can provide some information (e.g. server name, etc.) to the client )
-Orxonox clients discover the servers inside the LAN and list them in the menu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation3/src/libraries/util/Serialise.h

    r7127 r7161  
    5353    template <class T> inline bool checkEquality( const T& variable, uint8_t* mem );
    5454
     55 
     56  // =========== char*
     57   
     58  inline uint32_t returnSize( char*& variable )
     59  {
     60    return strlen(variable)+1;
     61  }
     62     
     63  inline void saveAndIncrease( char*& variable, uint8_t*& mem )
     64  {
     65    strcpy((char*)mem, variable);
     66    mem += returnSize(variable);
     67  }
     68       
     69  inline void loadAndIncrease( char*& variable, uint8_t*& mem )
     70  {
     71    if( variable )
     72      delete variable;
     73    uint32_t len = strlen((char*)mem)+1;
     74    variable = new char[len];
     75    strcpy((char*)variable, (char*)mem);
     76    mem += len;
     77  }
     78         
     79  inline bool checkEquality( char*& variable, uint8_t* mem )
     80  {
     81    return strcmp(variable, (char*)mem)==0;
     82  }
     83   
    5584// =================== Template specialisation stuff =============
    5685
     
    394423        return memcmp(&temp, mem, sizeof(uint64_t))==0;
    395424    }
    396 
     425       
    397426// =========== string
    398427
Note: See TracChangeset for help on using the changeset viewer.