modulemanager: Use componentmanager to create new components.

Sun, 18 Oct 2009 03:15:33 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Sun, 18 Oct 2009 03:15:33 +0500
changeset 1993
09621f8d0366
parent 1992
bbaba17537a9
child 1994
9cc9b096c8f5

modulemanager: Use componentmanager to create new components.

core/modulemanager.lua file | annotate | diff | comparison | revisions
--- 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);

mercurial