+ if (L.IPAddr.empty())
+ {
+ L.IPAddr = "*";
+ ValidIPs.push_back("*");
+ ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"Configuration warning: Link block " + assign(L.Name) + " has no IP defined! This will allow any IP to connect as this server, and MAY not be what you want.");
+ }
+
+ if (L.RecvPass.empty())
+ {
+ throw CoreException("Invalid configuration for server '"+assign(L.Name)+"', recvpass not defined!");
+ }
+
+ if (L.SendPass.empty())
+ {
+ throw CoreException("Invalid configuration for server '"+assign(L.Name)+"', sendpass not defined!");
+ }
+
+ if (L.Name.empty())
+ {
+ throw CoreException("Invalid configuration, link tag without a name! IP address: "+L.IPAddr);
+ }
+
+ if (!L.Port)
+ {
+ ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"Configuration warning: Link block " + assign(L.Name) + " has no port defined, you will not be able to /connect it.");
+ }
+ }
+
+ LinkBlocks.push_back(L);
+ }
+
+ 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!");