File tree Expand file tree Collapse file tree 4 files changed +6
-22
lines changed
Expand file tree Collapse file tree 4 files changed +6
-22
lines changed Original file line number Diff line number Diff line change 11require (" love.system" )
2-
3- -- mac/linux support?
4-
5- local script_path = debug.getinfo (1 , " S" ).source :sub (2 )
6- local script_dir = script_path :match (" (.*/)" )
7-
8- package.path = script_dir .. " ?.lua;" .. package.path
9- package.cpath = script_dir .. " ?.so;" .. package.cpath
10-
11- local index_os = love .system .getOS ()
12-
13- if index_os == " OS X" then
14- loc_https = require (" macos-https" )
15- elseif index_os == " Linux" then
16- loc_https = require (" linux-https" )
17- else
18- loc_https = require (" https" )
19- end
2+ -- Currently crashes, I think SMODS.https module isn't loaded in the thread
3+ loc_https = require (" SMODS.https" )
204
215local last_update_time = 0
226local initial = true
237while true do
248 if (os.time () - last_update_time >= 60 ) or initial then
25- initial = nil
9+ initial = false
2610 last_update_time = os.time ()
2711 local resp , txt = loc_https .request (
2812 " https://discord.com/api/v10/invites/eUf9Ur6RyB?with_counts=true" .. " &v=" .. tostring (os.time ())
Original file line number Diff line number Diff line change 11-- Update the Cryptid member count using HTTPS
22function update_cry_member_count ()
3- if Cryptid . enabled [ " HTTPS Module " ] == true and Cryptid .mod_path then
3+ if Cryptid_config . HTTPS and Cryptid .path and false then
44 if not GLOBAL_cry_member_update_thread then
55 -- start up the HTTPS thread if needed
6- local file_data = assert (NFS .newFileData (Cryptid .mod_path .. " https/thread.lua" ))
6+ local file_data = assert (NFS .newFileData (Cryptid .path .. " https/thread.lua" ))
77 GLOBAL_cry_member_update_thread = love .thread .newThread (file_data )
88 GLOBAL_cry_member_update_thread :start ()
99 end
@@ -23,6 +23,6 @@ function update_cry_member_count()
2323 end
2424 else
2525 -- Use a fallback value if HTTPS is disabled (you all are awesome)
26- GLOBAL_cry_member_count = 20000
26+ GLOBAL_cry_member_count = 24000
2727 end
2828end
You can’t perform that action at this time.
0 commit comments