R-Type
Networked shoot'em up built on Aegis2D
Loading...
Searching...
No Matches
admin_console.hpp
Go to the documentation of this file.
1
3#pragma once
4#include <aegis2d/core/commands.hpp>
5
7
8#include <functional>
9#include <istream>
10#include <memory>
11#include <string>
12#include <string_view>
13#include <vector>
14
15namespace rtype {
16
33public:
37 AdminConsole(ServerNetwork& network, std::function<void()> stop);
38
42 aegis2d::core::CommandResult run(std::string_view line);
43
44private:
45 ServerNetwork* network_;
46 std::function<void()> stop_;
47 aegis2d::core::Commands commands_;
48};
49
56public:
59 explicit ConsoleInput(std::istream& input);
60
63 [[nodiscard]] std::vector<std::string> take();
64
67 [[nodiscard]] bool ended() const;
68
69private:
70 struct Shared;
71 std::shared_ptr<Shared> shared_;
72};
73
74} // namespace rtype
The commands of the server's administrator, on the engine's command system.
Definition admin_console.hpp:32
aegis2d::core::CommandResult run(std::string_view line)
Runs a line typed by the administrator.
AdminConsole(ServerNetwork &network, std::function< void()> stop)
Creates the commands.
The lines typed on a stream, read on a thread of their own, for the network thread to take between tw...
Definition admin_console.hpp:55
bool ended() const
Tells whether the stream ended.
ConsoleInput(std::istream &input)
Starts reading.
std::vector< std::string > take()
The lines read since the last call.
The two ports the server listens on, and the TCP side of the sessions.
Definition server_network.hpp:81
R-Type game code, built on the Aegis2D engine.
Definition enemy_scripts.hpp:16
Sockets of the R-Type server: the TCP port of the logins and the UDP port of the game.