15 #ifndef SERVER_GAME_HPP_INCLUDED
16 #define SERVER_GAME_HPP_INCLUDED
25 #include <boost/shared_ptr.hpp>
33 std::ostream&
operator<<(std::ostream& o,
const banned&
n);
39 bool operator()(
const banned_ptr&
a,
const banned_ptr&
b)
const;
43 bool operator()(
const banned_ptr&
a,
const banned_ptr&
b)
const;
45 bool less(
const banned_ptr& a,
const banned_ptr& b)
const;
50 typedef std::set<banned_ptr,banned_compare_subnet >
ban_set;
54 typedef std::pair<unsigned int, unsigned int>
ip_mask;
102 {
return group_ ==
group; }
104 bool match_ip(
const ip_mask& ip)
const;
135 {
return c >=
'0' && c <=
'9'; }
size_t to_digit(const char &c) const
std::list< banned_ptr > deleted_ban_list
unsigned int get_mask_ip(unsigned int) const
default_ban_times ban_times_
void list_deleted_bans(std::ostringstream &out, const std::string &mask="*") const
void load_config(const config &)
bool match_group(const std::string &group) const
std::string ban(const std::string &, const time_t &, const std::string &, const std::string &, const std::string &, const std::string &="")
std::string get_human_time_span() const
unsigned int mask() const
unsigned int get_int_ip() const
deleted_ban_list deleted_bans_
bool(banned_compare_subnet::* compare_fn)(const banned_ptr &a, const banned_ptr &b) const
std::string get_human_start_time() const
static std::string get_human_time(const time_t &)
std::set< banned_ptr, banned_compare_subnet > ban_set
bool match_ip(const ip_mask &ip) const
static compare_fn active_
std::string is_ip_banned(const std::string &ip) const
std::pair< unsigned int, unsigned int > ip_mask
GLdouble GLdouble GLdouble b
void read(const config &)
bool operator()(const banned_ptr &a, const banned_ptr &b) const
time_t get_end_time() const
bool parse_time(const std::string &duration, time_t *time) const
Parses the given duration and adds it to *time except if the duration is '0' or 'permanent' in which ...
void unban_group(std::ostringstream &os, const std::string &group)
boost::shared_ptr< banned > banned_ptr
bool less(const banned_ptr &a, const banned_ptr &b) const
std::string get_group() const
std::string get_human_end_time() const
We want to move the lowest value to the top.
GLboolean GLboolean GLboolean GLboolean a
ip_mask parse_ip(const std::string &ip)
banned(const std::string &ip)
bool match_ipmask(const ip_mask &ip) const
ban_time_queue time_queue_
static banned_ptr create_dummy(const std::string &ip)
std::string get_nick() const
void unban(std::ostringstream &os, const std::string &ip)
std::ostream & operator<<(std::ostream &o, const banned &n)
bool operator>(const banned &b) const
static const std::string who_banned_default_
void list_bans(std::ostringstream &out, const std::string &mask="*") const
std::priority_queue< banned_ptr, std::vector< banned_ptr >, banned_compare > ban_time_queue
const std::string & get_ban_help() const
void check_ban_times(time_t time_now)
Base class for all the errors encountered by the engine.
std::string get_who_banned() const
GLsizei GLenum GLuint GLuint GLsizei char * message
error(const std::string &message)
A config object defines a single node in a WML file, with access to child nodes.
GLsizei const GLcharARB ** string
std::map< std::string, size_t > default_ban_times
void write(config &) const
std::string get_reason() const
bool operator()(const banned_ptr &a, const banned_ptr &b) const
bool is_digit(const char &c) const
std::string get_ip() const