mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
add assert
This commit is contained in:
@@ -34,7 +34,7 @@ skynet.cache = require "skynet.codecache"
|
|||||||
function skynet.register_protocol(class)
|
function skynet.register_protocol(class)
|
||||||
local name = class.name
|
local name = class.name
|
||||||
local id = class.id
|
local id = class.id
|
||||||
assert(proto[name] == nil)
|
assert(proto[name] == nil and proto[id] == nil)
|
||||||
assert(type(name) == "string" and type(id) == "number" and id >=0 and id <=255)
|
assert(type(name) == "string" and type(id) == "number" and id >=0 and id <=255)
|
||||||
proto[name] = class
|
proto[name] = class
|
||||||
proto[id] = class
|
proto[id] = class
|
||||||
|
|||||||
Reference in New Issue
Block a user