From f938f8dd5324b4942cf642cc5fc219c997050b42 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Mon, 22 Nov 2021 21:23:34 +0100 Subject: [PATCH] Finished packet-type detection --- handler/textPacketHandler.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/handler/textPacketHandler.hpp b/handler/textPacketHandler.hpp index ec3f2d0..7b3219e 100644 --- a/handler/textPacketHandler.hpp +++ b/handler/textPacketHandler.hpp @@ -92,7 +92,14 @@ void textPacketHandler(const std::vector textPacket){ // If type is in map, use map-value, otherwise keep default if(PACKET_TYPE_MAP.find(textType) != PACKET_TYPE_MAP.end()) - type = PACKET_TYPE_MAP[textType]; + type = PACKET_TYPE_MAP.at(textType); + + if(type == PacketType::Unknown){ + fprintf(stderr, "Unknown package-type: %s\n", textType.c_str()); + } + } + packet.type = type; + } //