diff options
author | Adam <Adam@anope.org> | 2011-09-25 04:19:15 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-09-25 04:19:15 -0400 |
commit | 1f2399de364c09adcce4193895cd362d80ffdfc5 (patch) | |
tree | 5f40fc531f22c174b6e10bb7bc12842a4a21d30b /include/modules.h | |
parent | 43201ead9575a74e350710bc191f4ac67366aca7 (diff) |
Added a new database format and sqlite support. Also moved db-convert to a module.
Diffstat (limited to 'include/modules.h')
-rw-r--r-- | include/modules.h | 91 |
1 files changed, 9 insertions, 82 deletions
diff --git a/include/modules.h b/include/modules.h index d35c1f2ba..00e48250b 100644 --- a/include/modules.h +++ b/include/modules.h @@ -342,11 +342,6 @@ class CoreExport Module : public Extensible */ virtual void OnPostCommand(CommandSource &source, Command *command, const std::vector<Anope::string> ¶ms) { } - /** Called after the core has finished loading the databases, but before - * we connect to the server - */ - virtual void OnPostLoadDatabases() { } - /** Called when the databases are saved * @return EVENT_CONTINUE to let other modules continue saving, EVENT_STOP to stop */ @@ -485,73 +480,6 @@ class CoreExport Module : public Extensible */ virtual void OnServerDisconnect() { } - /** Called when the flatfile dbs are being written - * @param Write A callback to the function used to insert a line into the database - */ - virtual void OnDatabaseWrite(void (*Write)(const Anope::string &)) { } - - /** Called when a line is read from the database - * @param params The params from the database - * @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to stop processing - */ - virtual EventReturn OnDatabaseRead(const std::vector<Anope::string> ¶ms) { return EVENT_CONTINUE; } - - /** Called when nickcore metadata is read from the database - * @param nc The nickcore - * @param key The metadata key - * @param params The params from the database - * @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to stop processing - */ - virtual EventReturn OnDatabaseReadMetadata(NickCore *nc, const Anope::string &key, const std::vector<Anope::string> ¶ms) { return EVENT_CONTINUE; } - - /** Called when nickcore metadata is read from the database - * @param na The nickalias - * @param key The metadata key - * @param params The params from the database - * @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to stop processing - */ - virtual EventReturn OnDatabaseReadMetadata(NickAlias *na, const Anope::string &key, const std::vector<Anope::string> ¶ms) { return EVENT_CONTINUE; } - - /** Called when botinfo metadata is read from the database - * @param bi The botinfo - * @param key The metadata key - * @param params The params from the database - * @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to stop processing - */ - virtual EventReturn OnDatabaseReadMetadata(BotInfo *bi, const Anope::string &key, const std::vector<Anope::string> ¶ms) { return EVENT_CONTINUE; } - - /** Called when chaninfo metadata is read from the database - * @param ci The chaninfo - * @param key The metadata key - * @param params The params from the database - * @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to stop processing - */ - virtual EventReturn OnDatabaseReadMetadata(ChannelInfo *ci, const Anope::string &key, const std::vector<Anope::string> ¶ms) { return EVENT_CONTINUE; } - - /** Called when we are writing metadata for a nickcore - * @param WriteMetata A callback function used to insert the metadata - * @param nc The nickcore - */ - virtual void OnDatabaseWriteMetadata(void (*WriteMetadata)(const Anope::string &, const Anope::string &), NickCore *nc) { } - - /** Called when we are wrting metadata for a nickalias - * @param WriteMetata A callback function used to insert the metadata - * @param na The nick alias - */ - virtual void OnDatabaseWriteMetadata(void (*WriteMetadata)(const Anope::string &, const Anope::string &), NickAlias *na) { } - - /** Called when we are writing metadata for a botinfo - * @param WriteMetata A callback function used to insert the metadata - * @param bi The botinfo - */ - virtual void OnDatabaseWriteMetadata(void (*WriteMetadata)(const Anope::string &, const Anope::string &), BotInfo *bi) { } - - /** Called when are are writing metadata for a channelinfo - * @param WriteMetata A callback function used to insert the metadata - * @param bi The channelinfo - */ - virtual void OnDatabaseWriteMetadata(void (*WriteMetadata)(const Anope::string &, const Anope::string &), ChannelInfo *ci) { } - /** Called when services restart */ virtual void OnRestart() { } @@ -673,11 +601,6 @@ class CoreExport Module : public Extensible */ virtual void OnChanDrop(const Anope::string &chname) { } - /** Called when a channel is forbidden - * @param ci The channel - */ - virtual void OnChanForbidden(ChannelInfo *ci) { } - /** Called when a channel is registered * @param ci The channel */ @@ -979,10 +902,10 @@ class CoreExport Module : public Extensible /** Called when a mode is about to be unlocked * @param ci The channel the mode is being unlocked from - * @param mode The mode being unlocked + * @param lock The mode lock * @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to deny the mlock. */ - virtual EventReturn OnUnMLock(ChannelInfo *ci, ChannelMode *mode, const Anope::string ¶m) { return EVENT_CONTINUE; } + virtual EventReturn OnUnMLock(ChannelInfo *ci, ModeLock *lock) { return EVENT_CONTINUE; } /** Called after a module is loaded * @param u The user loading the module, can be NULL @@ -1042,7 +965,7 @@ enum Implementation I_OnNickUpdate, /* ChanServ */ - I_OnChanForbidden, I_OnChanSuspend, I_OnChanDrop, I_OnPreChanExpire, I_OnChanExpire, I_OnAccessAdd, + 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_OnChanInfo, I_OnFindChan, I_OnCheckPriv, I_OnGroupCheckPriv, @@ -1066,8 +989,7 @@ enum Implementation I_OnAddXLine, I_OnDelXLine, I_IsServicesOper, /* Database */ - I_OnPostLoadDatabases, I_OnSaveDatabase, I_OnLoadDatabase, - I_OnDatabaseWrite, I_OnDatabaseRead, I_OnDatabaseReadMetadata, I_OnDatabaseWriteMetadata, + I_OnSaveDatabase, I_OnLoadDatabase, /* Modules */ I_OnModuleLoad, I_OnModuleUnload, @@ -1235,6 +1157,11 @@ class service_reference : public dynamic_reference<T> { } + inline void operator=(const Anope::string &n) + { + this->name = n; + } + operator bool() { if (this->invalid) |