#include "helperfuncs.h"
// Global Vars
-/* XXX - should all this be marked static? clear the global namespace, etc. */
-ConfigReader *helpop;
-Server *Srv;
+static ConfigReader *helpop;
+static Server *Srv;
void handle_helpop(char**, int, userrec*);
bool do_helpop(char**, int, userrec*);
Srv->SendToModeMask("oh",WM_AND,line);
}
+class HelpopException : public ModuleException
+{
+ private:
+ std::string err;
+ public:
+ HelpopException(std::string message) : err(message) { }
+ virtual char* GetReason() { return (char*)err.c_str(); }
+};
+
class ModuleHelpop : public Module
{
private:
if (h_file == "")
{
helpop = NULL;
- log(DEFAULT,"m_helpop: Helpop file not Specified.");
- return;
+ HelpopException e("Missing helpop file");
+ throw(e);
}
helpop = new ConfigReader(h_file);
(helpop->ReadValue("nohelpo", "line1", 0) == "") ||
(helpop->ReadValue("start", "line1", 0) == ""))
{
- log(DEFAULT,"m_helpop: Helpop file is missing important entries. Please check the example conf.");
- return;
+ HelpopException e("m_helpop: Helpop file is missing important entries. Please check the example conf.");
+ throw(e);
}
}