Changeset 6861 in orxonox.OLD for branches/network/src/lib
- Timestamp:
- Jan 30, 2006, 10:24:20 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/synchronizeable.h
r6815 r6861 33 33 NWT_SS_VELY, 34 34 NWT_SS_VELZ, 35 NWT_SS_PL_SYNC, 35 36 36 37 NWT_HS_HOST_ID, 37 38 NWT_HS_NGM_ID, 39 40 NWT_PL_FLAGS, 38 41 39 42 NWT_PN_BO_WRITESTATE, … … 101 104 * with the same argument names! 102 105 * 106 * id is one int out of that enum on top of this comment it is used to identify 107 * read/write. when you read a value you have to use exactly the same as you used 108 * to write or you will see an assertion failing. 109 * 103 110 * SYNCHELP_WRITE_BEGIN() 104 * SYNCHELP_WRITE_INT(i )105 * SYNCHELP_WRITE_FLOAT(f )106 * SYNCHELP_WRITE_BYTE(b )107 * SYNCHELP_WRITE_STRING(s )111 * SYNCHELP_WRITE_INT(i,id) 112 * SYNCHELP_WRITE_FLOAT(f,id) 113 * SYNCHELP_WRITE_BYTE(b,id) 114 * SYNCHELP_WRITE_STRING(s,id) 108 115 * SYNCHELP_WRITE_N 109 116 * 110 117 * SYNCHELP_READ_BEGIN() 111 * SYNCHELP_READ_INT(i) 112 * SYNCHELP_READ_FLOAT(f) 113 * SYNCHELP_READ_STRING(s,l) l = size of buffer s 114 * SYNCHELP_READ_STRINGM(s) allocates memory for string! you have to free this after 115 * SYNCHELP_READ_BYTE(b) 118 * SYNCHELP_READ_INT(i,id) 119 * SYNCHELP_READ_FLOAT(f,id) 120 * SYNCHELP_READ_STRING(s,l,id) l = size of buffer s 121 * SYNCHELP_READ_STRINGM(s,id) allocates memory for string! you have to delete this later 122 * SYNCHELP_READ_BYTE(b,id) 123 * SYNCHELP_READ_REMAINING() returns the remaining buffer size 124 * SYNCHELP_READ_NEXTBYTE() reads the next byte but it is not removed from the buffer 116 125 * SYNCHELP_READ_N 117 126 * … … 122 131 * SYNCHELP_READ_FLOAT(size); 123 132 * SYNCHELP_READ_STRING( textureName, 1024 ); //1024 is the length of textureName 133 * delete[] textureName; 134 * textureName = NULL; 135 * SYNCHELP_READ_STRINGM( texturename ); //this will call new char[strlen()+1] 124 136 * 125 137 * Example 2: … … 130 142 * 131 143 */ 144 132 145 #define SYNCHELP_WRITE_DEBUG(n) {\ 133 146 __synchelp_write_n = Converter::intToByteArray( n, data+__synchelp_write_i, maxLength-__synchelp_write_i ); \
Note: See TracChangeset
for help on using the changeset viewer.