]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/modules.h
m_spanningtree Remove unneeded #includes
[user/henk/code/inspircd.git] / include / modules.h
index ac90d60e7241649f1f2bb0b3b86805f84cdf4b48..783edd9b171d60ae9a2df2a3dfadd5e14ebec9d9 100644 (file)
@@ -23,8 +23,7 @@
  */
 
 
-#ifndef MODULES_H
-#define MODULES_H
+#pragma once
 
 #include "dynamic.h"
 #include "base.h"
@@ -135,7 +134,7 @@ struct ModResult {
                } \
                catch (CoreException& modexcept) \
                { \
-                       ServerInstance->Logs->Log("MODULE",DEFAULT,"Exception caught: %s",modexcept.GetReason()); \
+                       ServerInstance->Logs->Log("MODULE",LOG_DEFAULT,"Exception caught: %s",modexcept.GetReason()); \
                } \
                _i = safei; \
        } \
@@ -162,7 +161,7 @@ do { \
                } \
                catch (CoreException& except_ ## n) \
                { \
-                       ServerInstance->Logs->Log("MODULE",DEFAULT,"Exception caught: %s", (except_ ## n).GetReason()); \
+                       ServerInstance->Logs->Log("MODULE",LOG_DEFAULT,"Exception caught: %s", (except_ ## n).GetReason()); \
                        (void) mod_ ## n; /* catch mismatched pairs */ \
                } \
        } \
@@ -288,7 +287,7 @@ class CoreExport dynamic_reference_base : public interfacebase
        std::string name;
        void resolve();
  protected:
-       DataProvider* value;
+       ServiceProvider* value;
  public:
        ModuleRef creator;
        dynamic_reference_base(Module* Creator, const std::string& Name);
@@ -343,6 +342,13 @@ class dynamic_reference_nocheck : public dynamic_reference_base
        }
 };
 
+class ModeReference : public dynamic_reference_nocheck<ModeHandler>
+{
+ public:
+       ModeReference(Module* mod, const std::string& modename)
+               : dynamic_reference_nocheck<ModeHandler>(mod, "mode/" + modename) {}
+};
+
 /** Priority types which can be used by Module::Prioritize()
  */
 enum Priority { PRIORITY_FIRST, PRIORITY_LAST, PRIORITY_BEFORE, PRIORITY_AFTER };
@@ -904,9 +910,9 @@ class CoreExport Module : public classbase, public usecountbase
 
        /** Called when a 005 numeric is about to be output.
         * The module should modify the 005 numeric if needed to indicate its features.
-        * @param output The 005 string to be modified if neccessary.
-        */
-       virtual void On005Numeric(std::string &output);
+       * @param output The 005 map to be modified if neccessary.
+       */
+       virtual void On005Numeric(std::map<std::string, std::string>& tokens);
 
        /** Called when a client is disconnected by KILL.
         * If a client is killed by a server, e.g. a nickname collision or protocol error,
@@ -1638,5 +1644,3 @@ struct AllModuleList {
 #define COMMAND_INIT(c) MODULE_INIT(CommandModule<c>)
 
 #endif
-
-#endif