Comparison

core/componentmanager.lua @ 1849:5529d3c8eee7

componentmanager: Use create_component for, er, creating components
author Matthew Wild <mwild1@gmail.com>
date Wed, 30 Sep 2009 11:02:31 +0100
parent 1523:841d61be198f
child 1850:8f1871c1d456
comparison
equal deleted inserted replaced
1848:0033359aeb70 1849:5529d3c8eee7
49 function load_enabled_components(config) 49 function load_enabled_components(config)
50 local defined_hosts = config or configmanager.getconfig(); 50 local defined_hosts = config or configmanager.getconfig();
51 51
52 for host, host_config in pairs(defined_hosts) do 52 for host, host_config in pairs(defined_hosts) do
53 if host ~= "*" and ((host_config.core.enabled == nil or host_config.core.enabled) and type(host_config.core.component_module) == "string") then 53 if host ~= "*" and ((host_config.core.enabled == nil or host_config.core.enabled) and type(host_config.core.component_module) == "string") then
54 hosts[host] = { type = "component", host = host, connected = false, s2sout = {}, events = events_new() }; 54 hosts[host] = create_component(host);
55 hosts[host].connected = false;
55 components[host] = default_component_handler; 56 components[host] = default_component_handler;
56 local ok, err = modulemanager.load(host, host_config.core.component_module); 57 local ok, err = modulemanager.load(host, host_config.core.component_module);
57 if not ok then 58 if not ok then
58 log("error", "Error loading %s component %s: %s", tostring(host_config.core.component_module), tostring(host), tostring(err)); 59 log("error", "Error loading %s component %s: %s", tostring(host_config.core.component_module), tostring(host), tostring(err));
59 else 60 else