+
+ for (int j = 0; j < Conf->Enumerate("autoconnect"); ++j)
+ {
+ Autoconnect A;
+ A.Period = Conf->ReadInteger("autoconnect", "period", j, true);
+ A.Server = Conf->ReadValue("autoconnect", "server", j);
+ A.FailOver = Conf->ReadValue("autoconnect", "failover", j).c_str();
+
+ // Fix: Only trip autoconnects if this wouldn't delay autoconnect..
+ if (A.NextConnectTime > ((time_t)(ServerInstance->Time() + A.Period)))
+ A.NextConnectTime = ServerInstance->Time() + A.Period;
+
+ if (A.Period <= 0)
+ {
+ throw CoreException("Invalid configuration for autoconnect, period not a positive integer!");
+ }
+
+ if (A.Server.empty())
+ {
+ throw CoreException("Invalid configuration for autoconnect, server cannot be empty!");
+ }
+
+ AutoconnectBlocks.push_back(A);
+ }
+