From 99f6f5c9f7227f09b457fcdb938f3b26a76a1eda Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 24 May 2005 04:55:22 +0000 Subject: Fixed to not autoconnect servers we already have! git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1488 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index b52044d2a..2ee4ca577 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -2517,6 +2517,26 @@ bool LoadModule(const char* filename) return true; } + +void GotServer(std::string name) +{ + for (int j = 0; j < 32; j++) + { + if (me[j] != NULL) + { + for (int k = 0; k < me[j]->connectors.size(); k++) + { + if (name == me[j]->connectors.GetServerName()) + { + return true; + } + } + } + } + return false; +} + + int InspIRCd(char** argv, int argc) { struct sockaddr_in client,server; @@ -2826,7 +2846,7 @@ int InspIRCd(char** argv, int argc) char Link_ServerName[MAXBUF],Link_AConn[MAXBUF]; ConfValue("link","name",i,Link_ServerName,&config_f); ConfValue("link","autoconnect",i,Link_AConn,&config_f); - if (Link_AConn[0]) + if (Link_AConn[0]) && (!GotServer(Link_ServerName)) { autoconnects::iterator a = autoconns.find(Link_ServerName); if (a != autoconns.end()) -- cgit v1.2.3