mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
skynet.dispatch can replace old func
This commit is contained in:
@@ -417,8 +417,9 @@ end
|
|||||||
function skynet.dispatch(typename, func)
|
function skynet.dispatch(typename, func)
|
||||||
local p = proto[typename]
|
local p = proto[typename]
|
||||||
if func then
|
if func then
|
||||||
assert(p and (p.dispatch == nil), tostring(typename))
|
local ret = p.dispatch
|
||||||
p.dispatch = func
|
p.dispatch = func
|
||||||
|
return ret
|
||||||
else
|
else
|
||||||
return p and p.dispatch
|
return p and p.dispatch
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user