From 76cfe3c7ab3ffa5b6b9ba4f839489c1f5255446a Mon Sep 17 00:00:00 2001 From: HF Date: Wed, 7 Sep 2022 21:23:50 +0200 Subject: [PATCH] first check captcha, then check proxy --- src/data/redis/lua/placePixel.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/data/redis/lua/placePixel.lua b/src/data/redis/lua/placePixel.lua index f8d3381..f81a5c0 100644 --- a/src/data/redis/lua/placePixel.lua +++ b/src/data/redis/lua/placePixel.lua @@ -25,6 +25,12 @@ -- 5: if we have to update isAllowed( proxycheck) -- } local ret = {0, 0, 0, 0, 0} +-- check if captcha is needed +if KEYS[2] ~= "nope" and not redis.call('get', KEYS[2]) then + -- captcha + ret[1] = 10 + return ret +end -- check if isAllowed local ia = redis.call('get', KEYS[1]) if not ia then @@ -45,12 +51,6 @@ else return ret end end --- check if captcha is needed -if KEYS[2] ~= "nope" and not redis.call('get', KEYS[2]) then - -- captcha - ret[1] = 10 - return ret -end -- get cooldown of user local cd = redis.call('pttl', KEYS[3]) if cd < 0 then