fix: don't allow connection if maintenance on and fail api endpoint

This commit is contained in:
Linventif 2024-02-28 18:35:02 +01:00
parent 368f7979af
commit eb2a7a2cf3
No known key found for this signature in database
GPG Key ID: FAC0CA60F9AEEC24

View File

@ -52,7 +52,7 @@ local function playerFilter(data)
gmInte.http.get("/players/" .. data.steamID64, gmInte.http.get("/players/" .. data.steamID64,
function(code, body) function(code, body)
if (!gmInte.config.maintenance && !body.bypassMaintenance) then if (gmInte.config.maintenance && !body.bypassMaintenance) then
game.KickID(data.networkid, filterMessage("The server is currently under maintenance and you are not whitelisted.")) game.KickID(data.networkid, filterMessage("The server is currently under maintenance and you are not whitelisted."))
end end
@ -68,8 +68,8 @@ local function playerFilter(data)
-- game.KickID(data.networkid, filterMessage("Your trust factor is too low.")) -- game.KickID(data.networkid, filterMessage("Your trust factor is too low."))
-- end -- end
end, end,
function (err) function (code, body)
if (!gmInte.config.maintenance) then if (gmInte.config.maintenance) then
game.KickID(data.networkid, filterMessage("The server is currently under maintenance and we cannot verify your account.\nVerification URL: https://verif.gmod-integration.com")) game.KickID(data.networkid, filterMessage("The server is currently under maintenance and we cannot verify your account.\nVerification URL: https://verif.gmod-integration.com"))
end end
end end