Anope IRC Services  Version 2.0
Public Member Functions | Private Member Functions | Private Attributes
MChanstats Class Reference
Inheritance diagram for MChanstats:
Inheritance graph
[legend]
Collaboration diagram for MChanstats:
Collaboration graph
[legend]

Public Member Functions

 MChanstats (const Anope::string &modname, const Anope::string &creator)
 
void OnReload (Configuration::Conf *conf) anope_override
 
void OnChanInfo (CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_all) anope_override
 
void OnNickInfo (CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) anope_override
 
void OnTopicUpdated (Channel *c, const Anope::string &user, const Anope::string &topic) anope_override
 
EventReturn OnChannelModeSet (Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string &param) anope_override
 
EventReturn OnChannelModeUnset (Channel *c, MessageSource &setter, ChannelMode *, const Anope::string &param) anope_override
 
void OnPreUserKicked (const MessageSource &source, ChanUserContainer *cu, const Anope::string &kickmsg) anope_override
 
void OnPrivmsg (User *u, Channel *c, Anope::string &msg) anope_override
 
void OnDelCore (NickCore *nc) anope_override
 
void OnChangeCoreDisplay (NickCore *nc, const Anope::string &newdisplay) anope_override
 
void OnDelChan (ChannelInfo *ci) anope_override
 
void OnChanRegistered (ChannelInfo *ci)
 
void OnNickRegister (User *user, NickAlias *na, const Anope::string &)
 
- Public Member Functions inherited from Module
 Module (const Anope::string &modname, const Anope::string &loadernick, ModType type=THIRD)
 
virtual ~Module ()
 
void SetPermanent (bool state)
 
bool GetPermanent () const
 
void SetVersion (const Anope::string &version)
 
void SetAuthor (const Anope::string &author)
 
ModuleVersion GetVersion () const
 
virtual void OnUserKicked (const MessageSource &source, User *target, const Anope::string &channel, ChannelStatus &status, const Anope::string &kickmsg)
 
virtual EventReturn OnPreBotAssign (User *sender, ChannelInfo *ci, BotInfo *bi)
 
virtual void OnBotAssign (User *sender, ChannelInfo *ci, BotInfo *bi)
 
virtual EventReturn OnBotUnAssign (User *sender, ChannelInfo *ci)
 
virtual void OnUserConnect (User *u, bool &exempt)
 
virtual void OnNewServer (Server *s)
 
virtual void OnUserNickChange (User *u, const Anope::string &oldnick)
 
virtual EventReturn OnPreHelp (CommandSource &source, const std::vector< Anope::string > &params)
 
virtual void OnPostHelp (CommandSource &source, const std::vector< Anope::string > &params)
 
virtual EventReturn OnPreCommand (CommandSource &source, Command *command, std::vector< Anope::string > &params)
 
virtual void OnPostCommand (CommandSource &source, Command *command, const std::vector< Anope::string > &params)
 
virtual void OnSaveDatabase ()
 
virtual EventReturn OnLoadDatabase ()
 
virtual EventReturn OnEncrypt (const Anope::string &src, Anope::string &dest)
 
virtual EventReturn OnDecrypt (const Anope::string &hashm, const Anope::string &src, Anope::string &dest)
 
virtual EventReturn OnBotFantasy (CommandSource &source, Command *c, ChannelInfo *ci, const std::vector< Anope::string > &params)
 
virtual EventReturn OnBotNoFantasyAccess (CommandSource &source, Command *c, ChannelInfo *ci, const std::vector< Anope::string > &params)
 
virtual void OnBotBan (User *u, ChannelInfo *ci, const Anope::string &mask)
 
virtual void OnBadWordAdd (ChannelInfo *ci, const BadWord *bw)
 
virtual void OnBadWordDel (ChannelInfo *ci, const BadWord *bw)
 
virtual void OnCreateBot (BotInfo *bi)
 
virtual void OnDelBot (BotInfo *bi)
 
virtual EventReturn OnBotKick (BotInfo *bi, Channel *c, User *u, const Anope::string &reason)
 
virtual void OnPrePartChannel (User *u, Channel *c)
 
virtual void OnPartChannel (User *u, Channel *c, const Anope::string &channel, const Anope::string &msg)
 
virtual void OnLeaveChannel (User *u, Channel *c)
 
virtual void OnJoinChannel (User *u, Channel *c)
 
virtual void OnPreChanExpire (ChannelInfo *ci, bool &expire)
 
virtual void OnChanExpire (ChannelInfo *ci)
 
virtual void OnPreServerConnect ()
 
virtual void OnServerConnect ()
 
virtual void OnPreUplinkSync (Server *serv)
 
virtual void OnServerDisconnect ()
 
virtual void OnRestart ()
 
virtual void OnShutdown ()
 
virtual void OnPreNickExpire (NickAlias *na, bool &expire)
 
virtual void OnNickExpire (NickAlias *na)
 
virtual void OnDefconLevel (int level)
 
virtual EventReturn OnExceptionAdd (Exception *ex)
 
virtual void OnExceptionDel (CommandSource &source, Exception *ex)
 
virtual EventReturn OnAddXLine (CommandSource &source, const XLine *x, XLineManager *xlm)
 
virtual void OnDelXLine (CommandSource &source, const XLine *x, XLineManager *xlm)
 
virtual EventReturn IsServicesOper (User *u)
 
virtual void OnServerQuit (Server *server)
 
virtual void OnUserQuit (User *u, const Anope::string &msg)
 
virtual void OnPreUserLogoff (User *u)
 
virtual void OnPostUserLogoff (User *u)
 
virtual void OnBotCreate (BotInfo *bi)
 
virtual void OnBotChange (BotInfo *bi)
 
virtual void OnBotDelete (BotInfo *bi)
 
virtual void OnAccessDel (ChannelInfo *ci, CommandSource &source, ChanAccess *access)
 
virtual void OnAccessAdd (ChannelInfo *ci, CommandSource &source, ChanAccess *access)
 
virtual void OnAccessClear (ChannelInfo *ci, CommandSource &source)
 
virtual void OnLevelChange (CommandSource &source, ChannelInfo *ci, const Anope::string &priv, int16_t what)
 
virtual EventReturn OnChanDrop (CommandSource &source, ChannelInfo *ci)
 
virtual void OnChanSuspend (ChannelInfo *ci)
 
virtual void OnChanUnsuspend (ChannelInfo *ci)
 
virtual void OnCreateChan (ChannelInfo *ci)
 
virtual void OnChannelCreate (Channel *c)
 
virtual void OnChannelDelete (Channel *c)
 
virtual void OnAkickAdd (CommandSource &source, ChannelInfo *ci, const AutoKick *ak)
 
virtual void OnAkickDel (CommandSource &source, ChannelInfo *ci, const AutoKick *ak)
 
virtual EventReturn OnCheckKick (User *u, Channel *c, Anope::string &mask, Anope::string &reason)
 
virtual EventReturn OnCheckPriv (const ChanAccess *access, const Anope::string &priv)
 
virtual EventReturn OnGroupCheckPriv (const AccessGroup *group, const Anope::string &priv)
 
virtual void OnNickDrop (CommandSource &source, NickAlias *na)
 
virtual void OnNickGroup (User *u, NickAlias *target)
 
virtual void OnNickIdentify (User *u)
 
virtual void OnUserLogin (User *u)
 
virtual void OnNickLogout (User *u)
 
virtual void OnNickSuspend (NickAlias *na)
 
virtual void OnNickUnsuspended (NickAlias *na)
 
virtual void OnDelNick (NickAlias *na)
 
virtual void OnNickCoreCreate (NickCore *nc)
 
virtual void OnNickClearAccess (NickCore *nc)
 
virtual void OnNickAddAccess (NickCore *nc, const Anope::string &entry)
 
virtual void OnNickEraseAccess (NickCore *nc, const Anope::string &entry)
 
virtual void OnNickClearCert (NickCore *nc)
 
virtual void OnNickAddCert (NickCore *nc, const Anope::string &entry)
 
virtual void OnNickEraseCert (NickCore *nc, const Anope::string &entry)
 
virtual void OnBotInfo (CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info)
 
virtual void OnCheckAuthentication (User *u, IdentifyRequest *req)
 
virtual void OnNickUpdate (User *u)
 
virtual void OnFingerprint (User *u)
 
virtual void OnUserAway (User *u, const Anope::string &message)
 
virtual void OnInvite (User *source, Channel *c, User *targ)
 
virtual void OnDeleteVhost (NickAlias *na)
 
virtual void OnSetVhost (NickAlias *na)
 
virtual void OnSetDisplayedHost (User *)
 
virtual void OnMemoSend (const Anope::string &source, const Anope::string &target, MemoInfo *mi, Memo *m)
 
virtual void OnMemoDel (const Anope::string &target, MemoInfo *mi, const Memo *m)
 
virtual void OnUserModeSet (const MessageSource &setter, User *u, const Anope::string &mname)
 
virtual void OnUserModeUnset (const MessageSource &setter, User *u, const Anope::string &mname)
 
virtual void OnChannelModeAdd (ChannelMode *cm)
 
virtual void OnUserModeAdd (UserMode *um)
 
virtual EventReturn OnMLock (ChannelInfo *ci, ModeLock *lock)
 
virtual EventReturn OnUnMLock (ChannelInfo *ci, ModeLock *lock)
 
virtual void OnModuleLoad (User *u, Module *m)
 
virtual void OnModuleUnload (User *u, Module *m)
 
virtual void OnServerSync (Server *s)
 
virtual void OnUplinkSync (Server *s)
 
virtual EventReturn OnBotPrivmsg (User *u, BotInfo *bi, Anope::string &message)
 
virtual void OnBotNotice (User *u, BotInfo *bi, Anope::string &message)
 
virtual void OnLog (Log *l)
 
virtual void OnLogMessage (LogInfo *li, const Log *l, const Anope::string &msg)
 
virtual void OnDnsRequest (DNS::Query &req, DNS::Query *reply)
 
virtual void OnCheckModes (Reference< Channel > &c)
 
virtual void OnChannelSync (Channel *c)
 
virtual void OnSetCorrectModes (User *user, Channel *chan, AccessGroup &access, bool &give_modes, bool &take_modes)
 
virtual void OnSerializeCheck (Serialize::Type *)
 
virtual void OnSerializableConstruct (Serializable *)
 
virtual void OnSerializableDestruct (Serializable *)
 
virtual void OnSerializableUpdate (Serializable *)
 
virtual void OnSerializeTypeCreate (Serialize::Type *)
 
virtual EventReturn OnSetChannelOption (CommandSource &source, Command *cmd, ChannelInfo *ci, const Anope::string &setting)
 
virtual EventReturn OnSetNickOption (CommandSource &source, Command *cmd, NickCore *nc, const Anope::string &setting)
 
virtual EventReturn OnMessage (MessageSource &source, Anope::string &command, std::vector< Anope::string > &param)
 
virtual EventReturn OnCanSet (User *u, const ChannelMode *cm)
 
virtual EventReturn OnCheckDelete (Channel *)
 
virtual void OnExpireTick ()
 
virtual EventReturn OnNickValidate (User *u, NickAlias *na)
 
- Public Member Functions inherited from Extensible
virtual ~Extensible ()
 
template<typename T >
T * GetExt (const Anope::string &name) const
 
bool HasExt (const Anope::string &name) const
 
template<typename T >
T * Extend (const Anope::string &name, const T &what)
 
template<typename T >
T * Extend (const Anope::string &name)
 
template<typename T >
T * Require (const Anope::string &name)
 
template<typename T >
void Shrink (const Anope::string &name)
 
template<>
bool * Extend (const Anope::string &name, const bool &what)
 

Private Member Functions

void RunQuery (const SQL::Query &q)
 
size_t CountWords (const Anope::string &msg)
 
size_t CountSmileys (const Anope::string &msg, const Anope::string &smileylist)
 
const Anope::string GetDisplay (User *u)
 
void GetTables ()
 
bool HasTable (const Anope::string &table)
 
bool HasProcedure (const Anope::string &table)
 
bool HasEvent (const Anope::string &table)
 
void CheckTables ()
 
void OnModeChange (Channel *c, User *u)
 

Private Attributes

SerializableExtensibleItem< bool > cs_stats
 
SerializableExtensibleItem< bool > ns_stats
 
CommandCSSetChanstats commandcssetchanstats
 
CommandNSSetChanstats commandnssetchanstats
 
CommandNSSASetChanstats commandnssasetchanstats
 
ServiceReference< SQL::Providersql
 
MySQLInterface sqlinterface
 
SQL::Query query
 
Anope::string SmileysHappy
 
Anope::string SmileysSad
 
Anope::string SmileysOther
 
Anope::string prefix
 
std::vector< Anope::stringTableList
 
std::vector< Anope::stringProcedureList
 
std::vector< Anope::stringEventList
 
bool NSDefChanstats
 
bool CSDefChanstats
 

Additional Inherited Members

- Static Public Member Functions inherited from Extensible
static void ExtensibleSerialize (const Extensible *, const Serializable *, Serialize::Data &data)
 
static void ExtensibleUnserialize (Extensible *, Serializable *, Serialize::Data &data)
 
- Data Fields inherited from Module
Anope::string name
 
ModType type
 
Anope::string filename
 
void * handle
 
time_t created
 
Anope::string version
 
Anope::string author
 
- Data Fields inherited from Extensible
std::set< ExtensibleBase * > extension_items
 

Detailed Description

Definition at line 157 of file m_chanstats.cpp.

Constructor & Destructor Documentation

MChanstats::MChanstats ( const Anope::string modname,
const Anope::string creator 
)
inline

Definition at line 479 of file m_chanstats.cpp.

Member Function Documentation

void MChanstats::CheckTables ( )
inlineprivate

Definition at line 262 of file m_chanstats.cpp.

References GetTables(), HasEvent(), HasProcedure(), HasTable(), and RunQuery().

Referenced by OnReload().

size_t MChanstats::CountSmileys ( const Anope::string msg,
const Anope::string smileylist 
)
inlineprivate
size_t MChanstats::CountWords ( const Anope::string msg)
inlineprivate

Definition at line 179 of file m_chanstats.cpp.

References Anope::string::find(), and Anope::string::npos.

Referenced by OnPrivmsg().

const Anope::string MChanstats::GetDisplay ( User u)
inlineprivate
void MChanstats::GetTables ( )
inlineprivate

Definition at line 208 of file m_chanstats.cpp.

References SQL::Result::Get(), SQL::Result::Row(), and SQL::Result::Rows().

Referenced by CheckTables().

bool MChanstats::HasEvent ( const Anope::string table)
inlineprivate

Definition at line 253 of file m_chanstats.cpp.

Referenced by CheckTables().

bool MChanstats::HasProcedure ( const Anope::string table)
inlineprivate

Definition at line 245 of file m_chanstats.cpp.

Referenced by CheckTables().

bool MChanstats::HasTable ( const Anope::string table)
inlineprivate

Definition at line 237 of file m_chanstats.cpp.

Referenced by CheckTables().

void MChanstats::OnChangeCoreDisplay ( NickCore nc,
const Anope::string newdisplay 
)
inlinevirtual

Called on change_core_display()

Parameters
ncpointer to the NickCore
newdisplaythe new display

Reimplemented from Module.

Definition at line 620 of file m_chanstats.cpp.

References RunQuery(), and SQL::Query::SetValue().

void MChanstats::OnChanInfo ( CommandSource source,
ChannelInfo ci,
InfoFormatter info,
bool  show_hidden 
)
inlinevirtual

Called when a user requests info for a channel

Parameters
sourceThe user requesting info
ciThe channel the user is requesting info for
infoData to show the user requesting information
show_hiddentrue if we should show the user everything

Reimplemented from Module.

Definition at line 504 of file m_chanstats.cpp.

References _, and BaseExtensibleItem< T >::HasExt().

EventReturn MChanstats::OnChannelModeSet ( Channel c,
MessageSource setter,
ChannelMode mode,
const Anope::string param 
)
inlinevirtual

Called when a mode is set on a channel

Parameters
cThe channel
setterThe user or server that is setting the mode
modeThe mode
paramThe mode param, if there is one
Returns
EVENT_STOP to make mlock/secureops etc checks not happen

Reimplemented from Module.

Definition at line 531 of file m_chanstats.cpp.

References EVENT_CONTINUE, and OnModeChange().

EventReturn MChanstats::OnChannelModeUnset ( Channel c,
MessageSource setter,
ChannelMode mode,
const Anope::string param 
)
inlinevirtual

Called when a mode is unset on a channel

Parameters
cThe channel
setterThe user or server that is unsetting the mode
modeThe mode
paramThe mode param, if there is one
Returns
EVENT_STOP to make mlock/secureops etc checks not happen

Reimplemented from Module.

Definition at line 537 of file m_chanstats.cpp.

References EVENT_CONTINUE, and OnModeChange().

void MChanstats::OnChanRegistered ( ChannelInfo ci)
inlinevirtual

Called when a channel is registered

Parameters
ciThe channel

Reimplemented from Module.

Definition at line 635 of file m_chanstats.cpp.

References Extensible::Extend().

void MChanstats::OnDelChan ( ChannelInfo ci)
inlinevirtual

Called when a channel is being deleted, for any reason

Parameters
ciThe channel

Reimplemented from Module.

Definition at line 628 of file m_chanstats.cpp.

References RunQuery(), and SQL::Query::SetValue().

void MChanstats::OnDelCore ( NickCore nc)
inlinevirtual

Called on delcore()

Parameters
ncpointer to the NickCore

Reimplemented from Module.

Definition at line 613 of file m_chanstats.cpp.

References RunQuery(), and SQL::Query::SetValue().

void MChanstats::OnModeChange ( Channel c,
User u 
)
inlineprivate
void MChanstats::OnNickInfo ( CommandSource source,
NickAlias na,
InfoFormatter info,
bool  show_hidden 
)
inlinevirtual

Called when a user requests info for a nick

Parameters
sourceThe user requesting info
naThe nick the user is requesting info from
infoData to show the user requesting information
show_hiddentrue if we should show the user everything

Reimplemented from Module.

Definition at line 512 of file m_chanstats.cpp.

References _, and BaseExtensibleItem< T >::HasExt().

void MChanstats::OnNickRegister ( User user,
NickAlias na,
const Anope::string pass 
)
inlinevirtual

Called when a nick is registered

Parameters
userThe user registering the nick, of any
Thenick
passThe password of the newly registered nick

Reimplemented from Module.

Definition at line 641 of file m_chanstats.cpp.

References NickAlias::nc.

void MChanstats::OnPreUserKicked ( const MessageSource source,
ChanUserContainer cu,
const Anope::string kickmsg 
)
inlinevirtual

Called before a user has been kicked from a channel.

Parameters
sourceThe kicker
cuThe user, channel, and status of the user being kicked
kickmsgThe reason for the kick.

Reimplemented from Module.

Definition at line 556 of file m_chanstats.cpp.

References GetDisplay(), BaseExtensibleItem< T >::HasExt(), RunQuery(), and SQL::Query::SetValue().

void MChanstats::OnPrivmsg ( User u,
Channel c,
Anope::string msg 
)
inlinevirtual

Called when we receive a PRIVMSG for a registered channel we are in

Parameters
uThe source of the message
cThe channel
msgThe message

Reimplemented from Module.

Definition at line 572 of file m_chanstats.cpp.

References CountSmileys(), CountWords(), GetDisplay(), BaseExtensibleItem< T >::HasExt(), Anope::string::npos, RunQuery(), and SQL::Query::SetValue().

void MChanstats::OnReload ( Configuration::Conf conf)
inlinevirtual

Called when Services' configuration is being (re)loaded.

Parameters
confThe config that is being built now and will replace the global Config object
Exceptions
AConfigException to abort the config (re)loading process.

Reimplemented from Module.

Definition at line 487 of file m_chanstats.cpp.

References CheckTables(), and Configuration::Block::Get().

void MChanstats::OnTopicUpdated ( Channel c,
const Anope::string user,
const Anope::string topic 
)
inlinevirtual

Called when a new topic is set

Parameters
cThe channel
setterThe user who set the new topic
topicThe new topic

Reimplemented from Module.

Definition at line 520 of file m_chanstats.cpp.

References User::Account(), User::Find(), GetDisplay(), BaseExtensibleItem< T >::HasExt(), RunQuery(), and SQL::Query::SetValue().

void MChanstats::RunQuery ( const SQL::Query q)
inlineprivate

Field Documentation

CommandCSSetChanstats MChanstats::commandcssetchanstats
private

Definition at line 161 of file m_chanstats.cpp.

CommandNSSASetChanstats MChanstats::commandnssasetchanstats
private

Definition at line 164 of file m_chanstats.cpp.

CommandNSSetChanstats MChanstats::commandnssetchanstats
private

Definition at line 163 of file m_chanstats.cpp.

SerializableExtensibleItem<bool> MChanstats::cs_stats
private

Definition at line 159 of file m_chanstats.cpp.

bool MChanstats::CSDefChanstats
private

Definition at line 171 of file m_chanstats.cpp.

std::vector<Anope::string> MChanstats::EventList
private

Definition at line 170 of file m_chanstats.cpp.

SerializableExtensibleItem<bool> MChanstats::ns_stats
private

Definition at line 159 of file m_chanstats.cpp.

bool MChanstats::NSDefChanstats
private

Definition at line 171 of file m_chanstats.cpp.

Anope::string MChanstats::prefix
private

Definition at line 169 of file m_chanstats.cpp.

std::vector<Anope::string> MChanstats::ProcedureList
private

Definition at line 170 of file m_chanstats.cpp.

SQL::Query MChanstats::query
private

Definition at line 168 of file m_chanstats.cpp.

Anope::string MChanstats::SmileysHappy
private

Definition at line 169 of file m_chanstats.cpp.

Anope::string MChanstats::SmileysOther
private

Definition at line 169 of file m_chanstats.cpp.

Anope::string MChanstats::SmileysSad
private

Definition at line 169 of file m_chanstats.cpp.

ServiceReference<SQL::Provider> MChanstats::sql
private

Definition at line 166 of file m_chanstats.cpp.

MySQLInterface MChanstats::sqlinterface
private

Definition at line 167 of file m_chanstats.cpp.

std::vector<Anope::string> MChanstats::TableList
private

Definition at line 170 of file m_chanstats.cpp.


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