Anope IRC Services  Version 2.0
modules.h
Go to the documentation of this file.
1 /* Modular support
2  *
3  * (C) 2003-2014 Anope Team
4  * Contact us at team@anope.org
5  *
6  * Please read COPYING and README for further details.
7  *
8  * Based on the original code of Epona by Lara.
9  * Based on the original code of Services by Andy Church.
10  *
11  */
12 
13 #include "serialize.h"
14 
15 #ifndef MODULES_H
16 #define MODULES_H
17 
18 #include "base.h"
19 #include "modes.h"
20 #include "timers.h"
21 #include "logger.h"
22 #include "extensible.h"
23 
28 #ifdef _WIN32
29 # define MODULE_INIT(x) \
30  extern "C" DllExport Module *AnopeInit(const Anope::string &, const Anope::string &); \
31  extern "C" Module *AnopeInit(const Anope::string &modname, const Anope::string &creator) \
32  { \
33  return new x(modname, creator); \
34  } \
35  BOOLEAN WINAPI DllMain(HINSTANCE, DWORD, LPVOID) \
36  { \
37  return TRUE; \
38  } \
39  extern "C" DllExport void AnopeFini(x *); \
40  extern "C" void AnopeFini(x *m) \
41  { \
42  delete m; \
43  }
44 #else
45 # define MODULE_INIT(x) \
46  extern "C" DllExport Module *AnopeInit(const Anope::string &modname, const Anope::string &creator) \
47  { \
48  return new x(modname, creator); \
49  } \
50  extern "C" DllExport void AnopeFini(x *m) \
51  { \
52  delete m; \
53  }
54 #endif
55 
62 #define FOREACH_MOD(ename, args) \
63 if (true) \
64 { \
65  std::vector<Module *> &_modules = ModuleManager::EventHandlers[I_ ## ename]; \
66  for (std::vector<Module *>::iterator _i = _modules.begin(); _i != _modules.end();) \
67  { \
68  try \
69  { \
70  (*_i)->ename args; \
71  } \
72  catch (const ModuleException &modexcept) \
73  { \
74  Log() << "Exception caught: " << modexcept.GetReason(); \
75  } \
76  catch (const NotImplementedException &) \
77  { \
78  _i = _modules.erase(_i); \
79  continue; \
80  } \
81  ++_i; \
82  } \
83 } \
84 else \
85  static_cast<void>(0)
86 
95 #define FOREACH_RESULT(ename, ret, args) \
96 if (true) \
97 { \
98  ret = EVENT_CONTINUE; \
99  std::vector<Module *> &_modules = ModuleManager::EventHandlers[I_ ## ename]; \
100  for (std::vector<Module *>::iterator _i = _modules.begin(); _i != _modules.end();) \
101  { \
102  try \
103  { \
104  EventReturn res = (*_i)->ename args; \
105  if (res != EVENT_CONTINUE) \
106  { \
107  ret = res; \
108  break; \
109  } \
110  } \
111  catch (const ModuleException &modexcept) \
112  { \
113  Log() << "Exception caught: " << modexcept.GetReason(); \
114  } \
115  catch (const NotImplementedException &) \
116  { \
117  _i = _modules.erase(_i); \
118  continue; \
119  } \
120  ++_i; \
121  } \
122 } \
123 else \
124  static_cast<void>(0)
125 
126 
130 {
134 };
135 
137 {
147 };
148 
152 /* Module types, in the order in which they are unloaded. The order these are in is IMPORTANT */
153 enum
154 {
156  /* Module is 3rd party. All 3rd party modules should set this. Mutually exclusive to VENDOR. */
157  THIRD = 1 << 0,
158  /* A vendor module, which is made and shipped by Anope. Mutually exclusive to THIRD. */
159  VENDOR = 1 << 1,
160  /* Extra module not required for standard use. Probably requires external dependencies.
161  * This module does something extreme enough that we want it to show in the default /os modlist command
162  */
163  EXTRA = 1 << 2,
164  /* Module provides access to a database */
165  DATABASE = 1 << 3,
166  /* Module provides encryption */
167  ENCRYPTION = 1 << 4,
168  /* Module provides a pseudoclient */
169  PSEUDOCLIENT = 1 << 5,
170  /* Module provides IRCd protocol support */
171  PROTOCOL = 1 << 6,
172  MT_END = 1 << 7
173 };
174 typedef unsigned short ModType;
175 
180 {
181  private:
185 
186  public:
192  ModuleVersion(int major, int minor, int patch);
193 
197  int GetMajor() const;
198 
202  int GetMinor() const;
203 
207  int GetPatch() const;
208 };
209 
211 
215 {
216  private:
217  bool permanent;
218  public:
222 
226 
230 
233  void *handle;
234 
237  time_t created;
238 
242 
246 
252  Module(const Anope::string &modname, const Anope::string &loadernick, ModType type = THIRD);
253 
256  virtual ~Module();
257 
265  void SetPermanent(bool state);
266 
270  bool GetPermanent() const;
271 
275  void SetVersion(const Anope::string &version);
276 
280  void SetAuthor(const Anope::string &author);
281 
286  ModuleVersion GetVersion() const;
287 
288  /* Everything below here are events. Modules must ModuleManager::Attach to these events
289  * before they will be called.
290  */
291 
297  virtual void OnPreUserKicked(const MessageSource &source, ChanUserContainer *cu, const Anope::string &kickmsg) { throw NotImplementedException(); }
298 
306  virtual void OnUserKicked(const MessageSource &source, User *target, const Anope::string &channel, ChannelStatus &status, const Anope::string &kickmsg) { throw NotImplementedException(); }
307 
312  virtual void OnReload(Configuration::Conf *conf) { throw NotImplementedException(); }
313 
321 
324  virtual void OnBotAssign(User *sender, ChannelInfo *ci, BotInfo *bi) { throw NotImplementedException(); }
325 
332 
337  virtual void OnUserConnect(User *u, bool &exempt) { throw NotImplementedException(); }
338 
342  virtual void OnNewServer(Server *s) { throw NotImplementedException(); }
343 
348  virtual void OnUserNickChange(User *u, const Anope::string &oldnick) { throw NotImplementedException(); }
349 
355  virtual EventReturn OnPreHelp(CommandSource &source, const std::vector<Anope::string> &params) { throw NotImplementedException(); }
356 
361  virtual void OnPostHelp(CommandSource &source, const std::vector<Anope::string> &params) { throw NotImplementedException(); }
362 
369  virtual EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> &params) { throw NotImplementedException(); }
370 
376  virtual void OnPostCommand(CommandSource &source, Command *command, const std::vector<Anope::string> &params) { throw NotImplementedException(); }
377 
380  virtual void OnSaveDatabase() { throw NotImplementedException(); }
381 
386 
392 
400  virtual EventReturn OnBotFantasy(CommandSource &source, Command *c, ChannelInfo *ci, const std::vector<Anope::string> &params) { throw NotImplementedException(); }
401 
409  virtual EventReturn OnBotNoFantasyAccess(CommandSource &source, Command *c, ChannelInfo *ci, const std::vector<Anope::string> &params) { throw NotImplementedException(); }
410 
416  virtual void OnBotBan(User *u, ChannelInfo *ci, const Anope::string &mask) { throw NotImplementedException(); }
417 
422  virtual void OnBadWordAdd(ChannelInfo *ci, const BadWord *bw) { throw NotImplementedException(); }
423 
428  virtual void OnBadWordDel(ChannelInfo *ci, const BadWord *bw) { throw NotImplementedException(); }
429 
432  virtual void OnCreateBot(BotInfo *bi) { throw NotImplementedException(); }
433  virtual void OnDelBot(BotInfo *bi) { throw NotImplementedException(); }
434 
442  virtual EventReturn OnBotKick(BotInfo *bi, Channel *c, User *u, const Anope::string &reason) { throw NotImplementedException(); }
443 
448  virtual void OnPrePartChannel(User *u, Channel *c) {}
449 
456  virtual void OnPartChannel(User *u, Channel *c, const Anope::string &channel, const Anope::string &msg) { throw NotImplementedException(); }
457 
463  virtual void OnLeaveChannel(User *u, Channel *c) { throw NotImplementedException(); }
464 
472  virtual void OnJoinChannel(User *u, Channel *c) { throw NotImplementedException(); }
473 
479  virtual void OnTopicUpdated(Channel *c, const Anope::string &user, const Anope::string &topic) { throw NotImplementedException(); }
480 
485  virtual void OnPreChanExpire(ChannelInfo *ci, bool &expire) { throw NotImplementedException(); }
486 
491 
494  virtual void OnPreServerConnect() { throw NotImplementedException(); }
495 
498  virtual void OnServerConnect() { throw NotImplementedException(); }
499 
502  virtual void OnPreUplinkSync(Server *serv) { throw NotImplementedException(); }
503 
506  virtual void OnServerDisconnect() { throw NotImplementedException(); }
507 
510  virtual void OnRestart() { throw NotImplementedException(); }
511 
514  virtual void OnShutdown() { throw NotImplementedException(); }
515 
520  virtual void OnPreNickExpire(NickAlias *na, bool &expire) { throw NotImplementedException(); }
521 
525  virtual void OnNickExpire(NickAlias *na) { throw NotImplementedException(); }
526 
530  virtual void OnDefconLevel(int level) { throw NotImplementedException(); }
531 
537 
542  virtual void OnExceptionDel(CommandSource &source, Exception *ex) { throw NotImplementedException(); }
543 
550  virtual EventReturn OnAddXLine(CommandSource &source, const XLine *x, XLineManager *xlm) { throw NotImplementedException(); }
551 
557  virtual void OnDelXLine(CommandSource &source, const XLine *x, XLineManager *xlm) { throw NotImplementedException(); }
558 
564 
568  virtual void OnServerQuit(Server *server) { throw NotImplementedException(); }
569 
574  virtual void OnUserQuit(User *u, const Anope::string &msg) { throw NotImplementedException(); }
575 
582  virtual void OnPreUserLogoff(User *u) { throw NotImplementedException(); }
583  virtual void OnPostUserLogoff(User *u) { throw NotImplementedException(); }
584 
588  virtual void OnBotCreate(BotInfo *bi) { throw NotImplementedException(); }
589 
593  virtual void OnBotChange(BotInfo *bi) { throw NotImplementedException(); }
594 
598  virtual void OnBotDelete(BotInfo *bi) { throw NotImplementedException(); }
599 
605  virtual void OnAccessDel(ChannelInfo *ci, CommandSource &source, ChanAccess *access) { throw NotImplementedException(); }
606 
612  virtual void OnAccessAdd(ChannelInfo *ci, CommandSource &source, ChanAccess *access) { throw NotImplementedException(); }
613 
618  virtual void OnAccessClear(ChannelInfo *ci, CommandSource &source) { throw NotImplementedException(); }
619 
626  virtual void OnLevelChange(CommandSource &source, ChannelInfo *ci, const Anope::string &priv, int16_t what) { throw NotImplementedException(); }
627 
633 
638 
643 
648 
653 
657  virtual void OnDelChan(ChannelInfo *ci) { throw NotImplementedException(); }
658 
663  virtual void OnChannelCreate(Channel *c) { throw NotImplementedException(); }
664 
668  virtual void OnChannelDelete(Channel *c) { throw NotImplementedException(); }
669 
675  virtual void OnAkickAdd(CommandSource &source, ChannelInfo *ci, const AutoKick *ak) { throw NotImplementedException(); }
676 
682  virtual void OnAkickDel(CommandSource &source, ChannelInfo *ci, const AutoKick *ak) { throw NotImplementedException(); }
683 
693 
700  virtual void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_hidden) { throw NotImplementedException(); }
701 
707  virtual EventReturn OnCheckPriv(const ChanAccess *access, const Anope::string &priv) { throw NotImplementedException(); }
708 
714  virtual EventReturn OnGroupCheckPriv(const AccessGroup *group, const Anope::string &priv) { throw NotImplementedException(); }
715 
720  virtual void OnNickDrop(CommandSource &source, NickAlias *na) { throw NotImplementedException(); }
721 
726  virtual void OnNickGroup(User *u, NickAlias *target) { throw NotImplementedException(); }
727 
731  virtual void OnNickIdentify(User *u) { throw NotImplementedException(); }
732 
736  virtual void OnUserLogin(User *u) { throw NotImplementedException(); }
737 
741  virtual void OnNickLogout(User *u) { throw NotImplementedException(); }
742 
748  virtual void OnNickRegister(User *user, NickAlias *na, const Anope::string &pass) { throw NotImplementedException(); }
749 
753  virtual void OnNickSuspend(NickAlias *na) { throw NotImplementedException(); }
754 
758  virtual void OnNickUnsuspended(NickAlias *na) { throw NotImplementedException(); }
759 
763  virtual void OnDelNick(NickAlias *na) { throw NotImplementedException(); }
764 
768  virtual void OnNickCoreCreate(NickCore *nc) { throw NotImplementedException(); }
769 
773  virtual void OnDelCore(NickCore *nc) { throw NotImplementedException(); }
774 
779  virtual void OnChangeCoreDisplay(NickCore *nc, const Anope::string &newdisplay) { throw NotImplementedException(); }
780 
784  virtual void OnNickClearAccess(NickCore *nc) { throw NotImplementedException(); }
785 
790  virtual void OnNickAddAccess(NickCore *nc, const Anope::string &entry) { throw NotImplementedException(); }
791 
796  virtual void OnNickEraseAccess(NickCore *nc, const Anope::string &entry) { throw NotImplementedException(); }
797 
801  virtual void OnNickClearCert(NickCore *nc) { throw NotImplementedException(); }
802 
807  virtual void OnNickAddCert(NickCore *nc, const Anope::string &entry) { throw NotImplementedException(); }
808 
813  virtual void OnNickEraseCert(NickCore *nc, const Anope::string &entry) { throw NotImplementedException(); }
814 
821  virtual void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) { throw NotImplementedException(); }
822 
825  virtual void OnBotInfo(CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info) { throw NotImplementedException(); }
826 
832 
836  virtual void OnNickUpdate(User *u) { throw NotImplementedException(); }
837 
842  virtual void OnFingerprint(User *u) { throw NotImplementedException(); }
843 
847  virtual void OnUserAway(User *u, const Anope::string &message) { throw NotImplementedException(); }
848 
854  virtual void OnInvite(User *source, Channel *c, User *targ) { throw NotImplementedException(); }
855 
859  virtual void OnDeleteVhost(NickAlias *na) { throw NotImplementedException(); }
860 
864  virtual void OnSetVhost(NickAlias *na) { throw NotImplementedException(); }
865 
869  virtual void OnSetDisplayedHost(User *) { throw NotImplementedException(); }
870 
877  virtual void OnMemoSend(const Anope::string &source, const Anope::string &target, MemoInfo *mi, Memo *m) { throw NotImplementedException(); }
878 
884  virtual void OnMemoDel(const Anope::string &target, MemoInfo *mi, const Memo *m) { throw NotImplementedException(); }
885 
894 
903 
909  virtual void OnUserModeSet(const MessageSource &setter, User *u, const Anope::string &mname) { throw NotImplementedException(); }
910 
916  virtual void OnUserModeUnset(const MessageSource &setter, User *u, const Anope::string &mname) { throw NotImplementedException(); }
917 
921  virtual void OnChannelModeAdd(ChannelMode *cm) { throw NotImplementedException(); }
922 
926  virtual void OnUserModeAdd(UserMode *um) { throw NotImplementedException(); }
927 
934 
941 
946  virtual void OnModuleLoad(User *u, Module *m) { throw NotImplementedException(); }
947 
952  virtual void OnModuleUnload(User *u, Module *m) { throw NotImplementedException(); }
953 
957  virtual void OnServerSync(Server *s) { throw NotImplementedException(); }
958 
962  virtual void OnUplinkSync(Server *s) { throw NotImplementedException(); }
963 
971 
977  virtual void OnBotNotice(User *u, BotInfo *bi, Anope::string &message) { throw NotImplementedException(); }
978 
984  virtual void OnPrivmsg(User *u, Channel *c, Anope::string &msg) { throw NotImplementedException(); }
985 
989  virtual void OnLog(Log *l) { throw NotImplementedException(); }
990 
997  virtual void OnLogMessage(LogInfo *li, const Log *l, const Anope::string &msg) { throw NotImplementedException(); }
998 
1003  virtual void OnDnsRequest(DNS::Query &req, DNS::Query *reply) { throw NotImplementedException(); }
1004 
1010 
1016  virtual void OnChannelSync(Channel *c) { throw NotImplementedException(); }
1017 
1025  virtual void OnSetCorrectModes(User *user, Channel *chan, AccessGroup &access, bool &give_modes, bool &take_modes) { throw NotImplementedException(); }
1026 
1032 
1041 
1049  virtual EventReturn OnSetNickOption(CommandSource &source, Command *cmd, NickCore *nc, const Anope::string &setting) { throw NotImplementedException(); }
1050 
1057  virtual EventReturn OnMessage(MessageSource &source, Anope::string &command, std::vector<Anope::string> &param) { throw NotImplementedException(); }
1058 
1063  virtual EventReturn OnCanSet(User *u, const ChannelMode *cm) { throw NotImplementedException(); }
1064 
1066 
1070  virtual void OnExpireTick() { throw NotImplementedException(); }
1071 
1079 };
1080 
1082 {
1105 };
1106 
1110 {
1111  public:
1114  static std::vector<Module *> EventHandlers[I_SIZE];
1115 
1118  static std::list<Module *> Modules;
1119 
1120 #ifdef _WIN32
1121 
1123  static void CleanupRuntimeDirectory();
1124 #endif
1125 
1131  static ModuleReturn LoadModule(const Anope::string &modname, User *u);
1132 
1138  static ModuleReturn UnloadModule(Module *m, User * u);
1139 
1144  static Module *FindModule(const Anope::string &name);
1145 
1150  static Module *FindFirstOf(ModType type);
1151 
1158  static void RequireVersion(int major, int minor, int patch);
1159 
1175  static bool SetPriority(Module *mod, Implementation i, Priority s, Module **modules = NULL, size_t sz = 1);
1176 
1183  static bool SetPriority(Module *mod, Priority s);
1184 
1188  static void DetachAll(Module *mod);
1189 
1192  static void UnloadAll();
1193 
1194  private:
1199  static ModuleReturn DeleteModule(Module *m);
1200 };
1201 
1202 #endif // MODULES_H
Definition: bots.h:24
void * handle
Definition: modules.h:233
virtual void OnServerQuit(Server *server)
Definition: modules.h:568
virtual void OnJoinChannel(User *u, Channel *c)
Definition: modules.h:472
virtual EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector< Anope::string > &params)
Definition: modules.h:369
Definition: servers.h:42
virtual EventReturn OnExceptionAdd(Exception *ex)
Definition: modules.h:536
virtual EventReturn OnBotKick(BotInfo *bi, Channel *c, User *u, const Anope::string &reason)
Definition: modules.h:442
virtual void OnDelBot(BotInfo *bi)
Definition: modules.h:433
Anope::string name
Definition: modules.h:221
virtual void OnCreateChan(ChannelInfo *ci)
Definition: modules.h:652
virtual void OnUserKicked(const MessageSource &source, User *target, const Anope::string &channel, ChannelStatus &status, const Anope::string &kickmsg)
Definition: modules.h:306
virtual void OnPreNickExpire(NickAlias *na, bool &expire)
Definition: modules.h:520
virtual EventReturn IsServicesOper(User *u)
Definition: modules.h:563
virtual void OnLog(Log *l)
Definition: modules.h:989
int version_patch
Definition: modules.h:184
int GetMinor() const
Definition: module.cpp:113
Definition: hashcomp.h:84
virtual void OnServerSync(Server *s)
Definition: modules.h:957
virtual void OnUserModeUnset(const MessageSource &setter, User *u, const Anope::string &mname)
Definition: modules.h:916
time_t created
Definition: modules.h:237
virtual void OnNickAddAccess(NickCore *nc, const Anope::string &entry)
Definition: modules.h:790
virtual void OnChannelSync(Channel *c)
Definition: modules.h:1016
virtual void OnNickDrop(CommandSource &source, NickAlias *na)
Definition: modules.h:720
virtual void OnChanRegistered(ChannelInfo *ci)
Definition: modules.h:637
virtual void OnSetVhost(NickAlias *na)
Definition: modules.h:864
virtual void OnReload(Configuration::Conf *conf)
Definition: modules.h:312
virtual void OnPostHelp(CommandSource &source, const std::vector< Anope::string > &params)
Definition: modules.h:361
virtual void OnServerConnect()
Definition: modules.h:498
virtual void OnUserModeSet(const MessageSource &setter, User *u, const Anope::string &mname)
Definition: modules.h:909
virtual void OnChangeCoreDisplay(NickCore *nc, const Anope::string &newdisplay)
Definition: modules.h:779
virtual EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason)
Definition: modules.h:692
virtual void OnNickGroup(User *u, NickAlias *target)
Definition: modules.h:726
virtual void OnSaveDatabase()
Definition: modules.h:380
virtual void OnPreChanExpire(ChannelInfo *ci, bool &expire)
Definition: modules.h:485
Definition: users.h:34
virtual void OnUserAway(User *u, const Anope::string &message)
Definition: modules.h:847
virtual EventReturn OnBotPrivmsg(User *u, BotInfo *bi, Anope::string &message)
Definition: modules.h:970
virtual EventReturn OnCheckPriv(const ChanAccess *access, const Anope::string &priv)
Definition: modules.h:707
virtual void OnLogMessage(LogInfo *li, const Log *l, const Anope::string &msg)
Definition: modules.h:997
virtual void OnPostCommand(CommandSource &source, Command *command, const std::vector< Anope::string > &params)
Definition: modules.h:376
virtual void OnNickAddCert(NickCore *nc, const Anope::string &entry)
Definition: modules.h:807
virtual void OnBotDelete(BotInfo *bi)
Definition: modules.h:598
virtual void OnServerDisconnect()
Definition: modules.h:506
Anope::string filename
Definition: modules.h:229
virtual void OnInvite(User *source, Channel *c, User *targ)
Definition: modules.h:854
virtual void OnSetCorrectModes(User *user, Channel *chan, AccessGroup &access, bool &give_modes, bool &take_modes)
Definition: modules.h:1025
virtual void OnNickEraseCert(NickCore *nc, const Anope::string &entry)
Definition: modules.h:813
virtual EventReturn OnEncrypt(const Anope::string &src, Anope::string &dest)
Definition: modules.h:390
ModType type
Definition: modules.h:225
virtual void OnChannelDelete(Channel *c)
Definition: modules.h:668
virtual void OnAkickAdd(CommandSource &source, ChannelInfo *ci, const AutoKick *ak)
Definition: modules.h:675
virtual EventReturn OnBotFantasy(CommandSource &source, Command *c, ChannelInfo *ci, const std::vector< Anope::string > &params)
Definition: modules.h:400
virtual void OnAccessAdd(ChannelInfo *ci, CommandSource &source, ChanAccess *access)
Definition: modules.h:612
virtual void OnPreUserLogoff(User *u)
Definition: modules.h:582
virtual void OnUserModeAdd(UserMode *um)
Definition: modules.h:926
virtual void OnRestart()
Definition: modules.h:510
virtual EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string &param)
Definition: modules.h:893
int version_major
Definition: modules.h:182
Anope::string version
Definition: modules.h:241
virtual void OnDelXLine(CommandSource &source, const XLine *x, XLineManager *xlm)
Definition: modules.h:557
ModuleReturn
Definition: modules.h:136
virtual void OnNickSuspend(NickAlias *na)
Definition: modules.h:753
virtual void OnMemoSend(const Anope::string &source, const Anope::string &target, MemoInfo *mi, Memo *m)
Definition: modules.h:877
virtual void OnTopicUpdated(Channel *c, const Anope::string &user, const Anope::string &topic)
Definition: modules.h:479
virtual void OnDelNick(NickAlias *na)
Definition: modules.h:763
virtual void OnNickExpire(NickAlias *na)
Definition: modules.h:525
virtual EventReturn OnPreHelp(CommandSource &source, const std::vector< Anope::string > &params)
Definition: modules.h:355
virtual void OnBadWordDel(ChannelInfo *ci, const BadWord *bw)
Definition: modules.h:428
virtual void OnPostUserLogoff(User *u)
Definition: modules.h:583
virtual void OnCheckModes(Reference< Channel > &c)
Definition: modules.h:1009
Priority
Definition: modules.h:151
virtual void OnFingerprint(User *u)
Definition: modules.h:842
Definition: memo.h:40
virtual void OnBotInfo(CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info)
Definition: modules.h:825
virtual void OnBotCreate(BotInfo *bi)
Definition: modules.h:588
virtual void OnMemoDel(const Anope::string &target, MemoInfo *mi, const Memo *m)
Definition: modules.h:884
virtual void OnBotNotice(User *u, BotInfo *bi, Anope::string &message)
Definition: modules.h:977
virtual void OnAccessDel(ChannelInfo *ci, CommandSource &source, ChanAccess *access)
Definition: modules.h:605
virtual void OnUplinkSync(Server *s)
Definition: modules.h:962
virtual void OnSerializeTypeCreate(Serialize::Type *)
Definition: modules.h:1031
virtual void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden)
Definition: modules.h:821
Definition: memo.h:19
virtual void OnPartChannel(User *u, Channel *c, const Anope::string &channel, const Anope::string &msg)
Definition: modules.h:456
int GetPatch() const
Definition: module.cpp:118
Definition: modes.h:68
virtual void OnLevelChange(CommandSource &source, ChannelInfo *ci, const Anope::string &priv, int16_t what)
Definition: modules.h:626
virtual void OnNickCoreCreate(NickCore *nc)
Definition: modules.h:768
virtual EventReturn OnCheckDelete(Channel *)
Definition: modules.h:1065
virtual EventReturn OnCanSet(User *u, const ChannelMode *cm)
Definition: modules.h:1063
virtual EventReturn OnNickValidate(User *u, NickAlias *na)
Definition: modules.h:1078
virtual EventReturn OnChanDrop(CommandSource &source, ChannelInfo *ci)
Definition: modules.h:632
bool permanent
Definition: modules.h:217
virtual void OnDefconLevel(int level)
Definition: modules.h:530
virtual void OnNewServer(Server *s)
Definition: modules.h:342
virtual EventReturn OnBotUnAssign(User *sender, ChannelInfo *ci)
Definition: modules.h:331
virtual void OnDelCore(NickCore *nc)
Definition: modules.h:773
static std::list< Module * > Modules
Definition: modules.h:1118
virtual void OnBotAssign(User *sender, ChannelInfo *ci, BotInfo *bi)
Definition: modules.h:324
virtual void OnPreUserKicked(const MessageSource &source, ChanUserContainer *cu, const Anope::string &kickmsg)
Definition: modules.h:297
virtual void OnNickRegister(User *user, NickAlias *na, const Anope::string &pass)
Definition: modules.h:748
virtual void OnUserQuit(User *u, const Anope::string &msg)
Definition: modules.h:574
virtual void OnPreUplinkSync(Server *serv)
Definition: modules.h:502
virtual void OnSerializableUpdate(Serializable *)
Definition: modules.h:1030
virtual EventReturn OnBotNoFantasyAccess(CommandSource &source, Command *c, ChannelInfo *ci, const std::vector< Anope::string > &params)
Definition: modules.h:409
EventReturn
Definition: modules.h:129
virtual EventReturn OnPreBotAssign(User *sender, ChannelInfo *ci, BotInfo *bi)
Definition: modules.h:320
virtual void OnExpireTick()
Definition: modules.h:1070
virtual EventReturn OnLoadDatabase()
Definition: modules.h:385
virtual void OnPreServerConnect()
Definition: modules.h:494
virtual void OnBotBan(User *u, ChannelInfo *ci, const Anope::string &mask)
Definition: modules.h:416
virtual void OnAccessClear(ChannelInfo *ci, CommandSource &source)
Definition: modules.h:618
#define CoreExport
Definition: services.h:62
virtual EventReturn OnDecrypt(const Anope::string &hashm, const Anope::string &src, Anope::string &dest)
Definition: modules.h:391
virtual void OnBadWordAdd(ChannelInfo *ci, const BadWord *bw)
Definition: modules.h:422
virtual EventReturn OnUnMLock(ChannelInfo *ci, ModeLock *lock)
Definition: modules.h:940
virtual EventReturn OnSetNickOption(CommandSource &source, Command *cmd, NickCore *nc, const Anope::string &setting)
Definition: modules.h:1049
virtual void OnUserConnect(User *u, bool &exempt)
Definition: modules.h:337
virtual void OnChannelModeAdd(ChannelMode *cm)
Definition: modules.h:921
virtual void OnUserNickChange(User *u, const Anope::string &oldnick)
Definition: modules.h:348
virtual void OnSerializeCheck(Serialize::Type *)
Definition: modules.h:1027
virtual EventReturn OnMLock(ChannelInfo *ci, ModeLock *lock)
Definition: modules.h:933
Definition: modules.h:157
virtual void OnExceptionDel(CommandSource &source, Exception *ex)
Definition: modules.h:542
virtual void OnNickUnsuspended(NickAlias *na)
Definition: modules.h:758
virtual void OnShutdown()
Definition: modules.h:514
virtual EventReturn OnGroupCheckPriv(const AccessGroup *group, const Anope::string &priv)
Definition: modules.h:714
virtual void OnDelChan(ChannelInfo *ci)
Definition: modules.h:657
virtual void OnSerializableDestruct(Serializable *)
Definition: modules.h:1029
virtual void OnChanSuspend(ChannelInfo *ci)
Definition: modules.h:642
Definition: xline.h:18
static Anope::string hashm
Definition: db_old.cpp:123
Anope::string name
Definition: access.cpp:22
virtual void OnBotChange(BotInfo *bi)
Definition: modules.h:593
virtual EventReturn OnSetChannelOption(CommandSource &source, Command *cmd, ChannelInfo *ci, const Anope::string &setting)
Definition: modules.h:1040
virtual EventReturn OnAddXLine(CommandSource &source, const XLine *x, XLineManager *xlm)
Definition: modules.h:550
virtual EventReturn OnMessage(MessageSource &source, Anope::string &command, std::vector< Anope::string > &param)
Definition: modules.h:1057
virtual void OnDeleteVhost(NickAlias *na)
Definition: modules.h:859
virtual void OnSerializableConstruct(Serializable *)
Definition: modules.h:1028
virtual void OnModuleLoad(User *u, Module *m)
Definition: modules.h:946
Definition: logger.h:53
int GetMajor() const
Definition: module.cpp:108
virtual void OnLeaveChannel(User *u, Channel *c)
Definition: modules.h:463
virtual void OnNickEraseAccess(NickCore *nc, const Anope::string &entry)
Definition: modules.h:796
virtual void OnPrePartChannel(User *u, Channel *c)
Definition: modules.h:448
unsigned short ModType
Definition: modules.h:174
virtual void OnNickUpdate(User *u)
Definition: modules.h:836
virtual void OnNickClearAccess(NickCore *nc)
Definition: modules.h:784
virtual void OnPrivmsg(User *u, Channel *c, Anope::string &msg)
Definition: modules.h:984
virtual void OnSetDisplayedHost(User *)
Definition: modules.h:869
virtual void OnCreateBot(BotInfo *bi)
Definition: modules.h:432
virtual void OnAkickDel(CommandSource &source, ChannelInfo *ci, const AutoKick *ak)
Definition: modules.h:682
virtual void OnNickIdentify(User *u)
Definition: modules.h:731
Implementation
Definition: modules.h:1081
virtual void OnUserLogin(User *u)
Definition: modules.h:736
virtual void OnChanUnsuspend(ChannelInfo *ci)
Definition: modules.h:647
virtual void OnNickLogout(User *u)
Definition: modules.h:741
virtual void OnChanExpire(ChannelInfo *ci)
Definition: modules.h:490
int version_minor
Definition: modules.h:183
virtual void OnModuleUnload(User *u, Module *m)
Definition: modules.h:952
virtual void OnDnsRequest(DNS::Query &req, DNS::Query *reply)
Definition: modules.h:1003
Type(const Anope::string &n, unserialize_func f, Module *owner=NULL)
virtual void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_hidden)
Definition: modules.h:700
virtual EventReturn OnChannelModeUnset(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string &param)
Definition: modules.h:902
ModuleVersion(int major, int minor, int patch)
Definition: module.cpp:104
Anope::string author
Definition: modules.h:245
virtual void OnChannelCreate(Channel *c)
Definition: modules.h:663
Definition: modules.h:163
virtual void OnCheckAuthentication(User *u, IdentifyRequest *req)
Definition: modules.h:831
virtual void OnNickClearCert(NickCore *nc)
Definition: modules.h:801