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

ModuleServProtectMode Class Reference

Inheritance diagram for ModuleServProtectMode:

Inheritance graph
[legend]
Collaboration diagram for ModuleServProtectMode:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ModuleServProtectMode (InspIRCd *Me)
virtual ~ModuleServProtectMode ()
virtual Version GetVersion ()
 Returns the version number of a Module.
virtual void OnWhois (User *src, User *dst)
 Called whenever a /WHOIS is performed on a local user.
virtual int OnRawMode (User *user, Channel *chan, const char mode, const std::string &param, bool adding, int pcnt, bool servermode)
 Called whenever a mode character is processed.
virtual int OnKill (User *src, User *dst, const std::string &reason)
 Called when a client is disconnected by KILL.
virtual int OnUserPreKick (User *src, User *dst, Channel *c, const std::string &reason)
 Called whenever a user is about to be kicked.
virtual int OnWhoisLine (User *src, User *dst, int &numeric, std::string &text)
 Called whenever a line of WHOIS output is sent to a user.

Private Attributes

ServProtectModebm

Detailed Description

Definition at line 41 of file m_servprotect.cpp.


Constructor & Destructor Documentation

ModuleServProtectMode::ModuleServProtectMode InspIRCd Me  )  [inline]
 

Definition at line 46 of file m_servprotect.cpp.

References ModeParser::AddMode(), ModuleManager::Attach(), bm, I_OnKill, I_OnRawMode, I_OnUserPreKick, I_OnWhois, I_OnWhoisLine, InspIRCd::Modes, InspIRCd::Modules, and Module::ServerInstance.

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

Definition at line 58 of file m_servprotect.cpp.

References bm, ModeParser::DelMode(), InspIRCd::Modes, and Module::ServerInstance.


Member Function Documentation

virtual Version ModuleServProtectMode::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 64 of file m_servprotect.cpp.

References API_VERSION, and VF_COMMON.

virtual int ModuleServProtectMode::OnKill User src,
User dst,
const std::string reason
[inline, virtual]
 

Called when a client is disconnected by KILL.

If a client is killed by a server, e.g. a nickname collision or protocol error, source is NULL. Return 1 from this function to prevent the kill, and 0 from this function to allow it as normal. If you prevent the kill no output will be sent to the client, it is down to your module to generate this information. NOTE: It is NOT advisable to stop kills which originate from servers or remote users. If you do so youre risking race conditions, desyncs and worse!

Parameters:
source The user sending the KILL
dest The user being killed
reason The kill reason
Returns:
1 to prevent the kill, 0 to allow

Reimplemented from Module.

Definition at line 105 of file m_servprotect.cpp.

References InspIRCd::Config, User::IsModeSet(), ServerConfig::Network, User::nick, Module::ServerInstance, InspIRCd::SNO, User::WriteNumeric(), and SnomaskManager::WriteToSnoMask().

virtual int ModuleServProtectMode::OnRawMode User user,
Channel chan,
const char  mode,
const std::string param,
bool  adding,
int  pcnt,
bool  servermode
[inline, virtual]
 

Called whenever a mode character is processed.

Return 1 from this function to block the mode character from being processed entirely.

Parameters:
user The user who is sending the mode
chan The channel the mode is being sent to (or NULL if a usermode)
mode The mode character being set
param The parameter for the mode or an empty string
adding true of the mode is being added, false if it is being removed
pcnt The parameter count for the mode (0 or 1)
Returns:
ACR_DENY to deny the mode, ACR_DEFAULT to do standard mode checking, and ACR_ALLOW to skip all permission checking. Please note that for remote mode changes, your return value will be ignored!

Reimplemented from Module.

Definition at line 77 of file m_servprotect.cpp.

References ACR_DENY, InspIRCd::Config, InspIRCd::FindNick(), IS_LOCAL, User::IsModeSet(), InspIRCd::Modes, ModeParser::ModeString(), Channel::name, ServerConfig::Network, User::nick, User::server, Module::ServerInstance, InspIRCd::ULine(), and User::WriteNumeric().

virtual int ModuleServProtectMode::OnUserPreKick User src,
User dst,
Channel c,
const std::string reason
[inline, virtual]
 

Called whenever a user is about to be kicked.

Returning a value of 1 from this function stops the process immediately, causing no output to be sent to the user by the core. If you do this you must produce your own numerics, notices etc.

Parameters:
source The user issuing the kick
user The user being kicked
chan The channel the user is being kicked from
reason The kick reason
Returns:
1 to prevent the kick, 0 to continue normally, -1 to explicitly allow the kick regardless of normal operation

Reimplemented from Module.

Definition at line 119 of file m_servprotect.cpp.

References User::IsModeSet(), Channel::name, User::nick, and User::WriteNumeric().

virtual void ModuleServProtectMode::OnWhois User src,
User dst
[inline, virtual]
 

Called whenever a /WHOIS is performed on a local user.

The source parameter contains the details of the user who issued the WHOIS command, and the dest parameter contains the information of the user they are whoising.

Parameters:
source The user issuing the WHOIS command
dest The user who is being WHOISed

Reimplemented from Module.

Definition at line 69 of file m_servprotect.cpp.

References InspIRCd::Config, User::IsModeSet(), ServerConfig::Network, User::nick, InspIRCd::SendWhoisLine(), and Module::ServerInstance.

virtual int ModuleServProtectMode::OnWhoisLine User src,
User dst,
int &  numeric,
std::string text
[inline, virtual]
 

Called whenever a line of WHOIS output is sent to a user.

You may change the numeric and the text of the output by changing the values numeric and text, but you cannot change the user the numeric is sent to. You may however change the user's User values.

Parameters:
user The user the numeric is being sent to
dest The user being WHOISed
numeric The numeric of the line being sent
text The text of the numeric, including any parameters
Returns:
nonzero to drop the line completely so that the user does not receive it, or zero to allow the line to be sent.

Reimplemented from Module.

Definition at line 130 of file m_servprotect.cpp.

References User::IsModeSet().


Member Data Documentation

ServProtectMode* ModuleServProtectMode::bm [private]
 

Definition at line 44 of file m_servprotect.cpp.

Referenced by ModuleServProtectMode(), and ~ModuleServProtectMode().


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