126 setfenv(mod, pluginenv); |
126 setfenv(mod, pluginenv); |
127 if not hosts[host] then hosts[host] = { type = "component", host = host, connected = false, s2sout = {} }; end |
127 if not hosts[host] then hosts[host] = { type = "component", host = host, connected = false, s2sout = {} }; end |
128 |
128 |
129 local success, ret = pcall(mod); |
129 local success, ret = pcall(mod); |
130 if not success then |
130 if not success then |
131 log("error", "Error initialising module '%s': %s", name or "nil", ret or "nil"); |
131 log("error", "Error initialising module '%s': %s", module_name or "nil", ret or "nil"); |
132 return nil, ret; |
132 return nil, ret; |
133 end |
133 end |
134 |
134 |
135 -- Use modified host, if the module set one |
135 -- Use modified host, if the module set one |
136 modulemap[api_instance.host][module_name] = pluginenv; |
136 modulemap[api_instance.host][module_name] = pluginenv; |