mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 11:09:04 -04:00
m_spanningtree Add SpanningTreeUtilities::FindRouteTarget()
This commit is contained in:
parent
610a74ecea
commit
ea258053f6
@ -89,6 +89,19 @@ TreeServer* SpanningTreeUtilities::FindServerID(const std::string &id)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
TreeServer* SpanningTreeUtilities::FindRouteTarget(const std::string& target)
|
||||
{
|
||||
TreeServer* const server = FindServer(target);
|
||||
if (server)
|
||||
return server;
|
||||
|
||||
User* const user = ServerInstance->FindNick(target);
|
||||
if (user)
|
||||
return TreeServer::Get(user);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SpanningTreeUtilities::SpanningTreeUtilities(ModuleSpanningTree* C)
|
||||
: Creator(C), TreeRoot(NULL)
|
||||
, PingFreq(60) // XXX: TreeServer constructor reads this and TreeRoot is created before the config is read, so init it to something (value doesn't matter) to avoid a valgrind warning in TimerManager on unload
|
||||
|
@ -148,6 +148,11 @@ class SpanningTreeUtilities : public classbase
|
||||
*/
|
||||
TreeServer* FindServerID(const std::string &id);
|
||||
|
||||
/** Find a server based on a target string.
|
||||
* @param target Target string where a command should be routed to. May be a server name, a sid, a nickname or a uuid.
|
||||
*/
|
||||
TreeServer* FindRouteTarget(const std::string& target);
|
||||
|
||||
/** Find a server by glob mask
|
||||
*/
|
||||
TreeServer* FindServerMask(const std::string &ServerName);
|
||||
|
Loading…
x
Reference in New Issue
Block a user