From 0f4ead87d522272e93dc67a701311d6e68e34c12 Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 24 May 2005 04:52:02 +0000 Subject: Autoconnection of servers added git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1487 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/inspircd.cpp') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 577741377..b52044d2a 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -2821,6 +2821,25 @@ int InspIRCd(char** argv, int argc) // them in a list, then reap the list every second or so. if (((TIME % 5) == 0) && (!expire_run)) { + for (int i = 0; i < ConfValueEnum("link",&config_f); i++) + { + 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]) + { + autoconnects::iterator a = autoconns.find(Link_ServerName); + if (a != autoconns.end()) + { + if (TIME > a->second) + { + ConnectServer(Link_ServerName,NULL); + a->second = TIME + atoi(Link_AConn); + } + } + } + } + expire_lines(); FOREACH_MOD OnBackgroundTimer(TIME); expire_run = true; -- cgit v1.2.3