reload snlua service

This commit is contained in:
云风
2012-10-27 22:48:38 +08:00
parent 88c2af4884
commit 40d2f89443
7 changed files with 106 additions and 30 deletions

View File

@@ -17,6 +17,18 @@ function command.LIST()
skynet.ret(skynet.pack(list))
end
function command.RELOAD(handle)
handle = handle_to_address(handle)
local cmd = string.match(services[handle], "snlua (.+)")
print(services[handle],cmd)
if cmd then
skynet.send(handle,"debug","RELOAD",cmd)
skynet.ret(skynet.pack({cmd}))
else
skynet.ret(skynet.pack({"Support only snlua"}))
end
end
function command.STAT()
local list = {}
for k,v in pairs(services) do