From 3b9cf59ba05e57fe16ff13b2782bc90e4a0685a5 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 8 Feb 2006 18:14:12 +0000 Subject: Checks to not propogate invalid or already-existing Xlines git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3143 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'src/modules/m_spanningtree.cpp') diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index e1dbb5291..2aadd97f0 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -1554,35 +1554,42 @@ class TreeSocket : public InspSocket if (params.size() < 6) return true; + bool propogate = false; + switch (*(params[0].c_str())) { case 'Z': - add_zline(atoi(params[4].c_str()), params[2].c_str(), params[5].c_str(), params[1].c_str()); + propogate = add_zline(atoi(params[4].c_str()), params[2].c_str(), params[5].c_str(), params[1].c_str()); zline_set_creation_time((char*)params[1].c_str(), atoi(params[3].c_str())); break; case 'Q': - add_qline(atoi(params[4].c_str()), params[2].c_str(), params[5].c_str(), params[1].c_str()); + propogate = add_qline(atoi(params[4].c_str()), params[2].c_str(), params[5].c_str(), params[1].c_str()); qline_set_creation_time((char*)params[1].c_str(), atoi(params[3].c_str())); break; case 'E': - add_eline(atoi(params[4].c_str()), params[2].c_str(), params[5].c_str(), params[1].c_str()); + propogate = add_eline(atoi(params[4].c_str()), params[2].c_str(), params[5].c_str(), params[1].c_str()); eline_set_creation_time((char*)params[1].c_str(), atoi(params[3].c_str())); break; case 'G': - add_gline(atoi(params[4].c_str()), params[2].c_str(), params[5].c_str(), params[1].c_str()); + propogate = add_gline(atoi(params[4].c_str()), params[2].c_str(), params[5].c_str(), params[1].c_str()); gline_set_creation_time((char*)params[1].c_str(), atoi(params[3].c_str())); break; case 'K': - add_kline(atoi(params[4].c_str()), params[2].c_str(), params[5].c_str(), params[1].c_str()); + propogate = add_kline(atoi(params[4].c_str()), params[2].c_str(), params[5].c_str(), params[1].c_str()); + kline_set_creation_time((char*)params[1].c_str(), atoi(params[3].c_str())); break; default: /* Just in case... */ Srv->SendOpers("*** \2WARNING\2: Invalid xline type '"+params[0]+"' sent by server "+prefix+", ignored!"); + propogate = false; break; } /* Send it on its way */ - params[5] = ":" + params[5]; - DoOneToAllButSender(prefix,"ADDLINE",params,prefix); + if (propogate) + { + params[5] = ":" + params[5]; + DoOneToAllButSender(prefix,"ADDLINE",params,prefix); + } return true; } -- cgit v1.2.3