aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2008-10-01 01:18:19 +0100
committerMatthew Wild <mwild1@gmail.com>2008-10-01 01:18:19 +0100
commitc0f26c28d0fdcdff6fc2bd271a0a2996592b882d (patch)
tree8138097068daa1ed5504ea9714c35d75ae4fc68d
parent298bb340b2eea44f10de6efe45f361f9f6893a12 (diff)
downloadprosody-c0f26c28d0fdcdff6fc2bd271a0a2996592b882d.tar.gz
prosody-c0f26c28d0fdcdff6fc2bd271a0a2996592b882d.zip
Let modules set/write globals
-rw-r--r--main.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/main.lua b/main.lua
index c25933ce..864a1ee4 100644
--- a/main.lua
+++ b/main.lua
@@ -162,9 +162,10 @@ function disconnect(conn, err)
sessions[conn].disconnect(err);
end
+modulemanager.loadall();
+
setmetatable(_G, { __index = function (t, k) print("WARNING: ATTEMPT TO READ A NIL GLOBAL!!!", k); error("Attempt to read a non-existent global. Naughty boy.", 2); end, __newindex = function (t, k, v) print("ATTEMPT TO SET A GLOBAL!!!!", tostring(k).." = "..tostring(v)); error("Attempt to set a global. Naughty boy.", 2); end }) --]][][[]][];
-modulemanager.loadall();
local protected_handler = function (conn, data, err) local success, ret = pcall(handler, conn, data, err); if not success then print("ERROR on "..tostring(conn)..": "..ret); conn:close(); end end;
local protected_disconnect = function (conn, err) local success, ret = pcall(disconnect, conn, err); if not success then print("ERROR on "..tostring(conn).." disconnect: "..ret); conn:close(); end end;