aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/m_spanningtree/treeserver.cpp
diff options
context:
space:
mode:
authorGravatar Attila Molnar2014-07-27 18:50:07 +0200
committerGravatar Attila Molnar2014-07-27 18:50:07 +0200
commit984004505b8b5eea2467b703411fccac831ee780 (patch)
treea9fb42d4d8a4f4d1d42c00d53a9ad204459d06ae /src/modules/m_spanningtree/treeserver.cpp
parentm_spanningtree Use the value of StartBurst to determine whether a server is b... (diff)
downloadinspircd++-984004505b8b5eea2467b703411fccac831ee780.tar.gz
inspircd++-984004505b8b5eea2467b703411fccac831ee780.tar.bz2
inspircd++-984004505b8b5eea2467b703411fccac831ee780.zip
m_spanningtree Add TreeServer::BeginBurst() that marks a server as bursting
Don't mark servers as bursting in the constructor
Diffstat (limited to 'src/modules/m_spanningtree/treeserver.cpp')
-rw-r--r--src/modules/m_spanningtree/treeserver.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp
index 9a661416a..8ff4cbe7b 100644
--- a/src/modules/m_spanningtree/treeserver.cpp
+++ b/src/modules/m_spanningtree/treeserver.cpp
@@ -51,16 +51,12 @@ TreeServer::TreeServer()
TreeServer::TreeServer(const std::string& Name, const std::string& Desc, const std::string& id, TreeServer* Above, TreeSocket* Sock, bool Hide)
: Server(Name, Desc)
, Parent(Above), Socket(Sock), sid(id), ServerUser(new FakeUser(id, this))
- , age(ServerInstance->Time()), Warned(false), UserCount(0), OperCount(0), rtt(0), Hidden(Hide)
+ , age(ServerInstance->Time()), Warned(false), UserCount(0), OperCount(0), rtt(0), StartBurst(0), Hidden(Hide)
{
CheckULine();
SetNextPingTime(ServerInstance->Time() + Utils->PingFreq);
SetPingFlag();
- long ts = ServerInstance->Time() * 1000 + (ServerInstance->Time_ns() / 1000000);
- this->StartBurst = ts;
- ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Server %s started bursting at time %lu", sid.c_str(), ts);
-
/* find the 'route' for this server (e.g. the one directly connected
* to the local server, which we can use to reach it)
*
@@ -116,6 +112,14 @@ TreeServer::TreeServer(const std::string& Name, const std::string& Desc, const s
Parent->AddChild(this);
}
+void TreeServer::BeginBurst(unsigned long startms)
+{
+ if (!startms)
+ startms = ServerInstance->Time() * 1000 + (ServerInstance->Time_ns() / 1000000);
+ this->StartBurst = startms;
+ ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Server %s started bursting at time %lu", sid.c_str(), startms);
+}
+
const std::string& TreeServer::GetID()
{
return sid;