mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 12:20:41 +00:00
fix
This commit is contained in:
@@ -140,10 +140,13 @@ end
|
|||||||
local function watch_proto(protoname, cond)
|
local function watch_proto(protoname, cond)
|
||||||
local proto = assert(replace_upvalue(skynet.register_protocol, "proto"), "Can't find proto table")
|
local proto = assert(replace_upvalue(skynet.register_protocol, "proto"), "Can't find proto table")
|
||||||
local p = proto[protoname]
|
local p = proto[protoname]
|
||||||
local dispatch = p.dispatch_origin or p.dispatch
|
if p == nil then
|
||||||
if p == nil or dispatch == nil then
|
|
||||||
return "No " .. protoname
|
return "No " .. protoname
|
||||||
end
|
end
|
||||||
|
local dispatch = p.dispatch_origin or p.dispatch
|
||||||
|
if dispatch == nil then
|
||||||
|
return "No dispatch"
|
||||||
|
end
|
||||||
p.dispatch_origin = dispatch
|
p.dispatch_origin = dispatch
|
||||||
p.dispatch = function(...)
|
p.dispatch = function(...)
|
||||||
if not cond or cond(...) then
|
if not cond or cond(...) then
|
||||||
|
|||||||
Reference in New Issue
Block a user