mirror of
https://github.com/gmod-integration/lua.git
synced 2025-03-15 22:07:34 +00:00
add: open config if fail to connect to api
This commit is contained in:
parent
d2a86b2182
commit
ded2ea4a6a
|
@ -35,7 +35,8 @@ local netReceive = {
|
||||||
gmInte.showTestConnection(data)
|
gmInte.showTestConnection(data)
|
||||||
end,
|
end,
|
||||||
[5] = function(data)
|
[5] = function(data)
|
||||||
gmInte.config = table.Merge(gmInte.config, data)
|
gmInte.config = table.Merge(gmInte.config, data.config)
|
||||||
|
if (!data.other.aprovedCredentials) then RunConsoleCommand("gmod_integration_admin") end
|
||||||
end,
|
end,
|
||||||
[6] = function(data)
|
[6] = function(data)
|
||||||
gmInte.chatAddText(data)
|
gmInte.chatAddText(data)
|
||||||
|
|
|
@ -64,10 +64,16 @@ function gmInte.publicGetConfig(ply)
|
||||||
if (!ply:IsValid() || !ply:IsPlayer(ply)) then return end
|
if (!ply:IsValid() || !ply:IsPlayer(ply)) then return end
|
||||||
|
|
||||||
gmInte.SendNet("publicConfig", {
|
gmInte.SendNet("publicConfig", {
|
||||||
["id"] = gmInte.config.id,
|
["config"] = {
|
||||||
["debug"] = gmInte.config.debug,
|
["id"] = gmInte.config.id,
|
||||||
["apiFQDN"] = gmInte.config.apiFQDN,
|
["debug"] = gmInte.config.debug,
|
||||||
["websocketFQDN"] = gmInte.config.websocketFQDN,
|
["apiFQDN"] = gmInte.config.apiFQDN,
|
||||||
|
["websocketFQDN"] = gmInte.config.websocketFQDN,
|
||||||
|
["version"] = gmInte.config.version,
|
||||||
|
},
|
||||||
|
["other"] = {
|
||||||
|
["aprovedCredentials"] = gmInte.aprovedCredentials,
|
||||||
|
}
|
||||||
}, ply)
|
}, ply)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -79,6 +79,7 @@ function gmInte.http.requestAPI(params)
|
||||||
return failed(code, body)
|
return failed(code, body)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
gmInte.aprovedCredentials = true
|
||||||
return success(code, body)
|
return success(code, body)
|
||||||
end,
|
end,
|
||||||
["failed"] = function(error)
|
["failed"] = function(error)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user