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

ModuleFoobar Class Reference

Inheritance diagram for ModuleFoobar:

Inheritance graph
[legend]
Collaboration diagram for ModuleFoobar:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ModuleFoobar (InspIRCd *Me)
virtual ~ModuleFoobar ()
virtual Version GetVersion ()
 Returns the version number of a Module.
virtual void OnUserConnect (User *user)
 Called when a user connects.
virtual void OnUserQuit (User *user, const std::string &reason, const std::string &oper_message)
 Called when a user quits.
virtual void OnUserJoin (User *user, Channel *channel, bool sync, bool &silent)
 Called when a user joins a channel.
virtual void OnUserPart (User *user, Channel *channel, const std::string &partreason, bool &silent)
 Called when a user parts a channel.
virtual int OnUserPreJoin (User *user, Channel *chan, const char *cname, std::string &privs, const std::string &keygiven)
 Called whenever a user is about to join a channel, before any processing is done.

Detailed Description

Definition at line 21 of file m_foobar.cpp.


Constructor & Destructor Documentation

ModuleFoobar::ModuleFoobar InspIRCd Me  )  [inline]
 

Definition at line 32 of file m_foobar.cpp.

References ModuleManager::Attach(), I_OnUserConnect, I_OnUserJoin, I_OnUserPart, I_OnUserPreJoin, I_OnUserQuit, InspIRCd::Modules, and Module::ServerInstance.

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

Definition at line 42 of file m_foobar.cpp.


Member Function Documentation

virtual Version ModuleFoobar::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 46 of file m_foobar.cpp.

References API_VERSION, and VF_VENDOR.

virtual void ModuleFoobar::OnUserConnect User user  )  [inline, virtual]
 

Called when a user connects.

The details of the connecting user are available to you in the parameter User *user

Parameters:
user The user who is connecting

Reimplemented from Module.

Definition at line 55 of file m_foobar.cpp.

References DEBUG, LogManager::Log(), InspIRCd::Logs, User::nick, and Module::ServerInstance.

virtual void ModuleFoobar::OnUserJoin User user,
Channel channel,
bool  sync,
bool &  silent
[inline, virtual]
 

Called when a user joins a channel.

The details of the joining user are available to you in the parameter User *user, and the details of the channel they have joined is available in the variable Channel *channel

Parameters:
user The user who is joining
channel The channel being joined
silent Change this to true if you want to conceal the JOIN command from the other users of the channel (useful for modules such as auditorium)
sync This is set to true if the JOIN is the result of a network sync and the remote user is being introduced to a channel due to the network sync.

Reimplemented from Module.

Definition at line 71 of file m_foobar.cpp.

References DEBUG, LogManager::Log(), InspIRCd::Logs, Channel::name, User::nick, and Module::ServerInstance.

virtual void ModuleFoobar::OnUserPart User user,
Channel channel,
const std::string partreason,
bool &  silent
[inline, virtual]
 

Called when a user parts a channel.

The details of the leaving user are available to you in the parameter User *user, and the details of the channel they have left is available in the variable Channel *channel

Parameters:
user The user who is parting
channel The channel being parted
partmessage The part message, or an empty string
silent Change this to true if you want to conceal the PART command from the other users of the channel (useful for modules such as auditorium)

Reimplemented from Module.

Definition at line 80 of file m_foobar.cpp.

References DEBUG, LogManager::Log(), InspIRCd::Logs, Channel::name, User::nick, and Module::ServerInstance.

virtual int ModuleFoobar::OnUserPreJoin User user,
Channel chan,
const char *  cname,
std::string privs,
const std::string keygiven
[inline, virtual]
 

Called whenever a user is about to join a channel, before any processing is done.

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. This is useful for modules which may want to mimic +b, +k, +l etc. Returning -1 from this function forces the join to be allowed, bypassing restrictions such as banlists, invite, keys etc.

IMPORTANT NOTE!

If the user joins a NEW channel which does not exist yet, OnUserPreJoin will be called BEFORE the channel record is created. This will cause Channel* chan to be NULL. There is very little you can do in form of processing on the actual channel record at this point, however the channel NAME will still be passed in char* cname, so that you could for example implement a channel blacklist or whitelist, etc.

Parameters:
user The user joining the channel
chan If the channel is a new channel, this will be NULL, otherwise it will be a pointer to the channel being joined
cname The channel name being joined. For new channels this is valid where chan is not.
privs A string containing the users privilages when joining the channel. For new channels this will contain "@". You may alter this string to alter the user's modes on the channel.
keygiven The key given to join the channel, or an empty string if none was provided
Returns:
1 To prevent the join, 0 to allow it.

Reimplemented from Module.

Definition at line 89 of file m_foobar.cpp.

virtual void ModuleFoobar::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 63 of file m_foobar.cpp.

References DEBUG, LogManager::Log(), InspIRCd::Logs, User::nick, and Module::ServerInstance.


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