* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
- * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
* E-mail:
* <brain@chatspike.net>
* <Craig@chatspike.net>
#include "modules.h"
#include "helperfuncs.h"
-Server *Srv;
-FileReader *quotes = NULL;
+static Server *Srv;
+static FileReader *quotes = NULL;
std::string q_file = "";
std::string prefix = "";
}
};
+class RandquoteException : public ModuleException
+{
+ private:
+ std::string err;
+ public:
+ RandquoteException(std::string message) : err(message) { }
+
+ virtual char* GetReason()
+ {
+ return (char*)err.c_str();
+ }
+};
class ModuleRandQuote : public Module
{
if (q_file == "")
{
- log(DEFAULT,"m_randquote: Quotefile not specified - Please check your config.");
- return;
+ RandquoteException e("m_randquote: Quotefile not specified - Please check your config.");
+ throw(e);
}
quotes = new FileReader(q_file);
if(!quotes->Exists())
{
- log(DEFAULT,"m_randquote: QuoteFile not Found!! Please check your config - module will not function.");
- return;
+ RandquoteException e("m_randquote: QuoteFile not Found!! Please check your config - module will not function.");
+ throw(e);
}
else
{