summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree/utils.cpp
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-01-05 15:04:01 +0100
committerAttila Molnar <attilamolnar@hush.com>2014-01-05 15:04:01 +0100
commit11916574f67962dce1d7a2fdf7ef6a3d2d1fa49f (patch)
tree1c3c602de5512a62e2db96652ddd540e6e53e821 /src/modules/m_spanningtree/utils.cpp
parent2f181fef775da4a686a892c06af843dddfb7950a (diff)
Introduce Server class
- Replaces std::string server in User - Replaces InspIRCd::ULine() and SilentULine()
Diffstat (limited to 'src/modules/m_spanningtree/utils.cpp')
-rw-r--r--src/modules/m_spanningtree/utils.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp
index dbd246ffe..fd51fb6b4 100644
--- a/src/modules/m_spanningtree/utils.cpp
+++ b/src/modules/m_spanningtree/utils.cpp
@@ -93,9 +93,7 @@ TreeServer* SpanningTreeUtilities::BestRouteTo(const std::string &ServerName)
User *u = ServerInstance->FindNick(ServerName);
if (u)
{
- Found = FindServer(u->server);
- if (Found)
- return Found->GetRoute();
+ return TreeServer::Get(u)->GetRoute();
}
return NULL;
@@ -180,9 +178,8 @@ void SpanningTreeUtilities::GetListOfServersForChannel(Channel* c, TreeSocketSet
if (exempt_list.find(i->first) == exempt_list.end())
{
- TreeServer* best = this->BestRouteTo(i->first->server);
- if (best)
- list.insert(best->GetSocket());
+ TreeServer* best = TreeServer::Get(i->first);
+ list.insert(best->GetSocket());
}
}
return;
@@ -210,10 +207,16 @@ bool SpanningTreeUtilities::DoOneToOne(const CmdBuilder& params, const std::stri
if (!Route)
return false;
- Route->GetSocket()->WriteLine(params);
+ DoOneToOne(params, Route);
return true;
}
+void SpanningTreeUtilities::DoOneToOne(const CmdBuilder& params, Server* server)
+{
+ TreeServer* ts = static_cast<TreeServer*>(server);
+ ts->GetSocket()->WriteLine(params);
+}
+
void SpanningTreeUtilities::RefreshIPCache()
{
ValidIPs.clear();
@@ -349,6 +352,9 @@ void SpanningTreeUtilities::ReadConfiguration()
AutoconnectBlocks.push_back(A);
}
+ for (server_hash::const_iterator i = serverlist.begin(); i != serverlist.end(); ++i)
+ i->second->CheckULine();
+
RefreshIPCache();
}