QtCraft API C++ classes QML types Handbook

QcMsg Namespace

The protocol messages: plain data structs in thematic headers, together the alternatives of the QcMessage variant (QcMessages.h). More...

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

Namespaces

namespace AdminLimits

Classes

struct AdminCatalogue
struct AdminChat
struct AdminChatLine
struct AdminHistory
struct AdminLists
struct AdminLog
struct AdminLogLine
struct AdminPlayers
struct AdminRequest
struct AdminResult
struct AdminSample
struct AdminSettings
struct AdminStatus
struct AdminSubscribe
struct AdvancementProgress
struct AnvilState
struct AttackEntity
struct BlockAck
struct BlockBatch
struct BlockUpdate
struct CampfireDisplay
struct CancelMining
struct ChatInput
struct ChatMessage
struct ChooseEnchantment
struct ChunkData
struct ChunkLabels
struct ChunkUnload
struct CloseAnvil
struct CloseCrafting
struct CloseEnchanting
struct CloseMachine
struct CloseStonecutter
struct CloseTrade
struct ConsumeItem
struct ContentSync
struct CraftRecipe
struct CreativeItem
struct DebugSubscribe
struct Disconnect
struct DrawLauncher
struct DropItem
struct EditSign
struct EnchantingOffer
struct EnchantingState
struct EntityMove
struct EntityMoves
struct EntityRemove
struct EntitySpawn
struct Explosion
struct FinishMining
struct ForgeAnvil
struct GameMode
struct Hello
struct InventoryState
struct LatencyEcho
struct LatencyProbe
struct Lightning
struct LoginChallenge
struct LoginResponse
struct MachineState
struct MapUpdate
struct MobGoal
struct MoveInventoryItem
struct OpenAnvil
struct OpenCrafting
struct OpenEnchanting
struct OpenMachine
struct OpenSignEditor
struct OpenStonecutter
struct PauseRequest
struct PickBlock
struct Ping
struct PlayerAir
struct PlayerExperience
struct PlayerFood
struct PlayerHealth
struct PlayerInput
struct PlayerList
struct PlayerState
struct Pong
struct QuickMoveItem
struct RenameAnvil
struct Respawn
struct SelectHotbarSlot
struct SelectStonecutterRecipe
struct ServerDebug
struct ServerPause
struct SetAppearance
struct SignText
struct SoundEvent
struct SpawnerDisplay
struct StartMining
struct StonecutterState
struct TakeCraftingResult
struct ThrowItem
struct Trade
struct TradeOffer
struct TradeState
struct UseEntity
struct UseItem
struct Weather
struct Welcome
struct WorldTime

Variables

const quint16 Burning
const quint16 Drawing
const quint16 InLove
const quint16 InWater
const quint16 OnGround
const quint16 Riding
const quint16 Rowing
const quint16 Sneaking
const quint16 Sprinting
const quint16 Stuck
const quint16 Swing
const quint16 Young
const double youngScale

Functions

quint16 poseFlags(QcPose pose)
QcPose poseOf(quint16 flags)

Detailed Description

Namespaces

namespace QcMsg::AdminLimits

Classes

class AdminCatalogue

Server -> client: the commands of the registry and the macros of the content. More...

class AdminChat

Server -> client: recent chat after subscribing (history), then each new line. More...

class AdminChatLine

One chat line as the server sent it to the players, with when (ms since the epoch) and who wrote it (empty for lines of the server). More...

class AdminHistory

Server -> client after subscribing to the status: the bounded history for charts, oldest first. More...

class AdminLists

Server -> client: operators, whitelist and bans. More...

class AdminLog

Server -> client: the log's tail (tail, answering a subscription or LogTail) or new lines. More...

class AdminLogLine

One line of the server's log (QcMessageLog::recent). More...

class AdminPlayers

Server -> client: everyone playing, with the server's view of each. More...

class AdminRequest

Client -> server: one request of the operator; the server answers with AdminResult (same id) and, for the readers and the changes of a list or setting, the report of that topic. More...

class AdminResult

Server -> client: the outcome of an AdminRequest (id 0 answers a subscription or ends it), with the command's replies as chat lines. More...

class AdminSample

One point of the status: at timeMs (milliseconds since the epoch, UTC) the ticks of the second before it, the players, chunks and entities, the resident memory and the network rates. More...

class AdminSettings

Server -> client: game rules and server limits with what a settings page needs. More...

class AdminStatus

Server -> client, about once a second while the operator follows the status. More...

class AdminSubscribe

Client -> server: the topics the operator follows; 0 ends the subscription. More...

class AdvancementProgress

Server -> client: the receiving player's progress in the adventure guide (decision E-923). More...

class AnvilState

Server -> client: the open anvil's slots, the name in its name field, what it would make and the levels that costs (QcAnvil::Result; 0 and an empty output for nothing). More...

class AttackEntity

Client -> server: hit an entity with the held item. More...

class BlockAck

Server -> client: the player's action numbered sequence (FinishMining, UseItem) is handled, together with every earlier one (decision E-853). More...

class BlockBatch

Server -> client: blocks set together in one tick (an explosion's, decision E-604). More...

class BlockUpdate

Server -> client: the block at pos is now block. More...

class CampfireDisplay

Server -> client: the items lying on the campfire at pos (decision E-772), sent after the ChunkData of its chunk and whenever they change; one content item id per slot, 0 for an empty one. More...

class CancelMining

Client -> server: the player stopped hitting before the block broke. More...

class ChatInput

Client -> server: chat line or command starting with '/'. More...

class ChatMessage

Server -> client: chat line or command feedback. More...

class ChooseEnchantment

Client -> server: take offer slot (0–2) of the open enchanting table. More...

class ChunkData

Server -> client: a whole chunk, sent when it comes into the player's view. More...

class ChunkLabels

Server -> client: the labels floating in a chunk (decision E-222), sent right after its ChunkData when there are any; they go with the chunk's ChunkUnload. More...

class ChunkUnload

Server -> client: the client forgets the chunk at pos. More...

class CloseAnvil

Client -> server: the anvil screen closed. More...

class CloseCrafting

Client -> server: the crafting screen closed; grid items go back to the inventory. More...

class CloseEnchanting

Client -> server: the enchanting screen closed. More...

class CloseMachine

Client -> server: the machine screen closed. More...

class CloseStonecutter

Client -> server: the stonecutter screen closed. More...

class CloseTrade

Client -> server: the player closed the trading screen. More...

class ConsumeItem

Client -> server: use the held item without a target: eat it, or put on held armour (swapping with what is worn in its slot). More...

class ContentSync

Server -> client: all content definitions; runtime block ids are the indices in this registry. More...

class CraftRecipe

Client -> server: craft a recipe directly from the inventory (recipe book), count times. More...

class CreativeItem

Client -> server, creative mode only (decision E-283): puts stack into the inventory slot slot (0..35, or an armour slot 100..103 for armour made for it), onto the same item up to its stack size, else in place of what is there; an empty stack clears the slot (the bin). More...

class DebugSubscribe

Client -> server: which debug data the client wants while its debug display, the control interface or the statistics log needs it; 0 stops it. More...

class Disconnect

Both directions: the connection ends. More...

class DrawLauncher

Client -> server: the use button pressed or released with a launcher in the hand, or the draw given up (a screen opened, decision E-425). More...

class DropItem

Client -> server: throw one item (or the whole stack) of the selected hotbar slot. More...

class EditSign

Client -> server: the lines the player wrote on the sign at pos. More...

class EnchantingOffer

One of the three offers as the player sees it: the levels it needs (0: no offer) and, as a clue, the first enchantment it gives (its content name and level). More...

class EnchantingState

Server -> client: the open enchanting table's slots, the bookshelves that count, the offers and the rune seed the screen writes the clues with (decision E-884: a random value of the player's own, drawn anew with the enchanting seed but not derived from it, so the order of the readable letters stays until the player enchants and tells nothing about the offers). More...

class EntityMove

The state of one entity in EntityMoves; the fields as in EntitySpawn. More...

class EntityMoves

Server -> client: positions of all visible entities that changed this tick, with the server's time of the tick (players' time, QcServerClock::playerTimeNs, in ms) for the client's interpolation buffer (decision E-271). More...

class EntityRemove

Server -> client: the entity id left the player's view or died. More...

class EntitySpawn

Server -> client: an entity came into view, with its kind (decision E-365); a creature also names its type, an index into the content's mobs. More...

class Explosion

Server -> client: an explosion of power (QcBlastDefinition) at centre (decision E-604); the client shows its flash and smoke, the sound comes as a sound event. More...

class FinishMining

Client -> server: the client's timer says the block is broken; the server checks the time itself. More...

class ForgeAnvil

Client -> server: take the anvil's output output for levelCost levels, as the last AnvilState showed them; refused when either changed since. More...

class GameMode

Server -> client: the receiving player's game mode (decision E-282), after the welcome and with every change. More...

class Hello

Client -> server: first message on every connection. More...

class InventoryState

Server -> client: the receiving player's complete inventory, crafting grid and armour slots. More...

class LatencyEcho

Server -> client: the answer to LatencyProbe. More...

class LatencyProbe

Client -> server: measures the round trip of the connection (decision E-886). More...

class Lightning

Server -> client: lightning struck at position (the top of the column it hit). More...

class LoginChallenge

Server -> client after Hello from a remote client: what the server needs for the login. More...

class LoginResponse

Client -> server: the answer to LoginChallenge. More...

class MachineState

Server -> client: contents and progress of the open machine. More...

class MapUpdate

Server -> client: what is new of map id for a player holding it (decision E-802): its place on the grid, the pixels of area row by row (QcMapPixel; an empty area sends none) and the players shown on it now (QcMapMarker). More...

class MobGoal

Where a creature is heading: chasing a player, wandering or fleeing. More...

class MoveInventoryItem

Client -> server: move count items from slot from to slot to. More...

class OpenAnvil

Server -> client: the player opened the anvil at pos (decision E-866); AnvilState follows. More...

class OpenCrafting

Server -> client: open the crafting screen with a grid of this size (crafting table). More...

class OpenEnchanting

Server -> client: the player opened the enchanting table at pos (decision E-864); EnchantingState follows. More...

class OpenMachine

Server -> client: the player opened the machine at pos, or with an empty category the storage block (chest) there; MachineState follows. More...

class OpenSignEditor

Server -> client: the player placed or used the sign at pos; the client opens its editor with the sign's current lines. More...

class OpenStonecutter

Server -> client: the player opened the stonecutter at pos (decision E-785); StonecutterState follows. More...

class PauseRequest

Client -> server: the player opened (paused) or left the pause menu (decision E-877). More...

class PickBlock

Client -> server: the middle mouse button on a block (decision E-285). More...

class Ping

Server -> client: measures the round trip for the admin channel's player list (decision E-848); the client's tick thread answers at once with a Pong of the same nonce. More...

class PlayerAir

Server -> client: the receiving player's air under water (decision E-955), sent only when what the HUD shows changes: the bubbles (QcAirSupply::bubblesOf), a full breath or whether the eyes are under water. More...

class PlayerExperience

Server -> client: the receiving player's experience (decision E-398): his level and the points towards the next one, which needs pointsForNext (QcExperience::pointsForNext, sent so the client needs no curve). More...

class PlayerFood

Server -> client: the receiving player's food points. More...

class PlayerHealth

Server -> client: the receiving player's health; dead players wait for Respawn. More...

class PlayerInput

Client -> server: one tick of movement intent. More...

class PlayerList

Server -> client: everyone on the server, sent to all whenever someone joins or leaves, and every two seconds while a round trip changed (decision E-886). More...

class PlayerState

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

class Pong

Client -> server: the answer to Ping. More...

class QuickMoveItem

Client -> server: shift-click on a slot. More...

class RenameAnvil

Client -> server: the text of the anvil's name field changed (at most QcItemData::maxNameLength characters after trimming). More...

class Respawn

Client -> server: leave the death screen. More...

class SelectHotbarSlot

Client -> server: the player selected another hotbar slot. More...

class SelectStonecutterRecipe

Client -> server: choose the stonecutting recipe recipe for the input of the open stonecutter (empty: none); the server answers with StonecutterState. More...

class ServerDebug

Server -> client: tick phases and server counts, at most twice a second while subscribed. More...

class ServerPause

Server -> client: the server stopped (paused) or resumed its ticks (decision E-877). More...

class SetAppearance

Client -> server: the player changed their look. More...

class SignText

Server -> client: the text on the sign at pos, sent after the ChunkData of its chunk and whenever it changes; all lines empty: no text (cleared, or the sign is gone). More...

class SoundEvent

Server -> client: a sound at a world position (block broken, creature hurt, furnace crackling). More...

class SpawnerDisplay

Server -> client: the creature kind shown spinning in the monster spawner at pos (decision E-520), sent after the ChunkData of its chunk and whenever it changes; mob is the kind's index in the content, -1 for none (an empty cage, or the spawner is gone). More...

class StartMining

Client -> server: the player starts hitting a block. More...

class StonecutterState

Server -> client: the open stonecutter's input slot and the stonecutting recipe chosen for it (empty: none). More...

class TakeCraftingResult

Client -> server: take the crafting result once into the inventory. More...

class ThrowItem

Client -> server: the use button pressed with a throwable item in the hand (a snowball, decision E-427); the server throws it unless its cooldown runs. More...

class Trade

Client -> server: trade the offer at index offer of the open screen once, or with repeat as often as the inventory and the uses left allow (shift-click). More...

class TradeOffer

One offer as the trading screen shows it: what the player pays (one or two stacks, the first at its current price), what they get, and how often it can still be traded before the villager restocks. More...

class TradeState

Server -> client: the trading screen of the villager villager opened or changed (a trade, a restock, a level gained). More...

class UseEntity

Client -> server: use the held item on a creature (catch a firefly with an empty bottle) or on an armour stand (put on or take off armour or the held item; the server picks the body part from the player's view). More...

class UseItem

Client -> server: use the held item on a block face (places blocks, opens doors). More...

class Weather

Server -> client: the weather as this player sees it (decision E-395). More...

class Welcome

Server -> client: accepted connection. More...

class WorldTime

Server -> client: seconds since the world began and the length of a full day; running is false while the time of day stands still (game rule daylightCycle, decision E-221). More...

Variable Documentation

const quint16 QcMsg::Burning

On fire (decision E-393): flames around the body.

const quint16 QcMsg::Drawing

A player drawing a bow (decision E-425): arms raised to aim in the third person.

const quint16 QcMsg::InLove

An animal in love after feeding: hearts above it.

const quint16 QcMsg::InWater

Flag bit: the entity is in a liquid.

const quint16 QcMsg::OnGround

Flag bit: the entity stands on the ground.

const quint16 QcMsg::Riding

A player sitting in a minecart (decision E-382).

const quint16 QcMsg::Rowing

On a boat the sprint bit tells that its driver paddles: his latest input pressed a key that paddles or turns (decision E-920); the paddles row.

const quint16 QcMsg::Sneaking

Flag bit: the entity sneaks.

const quint16 QcMsg::Sprinting

Flag bit: the entity sprints.

const quint16 QcMsg::Stuck

A projectile stuck in a block: it no longer turns with its flight.

const quint16 QcMsg::Swing

Flag bit: a swing of the right arm started this tick (mining, attacking, using).

const quint16 QcMsg::Young

A young animal (decision E-293): drawn at QcMsg::youngScale of its size.

const double QcMsg::youngScale

The size of a young animal relative to a grown one.

Function Documentation

quint16 QcMsg::poseFlags(QcPose pose)

Returns the flag bits of pose: Lying, Sitting or none for standing.

QcPose QcMsg::poseOf(quint16 flags)

Returns the pose the bits of flags carry; standing without Lying or Sitting.