mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-22 02:53:09 +00:00
add assert
This commit is contained in:
@@ -34,7 +34,7 @@ skynet.cache = require "skynet.codecache"
|
||||
function skynet.register_protocol(class)
|
||||
local name = class.name
|
||||
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)
|
||||
proto[name] = class
|
||||
proto[id] = class
|
||||
|
||||
Reference in New Issue
Block a user