Fix sync unbox method call

This commit is contained in:
Benoît Rouits 2020-05-31 23:45:16 +02:00
parent c4fd21a229
commit c96e4d460d
2 changed files with 3 additions and 4 deletions

View File

@ -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

View File

@ -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)