// version is a simple class for holding a modules version number
-Version::Version(const std::string &modv, int flags, int api_ver, const std::string& rev)
-: description(modv), version(rev), Flags(flags), API(api_ver)
+template<>
+VersionBase<API_VERSION>::VersionBase(const std::string &modv, int flags, int, const std::string& rev)
+: description(modv), version(rev), Flags(flags)
{
}
ModResult Module::OnSetAway(User*, const std::string &) { return MOD_RES_PASSTHRU; }
ModResult Module::OnUserList(User*, Channel*) { return MOD_RES_PASSTHRU; }
ModResult Module::OnWhoisLine(User*, User*, int&, std::string&) { return MOD_RES_PASSTHRU; }
-void Module::OnBuildExemptList(MessageType, Channel*, User*, char, CUList&, const std::string&) { }
+void Module::OnBuildNeighborList(User*, UserChanList&, std::map<User*,bool>&) { }
void Module::OnGarbageCollect() { }
void Module::OnText(User*, void*, int, const std::string&, char, CUList&) { }
void Module::OnRunTestSuite() { }
void Module::OnNamesListItem(User*, Membership*, std::string&, std::string&) { }
ModResult Module::OnNumeric(User*, unsigned int, const std::string&) { return MOD_RES_PASSTHRU; }
void Module::OnHookIO(StreamSocket*, ListenSocketBase*) { }
-ModResult Module::OnHostCycle(User*) { return MOD_RES_PASSTHRU; }
void Module::OnSendWhoLine(User*, User*, Channel*, std::string&) { }
ModuleManager::ModuleManager() : ModCount(0)
newmod->ModuleDLLFactory = newhandle;
Version v = newmod->GetVersion();
- if (v.API != API_VERSION)
- {
- DetachAll(newmod);
- delete newmod;
- delete newhandle;
- LastModuleError = "Unable to load " + filename_str + ": Incorrect module API version: " + ConvToStr(v.API) + " (our version: " + ConvToStr(API_VERSION) + ")";
- ServerInstance->Logs->Log("MODULE", DEFAULT, LastModuleError);
- return false;
- }
- else
- {
- ServerInstance->Logs->Log("MODULE", DEFAULT,"New module introduced: %s (API version %d, Module version %s)%s", filename, v.API, v.version.c_str(), (!(v.Flags & VF_VENDOR) ? " [3rd Party]" : " [Vendor]"));
- }
+ ServerInstance->Logs->Log("MODULE", DEFAULT,"New module introduced: %s (Module version %s)%s", filename, v.version.c_str(), (!(v.Flags & VF_VENDOR) ? " [3rd Party]" : " [Vendor]"));
Modules[filename_str] = newmod;
}
return false;
}
}
- /** XXX: Is there anything we can do about this mess? -- Brain */
+ /** XXX: Is there anything we can do about this mess? -- Brain
+ * Yeah, don't use exceptions without RAII. -- Daniel
+ */
catch (LoadModuleException& modexcept)
{
DetachAll(newmod);
this->DetachAll(modfind->second);
ServerInstance->Parser->RemoveCommands(modfind->second);
+ ServerInstance->Modes->RemoveModes(modfind->second);
ServerInstance->GlobalCulls.AddItem(modfind->second);
Modules.erase(modfind);