Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove baseUrl #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addon.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"AddonInfo"
{
"name" "TebexGmod"
"version" "0.1"
"version" "0.2"
"up_date" "06/07/2018"
"author_name" "Tebex"
"author_email" "liam@tebex.co.uk"
2 changes: 1 addition & 1 deletion lua/tebex/commands/forcecheck.lua
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ Msg( "// Command tebex:forcecheck //\n" )

Tebex.commands["forcecheck"] = function(ply, args)
Tebex.warn("Checking for commands to be executed...");
apiclient = TebexApiClient:init(config:get("baseUrl"), config:get("secret"))
apiclient = TebexApiClient:init("https://plugin.tebex.io", config:get("secret"))
apiclient:get("/queue", function(response)

if (response["meta"]["next_check"] > 0) then
2 changes: 1 addition & 1 deletion lua/tebex/commands/info.lua
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ Msg( "// Command tebex:info //\n" )


Tebex.commands["info"] = function(ply, args)
apiclient = TebexApiClient:init(config:get("baseUrl"), config:get("secret"))
apiclient = TebexApiClient:init("https://plugin.tebex.io", config:get("secret"))
apiclient:get("/information", function(response)
TebexInformation.id = response["account"]["id"]
TebexInformation.domain = response["account"]["domain"]
2 changes: 1 addition & 1 deletion lua/tebex/commands/secret.lua
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ Tebex.commands["secret"] = function(ply, args)
end

config:set("secret", args[3])
apiclient = TebexApiClient:init(config:get("baseUrl"), config:get("secret"))
apiclient = TebexApiClient:init("https://plugin.tebex.io", config:get("secret"))
apiclient:get("/information", function(response)
TebexInformation.id = response["account"]["id"]
TebexInformation.domain = response["account"]["domain"]
2 changes: 1 addition & 1 deletion lua/tebex/init.lua
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ if not Tebex then
file.CreateDir( "tebex" )

Msg( "\n///////////////////////////////\n" )
Msg( "// TebexGmod v 0.1 //\n" )
Msg( "// TebexGmod v 0.2 //\n" )
Msg( "// https://www.tebex.io/ //\n" )
Msg( "///////////////////////////////\n" )
Msg( "// Loading... //\n" )
6 changes: 3 additions & 3 deletions lua/tebex/models/commandrunner.lua
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ TebexCommandRunner = {}
TebexCommandRunner.deleteAfter = 3

TebexCommandRunner.doOfflineCommands = function()
apiclient = TebexApiClient:init(config:get("baseUrl"), config:get("secret"))
apiclient = TebexApiClient:init("https://plugin.tebex.io", config:get("secret"))
apiclient:get("/queue/offline-commands", function(response)
commands = response.commands
exCount = 0
@@ -39,7 +39,7 @@ end

TebexCommandRunner.doOnlineCommands = function(playerPluginId, playerName, playerId)
Tebex.warn("Running online commands for " .. playerName .. " (" .. playerId .. ")");
apiclient = TebexApiClient:init(config:get("baseUrl"), config:get("secret"))
apiclient = TebexApiClient:init("https://plugin.tebex.io", config:get("secret"))
apiclient:get("/queue/online-commands/" .. playerPluginId, function(response)
commands = response.commands
exCount = 0
@@ -89,7 +89,7 @@ TebexCommandRunner.deleteCommands = function(commandIds)
amp = "&"
end

apiclient = TebexApiClient:init(config:get("baseUrl"), config:get("secret"))
apiclient = TebexApiClient:init("https://plugin.tebex.io", config:get("secret"))
apiclient:delete(endpoint, function(response)
end, function(body)
print (body["error_code"] .. " " .. body["error_message"])
3 changes: 1 addition & 2 deletions lua/tebex/models/config.lua
Original file line number Diff line number Diff line change
@@ -8,8 +8,7 @@ function TebexConfig:init()
cfg = {
buyEnabled = false,
secret = "",
buyCommand = "!donate",
baseUrl = "https://plugin.buycraft.net"
buyCommand = "!donate"
}
}