QtCraft API C++ classes QML types Handbook

QcControlReports Class

JSON views of the session state that control responses report. More...

Header: #include <clientcore/control/QcControlReports.h>

Public Functions

QcControlReports(const QcClientSession &session, const QStringList &chatLog)
QJsonObject inventoryJson() const
QJsonObject machineJson() const
QJsonObject playerStatus() const
QJsonObject soundsJson() const
QJsonValue stackJson(const QcItemStack &stack) const
QJsonObject weatherJson() const

Static Public Members

QJsonObject appearanceJson(const QcAppearance &look)
QJsonArray vectorJson(const QcVec3 &v)

Detailed Description

Member Function Documentation

QcControlReports::QcControlReports(const QcClientSession &session, const QStringList &chatLog)

session: the session reported on; chatLog: chat lines received while the current request runs.

[static] QJsonObject QcControlReports::appearanceJson(const QcAppearance &look)

Returns the player's look with the colours as "#rrggbb".

QJsonObject QcControlReports::inventoryJson() const

Returns the inventory: the occupied slots, the selected one and the crafting grid.

QJsonObject QcControlReports::machineJson() const

Returns the open machine screen: {"open": false} while none is open.

QJsonObject QcControlReports::playerStatus() const

Returns the player's status: position, motion, health, target and the chat lines of the request.

QJsonObject QcControlReports::soundsJson() const

Returns the recent sound cues with their loudness and side as heard now, and the ambience levels.

QJsonValue QcControlReports::stackJson(const QcItemStack &stack) const

Returns stack as {item, count, ...}; null for an empty stack or an unknown item.

[static] QJsonArray QcControlReports::vectorJson(const QcVec3 &v)

Returns v as [x, y, z].

QJsonObject QcControlReports::weatherJson() const

Returns the weather where the player stands (decision E-395).