QtCraft API C++ classes QML types Handbook

QcCommandContext Struct

One call of a command: who runs it and the words after the command's name. More...

Header: #include <server/commands/QcCommandRegistry.h>

Public Functions

QcServerClient &player() const
void reply(const char *key, const QStringList &arguments = {}) const

Public Variables

const QStringList &args
QcPermission permission
const QcCommandSource &source
const QString &text
QcCommandHandler

Detailed Description

Member Function Documentation

QcServerClient &QcCommandContext::player() const

Returns the player who runs it. Precondition: the command needs a player (QcCommandSpec::needsPlayer).

void QcCommandContext::reply(const char *key, const QStringList &arguments = {}) const

Replies to the source with the translatable key and arguments (QcCommandSource::reply()).

Member Variable Documentation

const QStringList &QcCommandContext::args

The words after the command's name.

QcPermission QcCommandContext::permission

The right the command needs (a confirmation checks it again).

const QcCommandSource &QcCommandContext::source

Who runs the command.

const QString &QcCommandContext::text

The whole line as typed.

Related Non-Members

[alias] QcCommandHandler

Runs a command for the call context.