add skynet.pcall for hotfix use (call a function with require)

This commit is contained in:
Cloud Wu
2015-04-22 16:50:20 +08:00
parent e3b7f86075
commit cd3391461c
7 changed files with 18 additions and 7 deletions

View File

@@ -44,7 +44,7 @@ function CMD.new(name, t)
elseif dt == "string" then
value = setmetatable({}, env_mt)
local f = load(t, "=" .. name, "t", value)
f()
assert(skynet.pcall(f))
setmetatable(value, nil)
elseif dt == "nil" then
value = {}