#include "ext_packet.h" #include "aoapplication.h" #include "auth_flow.h" #include "courtroom.h" #include "networkmanager.h" #include #include static void handleAuthChallenge(QByteArrayView body, AuthFlow *auth) { if (!auth->awaiting_challenge()) { return; } AuthChallenge challenge; if (!parseAuthChallenge(body, challenge)) { qWarning() << "Invalid AuthChallenge message"; return; } auth->respond(challenge); } void AOApplication::ex_message_received(QByteArrayView message) { ExMsgType type = (ExMsgType)message[0]; QByteArrayView body = message.sliced(1); switch (type) { case ExMsgType::auth_challenge: handleAuthChallenge(body, &this->auth); break; default: qWarning() << "Unknown message type:" << (int)type; break; } } void AOApplication::send_ex_message(const QByteArray &msg) { // Why indirection? net_manager->ship_ex_message(msg); }