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

ModuleNickLock Class Reference

Inheritance diagram for ModuleNickLock:

Inheritance graph
[legend]
Collaboration diagram for ModuleNickLock:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ModuleNickLock (InspIRCd *Me)
virtual ~ModuleNickLock ()
virtual Version GetVersion ()
 Returns the version number of a Module.
virtual int OnUserPreNick (User *user, const std::string &newnick)
 Called before any nickchange, local or remote.
virtual void OnUserQuit (User *user, const std::string &reason, const std::string &oper_message)
 Called when a user quits.
virtual void OnCleanup (int target_type, void *item)
 Called before your module is unloaded to clean up Extensibles.

Private Attributes

CommandNicklockcmd1
CommandNickunlockcmd2
char * n

Detailed Description

Definition at line 104 of file m_nicklock.cpp.


Constructor & Destructor Documentation

ModuleNickLock::ModuleNickLock InspIRCd Me  )  [inline]
 

Definition at line 110 of file m_nicklock.cpp.

References InspIRCd::AddCommand(), ModuleManager::Attach(), cmd1, cmd2, I_OnCleanup, I_OnUserPreNick, I_OnUserQuit, InspIRCd::Modules, and Module::ServerInstance.

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

Definition at line 122 of file m_nicklock.cpp.


Member Function Documentation

virtual Version ModuleNickLock::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 126 of file m_nicklock.cpp.

References API_VERSION, VF_COMMON, and VF_VENDOR.

virtual void ModuleNickLock::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 150 of file m_nicklock.cpp.

References Extensible::Shrink(), and TYPE_USER.

virtual int ModuleNickLock::OnUserPreNick User user,
const std::string newnick
[inline, virtual]
 

Called before any nickchange, local or remote.

This can be used to implement Q-lines etc. Please note that although you can see remote nickchanges through this function, you should NOT make any changes to the User if the user is a remote user as this may cause a desnyc. check user->server before taking any action (including returning nonzero from the method). If your method returns nonzero, the nickchange is silently forbidden, and it is down to your module to generate some meaninful output.

Parameters:
user The username changing their nick
newnick Their new nickname
Returns:
1 to deny the change, 0 to allow

Reimplemented from Module.

Definition at line 132 of file m_nicklock.cpp.

References Extensible::GetExt(), n, User::nick, and User::WriteNumeric().

virtual void ModuleNickLock::OnUserQuit User user,
const std::string reason,
const std::string oper_message
[inline, virtual]
 

Called when a user quits.

The details of the exiting user are available to you in the parameter User *user This event is only called when the user is fully registered when they quit. To catch raw disconnections, use the OnUserDisconnect method.

Parameters:
user The user who is quitting
message The user's quit message (as seen by non-opers)
oper_message The user's quit message (as seen by opers)

Reimplemented from Module.

Definition at line 145 of file m_nicklock.cpp.

References Extensible::Shrink().


Member Data Documentation

CommandNicklock* ModuleNickLock::cmd1 [private]
 

Definition at line 106 of file m_nicklock.cpp.

Referenced by ModuleNickLock().

CommandNickunlock* ModuleNickLock::cmd2 [private]
 

Definition at line 107 of file m_nicklock.cpp.

Referenced by ModuleNickLock().

char* ModuleNickLock::n [private]
 

Definition at line 108 of file m_nicklock.cpp.

Referenced by OnUserPreNick().


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