Public Member Functions | Private Member Functions | Private Attributes

wesnothd::ban_manager Class Reference

#include <ban.hpp>

Collaboration diagram for wesnothd::ban_manager:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ban_manager ()
 ~ban_manager ()
void read ()
void write ()
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 case *time will be set to '0'.
std::string ban (const std::string &, const time_t &, const std::string &, const std::string &, const std::string &, const std::string &="")
void unban (std::ostringstream &os, const std::string &ip)
void unban_group (std::ostringstream &os, const std::string &group)
void check_ban_times (time_t time_now)
void list_deleted_bans (std::ostringstream &out, const std::string &mask="*") const
void list_bans (std::ostringstream &out, const std::string &mask="*") const
std::string is_ip_banned (const std::string &ip) const
const std::string & get_ban_help () const
void load_config (const config &)

Private Member Functions

bool is_digit (const char &c) const
size_t to_digit (const char &c) const
void init_ban_help ()

Private Attributes

ban_set bans_
deleted_ban_list deleted_bans_
ban_time_queue time_queue_
default_ban_times ban_times_
std::string ban_help_
std::string filename_
bool dirty_

Detailed Description

Definition at line 123 of file ban.hpp.


Constructor & Destructor Documentation

wesnothd::ban_manager::ban_manager (  ) 

Definition at line 698 of file ban.cpp.

References write().

Here is the call graph for this function:

wesnothd::ban_manager::~ban_manager (  ) 

Definition at line 693 of file ban.cpp.


Member Function Documentation

std::string wesnothd::ban_manager::ban ( const std::string &  ip,
const time_t &  end_time,
const std::string &  reason,
const std::string &  who_banned,
const std::string &  group,
const std::string &  nick = "" 
)

Definition at line 470 of file ban.cpp.

Referenced by server::ban_handler(), server::gban_handler(), server::kickban_handler(), and server::process_login().

Here is the caller graph for this function:

void wesnothd::ban_manager::check_ban_times ( time_t  time_now  ) 

Definition at line 540 of file ban.cpp.

Referenced by server::run().

Here is the caller graph for this function:

const std::string& wesnothd::ban_manager::get_ban_help (  )  const [inline]

Definition at line 167 of file ban.hpp.

References ban_help_.

Referenced by server::ban_handler(), server::gban_handler(), and server::kickban_handler().

Here is the caller graph for this function:

void wesnothd::ban_manager::init_ban_help (  )  [private]

Definition at line 649 of file ban.cpp.

bool wesnothd::ban_manager::is_digit ( const char &  c  )  const [inline, private]

Definition at line 134 of file ban.hpp.

std::string wesnothd::ban_manager::is_ip_banned ( const std::string &  ip  )  const

Definition at line 635 of file ban.cpp.

Referenced by server::is_ip_banned().

Here is the caller graph for this function:

void wesnothd::ban_manager::list_bans ( std::ostringstream &  out,
const std::string &  mask = "*" 
) const

Definition at line 592 of file ban.cpp.

Referenced by server::bans_handler().

Here is the caller graph for this function:

void wesnothd::ban_manager::list_deleted_bans ( std::ostringstream &  out,
const std::string &  mask = "*" 
) const

Definition at line 564 of file ban.cpp.

Referenced by server::bans_handler().

Here is the caller graph for this function:

void wesnothd::ban_manager::load_config ( const config cfg  ) 

Definition at line 676 of file ban.cpp.

Referenced by server::load_config().

Here is the caller graph for this function:

bool wesnothd::ban_manager::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 case *time will be set to '0'.

Returns:
false if an invalid time modifier is encountered. *time is undefined in that case.

Definition at line 315 of file ban.cpp.

Referenced by server::ban_handler(), server::gban_handler(), and server::kickban_handler().

Here is the caller graph for this function:

void wesnothd::ban_manager::read (  ) 

Definition at line 250 of file ban.cpp.

References wesnothd::banned::ip_, and wesnothd::banned::mask_.

Referenced by server::server().

Here is the caller graph for this function:

size_t wesnothd::ban_manager::to_digit ( const char &  c  )  const [inline, private]

Definition at line 136 of file ban.hpp.

void wesnothd::ban_manager::unban ( std::ostringstream &  os,
const std::string &  ip 
)

Definition at line 504 of file ban.cpp.

Referenced by server::unban_handler().

Here is the caller graph for this function:

void wesnothd::ban_manager::unban_group ( std::ostringstream &  os,
const std::string &  group 
)

Definition at line 529 of file ban.cpp.

Referenced by server::ungban_handler().

Here is the caller graph for this function:

void wesnothd::ban_manager::write (  ) 

Definition at line 289 of file ban.cpp.

Referenced by ban_manager().

Here is the caller graph for this function:


Member Data Documentation

std::string wesnothd::ban_manager::ban_help_ [private]

Definition at line 130 of file ban.hpp.

Referenced by get_ban_help().

Definition at line 129 of file ban.hpp.

Definition at line 126 of file ban.hpp.

Definition at line 127 of file ban.hpp.

Definition at line 132 of file ban.hpp.

std::string wesnothd::ban_manager::filename_ [private]

Definition at line 131 of file ban.hpp.

Definition at line 128 of file ban.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:26:43 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs