X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree%2Fmain.cpp;h=4dc6eedc0e9d3d4e4cf0cb4a3875b205db6821a7;hb=7555c1801d81d2f8ac2d4b953135ff980037f6b4;hp=9205077cf8e6ef6a9f147af97c8896eb4334213e;hpb=feebd9bbc3604877035f5cc9ba5aee960cf942b8;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 9205077cf..4dc6eedc0 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -463,11 +463,13 @@ void ModuleSpanningTree::DoPingChecks(time_t curtime) sock->WriteLine(std::string(":")+ServerInstance->Config->ServerName+" PING "+serv->GetName()); serv->SetNextPingTime(curtime + 60); serv->LastPing = curtime; + serv->Warned = false; } else { // they didnt answer, boot them ServerInstance->SNO->WriteToSnoMask('l',"Server \002%s\002 pinged out",serv->GetName().c_str()); + sock->SendError("Ping timeout"); sock->Squit(serv,"Ping timeout"); ServerInstance->SE->DelFd(sock); sock->Close(); @@ -475,6 +477,12 @@ void ModuleSpanningTree::DoPingChecks(time_t curtime) return; } } + else if ((Utils->PingWarnTime) && (!serv->Warned) && (curtime >= serv->NextPingTime() - (60 - Utils->PingWarnTime)) && (!serv->AnsweredLastPing())) + { + /* The server hasnt responded, send a warning to opers */ + ServerInstance->SNO->WriteToSnoMask('l',"Server \002%s\002 has not responded to PING for %d seconds, high latency.", serv->GetName().c_str(), Utils->PingWarnTime); + serv->Warned = true; + } } } } @@ -872,7 +880,7 @@ void ModuleSpanningTree::OnBackgroundTimer(time_t curtime) DoPingChecks(curtime); } -void ModuleSpanningTree::OnUserJoin(userrec* user, chanrec* channel) +void ModuleSpanningTree::OnUserJoin(userrec* user, chanrec* channel, bool &silent) { // Only do this for local users if (IS_LOCAL(user)) @@ -923,7 +931,7 @@ void ModuleSpanningTree::OnChangeName(userrec* user, const std::string &gecos) Utils->DoOneToMany(user->nick,"FNAME",params); } -void ModuleSpanningTree::OnUserPart(userrec* user, chanrec* channel, const std::string &partmessage) +void ModuleSpanningTree::OnUserPart(userrec* user, chanrec* channel, const std::string &partmessage, bool &silent) { if (IS_LOCAL(user)) { @@ -993,7 +1001,7 @@ void ModuleSpanningTree::OnUserPostNick(userrec* user, const std::string &oldnic } } -void ModuleSpanningTree::OnUserKick(userrec* source, userrec* user, chanrec* chan, const std::string &reason) +void ModuleSpanningTree::OnUserKick(userrec* source, userrec* user, chanrec* chan, const std::string &reason, bool &silent) { if ((source) && (IS_LOCAL(source))) {