mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 12:20:41 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b901c6a38 | ||
|
|
37d64a7028 | ||
|
|
f8bf05513c | ||
|
|
bac9348db9 | ||
|
|
3074dbea0b | ||
|
|
fe4122e579 |
@@ -1,3 +1,9 @@
|
|||||||
|
v0.7.1 (2014-9-22)
|
||||||
|
-----------
|
||||||
|
* bugfix: wakeup sleep should return BREAK
|
||||||
|
* bugfix: sharedatad load string
|
||||||
|
* bugfix: dataserver forward error msg
|
||||||
|
|
||||||
v0.7.0 (2014-9-8)
|
v0.7.0 (2014-9-8)
|
||||||
-----------
|
-----------
|
||||||
* Use sproto instead of cjson
|
* Use sproto instead of cjson
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ local function dispatch_wakeup()
|
|||||||
local session = sleep_session[co]
|
local session = sleep_session[co]
|
||||||
if session then
|
if session then
|
||||||
session_id_coroutine[session] = "BREAK"
|
session_id_coroutine[session] = "BREAK"
|
||||||
return suspend(co, coroutine.resume(co, true))
|
return suspend(co, coroutine.resume(co, true, "BREAK"))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -246,7 +246,8 @@ function skynet.sleep(ti)
|
|||||||
session = tonumber(session)
|
session = tonumber(session)
|
||||||
local succ, ret = coroutine_yield("SLEEP", session)
|
local succ, ret = coroutine_yield("SLEEP", session)
|
||||||
sleep_session[coroutine.running()] = nil
|
sleep_session[coroutine.running()] = nil
|
||||||
if ret == true then
|
assert(succ, ret)
|
||||||
|
if ret == "BREAK" then
|
||||||
return "BREAK"
|
return "BREAK"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ function gateserver.start(handler)
|
|||||||
|
|
||||||
function MSG.error(fd, msg)
|
function MSG.error(fd, msg)
|
||||||
if handler.error then
|
if handler.error then
|
||||||
handler.error(fd)
|
handler.error(fd, msg)
|
||||||
end
|
end
|
||||||
close_fd(fd)
|
close_fd(fd)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -32,15 +32,18 @@ end
|
|||||||
|
|
||||||
local CMD = {}
|
local CMD = {}
|
||||||
|
|
||||||
|
local env_mt = { __index = _ENV }
|
||||||
|
|
||||||
function CMD.new(name, t)
|
function CMD.new(name, t)
|
||||||
local dt = type(t)
|
local dt = type(t)
|
||||||
local value
|
local value
|
||||||
if dt == "table" then
|
if dt == "table" then
|
||||||
value = t
|
value = t
|
||||||
elseif dt == "string" then
|
elseif dt == "string" then
|
||||||
value = {}
|
value = setmetatable({}, env_mt)
|
||||||
local f = load(t, "=" .. name, "t", env)
|
local f = load(t, "=" .. name, "t", value)
|
||||||
f()
|
f()
|
||||||
|
setmetatable(value, nil)
|
||||||
elseif dt == "nil" then
|
elseif dt == "nil" then
|
||||||
value = {}
|
value = {}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user