#include <iostream>
-#include <fstream>
#include "inspircd.h"
#include "xline.h"
#include "socket.h"
void Module::OnUserInvite(User*, User*, Channel*, time_t) { DetachEvent(I_OnUserInvite); }
void Module::OnPostTopicChange(User*, Channel*, const std::string&) { DetachEvent(I_OnPostTopicChange); }
void Module::OnGetServerDescription(const std::string&, std::string&) { DetachEvent(I_OnGetServerDescription); }
-void Module::OnSyncUser(User*, Module*, void*) { DetachEvent(I_OnSyncUser); }
-void Module::OnSyncChannel(Channel*, Module*, void*) { DetachEvent(I_OnSyncChannel); }
-void Module::OnSyncNetwork(Module*, void*) { DetachEvent(I_OnSyncNetwork); }
+void Module::OnSyncUser(User*, ProtocolInterface::Server&) { DetachEvent(I_OnSyncUser); }
+void Module::OnSyncChannel(Channel*, ProtocolInterface::Server&) { DetachEvent(I_OnSyncChannel); }
+void Module::OnSyncNetwork(ProtocolInterface::Server&) { DetachEvent(I_OnSyncNetwork); }
void Module::OnDecodeMetaData(Extensible*, const std::string&, const std::string&) { DetachEvent(I_OnDecodeMetaData); }
-void Module::ProtoSendMetaData(void*, Extensible*, const std::string&, const std::string&) { }
void Module::OnChangeHost(User*, const std::string&) { DetachEvent(I_OnChangeHost); }
void Module::OnChangeName(User*, const std::string&) { DetachEvent(I_OnChangeName); }
void Module::OnChangeIdent(User*, const std::string&) { DetachEvent(I_OnChangeIdent); }
}
}
+ this->NewServices = NULL;
+
if (!PrioritizeHooks())
ServerInstance->Exit(EXIT_STATUS_MODULE);
}
else
return modfind->second;
}
-
-FileReader::FileReader(const std::string& filename)
-{
- Load(filename);
-}
-
-void FileReader::Load(const std::string& filename)
-{
- // If the file is stored in the file cache then we used that version instead.
- std::string realName = ServerInstance->Config->Paths.PrependConfig(filename);
- ConfigFileCache::iterator it = ServerInstance->Config->Files.find(realName);
- if (it != ServerInstance->Config->Files.end())
- {
- this->lines = it->second;
- }
- else
- {
- lines.clear();
-
- std::ifstream stream(realName.c_str());
- if (!stream.is_open())
- throw CoreException(filename + " does not exist or is not readable!");
-
- std::string line;
- while (std::getline(stream, line))
- {
- lines.push_back(line);
- totalSize += line.size() + 2;
- }
-
- stream.close();
- }
-}
-
-std::string FileReader::GetString()
-{
- std::string buffer;
- for (file_cache::iterator it = this->lines.begin(); it != this->lines.end(); ++it)
- {
- buffer.append(*it);
- buffer.append("\r\n");
- }
- return buffer;
-}