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

ModuleBanException Class Reference

Inheritance diagram for ModuleBanException:

Inheritance graph
[legend]
Collaboration diagram for ModuleBanException:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ModuleBanException (InspIRCd *Me)
virtual void On005Numeric (std::string &output)
 Called when a 005 numeric is about to be output.
virtual int OnCheckExtBan (User *user, Channel *chan, char type)
virtual int OnCheckStringExtBan (const std::string &str, Channel *chan, char type)
 Called whenever checking whether or not a string is extbanned.
virtual int OnCheckBan (User *user, Channel *chan)
 Called whenever a user joins a channel, to determine if banlist checks should go ahead or not.
virtual void OnCleanup (int target_type, void *item)
 Called before your module is unloaded to clean up Extensibles.
virtual void OnSyncChannel (Channel *chan, Module *proto, void *opaque)
 Allows modules to synchronize data which relates to channels during a netburst.
virtual void OnChannelDelete (Channel *chan)
 Called whenever a channel is deleted, either by QUIT, KICK or PART.
virtual void OnRehash (User *user, const std::string &param)
 Called on rehash.
virtual const char * OnRequest (Request *request)
 Called whenever a Request class is sent to your module by another module.
virtual Version GetVersion ()
 Returns the version number of a Module.
virtual ~ModuleBanException ()

Private Attributes

BanExceptionbe

Detailed Description

Definition at line 38 of file m_banexception.cpp.


Constructor & Destructor Documentation

ModuleBanException::ModuleBanException InspIRCd Me  )  [inline]
 

Definition at line 44 of file m_banexception.cpp.

References ModeParser::AddMode(), ModuleManager::Attach(), be, ListModeBase::DoImplements(), I_On005Numeric, I_OnCheckBan, I_OnCheckExtBan, I_OnCheckStringExtBan, I_OnRehash, I_OnRequest, InspIRCd::Modes, InspIRCd::Modules, ModuleManager::PublishInterface(), and Module::ServerInstance.

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

Definition at line 170 of file m_banexception.cpp.

References be, ModeParser::DelMode(), InspIRCd::Modes, InspIRCd::Modules, Module::ServerInstance, and ModuleManager::UnpublishInterface().


Member Function Documentation

virtual Version ModuleBanException::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 165 of file m_banexception.cpp.

References API_VERSION, VF_COMMON, and VF_VENDOR.

virtual void ModuleBanException::On005Numeric std::string output  )  [inline, virtual]
 

Called when a 005 numeric is about to be output.

The module should modify the 005 numeric if needed to indicate its features.

Parameters:
output The 005 string to be modified if neccessary.

Reimplemented from Module.

Definition at line 57 of file m_banexception.cpp.

virtual void ModuleBanException::OnChannelDelete Channel chan  )  [inline, virtual]
 

Called whenever a channel is deleted, either by QUIT, KICK or PART.

Parameters:
chan The channel being deleted

Reimplemented from Module.

Definition at line 150 of file m_banexception.cpp.

References be, and ListModeBase::DoChannelDelete().

virtual int ModuleBanException::OnCheckBan User user,
Channel chan
[inline, virtual]
 

Called whenever a user joins a channel, to determine if banlist checks should go ahead or not.

This method will always be called for each join, wether or not the user actually matches a channel ban, and determines the outcome of an if statement around the whole section of ban checking code. return 1 to explicitly allow the join to go ahead or 0 to ignore the event.

Parameters:
user The user joining the channel
chan The channel being joined
Returns:
1 to explicitly allow the join, 0 to proceed as normal. Return -1 to explicitly deny the join to the channel.

Reimplemented from Module.

Definition at line 114 of file m_banexception.cpp.

References be, Extensible::GetExt(), User::GetFullHost(), User::GetFullRealHost(), ListModeBase::GetInfoKey(), User::GetIPString(), User::ident, InspIRCd::Match(), InspIRCd::MatchCIDR(), and User::nick.

virtual int ModuleBanException::OnCheckExtBan User user,
Channel chan,
char  type
[inline, virtual]
 

Reimplemented from Module.

Definition at line 62 of file m_banexception.cpp.

References be, Extensible::GetExt(), User::GetFullHost(), User::GetFullRealHost(), ListModeBase::GetInfoKey(), User::GetIPString(), User::ident, InspIRCd::Match(), InspIRCd::MatchCIDR(), and User::nick.

virtual int ModuleBanException::OnCheckStringExtBan const std::string str,
Channel chan,
char  type
[inline, virtual]
 

Called whenever checking whether or not a string is extbanned.

NOTE: one OnCheckExtBan will also trigger a number of OnCheckStringExtBan events for seperate host/IP comnbinations.

Reimplemented from Module.

Definition at line 91 of file m_banexception.cpp.

References be, Extensible::GetExt(), ListModeBase::GetInfoKey(), and InspIRCd::Match().

virtual void ModuleBanException::OnCleanup int  target_type,
void *  item
[inline, virtual]
 

Called before your module is unloaded to clean up Extensibles.

This method is called once for every user and channel on the network, so that when your module unloads it may clear up any remaining data in the form of Extensibles added using Extensible::Extend(). If the target_type variable is TYPE_USER, then void* item refers to a User*, otherwise it refers to a Channel*.

Parameters:
target_type The type of item being cleaned
item A pointer to the item's class

Reimplemented from Module.

Definition at line 140 of file m_banexception.cpp.

References be, and ListModeBase::DoCleanup().

virtual void ModuleBanException::OnRehash User user,
const std::string param
[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 155 of file m_banexception.cpp.

References be, and ListModeBase::DoRehash().

virtual const char* ModuleBanException::OnRequest Request request  )  [inline, virtual]
 

Called whenever a Request class is sent to your module by another module.

Please see the documentation of Request::Send() for further information. The Request sent can always be assumed to be non-NULL, you should not change the request object or its data. Your method may return arbitary data in the char* result which the requesting module may be able to use for pre-determined purposes (e.g. the results of an SQL query, etc).

Parameters:
request The Request class being received

Reimplemented from Module.

Definition at line 160 of file m_banexception.cpp.

References be, and ListModeBase::DoOnRequest().

virtual void ModuleBanException::OnSyncChannel Channel chan,
Module proto,
void *  opaque
[inline, virtual]
 

Allows modules to synchronize data which relates to channels during a netburst.

When this function is called, it will be called from the module which implements the linking protocol. This currently is m_spanningtree.so. A pointer to this module is given in Module* proto, so that you may call its methods such as ProtoSendMode (see below). This function will be called for every user visible on your side of the burst, allowing you to for example set modes, etc. Do not use this call to synchronize data which you have stored using class Extensible -- There is a specialist function OnSyncUserMetaData and OnSyncChannelMetaData for this!

For a good example of how to use this function, please see src/modules/m_chanprotect.cpp

Parameters:
chan The channel being syncronized
proto A pointer to the module handling network protocol
opaque An opaque pointer set by the protocol module, should not be modified!

Reimplemented from Module.

Definition at line 145 of file m_banexception.cpp.

References be, and ListModeBase::DoSyncChannel().


Member Data Documentation

BanException* ModuleBanException::be [private]
 

Definition at line 40 of file m_banexception.cpp.

Referenced by ModuleBanException(), OnChannelDelete(), OnCheckBan(), OnCheckExtBan(), OnCheckStringExtBan(), OnCleanup(), OnRehash(), OnRequest(), OnSyncChannel(), and ~ModuleBanException().


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