diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/inspircd.h | 5 | ||||
-rw-r--r-- | include/modules.h | 10 |
2 files changed, 11 insertions, 4 deletions
diff --git a/include/inspircd.h b/include/inspircd.h index ac3d45a8d..3d1abdee4 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -598,7 +598,10 @@ class CoreExport InspIRCd * @param f A Command command handler object to add * @throw ModuleException Will throw ModuleExcption if the command already exists */ - void AddCommand(Command *f); + inline void AddCommand(Command *f) + { + Modules->AddService(*f); + } /** Send a modechange. * The parameters provided are identical to that sent to the diff --git a/include/modules.h b/include/modules.h index 13e3dc28c..582e74275 100644 --- a/include/modules.h +++ b/include/modules.h @@ -347,12 +347,16 @@ class CoreExport Module : public classbase, public usecountbase DLLManager* ModuleDLLManager; /** Default constructor. - * Creates a module class. - * @param Me An instance of the InspIRCd class which will be saved into ServerInstance for your use - * \exception ModuleException Throwing this class, or any class derived from ModuleException, causes loading of the module to abort. + * Creates a module class. Don't do any type of hook registration or checks + * for other modules here; do that in init(). */ Module(); + /** Module setup + * \exception ModuleException Throwing this class, or any class derived from ModuleException, causes loading of the module to abort. + */ + virtual void init() {} + /** Clean up prior to destruction * If you override, you must call this AFTER your module's cleanup */ |