From 97b79eeb86eedee57630b8d29f6eeab08ccb02b0 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Sun, 30 Nov 2014 13:05:19 +0100 Subject: add flatbuffer support and use that for the handshake --- resource/listener.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'resource') diff --git a/resource/listener.cpp b/resource/listener.cpp index da1edc3..645cb8c 100644 --- a/resource/listener.cpp +++ b/resource/listener.cpp @@ -2,6 +2,7 @@ #include "common/console.h" #include "common/commands.h" +#include "common/commands/handshake_generated.h" #include #include @@ -130,11 +131,12 @@ void Listener::processClientBuffer(Client &client) client.commandBuffer.remove(0, headerSize + size); switch (commandId) { - case Commands::HandshakeCommand: - client.name = data; - Console::main()->log(QString(" Handshake from %1").arg(client.name)); + case Commands::HandshakeCommand: { + auto buffer = Toynadi::GetHandshake(data.constData()); + Console::main()->log(QString(" Handshake from %1").arg(buffer->name()->c_str())); //TODO: reply? break; + } default: // client.hasSentCommand = true; break; -- cgit v1.2.3