QcCommandSource Class
Who runs a command (decision E-243): a player through the chat or the server console. More...
| Header: | #include <server/commands/QcCommandSource.h> |
Public Types
Public Functions
| QcCommandSource(QcServerClient &client, QcPermission permission, QcCommandSource::Output output) | |
| quint32 | id() const |
| bool | may(QcPermission needed) const |
| QString | name() const |
| std::optional<QcBlockPos> | origin() const |
| QcPermission | permission() const |
| QcServerClient * | player() const |
| void | reply(const char *key, const QStringList &arguments = {}) const |
| void | replyPlain(const QString &line) const |
| void | send(const QcMsg::ChatMessage &line) const |
Static Public Members
| const QStringView | consoleName |
Detailed Description
Replies go back to the source as translatable chat lines (decision E-094); the console receives the lines and shows their English text.
Member Type Documentation
[alias] QcCommandSource::Output
Takes the reply lines instead of a player's chat.
Member Function Documentation
QcCommandSource::QcCommandSource(QcServerClient &client, QcPermission permission, QcCommandSource::Output output)
A player whose replies go to output instead of his chat (the admin channel, decision E-848).
quint32 QcCommandSource::id() const
Returns the key of the source's pending confirmation: the player's entity id, 0 for the console.
bool QcCommandSource::may(QcPermission needed) const
Returns whether the source's right allows what needed asks for.
QString QcCommandSource::name() const
Returns the player's name, or consoleName.
std::optional<QcBlockPos> QcCommandSource::origin() const
Returns the block the player stands in, origin of ~ coordinates; std::nullopt for the console.
QcPermission QcCommandSource::permission() const
Returns the source's right.
QcServerClient *QcCommandSource::player() const
Returns the player behind the source; nullptr for the console.
void QcCommandSource::reply(const char *key, const QStringList &arguments = {}) const
Sends the translatable line key with arguments; key is marked with QT_TRANSLATE_NOOP("QcServerMessages", ...).
void QcCommandSource::replyPlain(const QString &line) const
Sends line as it is, not translated.
void QcCommandSource::send(const QcMsg::ChatMessage &line) const
Sends line to the output, else to the player's chat; the console without an output drops it.
Member Variable Documentation
const QStringView QcCommandSource::consoleName
The name the console has in the log and in messages to players.