summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree/main.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-16 21:02:39 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-05-16 21:02:39 +0000
commitb7dd7d244bb66f194b812126ac88106e60fc798f (patch)
tree2bc6d5421aa2a62f1a5dd9ff892f4fb50f9243b0 /src/modules/m_spanningtree/main.cpp
parent1635c37dadd8650a7d3ee27a0c003c4e30f1ec4e (diff)
Add a notice on connection close stating server link uptime, and fix a bug in m_opermodes which meant that its modes werent being replicated across servers (it was sending a totally malformed MODE
command with the nick in twice, and has been doing this presumably since early 1.1's) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7034 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree/main.cpp')
-rw-r--r--src/modules/m_spanningtree/main.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index 5c6fecc8f..69e032f6a 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -147,19 +147,24 @@ void ModuleSpanningTree::HandleLusers(const char** parameters, int pcnt, userrec
return;
}
-const std::string ModuleSpanningTree::MapOperInfo(TreeServer* Current)
+std::string ModuleSpanningTree::TimeToStr(time_t secs)
{
- time_t secs_up = ServerInstance->Time() - Current->age;
- time_t mins_up = secs_up / 60;
+ time_t mins_up = secs / 60;
time_t hours_up = mins_up / 60;
time_t days_up = hours_up / 24;
- secs_up = secs_up % 60;
+ secs = secs % 60;
mins_up = mins_up % 60;
hours_up = hours_up % 24;
- return (" [Up: "+ (days_up ? (ConvToStr(days_up) + "d") : std::string(""))
+ return ((days_up ? (ConvToStr(days_up) + "d") : std::string(""))
+ (hours_up ? (ConvToStr(hours_up) + "h") : std::string(""))
+ (mins_up ? (ConvToStr(mins_up) + "m") : std::string(""))
- + ConvToStr(secs_up) + "s Lag: "+ConvToStr(Current->rtt)+"s]");
+ + ConvToStr(secs) + "s");
+}
+
+const std::string ModuleSpanningTree::MapOperInfo(TreeServer* Current)
+{
+ time_t secs_up = ServerInstance->Time() - Current->age;
+ return (" [Up: " + TimeToStr(secs_up) + " Lag: "+ConvToStr(Current->rtt)+"s]");
}
// WARNING: NOT THREAD SAFE - DONT GET ANY SMART IDEAS.
@@ -1260,7 +1265,7 @@ void ModuleSpanningTree::OnEvent(Event* event)
if (a)
{
ourTS = a->age;
- Utils->DoOneToMany(ServerInstance->Config->ServerName,"MODE",*params);
+ Utils->DoOneToMany(ServerInstance->Config->ServerName,"FMODE",*params);
return;
}
else