mirror of
https://github.com/gmod-integration/lua.git
synced 2025-03-15 17:17:33 +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)
|
||||
end,
|
||||
[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,
|
||||
[6] = function(data)
|
||||
gmInte.chatAddText(data)
|
||||
|
|
|
@ -64,10 +64,16 @@ function gmInte.publicGetConfig(ply)
|
|||
if (!ply:IsValid() || !ply:IsPlayer(ply)) then return end
|
||||
|
||||
gmInte.SendNet("publicConfig", {
|
||||
["id"] = gmInte.config.id,
|
||||
["debug"] = gmInte.config.debug,
|
||||
["apiFQDN"] = gmInte.config.apiFQDN,
|
||||
["websocketFQDN"] = gmInte.config.websocketFQDN,
|
||||
["config"] = {
|
||||
["id"] = gmInte.config.id,
|
||||
["debug"] = gmInte.config.debug,
|
||||
["apiFQDN"] = gmInte.config.apiFQDN,
|
||||
["websocketFQDN"] = gmInte.config.websocketFQDN,
|
||||
["version"] = gmInte.config.version,
|
||||
},
|
||||
["other"] = {
|
||||
["aprovedCredentials"] = gmInte.aprovedCredentials,
|
||||
}
|
||||
}, ply)
|
||||
end
|
||||
|
||||
|
|
|
@ -79,6 +79,7 @@ function gmInte.http.requestAPI(params)
|
|||
return failed(code, body)
|
||||
end
|
||||
|
||||
gmInte.aprovedCredentials = true
|
||||
return success(code, body)
|
||||
end,
|
||||
["failed"] = function(error)
|
||||
|
|
Loading…
Reference in New Issue
Block a user