From bcc40d76fc87ab2673d356eec4c6c355330cc309 Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Tue, 16 Jan 2018 22:06:11 -0800 Subject: [PATCH] Validate player is still there. They could have logged off, we should stop processing if so. --- init.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/init.lua b/init.lua index 3df2e94..b785f64 100644 --- a/init.lua +++ b/init.lua @@ -113,6 +113,12 @@ local function send_request(request_type, player, context) timeout = 15, }, function(res) assert(res.completed) + if not player then + -- the player could have logged off + minetest.log("verbose", "player left, discarding packet result from mt2fa server") + return + end + if not res.succeeded then -- major problem, retry minetest.log("error", "mt2fa: server replied with an error code")