QcServerAdmin Class
The server's side of the admin channel (decision E-848): operators who play on the server follow its status, players, chat and log and act on it over their game connection. More...
| Header: | #include <server/admin/QcServerAdmin.h> |
Public Functions
| bool | handle(QcServerClient &client, const QcMessage &message) |
| void | noteLeft(const QcServerClient &client) |
| void | noteTick(double ms) |
| const QcAdminStatusRecorder & | recorder() const |
| QcTraffic | traffic() const |
| void | update() |
Static Public Members
| const qint64 | pingIntervalNs |
| const qint64 | statusIntervalNs |
| const qsizetype | tailLines |
Detailed Description
The rights are checked on every message and every tick: a player who is no operator (or no longer one) is refused with a warning in the log, and his subscription ends at once. Every action runs as the operator's command line through QcServerCommands, the same code as the chat and the console, so the admin channel adds no rules of its own; stopping the server runs the console's /stop and needs the argument "confirm". The status history is recorded all the time; pings to measure the players' round trips go out only while an operator follows the status. Every playing client is told when he becomes an operator (a result with number 0 and ok) and when he stops being one (a refusal with number 0), so the game shows "Manage server" only to operators (decision E-863).
Member Function Documentation
bool QcServerAdmin::handle(QcServerClient &client, const QcMessage &message)
Handles message of client if it is an admin message or a Pong of a playing client. Returns false for every other message.
void QcServerAdmin::noteLeft(const QcServerClient &client)
client left: his network bytes count on (traffic()), his subscription ends.
void QcServerAdmin::noteTick(double ms)
A tick ended after ms (the phases inside the tick).
const QcAdminStatusRecorder &QcServerAdmin::recorder() const
Returns the status history.
QcTraffic QcServerAdmin::traffic() const
Returns the bytes of all network clients so far, those who left included.
void QcServerAdmin::update()
Every tick: rights of the subscribers and of the players, new chat lines, and once a second the status sample, the status, the players and new log lines for those who follow them.