]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/modules.h
fix for bug #175, change OnUserRegister to return int, and if greater than 0 = user...
[user/henk/code/inspircd.git] / include / modules.h
index 48192959591f7f6b8b1330d2de079953d99f53f8..8e2746bf0bec2d3e04ed1c0fcee272f097091d73 100644 (file)
@@ -74,7 +74,7 @@ enum TargetTypeFlags {
  * ipv4 servers, so this value will be ten times as
  * high on ipv6 servers.
  */
-#define NATIVE_API_VERSION 11003
+#define NATIVE_API_VERSION 11004
 #ifdef IPV6
 #define API_VERSION (NATIVE_API_VERSION * 10)
 #else
@@ -313,7 +313,7 @@ class Event : public ModuleMessage
  * be loaded. If this happens, the error message returned by ModuleException::GetReason will be displayed to the user
  * attempting to load the module, or dumped to the console if the ircd is currently loading for the first time.
  */
-class ModuleException : public classbase
+class ModuleException : public std::exception
 {
  private:
        /** Holds the error message to be displayed
@@ -328,8 +328,9 @@ class ModuleException : public classbase
        ModuleException(std::string message) : err(message) {}
        /** This destructor solves world hunger, cancels the world debt, and causes the world to end.
         * Actually no, it does nothing. Never mind.
+        * @throws Nothing!
         */
-       virtual ~ModuleException() {};
+       virtual ~ModuleException() throw() {};
        /** Returns the reason for the exception.
         * The module should probably put something informative here as the user will see this upon failure.
         */
@@ -1061,8 +1062,9 @@ class Module : public Extensible
         * Note that you should NOT delete the user record here by causing a disconnection!
         * Use OnUserConnect for that instead.
         * @param user The user registering
+        * @return 1 to indicate user quit, 0 to continue
         */
-       virtual void OnUserRegister(userrec* user);
+       virtual int OnUserRegister(userrec* user);
 
        /** Called whenever a user joins a channel, to determine if invite checks should go ahead or not.
         * This method will always be called for each join, wether or not the channel is actually +i, and