/* $ModDesc: Forces opers to join a specified channel on oper-up */
-Server *Srv;
-
class ModuleOperjoin : public Module
{
private:
std::string operChan;
ConfigReader* conf;
+ Server* Srv;
public:
- ModuleOperjoin()
+ ModuleOperjoin(Server* Me)
+ : Module::Module(Me)
{
- Srv = new Server;
+ Srv = Me;
conf = new ConfigReader;
operChan = conf->ReadValue("operjoin", "channel", 0);
}
+ void Implements(char* List)
+ {
+ List[I_OnPostOper] = List[I_OnRehash] = 1;
+ }
+
+ virtual void OnRehash(std::string parameter)
+ {
+ delete conf;
+ conf = new ConfigReader;
+ }
+
virtual ~ModuleOperjoin()
{
- delete Srv;
delete conf;
}
return Version(1,0,0,1,VF_VENDOR);
}
- virtual void OnOper(userrec* user, std::string opertype)
+ virtual void OnPostOper(userrec* user, std::string opertype)
{
if(operChan != "")
{
{
}
- virtual Module * CreateModule()
+ virtual Module * CreateModule(Server* Me)
{
- return new ModuleOperjoin;
+ return new ModuleOperjoin(Me);
}
};