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

ModuleAntiBear Class Reference

Inheritance diagram for ModuleAntiBear:

Inheritance graph
[legend]
Collaboration diagram for ModuleAntiBear:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ModuleAntiBear (InspIRCd *Me)
virtual ~ModuleAntiBear ()
virtual Version GetVersion ()
 Returns the version number of a Module.
virtual int OnPreCommand (std::string &command, std::vector< std::string > &parameters, User *user, bool validated, const std::string &original_line)
 Called whenever any command is about to be executed.
virtual int OnUserRegister (User *user)
 Called whenever a user is about to register their connection (e.g.

Detailed Description

Definition at line 19 of file m_antibear.cpp.


Constructor & Destructor Documentation

ModuleAntiBear::ModuleAntiBear InspIRCd Me  )  [inline]
 

Definition at line 24 of file m_antibear.cpp.

References ModuleManager::Attach(), I_OnPreCommand, I_OnUserRegister, InspIRCd::Modules, and Module::ServerInstance.

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

Definition at line 31 of file m_antibear.cpp.


Member Function Documentation

virtual Version ModuleAntiBear::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 35 of file m_antibear.cpp.

References API_VERSION, and VF_VENDOR.

virtual int ModuleAntiBear::OnPreCommand std::string command,
std::vector< std::string > &  parameters,
User user,
bool  validated,
const std::string original_line
[inline, virtual]
 

Called whenever any command is about to be executed.

This event occurs for all registered commands, wether they are registered in the core, or another module, and for invalid commands. Invalid commands may only be sent to this function when the value of validated is false. By returning 1 from this method you may prevent the command being executed. If you do this, no output is created by the core, and it is down to your module to produce any output neccessary. Note that unless you return 1, you should not destroy any structures (e.g. by using InspIRCd::QuitUser) otherwise when the command's handler function executes after your method returns, it will be passed an invalid pointer to the user object and crash!)

Parameters:
command The command being executed
parameters An array of array of characters containing the parameters for the command
pcnt The nuimber of parameters passed to the command
user the user issuing the command
validated True if the command has passed all checks, e.g. it is recognised, has enough parameters, the user has permission to execute it, etc. You should only change the parameter list and command string if validated == false (e.g. before the command lookup occurs).
original_line The entire original line as passed to the parser from the user
Returns:
1 to block the command, 0 to allow

Reimplemented from Module.

Definition at line 40 of file m_antibear.cpp.

References XLineManager::AddLine(), XLineManager::ApplyLines(), InspIRCd::Config, Extensible::GetExt(), User::GetIPString(), Module::ServerInstance, ServerConfig::ServerName, Extensible::Shrink(), InspIRCd::Time(), and InspIRCd::XLines.

virtual int ModuleAntiBear::OnUserRegister User user  )  [inline, virtual]
 

Called whenever a user is about to register their connection (e.g.

before the user is sent the MOTD etc). Modules can use this method if they are performing a function which must be done before the actual connection is completed (e.g. ident lookups, dnsbl lookups, etc). Note that you should NOT delete the user record here by causing a disconnection! Use OnUserConnect for that instead.

Parameters:
user The user registering
Returns:
1 to indicate user quit, 0 to continue

Reimplemented from Module.

Definition at line 66 of file m_antibear.cpp.

References Extensible::Extend(), User::nick, User::WriteNumeric(), and User::WriteServ().


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