Diff

core/modulemanager.lua @ 1993:09621f8d0366

modulemanager: Use componentmanager to create new components.
author Waqas Hussain <waqas20@gmail.com>
date Sun, 18 Oct 2009 03:15:33 +0500
parent 1988:a6e7fe0fc3dd
child 1994:9cc9b096c8f5
line wrap: on
line diff
--- a/core/modulemanager.lua	Sun Oct 18 03:08:41 2009 +0500
+++ b/core/modulemanager.lua	Sun Oct 18 03:15:33 2009 +0500
@@ -128,7 +128,12 @@
 	local pluginenv = setmetatable({ module = api_instance }, { __index = _G });
 	
 	setfenv(mod, pluginenv);
-	if not hosts[host] then hosts[host] = { type = "component", host = host, connected = false, s2sout = {} }; end
+	if not hosts[host] then
+		local create_component = _G.require "core.componentmanager".create_component;
+		hosts[host] = create_component(host);
+		hosts[host].connected = false;
+		log("debug", "Created new component: %s", host);
+	end
 	hosts[host].modules = modulemap[host];
 	
 	local success, ret = pcall(mod);