summaryrefslogtreecommitdiff
path: root/src/inspircd.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-05-24 04:52:02 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-05-24 04:52:02 +0000
commit0f4ead87d522272e93dc67a701311d6e68e34c12 (patch)
tree8adfea76f2e98536322d0daf20b1226d0097ec40 /src/inspircd.cpp
parent02d7ceb47709c2ea9cc3734b5b2549c3f8990525 (diff)
Autoconnection of servers added
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1487 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r--src/inspircd.cpp19
1 files changed, 19 insertions, 0 deletions
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;