Changeset 6273 in orxonox.OLD for branches/network/src/lib/network/network_protocol.cc
- Timestamp:
- Dec 23, 2005, 5:30:22 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/network_protocol.cc
r6139 r6273 30 30 #include "debug.h" 31 31 32 #include "converter.h" 33 32 34 /* using namespace std is default, this needs to be here */ 33 35 using namespace std; … … 41 43 /* set the class id for the base object */ 42 44 this->setClassID(CL_NETWORK_PROTOCOL, "NetworkProtocol"); 43 this->headerLength = sizeof(Header);45 this->headerLength = INTSIZE+FLOATSIZE; 44 46 } 45 47 … … 74 76 //Now create the header 75 77 /* sender ID: FIXME: there will be a better ID (for example unique:D)*/ 76 data[0] = (byte)(source.getUniqueID()); 78 //data[0] = (byte)(source.getUniqueID()); 79 int res = Converter::intToByteArray( source.getUniqueID(), data, bufferLength ); 80 77 81 /* data length*/ 78 data[1] = length; 82 //data[1] = length; 83 res = Converter::intToByteArray( length, data+res, bufferLength-res ); 79 84 80 85 … … 105 110 106 111 /* unique ID */ 107 h.synchronizeableID = data[0]; 112 //h.synchronizeableID = data[0]; 113 int res = Converter::byteArrayToInt( data, &(h.synchronizeableID) ); 108 114 /* data length*/ 109 h.length = data[1]; 115 //h.length = data[1]; 116 Converter::byteArrayToInt( data+res, &(h.length) ); 110 117 111 118
Note: See TracChangeset
for help on using the changeset viewer.