Redesign harbor/master/dummy service

This commit is contained in:
Cloud Wu
2014-06-21 17:01:59 +08:00
parent 7137850eb2
commit 9937081854
16 changed files with 793 additions and 1084 deletions

View File

@@ -1,24 +1,8 @@
local skynet = require "skynet"
skynet.register_protocol {
name = "text",
id = skynet.PTYPE_TEXT,
pack = function (...)
local n = select ("#" , ...)
if n == 0 then
return ""
elseif n == 1 then
return tostring(...)
else
return table.concat({...}," ")
end
end,
unpack = skynet.tostring
}
skynet.start(function()
skynet.dispatch("text", function(session, address, text)
print("[GLOBALLOG]", skynet.address(address),text)
skynet.dispatch("lua", function(session, address, ...)
print("[GLOBALLOG]", skynet.address(address), ...)
end)
skynet.register "LOG"
end)