mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 07:23:39 +02:00
use JSONBreakableMarshal in AC monitor to get QJsonObject
This commit is contained in:
parent
4b777f09e6
commit
a7bff474e3
1 changed files with 5 additions and 8 deletions
|
@ -11,8 +11,9 @@
|
||||||
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#include <LogHandler.h>
|
|
||||||
#include <AddressManager.h>
|
#include <AddressManager.h>
|
||||||
|
#include <JSONBreakableMarshal.h>
|
||||||
|
#include <LogHandler.h>
|
||||||
|
|
||||||
#include "AssignmentClientMonitor.h"
|
#include "AssignmentClientMonitor.h"
|
||||||
#include "AssignmentClientApp.h"
|
#include "AssignmentClientApp.h"
|
||||||
|
@ -196,13 +197,9 @@ void AssignmentClientMonitor::readPendingDatagrams() {
|
||||||
// update our records about how to reach this child
|
// update our records about how to reach this child
|
||||||
matchingNode->setLocalSocket(senderSockAddr);
|
matchingNode->setLocalSocket(senderSockAddr);
|
||||||
|
|
||||||
// push past the packet header
|
QVariantMap packetVariantMap =
|
||||||
QDataStream packetStream(receivedPacket);
|
JSONBreakableMarshal::fromStringBuffer(receivedPacket.mid(numBytesForPacketHeader(receivedPacket)));
|
||||||
packetStream.skipRawData(numBytesForPacketHeader(receivedPacket));
|
QJsonObject unpackedStatsJSON = QJsonObject::fromVariantMap(packetVariantMap);
|
||||||
// decode json
|
|
||||||
QVariantMap unpackedVariantMap;
|
|
||||||
packetStream >> unpackedVariantMap;
|
|
||||||
QJsonObject unpackedStatsJSON = QJsonObject::fromVariantMap(unpackedVariantMap);
|
|
||||||
|
|
||||||
// get child's assignment type out of the decoded json
|
// get child's assignment type out of the decoded json
|
||||||
QString childType = unpackedStatsJSON["assignment_type"].toString();
|
QString childType = unpackedStatsJSON["assignment_type"].toString();
|
||||||
|
|
Loading…
Reference in a new issue