private:
char* hostmap;
public:
- CommandChghost (InspIRCd* Instance, char* hmap) : Command(Instance,"CHGHOST","o",2), hostmap(hmap)
+ CommandChghost (InspIRCd* Instance, Module* Creator, char* hmap) : Command(Instance,Creator,"CHGHOST","o",2), hostmap(hmap)
{
- this->source = "m_chghost.so";
syntax = "<nick> <newhost>";
TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
}
class ModuleChgHost : public Module
{
- CommandChghost* mycommand;
+ CommandChghost cmd;
char hostmap[256];
public:
ModuleChgHost(InspIRCd* Me)
- : Module(Me)
+ : Module(Me), cmd(Me, this, hostmap)
{
- OnRehash(NULL,"");
- mycommand = new CommandChghost(ServerInstance, hostmap);
- ServerInstance->AddCommand(mycommand);
+ OnRehash(NULL);
+ ServerInstance->AddCommand(&cmd);
Implementation eventlist[] = { I_OnRehash };
ServerInstance->Modules->Attach(eventlist, this, 1);
}
- void OnRehash(User* user, const std::string ¶meter)
+ void OnRehash(User* user)
{
ConfigReader Conf(ServerInstance);
std::string hmap = Conf.ReadValue("hostname", "charmap", 0);