modify api (no google and using custom json)

This commit is contained in:
edshot99 2024-12-01 15:53:52 -06:00
parent 5ec788afcb
commit 9050a8eb9b

View File

@ -3,7 +3,7 @@ require( "cfc_promises" )
CFCCrashAPI = {}
local endpointCFC = GetConVar( "cfc_disconnect_interface_status_endpoint" ):GetString()
local endpointGlobal = "https://www.google.com"
local endpointGlobal = "https://github.com"
local api = CFCCrashAPI
@ -22,7 +22,7 @@ function api._checkCFCEndpoint()
if not success then return false end
local data = util.JSONToTable( body )
return tobool( data and data.status == "server-is-up" )
return tobool( data and data.response.server.online )
end
api.checkCFCEndpoint = async( api._checkCFCEndpoint )