hostmanager: Add disallow_s2s to config, defaults to false unless anonymous_login is enabled, then defaults to true

Fri, 03 Jul 2009 04:24:30 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Fri, 03 Jul 2009 04:24:30 +0100
changeset 1467
fc420e9585c2
parent 1466
95f8024c77fc
child 1468
83b297a412a2

hostmanager: Add disallow_s2s to config, defaults to false unless anonymous_login is enabled, then defaults to true

core/hostmanager.lua file | annotate | diff | comparison | revisions
--- a/core/hostmanager.lua	Fri Jul 03 04:04:27 2009 +0100
+++ b/core/hostmanager.lua	Fri Jul 03 04:24:30 2009 +0100
@@ -27,7 +27,12 @@
 eventmanager.add_event_hook("server-starting", load_enabled_hosts);
 
 function activate(host, host_config)
-	hosts[host] = {type = "local", connected = true, sessions = {}, host = host, s2sout = {}, events = events_new() };
+	hosts[host] = {type = "local", connected = true, sessions = {}, 
+	               host = host, s2sout = {}, events = events_new(), 
+	               disallow_s2s = configmanager.get(host, "core", "disallow_s2s") 
+	                 or (configmanager.get(host, "core", "anonymous_login") 
+	                     and (configmanager.get(host, "core", "disallow_s2s") ~= false))
+	              };
 	log((hosts_loaded_once and "info") or "debug", "Activated host: %s", host);
 	eventmanager.fire_event("host-activated", host, host_config);
 end

mercurial