mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-23 19:43:09 +00:00
remove old client
This commit is contained in:
@@ -22,8 +22,12 @@ skynet.register_protocol {
|
||||
return jsonpack.unpack(skynet.tostring(msg,sz))
|
||||
end,
|
||||
dispatch = function (_, _, session, args)
|
||||
local result = skynet.call("SIMPLEDB", "lua", table.unpack(args))
|
||||
response_client(session, result)
|
||||
local ok, result = pcall(skynet.call,"SIMPLEDB", "lua", table.unpack(args))
|
||||
if ok then
|
||||
response_client(session, { true, result })
|
||||
else
|
||||
response_client(session, { false, "Invalid command" })
|
||||
end
|
||||
end
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ local function dispatch()
|
||||
assert(t == '-' or t == '+')
|
||||
session = tonumber(session)
|
||||
local result = cjson.decode(str)
|
||||
print("Response:",session, result)
|
||||
print("Response:",session, result[1], result[2])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user