mirror of
https://github.com/gmod-integration/lua.git
synced 2025-03-15 22:27:34 +00:00
fix: force player link
This commit is contained in:
parent
92635144b5
commit
d55e160320
|
@ -78,7 +78,10 @@ end
|
|||
function gmInte.verifyPlayer(ply)
|
||||
if (!gmInte.plyValid(ply)) then return end
|
||||
gmInte.http.get("/players/" .. ply:SteamID64(), function(code, data)
|
||||
if ((data && data.steam_id && ply.gmIntUnVerified) || !gmInte.config.forcePlayerLink) then
|
||||
if (!gmInte.config.forcePlayerLink) then return end
|
||||
|
||||
if (data && data.steamID64) then
|
||||
if (ply.gmIntVerified) then return end
|
||||
gmInte.SendNet(6, {
|
||||
[1] = {
|
||||
["text"] = "You have been verified",
|
||||
|
@ -86,7 +89,7 @@ function gmInte.verifyPlayer(ply)
|
|||
}
|
||||
}, ply)
|
||||
ply:Freeze(false)
|
||||
ply.gmIntUnVerified = false
|
||||
ply.gmIntVerified = true
|
||||
else
|
||||
gmInte.SendNet(6, {
|
||||
[1] = {
|
||||
|
@ -95,7 +98,6 @@ function gmInte.verifyPlayer(ply)
|
|||
}
|
||||
}, ply)
|
||||
ply:Freeze(true)
|
||||
ply.gmIntUnVerified = true
|
||||
gmInte.SendNet(7, nil, ply)
|
||||
end
|
||||
end)
|
||||
|
|
|
@ -69,11 +69,11 @@ function gmInte.http.requestAPI(params)
|
|||
return failed({ ["error"] = "Invalid Content-Type" }, code, headers)
|
||||
end
|
||||
|
||||
// Tableify the body if it's JSON
|
||||
// Parse body
|
||||
body = util.JSONToTable(body || "{}")
|
||||
|
||||
// Return success
|
||||
return success(body)
|
||||
return success(code, body)
|
||||
end,
|
||||
["failed"] = function(error)
|
||||
gmInte.logError(error)
|
||||
|
|
Loading…
Reference in New Issue
Block a user