4#include <aegis2d/net/endpoint.hpp>
24 explicit BanList(std::filesystem::path file);
29 bool ban(
const aegis2d::net::Endpoint& address);
34 [[nodiscard]]
bool banned(
const aegis2d::net::Endpoint& address)
const;
38 [[nodiscard]]
const std::vector<aegis2d::net::Endpoint>&
addresses() const noexcept;
42 [[nodiscard]] const std::optional<std::
string>&
load_error() const noexcept;
48 std::filesystem::path file_;
49 std::vector<aegis2d::net::Endpoint> addresses_;
50 std::optional<std::
string> load_error_;
The IP addresses that cannot log in, kept in a JSON file.
Definition ban_list.hpp:20
bool ban(const aegis2d::net::Endpoint &address)
Bans an address, its port ignored.
bool banned(const aegis2d::net::Endpoint &address) const
Tells whether an address is banned, whatever its port.
const std::optional< std::string > & load_error() const noexcept
Why the file could not be read at start.
const std::vector< aegis2d::net::Endpoint > & addresses() const noexcept
The banned addresses, port 0.
BanList(std::filesystem::path file)
Reads the bans of a file.
R-Type game code, built on the Aegis2D engine.
Definition enemy_scripts.hpp:16