// These declarations define the behavours of the base class Module (which does nothing at all)
-Module::Module() : refcount(0) { }
+Module::Module() : refcount(1) { }
CullResult Module::cull()
{
return classbase::cull();
}
Module::~Module()
{
- if (refcount)
+ if (refcount != 1)
ServerInstance->Logs->Log("MODULE", DEFAULT, "References remain to destructed module " + ModuleSourceFile);
}
mod->OnCleanup(TYPE_USER,u->second);
u->second->doUnhookExtensions(items);
}
- for(char m='A'; m < 'z'; m++)
+ for(char m='A'; m <= 'z'; m++)
{
ModeHandler* mh;
mh = ServerInstance->Modes->FindMode(m, MODETYPE_USER);
this->Modes->Process(parameters, user);
}
-void InspIRCd::DumpText(User* user, const std::string &text)
-{
- if (IS_LOCAL(user))
- {
- user->Write(text);
- }
- else
- {
- PI->PushToClient(user, text);
- }
-}
-
-void InspIRCd::DumpText(User* user, const char *text, ...)
-{
- va_list argsPtr;
- char line[MAXBUF];
-
- va_start(argsPtr, text);
- vsnprintf(line, MAXBUF, text, argsPtr);
- va_end(argsPtr);
-
- DumpText(user, std::string(line));
-}
-
-void InspIRCd::DumpText(User* user, const std::string &LinePrefix, std::stringstream &TextStream)
-{
- char line[MAXBUF];
- int start_pos = LinePrefix.length();
- int pos = start_pos;
- memcpy(line, LinePrefix.data(), pos);
- std::string Word;
- while (TextStream >> Word)
- {
- int len = Word.length();
- if (pos + len + 12 > MAXBUF)
- {
- line[pos] = '\0';
- DumpText(user, std::string(line));
- pos = start_pos;
- }
- line[pos] = ' ';
- memcpy(line + pos + 1, Word.data(), len);
- pos += len + 1;
- }
- line[pos] = '\0';
- DumpText(user, std::string(line));
-}
-
bool InspIRCd::AddResolver(Resolver* r, bool cached)
{
if (!cached)