service client and a simple DB example

This commit is contained in:
云风
2012-08-06 19:58:35 +08:00
parent b33d438715
commit 56f30e7f7f
12 changed files with 157 additions and 21 deletions

View File

@@ -16,7 +16,12 @@ end
skynet.dispatch(function(message, from, session)
print("simpledb",message, from, session)
local cmd, key , value = string.match(message, "(%w+) (%w+) ?(.*)")
command[cmd](key,value)
local f = command[cmd]
if f then
f(key,value)
else
skynet.ret("Invalid command : "..message)
end
end)
skynet.register "SIMPLEDB"