ConfigReader *Conf, *MyConf;
public:
- ModuleCensor()
+ ModuleCensor(Server* Me)
+ : Module::Module(Me)
{
- // read the configuration file on startup.
- // it is perfectly valid to set <censor file> to the value of the
- // main config file, then append your <badword> tags to the bottom
- // of the main config... but rather messy. That's why the capability
- // of using a seperate config file is provided.
- Srv = new Server;
+ /*
+ * read the configuration file on startup.
+ * it is perfectly valid to set <censor file> to the value of the
+ * main config file, then append your <badword> tags to the bottom
+ * of the main config... but rather messy. That's why the capability
+ * of using a seperate config file is provided.
+ *
+ * XXX - Really, it'd be nice to scraip this kind of thing, and have something like
+ * an include directive to include additional configuration files. Might make our lives easier. --w00t
+ *
+ * XXX - These module pre-date the include directive which exists since beta 5 -- Brain
+ */
+ Srv = Me;
Conf = new ConfigReader;
std::string Censorfile = Conf->ReadValue("censor","file",0);
MyConf = new ConfigReader(Censorfile);
virtual ~ModuleCensor()
{
- delete Srv;
delete MyConf;
delete Conf;
}
virtual void OnRehash(std::string parameter)
{
- // reload our config file on rehash - we must destroy and re-allocate the classes
- // to call the constructor again and re-read our data.
+ /*
+ * reload our config file on rehash - we must destroy and re-allocate the classes
+ * to call the constructor again and re-read our data.
+ */
delete Conf;
delete MyConf;
Conf = new ConfigReader;
{
}
- virtual Module * CreateModule()
+ virtual Module * CreateModule(Server* Me)
{
- return new ModuleCensor;
+ return new ModuleCensor(Me);
}
};