*/
-/* $ModDesc: Provides a spanning tree server link protocol */
-
#include "inspircd.h"
#include "socket.h"
#include "xline.h"
void ModuleSpanningTree::init()
{
+ ServerInstance->SNO->EnableSnomask('l', "LINK");
+
Utils = new SpanningTreeUtilities(this);
commands = new SpanningTreeCommands(this);
ServerInstance->Modules->AddService(commands->rconnect);
else if ((Current->Hidden) && (!user->IsOper()))
return;
- std::string servername = Current->GetName();
- user->WriteNumeric(364, "%s %s %s :%d %s", user->nick.c_str(), servername.c_str(),
+ user->WriteNumeric(364, "%s %s %s :%d %s", user->nick.c_str(), Current->GetName().c_str(),
(Utils->FlatLinks && (!user->IsOper())) ? ServerInstance->Config->ServerName.c_str() : Parent.c_str(),
(Utils->FlatLinks && (!user->IsOper())) ? 0 : hops,
Current->GetDesc().c_str());
if ((Utils->PingWarnTime) && (!s->Warned) && (curtime >= s->NextPingTime() - (Utils->PingFreq - Utils->PingWarnTime)) && (!s->AnsweredLastPing()))
{
/* The server hasnt responded, send a warning to opers */
- std::string servername = s->GetName();
- ServerInstance->SNO->WriteToSnoMask('l',"Server \002%s\002 has not responded to PING for %d seconds, high latency.", servername.c_str(), Utils->PingWarnTime);
+ ServerInstance->SNO->WriteToSnoMask('l',"Server \002%s\002 has not responded to PING for %d seconds, high latency.", s->GetName().c_str(), Utils->PingWarnTime);
s->Warned = true;
}
}
}
else
{
- std::string servername = CheckDupe->GetParent()->GetName();
- RemoteMessage(user, "*** CONNECT: Server \002%s\002 already exists on the network and is connected via \002%s\002", x->Name.c_str(), servername.c_str());
+ RemoteMessage(user, "*** CONNECT: Server \002%s\002 already exists on the network and is connected via \002%s\002", x->Name.c_str(), CheckDupe->GetParent()->GetName().c_str());
return MOD_RES_DENY;
}
}
if (loopCall)
return; // Don't generate a REHASH here if we're in the middle of processing a message that generated this one
- ServerInstance->Logs->Log("remoterehash", LOG_DEBUG, "called with param %s", parameter.c_str());
+ ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "OnPreRehash called with param %s", parameter.c_str());
// Send out to other servers
if (!parameter.empty() && parameter[0] != '-')
void ModuleSpanningTree::ProtoSendMode(void* opaque, TargetTypeFlags target_type, void* target, const parameterlist &modeline, const std::vector<TranslateType> &translate)
{
TreeSocket* s = (TreeSocket*)opaque;
- std::string output_text;
-
- ServerInstance->Parser->TranslateUIDs(translate, modeline, output_text);
+ std::string output_text = CommandParser::TranslateUIDs(translate, modeline);
if (target)
{
CullResult ModuleSpanningTree::cull()
{
- Utils->cull();
+ if (Utils)
+ Utils->cull();
return this->Module::cull();
}