summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-10-31 18:50:09 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-10-31 18:50:09 +0000
commit98cfe3e3283605dca18e815a8c7ecc5f6b58a913 (patch)
treea8a1850cbf4f7fbd7c2cbce0aaa119a41e770c37 /src
parentca7cb01b7a286f346748986da74b634edfe195c7 (diff)
Spanningtree now compiles
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8435 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp
index e1d320051..8a68d71c5 100644
--- a/src/modules/m_spanningtree/treesocket2.cpp
+++ b/src/modules/m_spanningtree/treesocket2.cpp
@@ -525,26 +525,37 @@ bool TreeSocket::AddLine(const std::string &prefix, std::deque<std::string> &par
bool propogate = false;
+ XLine* xl;
+ IdentHostPair ih;
+
switch (*(params[0].c_str()))
{
case 'Z':
- propogate = Instance->XLines->AddZLine(atoi(params[4].c_str()), params[2].c_str(), params[5].c_str(), params[1].c_str());
+ xl = (XLine*)(new ZLine(Instance, Instance->Time(), atoi(params[4].c_str()), params[2].c_str(), params[5].c_str(), params[1].c_str()));
+ propogate = Instance->XLines->AddLine(xl);
Instance->XLines->zline_set_creation_time(params[1].c_str(), atoi(params[3].c_str()));
break;
case 'Q':
- propogate = Instance->XLines->AddQLine(atoi(params[4].c_str()), params[2].c_str(), params[5].c_str(), params[1].c_str());
+ xl = (XLine*)(new QLine(Instance, Instance->Time(), atoi(params[4].c_str()), params[2].c_str(), params[5].c_str(), params[1].c_str()));
+ propogate = Instance->XLines->AddLine(xl);
Instance->XLines->qline_set_creation_time(params[1].c_str(), atoi(params[3].c_str()));
break;
case 'E':
- propogate = Instance->XLines->AddELine(atoi(params[4].c_str()), params[2].c_str(), params[5].c_str(), params[1].c_str());
+ ih = Instance->XLines->IdentSplit(params[1]);
+ xl = (XLine*)(new GLine(Instance, Instance->Time(), atoi(params[4].c_str()), params[2].c_str(), params[5].c_str(), ih.first.c_str(), ih.second.c_str()));
+ propogate = Instance->XLines->AddLine(xl);
Instance->XLines->eline_set_creation_time(params[1].c_str(), atoi(params[3].c_str()));
break;
case 'G':
- propogate = Instance->XLines->AddGLine(atoi(params[4].c_str()), params[2].c_str(), params[5].c_str(), params[1].c_str());
+ ih = Instance->XLines->IdentSplit(params[1]);
+ xl = (XLine*)(new GLine(Instance, Instance->Time(), atoi(params[4].c_str()), params[2].c_str(), params[5].c_str(), ih.first.c_str(), ih.second.c_str()));
+ propogate = Instance->XLines->AddLine(xl);
Instance->XLines->gline_set_creation_time(params[1].c_str(), atoi(params[3].c_str()));
break;
case 'K':
- propogate = Instance->XLines->AddKLine(atoi(params[4].c_str()), params[2].c_str(), params[5].c_str(), params[1].c_str());
+ ih = Instance->XLines->IdentSplit(params[1]);
+ xl = (XLine*)(new KLine(Instance, Instance->Time(), atoi(params[4].c_str()), params[2].c_str(), params[5].c_str(), ih.first.c_str(), ih.second.c_str()));
+ propogate = Instance->XLines->AddLine(xl);
break;
default:
/* Just in case... */
@@ -555,10 +566,9 @@ bool TreeSocket::AddLine(const std::string &prefix, std::deque<std::string> &par
/* Send it on its way */
if (propogate)
{
- if (atoi(params[4].c_str()))
+ if (xl->expiry)
{
- time_t c_requires_crap = ConvToInt(params[4]) + Instance->Time();
- this->Instance->SNO->WriteToSnoMask('x',"%s Added %cLINE on %s to expire on %s (%s).",prefix.c_str(),*(params[0].c_str()),params[1].c_str(),Instance->TimeString(c_requires_crap).c_str(),params[5].c_str());
+ this->Instance->SNO->WriteToSnoMask('x',"%s Added %cLINE on %s to expire on %s (%s).",prefix.c_str(),*(params[0].c_str()),params[1].c_str(),Instance->TimeString(xl->expiry).c_str(),params[5].c_str());
}
else
{