32 std::ostream&
operator<<(std::ostream& o,
const banned&
n);
52 typedef std::set<banned_ptr, banned_compare_subnet>
ban_set;
56 typedef std::pair<unsigned int, unsigned int>
ip_mask;
73 banned(
const std::string& ip,
const std::time_t end_time,
const std::string& reason,
const std::string& who_banned=
who_banned_default_,
const std::string& group=
"",
const std::string& nick=
"");
76 banned(
const std::string& ip);
104 {
return group_ == group; }
135 return c >=
'0' &&
c <=
'9';
163 bool parse_time(
const std::string& duration, std::time_t* time)
const;
165 std::string
ban(
const std::string&,
const std::time_t&,
const std::string&,
const std::string&,
const std::string&,
const std::string& =
"");
166 void unban(std::ostringstream& os,
const std::string& ip,
bool immediate_write=
true);
167 void unban_group(std::ostringstream& os,
const std::string& group);
169 void list_deleted_bans(std::ostringstream& out,
const std::string& mask =
"*")
const;
170 void list_bans(std::ostringstream& out,
const std::string& mask =
"*");
A config object defines a single node in a WML file, with access to child nodes.
std::string ban(const std::string &, const std::time_t &, const std::string &, const std::string &, const std::string &, const std::string &="")
bool parse_time(const std::string &duration, std::time_t *time) const
Parses the given duration and adds it to *time except if the duration is '0' or 'permanent' in which ...
void list_bans(std::ostringstream &out, const std::string &mask="*")
void unban(std::ostringstream &os, const std::string &ip, bool immediate_write=true)
default_ban_times ban_times_
void unban_group(std::ostringstream &os, const std::string &group)
bool is_digit(const char &c) const
std::size_t to_digit(const char &c) const
ban_time_queue time_queue_
const std::string & get_ban_help() const
void check_ban_times(std::time_t time_now)
std::string is_ip_banned(const std::string &ip)
deleted_ban_list deleted_bans_
void list_deleted_bans(std::ostringstream &out, const std::string &mask="*") const
void load_config(const config &)
banned(const std::string &ip, const std::time_t end_time, const std::string &reason, const std::string &who_banned=who_banned_default_, const std::string &group="", const std::string &nick="")
static std::string get_human_time(const std::time_t &)
bool match_ipmask(const ip_mask &ip) const
std::time_t get_end_time() const
std::string get_human_start_time() const
unsigned int get_mask_ip(unsigned int) const
std::string get_group() const
unsigned int get_int_ip() const
unsigned int mask() const
void read(const config &)
static const std::string who_banned_default_
std::string get_reason() const
std::string get_nick() const
bool operator>(const banned &b) const
void write(config &) const
std::string get_who_banned() const
bool match_ip(const ip_mask &ip) const
std::string get_human_end_time() const
bool match_group(const std::string &group) const
std::string get_human_time_span() const
std::string get_ip() const
std::ostream & operator<<(std::ostream &o, const banned &n)
std::set< banned_ptr, banned_compare_subnet > ban_set
std::priority_queue< banned_ptr, std::vector< banned_ptr >, banned_compare > ban_time_queue
std::list< banned_ptr > deleted_ban_list
std::shared_ptr< banned > banned_ptr
ip_mask parse_ip(const std::string &ip)
std::pair< unsigned int, unsigned int > ip_mask
std::map< std::string, std::size_t > default_ban_times
Base class for all the errors encountered by the engine.
error(const std::string &message)
bool operator()(const banned_ptr &a, const banned_ptr &b) const
static compare_fn active_
bool(banned_compare_subnet::* compare_fn)(const banned_ptr &a, const banned_ptr &b) const
bool less(const banned_ptr &a, const banned_ptr &b) const
We want to move the lowest value to the top.
bool operator()(const banned_ptr &a, const banned_ptr &b) const
static map_location::DIRECTION n