*/
-#ifndef MODULES_H
-#define MODULES_H
+#pragma once
#include "dynamic.h"
#include "base.h"
} \
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; \
} \
} \
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 */ \
} \
} \
std::string name;
void resolve();
protected:
- DataProvider* value;
+ ServiceProvider* value;
public:
ModuleRef creator;
dynamic_reference_base(Module* Creator, const std::string& Name);
}
};
+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 };
/** 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,
#define COMMAND_INIT(c) MODULE_INIT(CommandModule<c>)
#endif
-
-#endif