Changeset 6337 in orxonox.OLD for branches/network/src/lib/lang
- Timestamp:
- Dec 30, 2005, 1:32:46 AM (19 years ago)
- Location:
- branches/network/src/lib/lang
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/lang/base_object.cc
r6275 r6337 22 22 #include "compiler.h" 23 23 #include "class_list.h" 24 25 #include "synchronizeable.h" 24 26 25 27 using namespace std; … … 194 196 PRINT(0)(" -Weapon-"); 195 197 PRINT(0)("\n"); 196 } 197 } 198 } 199 } 200 201 /** 202 * Writes data from network containing information about the state 203 * @param data pointer to data 204 * @param length length of data 205 * @param sender hostID of sender 206 */ 207 int BaseObject::writeState( const byte * data, int length, int sender ) 208 { 209 SYNCHELP_READ_BEGIN(); 210 211 if ( objectName ) 212 { 213 delete[] objectName; 214 objectName = NULL; 215 } 216 SYNCHELP_READ_STRINGM( this->objectName ); 217 218 return SYNCHELP_READ_N; 219 } 220 221 /** 222 * data copied in data will bee sent to another host 223 * @param data pointer to data 224 * @param maxLength max length of data 225 * @return the number of bytes writen 226 */ 227 int BaseObject::readState( byte * data, int maxLength ) 228 { 229 SYNCHELP_WRITE_BEGIN(); 230 231 SYNCHELP_WRITE_STRING( this->objectName ); 232 233 return SYNCHELP_WRITE_N; 234 } -
branches/network/src/lib/lang/base_object.h
r6275 r6337 15 15 #define NULL 0 //!< NULL 16 16 #endif 17 18 #include "stdincl.h" 17 19 18 20 class TiXmlElement; … … 44 46 bool operator==(ClassID classID) { return this->isA(classID); }; 45 47 48 int writeState(const byte* data, int length, int sender); 49 int readState(byte* data, int maxLength ); 46 50 protected: 47 51 void setClassID(ClassID classID, const char* className);
Note: See TracChangeset
for help on using the changeset viewer.