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

Modulewatch Class Reference

Inheritance diagram for Modulewatch:

Inheritance graph
[legend]
Collaboration diagram for Modulewatch:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Modulewatch (InspIRCd *Me)
virtual void OnRehash (User *user, const std::string &parameter)
 Called on rehash.
virtual int OnSetAway (User *user, const std::string &awaymsg)
 Called whenever a user sets away or returns from being away.
virtual void OnUserQuit (User *user, const std::string &reason, const std::string &oper_message)
 Called when a user quits.
virtual void OnGarbageCollect ()
 Called at intervals for modules to garbage-collect any hashes etc.
virtual void OnCleanup (int target_type, void *item)
 Called before your module is unloaded to clean up Extensibles.
virtual void OnPostConnect (User *user)
 Called after a user has fully connected and all modules have executed OnUserConnect This event is informational only.
virtual void OnUserPostNick (User *user, const std::string &oldnick)
 Called after any nickchange, local or remote.
virtual void On005Numeric (std::string &output)
 Called when a 005 numeric is about to be output.
virtual ~Modulewatch ()
virtual Version GetVersion ()
 Returns the version number of a Module.

Private Attributes

CommandWatchmycommand
CommandSVSWatchsw
unsigned int maxwatch

Detailed Description

Definition at line 373 of file m_watch.cpp.


Constructor & Destructor Documentation

Modulewatch::Modulewatch InspIRCd Me  )  [inline]
 

Definition at line 380 of file m_watch.cpp.

References InspIRCd::AddCommand(), ModuleManager::Attach(), I_On005Numeric, I_OnCleanup, I_OnGarbageCollect, I_OnPostConnect, I_OnRehash, I_OnSetAway, I_OnUserPostNick, I_OnUserQuit, maxwatch, InspIRCd::Modules, mycommand, OnRehash(), Module::ServerInstance, sw, and whos_watching_me.

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

Definition at line 559 of file m_watch.cpp.

References whos_watching_me.


Member Function Documentation

virtual Version Modulewatch::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 564 of file m_watch.cpp.

References API_VERSION, VF_COMMON, and VF_VENDOR.

virtual void Modulewatch::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 553 of file m_watch.cpp.

References ConvToStr(), and maxwatch.

virtual void Modulewatch::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 486 of file m_watch.cpp.

References Extensible::GetExt(), Extensible::Shrink(), and TYPE_USER.

virtual void Modulewatch::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 475 of file m_watch.cpp.

References whos_watching_me.

virtual void Modulewatch::OnPostConnect User user  )  [inline, virtual]
 

Called after a user has fully connected and all modules have executed OnUserConnect This event is informational only.

You should not change any user information in this event. To do so, use the OnUserConnect method to change the state of local users. This is called for both local and remote users.

Parameters:
user The user who is connecting

Reimplemented from Module.

Definition at line 501 of file m_watch.cpp.

References classbase::age, ConvToStr(), User::dhost, User::ident, User::nick, User::Visibility, VisData::VisibleTo(), and whos_watching_me.

virtual void Modulewatch::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 393 of file m_watch.cpp.

References Conf, maxwatch, ConfigReader::ReadInteger(), and Module::ServerInstance.

Referenced by Modulewatch().

virtual int Modulewatch::OnSetAway User user,
const std::string awaymsg
[inline, virtual]
 

Called whenever a user sets away or returns from being away.

The away message is available as a parameter, but should not be modified. At this stage, it has already been copied into the user record. If awaymsg is empty, the user is returning from away.

Parameters:
user The user setting away
awaymsg The away message of the user, or empty if returning from away
Returns:
nonzero if the away message should be blocked - should ONLY be nonzero for LOCAL users (IS_LOCAL) (no output is returned by core)

Reimplemented from Module.

Definition at line 401 of file m_watch.cpp.

References ConvToStr(), User::dhost, User::ident, User::nick, Module::ServerInstance, InspIRCd::Time(), User::Visibility, VisData::VisibleTo(), and whos_watching_me.

virtual void Modulewatch::OnUserPostNick User user,
const std::string oldnick
[inline, virtual]
 

Called after any nickchange, local or remote.

This can be used to track users after nickchanges have been applied. 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). Because this method is called after the nickchange is taken place, no return values are possible to indicate forbidding of the nick change. Use OnUserPreNick for this.

Parameters:
user The user changing their nick
oldnick The old nickname of the user before the nickchange

Reimplemented from Module.

Definition at line 519 of file m_watch.cpp.

References classbase::age, ConvToStr(), User::dhost, User::ident, User::nick, User::Visibility, VisData::VisibleTo(), and whos_watching_me.

virtual void Modulewatch::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 430 of file m_watch.cpp.

References User::dhost, Extensible::GetExt(), User::ident, User::nick, Module::ServerInstance, Extensible::Shrink(), InspIRCd::Time(), User::Visibility, VisData::VisibleTo(), and whos_watching_me.


Member Data Documentation

unsigned int Modulewatch::maxwatch [private]
 

Definition at line 377 of file m_watch.cpp.

Referenced by Modulewatch(), On005Numeric(), and OnRehash().

CommandWatch* Modulewatch::mycommand [private]
 

Definition at line 375 of file m_watch.cpp.

Referenced by Modulewatch().

CommandSVSWatch* Modulewatch::sw [private]
 

Definition at line 376 of file m_watch.cpp.

Referenced by Modulewatch().


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