R-Type
Networked shoot'em up built on Aegis2D
Loading...
Searching...
No Matches
rtype::AdminConsole Class Reference

The commands of the server's administrator, on the engine's command system. More...

#include </__w/project-rtype/project-rtype/server/include/rtype/admin_console.hpp>

Public Member Functions

 AdminConsole (ServerNetwork &network, std::function< void()> stop)
 Creates the commands.
 
aegis2d::core::CommandResult run (std::string_view line)
 Runs a line typed by the administrator.
 

Detailed Description

The commands of the server's administrator, on the engine's command system.

  • rooms: the rooms in use, their players and whether they play;
  • players: every session, with its room (or the lobby), its number and its address;
  • say <text>: a message of the server to every player (RFC section 3.8);
  • close <room>: ends the sessions of a room, each told RoomClosed;
  • kick <player>: ends a player's session, telling it (Kicked) and the others;
  • ban <player>: the same (Banned), and its address may not log in again, even after a restart (ServerNetwork::bans());
  • stop: stops the server, as Ctrl+C does (the stop given, request_stop() in r-type_server);
  • help, help <command>: what the commands do.

A wrong command, a missing or bad argument, or a command that cannot be done (a room not in use, a text too long) says why and changes nothing. Use it on the network's thread.

Constructor & Destructor Documentation

◆ AdminConsole()

rtype::AdminConsole::AdminConsole ( ServerNetwork &  network,
std::function< void()>  stop 
)

Creates the commands.

Parameters
networkThe server's sockets and sessions; it must outlive the console.
stopWhat stop does, such as request_stop().

Member Function Documentation

◆ run()

aegis2d::core::CommandResult rtype::AdminConsole::run ( std::string_view  line)

Runs a line typed by the administrator.

Parameters
lineSuch as "close 1".
Returns
How it went, and the text to print.

The documentation for this class was generated from the following file: