Fix sync unbox method call
This commit is contained in:
parent
c4fd21a229
commit
c96e4d460d
4
init.lua
4
init.lua
|
@ -42,7 +42,7 @@ function ssb_send(player, key, message)
|
|||
if err then
|
||||
return (string.format("error happened: %s", err))
|
||||
else
|
||||
minetest.log(json.encode(ret))
|
||||
-- minetest.log(json.encode(ret))
|
||||
local v = {
|
||||
id = ret.key,
|
||||
sequence = ret.value.sequence + 1,
|
||||
|
@ -69,7 +69,7 @@ function reap()
|
|||
if ret ~= nil then
|
||||
if c.id == ret.value.previous and c.rcpt == ret.value.author then
|
||||
table.remove(v, i) -- end conversation
|
||||
local text = ssb:private():unbox(ret.value.content)
|
||||
local text = ssb:private():unbox(ret.value.content).text
|
||||
local author = "ssb: " .. string.sub(ret.value.author, 1, 7) .. "..."
|
||||
minetest.chat_send_player(p, author .. " replied: " .. text)
|
||||
end
|
||||
|
|
3
ssb.lua
3
ssb.lua
|
@ -105,14 +105,13 @@ function rpc_source(conn, meth, mtype, param)
|
|||
return ret, err
|
||||
end
|
||||
|
||||
minetest.log(ret)
|
||||
do_goodbye(conn)
|
||||
|
||||
return ret, err
|
||||
end
|
||||
|
||||
function rpc_sync(conn, meth, mtype, param)
|
||||
return rpc_source(conn, meth, mtype, param)
|
||||
return rpc_source(conn, meth, "async", param)
|
||||
end
|
||||
|
||||
function rpc_async(conn, meth, mtype, param)
|
||||
|
|
Loading…
Reference in New Issue