X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree%2Ftreeserver.cpp;h=42cd37fb9ec8ef0b6171f38fbef59767523088f5;hb=da28fe0b8c0bec9ab111044b1004f24cbf2d742e;hp=00799aa8e56cc0c58d0414b18b0c4298705d6c46;hpb=7e46119759b7099c38f543bd38d0186b9806542f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp index 00799aa8e..42cd37fb9 100644 --- a/src/modules/m_spanningtree/treeserver.cpp +++ b/src/modules/m_spanningtree/treeserver.cpp @@ -1,21 +1,30 @@ -/* +------------------------------------+ - * | Inspire Internet Relay Chat Daemon | - * +------------------------------------+ +/* + * InspIRCd -- Internet Relay Chat Daemon * - * InspIRCd: (C) 2002-2010 InspIRCd Development Team - * See: http://wiki.inspircd.org/Credits + * Copyright (C) 2009 Daniel De Graaf + * Copyright (C) 2007-2008 Craig Edwards + * Copyright (C) 2008 Robin Burchell + * Copyright (C) 2007 Dennis Friis * - * This program is free but copyrighted software; see - * the file COPYING for details. + * This file is part of InspIRCd. InspIRCd is free software: you can + * redistribute it and/or modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation, version 2. * - * --------------------------------------------------- + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ + #include "inspircd.h" #include "socket.h" #include "xline.h" #include "main.h" -#include "../spanningtree.h" +#include "modules/spanningtree.h" #include "utils.h" #include "treeserver.h" @@ -61,7 +70,7 @@ TreeServer::TreeServer(SpanningTreeUtilities* Util, std::string Name, std::strin long ts = ServerInstance->Time() * 1000 + (ServerInstance->Time_ns() / 1000000); this->StartBurst = ts; - ServerInstance->Logs->Log("m_spanningtree",DEBUG, "Started bursting at time %lu", ts); + ServerInstance->Logs->Log("m_spanningtree",LOG_DEBUG, "Started bursting at time %lu", ts); /* find the 'route' for this server (e.g. the one directly connected * to the local server, which we can use to reach it) @@ -119,7 +128,7 @@ TreeServer::TreeServer(SpanningTreeUtilities* Util, std::string Name, std::strin SetID(id); } -std::string& TreeServer::GetID() +const std::string& TreeServer::GetID() { return sid; } @@ -149,7 +158,7 @@ void TreeServer::FinishBurst() void TreeServer::SetID(const std::string &id) { - ServerInstance->Logs->Log("m_spanningtree",DEBUG, "Setting SID to " + id); + ServerInstance->Logs->Log("m_spanningtree",LOG_DEBUG, "Setting SID to " + id); sid = id; Utils->sidlist[sid] = this; } @@ -217,12 +226,12 @@ std::string TreeServer::GetName() return ServerName.c_str(); } -std::string TreeServer::GetDesc() +const std::string& TreeServer::GetDesc() { return ServerDesc; } -std::string TreeServer::GetVersion() +const std::string& TreeServer::GetVersion() { return VersionString; } @@ -312,13 +321,11 @@ void TreeServer::AddChild(TreeServer* Child) bool TreeServer::DelChild(TreeServer* Child) { - for (std::vector::iterator a = Children.begin(); a != Children.end(); a++) + std::vector::iterator it = std::find(Children.begin(), Children.end(), Child); + if (it != Children.end()) { - if (*a == Child) - { - Children.erase(a); - return true; - } + Children.erase(it); + return true; } return false; }