diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-12-01 18:45:35 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-12-01 18:45:35 +0000 |
commit | e0c54b23f69bed4df36348a2f88edaea6e1f96d4 (patch) | |
tree | 149c7d5153a764960b20bea1941f4d382d4fe85b /src/modules/m_spanningtree.cpp | |
parent | ad9cd7091aaef77261888ccb73b28232d9a58b5e (diff) |
Fixed forward declaration of class issue`
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2083 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree.cpp')
-rw-r--r-- | src/modules/m_spanningtree.cpp | 89 |
1 files changed, 46 insertions, 43 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 5263f3ff8..bb2231306 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -64,6 +64,7 @@ bool DoOneToOne(std::string prefix, std::string command, std::deque<std::string> bool DoOneToAllButSender(std::string prefix, std::string command, std::deque<std::string> params, std::string omit); bool DoOneToMany(std::string prefix, std::string command, std::deque<std::string> params); bool DoOneToAllButSenderRaw(std::string data,std::string omit); +void ReadConfiguration(bool rebind); class TreeServer { @@ -727,7 +728,7 @@ class TreeSocket : public InspSocket { Srv->SendOpers("*** Remote rehash initiated from server \002"+prefix+"\002."); Srv->RehashServer(); - TreeProtocolModule->ReadConfiguration(false); + ReadConfiguration(false); } DoOneToAllButSender(prefix,"REHASH",params,prefix); return true; @@ -1199,57 +1200,59 @@ bool DoOneToOne(std::string prefix, std::string command, std::deque<std::string> } } +std::vector<TreeSocket*> Bindings; -class ModuleSpanningTree : public Module +void ReadConfiguration(bool rebind) { - std::vector<TreeSocket*> Bindings; - int line; - - public: - - void ReadConfiguration(bool rebind) + if (rebind) { - if (rebind) + for (int j =0; j < Conf->Enumerate("bind"); j++) { - for (int j =0; j < Conf->Enumerate("bind"); j++) + std::string Type = Conf->ReadValue("bind","type",j); + std::string IP = Conf->ReadValue("bind","address",j); + long Port = Conf->ReadInteger("bind","port",j,true); + if (Type == "servers") { - std::string Type = Conf->ReadValue("bind","type",j); - std::string IP = Conf->ReadValue("bind","address",j); - long Port = Conf->ReadInteger("bind","port",j,true); - if (Type == "servers") + if (IP == "*") { - if (IP == "*") - { - IP = ""; - } - TreeSocket* listener = new TreeSocket(IP.c_str(),Port,true,10); - if (listener->GetState() == I_LISTENING) - { - Srv->AddSocket(listener); - Bindings.push_back(listener); - } - else - { - log(DEFAULT,"m_spanningtree: Warning: Failed to bind server port %d",Port); - listener->Close(); - delete listener; - } + IP = ""; + } + TreeSocket* listener = new TreeSocket(IP.c_str(),Port,true,10); + if (listener->GetState() == I_LISTENING) + { + Srv->AddSocket(listener); + Bindings.push_back(listener); + } + else + { + log(DEFAULT,"m_spanningtree: Warning: Failed to bind server port %d",Port); + listener->Close(); + delete listener; } } } - LinkBlocks.clear(); - for (int j =0; j < Conf->Enumerate("link"); j++) - { - Link L; - L.Name = Conf->ReadValue("link","name",j); - L.IPAddr = Conf->ReadValue("link","ipaddr",j); - L.Port = Conf->ReadInteger("link","port",j,true); - L.SendPass = Conf->ReadValue("link","sendpass",j); - L.RecvPass = Conf->ReadValue("link","recvpass",j); - LinkBlocks.push_back(L); - log(DEBUG,"m_spanningtree: Read server %s with host %s:%d",L.Name.c_str(),L.IPAddr.c_str(),L.Port); - } } + LinkBlocks.clear(); + for (int j =0; j < Conf->Enumerate("link"); j++) + { + Link L; + L.Name = Conf->ReadValue("link","name",j); + L.IPAddr = Conf->ReadValue("link","ipaddr",j); + L.Port = Conf->ReadInteger("link","port",j,true); + L.SendPass = Conf->ReadValue("link","sendpass",j); + L.RecvPass = Conf->ReadValue("link","recvpass",j); + LinkBlocks.push_back(L); + log(DEBUG,"m_spanningtree: Read server %s with host %s:%d",L.Name.c_str(),L.IPAddr.c_str(),L.Port); + } +} + + +class ModuleSpanningTree : public Module +{ + std::vector<TreeSocket*> Bindings; + int line; + + public: ModuleSpanningTree() { @@ -1611,7 +1614,7 @@ class ModuleSpanningTree : public Module Srv->RehashServer(); } } - this->ReadConfiguration(false); + ReadConfiguration(false); } // note: the protocol does not allow direct umode +o except |