From f14173fa68e681c3ac638a46864e4b992314b0e0 Mon Sep 17 00:00:00 2001 From: entar Date: Fri, 5 Sep 2025 14:40:56 +0700 Subject: [PATCH] Not sending requests when not logged in from now on --- credentials.lua | 4 ++-- init.lua | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/credentials.lua b/credentials.lua index a293bdc..fe206ed 100644 --- a/credentials.lua +++ b/credentials.lua @@ -1,4 +1,4 @@ return { - id = "", - key = "" + id = "1017262", + key = "46059c43ef883ba29b7e1d5b782b9366" } \ No newline at end of file diff --git a/init.lua b/init.lua index 84cd873..2271e66 100644 --- a/init.lua +++ b/init.lua @@ -147,6 +147,7 @@ end -- data store function GJ.fetchData(key, isGlobal) + if not GJ.isLoggedIn then return end local pu, pt = true, true if isGlobal then pu, pt = false, false end @@ -156,6 +157,7 @@ function GJ.fetchData(key, isGlobal) end function GJ.setData(key, data, isGlobal) + if not GJ.isLoggedIn then return end local pu, pt = true, true if isGlobal then pu, pt = false, false end @@ -163,6 +165,7 @@ function GJ.setData(key, data, isGlobal) end function GJ.setBigData(key, data, isGlobal) + if not GJ.isLoggedIn then return end local pu, pt = true, true if isGlobal then pu, pt = false, false end @@ -170,6 +173,7 @@ function GJ.setBigData(key, data, isGlobal) end function GJ.updateData(key, value, operation, isGlobal) + if not GJ.isLoggedIn then return end local pu, pt = true, true if isGlobal then pu, pt = false, false end @@ -178,6 +182,7 @@ function GJ.updateData(key, value, operation, isGlobal) end function GJ.removeData(key, isGlobal) + if not GJ.isLoggedIn then return end local pu, pt = true, true if isGlobal then pu, pt = false, false end @@ -185,6 +190,7 @@ function GJ.removeData(key, isGlobal) end function GJ.fetchStorageKeys(isGlobal) + if not GJ.isLoggedIn then return end local pu, pt = true, true if isGlobal then pu, pt = false, false end @@ -200,12 +206,14 @@ end -- trophies function GJ.giveTrophy(id) + if not GJ.isLoggedIn then return end local s = string.find(req("trophies/add-achieved/?trophy_id=" .. id, "dump", true, true), "SUCCESS") ~= nil GJ.fetchAllTrophies(true) return s end function GJ.fetchTrophy(id) + if not GJ.isLoggedIn then return end local d = req("trophies/?trophy_id=" .. tostring(id), "keypair", true, true) local t = {} @@ -216,10 +224,12 @@ function GJ.fetchTrophy(id) end function GJ.fetchTrophiesByStatus(achieved) + if not GJ.isLoggedIn then return end return handleTrophies("achieved=" .. (achieved and "true" or "false")) end function GJ.fetchAllTrophies(f) + if not GJ.isLoggedIn then return end if f then GJ.trophies = handleTrophies("") end @@ -228,6 +238,7 @@ end -- scores function GJ.addScore(score, desc, tableID, guestName, extraData) + if not GJ.isLoggedIn then return end local pu, pt, s = true, true, "" if guestName then pu, pt, s = false, false, s .. "&guest=" .. escape(guestName) end @@ -238,6 +249,7 @@ function GJ.addScore(score, desc, tableID, guestName, extraData) end function GJ.fetchScores(limit, tableID) + if not GJ.isLoggedIn then return end local pu, pt, s = true, true, "" if tableID then pu, pt, s = false, false, "&table_id=" .. escape(tableID) end @@ -257,6 +269,7 @@ function GJ.fetchScores(limit, tableID) end function GJ.fetchTables() + if not GJ.isLoggedIn then return end local d = req("scores/tables/?", "keypair", false, false) local t, f = {}