diff options
| author | Adam <Adam@anope.org> | 2012-04-23 05:08:26 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2012-04-23 05:08:26 -0400 |
| commit | 573e49a7ead331219eb6f0d3ca9cf83e793a5c9c (patch) | |
| tree | e145e04fa3d041cf92ce46da4ac790b63231059c /include/modules.h | |
| parent | 63c639e108a00d7dbb0d7ac9891684fc83a3b207 (diff) | |
Reworked live SQL support yet again
Diffstat (limited to 'include/modules.h')
| -rw-r--r-- | include/modules.h | 56 |
1 files changed, 22 insertions, 34 deletions
diff --git a/include/modules.h b/include/modules.h index 78ab24486..d44cbf8d9 100644 --- a/include/modules.h +++ b/include/modules.h @@ -9,14 +9,16 @@ * Based on the original code of Services by Andy Church. */ +#include "serialize.h" + #ifndef MODULES_H #define MODULES_H -#include "extensible.h" #include "base.h" #include "modes.h" #include "timers.h" #include "logger.h" +#include "extensible.h" /** This definition is used as shorthand for the various classes * and functions needed to make a module loadable by the OS. @@ -381,18 +383,13 @@ class CoreExport Module : public Extensible * @param ci The channel * @param bw The badword */ - virtual void OnBadWordAdd(ChannelInfo *ci, BadWord *bw) { } + virtual void OnBadWordAdd(ChannelInfo *ci, const BadWord *bw) { } /** Called before a badword is deleted from a channel * @param ci The channel * @param bw The badword */ - virtual void OnBadWordDel(ChannelInfo *ci, BadWord *bw) { } - - /** Called in findbot() - * @param nick The nick being looked up - */ - virtual void OnFindBot(const Anope::string &nick) { } + virtual void OnBadWordDel(ChannelInfo *ci, const BadWord *bw) { } /** Called before a bot kicks a user * @param bi The bot sending the kick @@ -513,14 +510,14 @@ class CoreExport Module : public Extensible * @param xlm The xline manager it was added to * @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to halt the command and not process it */ - virtual EventReturn OnAddXLine(User *u, XLine *x, XLineManager *xlm) { return EVENT_CONTINUE; } + virtual EventReturn OnAddXLine(User *u, const XLine *x, XLineManager *xlm) { return EVENT_CONTINUE; } /** Called before a XLine is deleted * @param u The user deleting the XLine * @param x The XLine * @param xlm The xline manager it was deleted from */ - virtual void OnDelXLine(User *u, XLine *x, XLineManager *xlm) { } + virtual void OnDelXLine(User *u, const XLine *x, XLineManager *xlm) { } /** Called when a user is checked for whether they are a services oper * @param u The user @@ -632,14 +629,14 @@ class CoreExport Module : public Extensible * @param ci The channel * @param ak The akick */ - virtual void OnAkickAdd(User *u, ChannelInfo *ci, AutoKick *ak) { } + virtual void OnAkickAdd(User *u, ChannelInfo *ci, const AutoKick *ak) { } /** Called before removing an akick from a channel * @param u The user removing the akick * @param ci The channel * @param ak The akick */ - virtual void OnAkickDel(User *u, ChannelInfo *ci, AutoKick *ak) { } + virtual void OnAkickDel(User *u, ChannelInfo *ci, const AutoKick *ak) { } /** Called after a user join a channel when we decide whether to kick them or not * @param u The user @@ -657,11 +654,6 @@ class CoreExport Module : public Extensible */ virtual void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool ShowHidden) { } - /** Called on cs_findchan() - * @param chname The name being looked up - */ - virtual void OnFindChan(const Anope::string &chname) { } - /** Checks if access has the channel privilege 'priv'. * @param access THe access struct * @param priv The privilege being checked for @@ -776,18 +768,6 @@ class CoreExport Module : public Extensible */ virtual void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool ShowHidden) { } - /** Called in findnick() - * Useful to modify the na returned by findnick() - * @param nick The nick being looked up - */ - virtual void OnFindNick(const Anope::string &nick) { } - - /** Called in findcore() - * Useful to modify the nc returned by findcore() - * @param nick The nick being looked up - */ - virtual void OnFindCore(const Anope::string &nick) { } - /** Check whether a users password is correct. * @param u The user * @param command The command the user is doing @@ -837,14 +817,14 @@ class CoreExport Module : public Extensible * @param mi The memo info * @param m The memo */ - virtual void OnMemoDel(const NickCore *nc, MemoInfo *mi, Memo *m) { } + virtual void OnMemoDel(NickCore *nc, MemoInfo *mi, const Memo *m) { } /** Called when a memo is deleted * @param ci The channel of the memo being deleted * @param mi The memo info * @param m The memo */ - virtual void OnMemoDel(ChannelInfo *ci, MemoInfo *mi, Memo *m) { } + virtual void OnMemoDel(ChannelInfo *ci, MemoInfo *mi, const Memo *m) { } /** Called when a mode is set on a channel * @param c The channel @@ -948,6 +928,12 @@ class CoreExport Module : public Extensible * @return EVENT_STOP to stop checking modes */ virtual EventReturn OnCheckModes(Channel *c) { return EVENT_CONTINUE; } + + virtual void OnSerializeCheck(SerializeType *) { } + virtual void OnSerializableConstruct(Serializable *) { } + virtual void OnSerializableDestruct(Serializable *) { } + virtual void OnSerializePtrAssign(Serializable *) { } + virtual void OnSerializableUpdate(Serializable *) { } }; /** Implementation-specific flags which may be set in ModuleManager::Attach() @@ -961,18 +947,18 @@ enum Implementation I_OnDelNick, I_OnDelCore, I_OnChangeCoreDisplay, I_OnNickClearAccess, I_OnNickAddAccess, I_OnNickEraseAccess, I_OnNickClearCert, I_OnNickAddCert, I_OnNickEraseCert, - I_OnNickInfo, I_OnFindNick, I_OnFindCore, I_OnCheckAuthentication, + I_OnNickInfo, I_OnCheckAuthentication, I_OnNickUpdate, /* ChanServ */ I_OnChanSuspend, I_OnChanDrop, I_OnPreChanExpire, I_OnChanExpire, I_OnAccessAdd, I_OnAccessDel, I_OnAccessClear, I_OnLevelChange, I_OnChanRegistered, I_OnChanUnsuspend, I_OnCreateChan, I_OnDelChan, I_OnChannelCreate, I_OnChannelDelete, I_OnAkickAdd, I_OnAkickDel, I_OnCheckKick, I_OnCheckModes, - I_OnChanInfo, I_OnFindChan, I_OnCheckPriv, I_OnGroupCheckPriv, + I_OnChanInfo, I_OnCheckPriv, I_OnGroupCheckPriv, /* BotServ */ I_OnBotJoin, I_OnBotKick, I_OnBotCreate, I_OnBotChange, I_OnBotDelete, I_OnBotAssign, I_OnBotUnAssign, - I_OnUserKicked, I_OnBotFantasy, I_OnBotNoFantasyAccess, I_OnBotBan, I_OnBadWordAdd, I_OnBadWordDel, I_OnFindBot, + I_OnUserKicked, I_OnBotFantasy, I_OnBotNoFantasyAccess, I_OnBotBan, I_OnBadWordAdd, I_OnBadWordDel, /* HostServ */ I_OnSetVhost, I_OnDeleteVhost, @@ -1001,6 +987,8 @@ enum Implementation I_OnEncrypt, I_OnDecrypt, I_OnChannelModeSet, I_OnChannelModeUnset, I_OnUserModeSet, I_OnUserModeUnset, I_OnChannelModeAdd, I_OnUserModeAdd, I_OnMLock, I_OnUnMLock, I_OnServerSync, I_OnUplinkSync, I_OnBotPrivmsg, I_OnPrivmsg, I_OnLog, + + I_OnSerializeCheck, I_OnSerializableConstruct, I_OnSerializableDestruct, I_OnSerializePtrAssign, I_OnSerializableUpdate, I_END }; |
