The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

ModuleQuitBan Class Reference

Inheritance diagram for ModuleQuitBan:

Inheritance graph
[legend]
Collaboration diagram for ModuleQuitBan:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ModuleQuitBan (InspIRCd *Me)
virtual ~ModuleQuitBan ()
virtual Version GetVersion ()
 Returns the version number of a Module.
virtual void OnRehash (User *user, const std::string &parameter)
 Called on rehash.
virtual void OnUserConnect (User *u)
 Called when a user connects.
virtual void OnGarbageCollect ()
 Called at intervals for modules to garbage-collect any hashes etc.

Private Attributes

clonemap connects
unsigned int threshold
unsigned int banduration
unsigned int ipv4_cidr
unsigned int ipv6_cidr

Detailed Description

Definition at line 19 of file m_connectban.cpp.


Constructor & Destructor Documentation

ModuleQuitBan::ModuleQuitBan InspIRCd Me  )  [inline]
 

Definition at line 28 of file m_connectban.cpp.

References ModuleManager::Attach(), I_OnGarbageCollect, I_OnRehash, I_OnUserConnect, InspIRCd::Modules, OnRehash(), and Module::ServerInstance.

virtual ModuleQuitBan::~ModuleQuitBan  )  [inline, virtual]
 

Definition at line 35 of file m_connectban.cpp.


Member Function Documentation

virtual Version ModuleQuitBan::GetVersion  )  [inline, virtual]
 

Returns the version number of a Module.

The method should return a Version object with its version information assigned via Version::Version

Reimplemented from Module.

Definition at line 39 of file m_connectban.cpp.

References API_VERSION, and VF_VENDOR.

virtual void ModuleQuitBan::OnGarbageCollect  )  [inline, virtual]
 

Called at intervals for modules to garbage-collect any hashes etc.

Certain data types such as hash_map 'leak' buckets, which must be tidied up and freed by copying into a new item every so often. This method is called when it is time to do that.

Reimplemented from Module.

Definition at line 116 of file m_connectban.cpp.

References connects, DEBUG, LogManager::Log(), InspIRCd::Logs, and Module::ServerInstance.

virtual void ModuleQuitBan::OnRehash User user,
const std::string parameter
[inline, virtual]
 

Called on rehash.

This method is called prior to a /REHASH or when a SIGHUP is received from the operating system. You should use it to reload any files so that your module keeps in step with the rest of the application. If a parameter is given, the core has done nothing. The module receiving the event can decide if this parameter has any relevence to it.

Parameters:
user The user performing the rehash, if any -- if this is server initiated, the value of this variable will be NULL.
parameter The (optional) parameter given to REHASH from the user.

Reimplemented from Module.

Definition at line 44 of file m_connectban.cpp.

References banduration, Conf, InspIRCd::Duration(), ipv4_cidr, ipv6_cidr, ConfigReader::ReadInteger(), ConfigReader::ReadValue(), Module::ServerInstance, and threshold.

Referenced by ModuleQuitBan().

virtual void ModuleQuitBan::OnUserConnect User u  )  [inline, virtual]
 

Called when a user connects.

The details of the connecting user are available to you in the parameter User *user

Parameters:
user The user who is connecting

Reimplemented from Module.

Definition at line 70 of file m_connectban.cpp.

References XLineManager::AddLine(), XLineManager::ApplyLines(), banduration, InspIRCd::Config, connects, User::GetCIDRMask(), User::GetProtocolFamily(), ipv4_cidr, ipv6_cidr, Module::ServerInstance, ServerConfig::ServerName, InspIRCd::SNO, threshold, InspIRCd::Time(), SnomaskManager::WriteToSnoMask(), and InspIRCd::XLines.


Member Data Documentation

unsigned int ModuleQuitBan::banduration [private]
 

Definition at line 24 of file m_connectban.cpp.

Referenced by OnRehash(), and OnUserConnect().

clonemap ModuleQuitBan::connects [private]
 

Definition at line 22 of file m_connectban.cpp.

Referenced by OnGarbageCollect(), and OnUserConnect().

unsigned int ModuleQuitBan::ipv4_cidr [private]
 

Definition at line 25 of file m_connectban.cpp.

Referenced by OnRehash(), and OnUserConnect().

unsigned int ModuleQuitBan::ipv6_cidr [private]
 

Definition at line 26 of file m_connectban.cpp.

Referenced by OnRehash(), and OnUserConnect().

unsigned int ModuleQuitBan::threshold [private]
 

Definition at line 23 of file m_connectban.cpp.

Referenced by OnRehash(), and OnUserConnect().


The documentation for this class was generated from the following file: