QtCraft API C++ classes QML types Handbook

QcMsg::PlayerState Struct

struct QcMsg::PlayerState

Server -> client: authoritative state of the receiving player. More...

Header: #include <common/protocol/QcPlayerMessages.h>

Public Variables

std::optional<QcBoatState> boat
quint32 lastInputSequence
QcEntityMotion motion
bool usingItem
quint32 vehicle

Detailed Description

vehicle is the minecart the player rides (entity id, 0 for none, decision E-382): while it is set the server moves the player with the cart and the client shows the player where it shows the cart, without predicting. It names the boat the player drives as well (decision E-920); then boat is its state after the acknowledged input, which the client's prediction of the boat starts from.

Member Variable Documentation

std::optional<QcBoatState> PlayerState::boat

The state of the boat the player drives (see the struct).

quint32 PlayerState::lastInputSequence

The sequence number of the latest input the server applied; the client drops older ones from its prediction.

QcEntityMotion PlayerState::motion

The player's motion after that input.

bool PlayerState::usingItem

The server knows the player to draw a launcher (decision E-986). False after an input the client sent as drawing: the server refused the draw or ended it, the client lets go.

quint32 PlayerState::vehicle

The minecart or boat the player is in; 0 for none (see the struct).