Changeset 6337 in orxonox.OLD for branches/network/src/lib
- Timestamp:
- Dec 30, 2005, 1:32:46 AM (20 years ago)
- Location:
- branches/network/src/lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/coord/p_node.cc
r6336 r6337 1016 1016 SYNCHELP_READ_BEGIN(); 1017 1017 1018 char * name; 1019 SYNCHELP_READ_STRINGM( name ); 1018 SYNCHELP_READ_FKT( BaseObject::writeState ); 1019 1020 PRINTF(0)("name = %s\n", this->getName()); 1020 1021 1021 1022 char * parentName = NULL; … … 1036 1037 SYNCHELP_READ_INT( parentMode ); 1037 1038 this->setParentMode((PARENT_MODE)parentMode); 1038 1039 if ( strcmp(name, "")==0 )1040 {1041 this->setName( NULL );1042 }1043 else1044 {1045 this->setName( name );1046 }1047 delete name;1048 name = NULL;1049 1039 1050 1040 float f1, f2, f3, f4; … … 1056 1046 //this->setRelCoor( 10, 0, 0 ); 1057 1047 1058 PRINTF(0)("%f %f %f\n", f1, f2, f3);1059 1060 1048 SYNCHELP_READ_FLOAT( f1 ); 1061 1049 SYNCHELP_READ_FLOAT( f2 ); 1062 1050 SYNCHELP_READ_FLOAT( f3 ); 1063 1051 //this->setAbsCoor( f1, f2, f3 ); 1064 1065 PRINTF(0)("%f %f %f\n", f1, f2, f3);1066 1052 1067 1053 SYNCHELP_READ_FLOAT( f1 ); … … 1085 1071 { 1086 1072 SYNCHELP_READ_STRINGM( childName ); 1073 PRINTF(0)("childname = %s\n", childName); 1087 1074 addChild( childName ); 1088 1075 delete childName; … … 1103 1090 SYNCHELP_WRITE_BEGIN(); 1104 1091 1105 SYNCHELP_WRITE_STRING( this->getName() ); 1092 SYNCHELP_WRITE_FKT( BaseObject::readState ); 1093 1094 PRINTF(0)("name = %s\n", this->getName()); 1106 1095 1107 1096 if ( this->parent ) … … 1143 1132 for (std::list<PNode*>::const_iterator it = children.begin(); it!=children.end(); it++) 1144 1133 { 1134 PRINTF(0)("childname = %s\n", (*it)->getName() ); 1145 1135 SYNCHELP_WRITE_STRING( (*it)->getName() ); 1146 1136 } -
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.