mirror of
https://github.com/gmod-integration/lua.git
synced 2025-03-16 01:57:34 +00:00
remove import cmd
This commit is contained in:
parent
c80e5fcaca
commit
275e91c812
|
@ -6,9 +6,6 @@ local conFuncs = {
|
||||||
["version"] = function()
|
["version"] = function()
|
||||||
gmInte.log("Version: " .. gmInte.version)
|
gmInte.log("Version: " .. gmInte.version)
|
||||||
end,
|
end,
|
||||||
["export"] = function()
|
|
||||||
gmInte.serverExport()
|
|
||||||
end,
|
|
||||||
["setting"] = function(args)
|
["setting"] = function(args)
|
||||||
gmInte.saveSetting(args[2], args[3])
|
gmInte.saveSetting(args[2], args[3])
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -24,31 +24,6 @@ function gmInte.plyValid(ply)
|
||||||
return ply:IsValid() && ply:IsPlayer() && !ply:IsBot()
|
return ply:IsValid() && ply:IsPlayer() && !ply:IsBot()
|
||||||
end
|
end
|
||||||
|
|
||||||
function gmInte.serverExport()
|
|
||||||
gmInte.log("Generating Token", true)
|
|
||||||
gmInte.post(
|
|
||||||
// Endpoint
|
|
||||||
"",
|
|
||||||
// Parameters
|
|
||||||
{ request = "generate" },
|
|
||||||
// Data
|
|
||||||
{
|
|
||||||
name = GetHostName(),
|
|
||||||
ip = game.GetIPAddress(),
|
|
||||||
port = GetConVar("hostport"):GetInt(),
|
|
||||||
},
|
|
||||||
// onSuccess
|
|
||||||
function( body, length, headers, code )
|
|
||||||
if gmInte.isCodeValid(code) then
|
|
||||||
gmInte.log("Token Generated Successfully")
|
|
||||||
gmInte.log("Use it with the command: /server import " .. body)
|
|
||||||
else
|
|
||||||
gmInte.httpError(body)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
function gmInte.saveSetting(setting, value)
|
function gmInte.saveSetting(setting, value)
|
||||||
// save this in data/gmod_integration/setting.json but first check if variable is valid
|
// save this in data/gmod_integration/setting.json but first check if variable is valid
|
||||||
if !gmInte.config[setting] then
|
if !gmInte.config[setting] then
|
||||||
|
|
Loading…
Reference in New Issue
Block a user