From c96e4d460daf6277b27ef50f18c992a947129c3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Rouits?= Date: Sun, 31 May 2020 23:45:16 +0200 Subject: [PATCH] Fix sync unbox method call --- init.lua | 4 ++-- ssb.lua | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 697ab73..7c00f24 100644 --- a/init.lua +++ b/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 diff --git a/ssb.lua b/ssb.lua index d0fbc98..0339aba 100644 --- a/ssb.lua +++ b/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)