Testing the encoder for sending more complex messages

This commit is contained in:
Paul Hollinsky
2018-10-03 14:33:30 -04:00
parent 590a99d995
commit dffae23e54
13 changed files with 78 additions and 37 deletions
+1
View File
@@ -64,6 +64,7 @@ std::shared_ptr<Message> Decoder::decodePacket(const std::shared_ptr<Packet>& pa
*/
uint16_t length = packet->data[0] | (packet->data[1] << 8);
packet->network = Network(packet->data[2] & 0xF);
std::cout << "Got an old format packet, decoding against " << packet->network << std::endl;
packet->data.erase(packet->data.begin(), packet->data.begin() + 3);
if(packet->data.size() != length)
packet->data.resize(length);