From 98865fd582137b48842791b2798eba22eea6ed48 Mon Sep 17 00:00:00 2001 From: Linventif Date: Wed, 17 Jan 2024 03:39:17 +0100 Subject: [PATCH] Update URLs for debug and development instances --- lua/gmod_integration/server/sv__websocket.lua | 9 +++++++-- lua/gmod_integration/shared/sh_http.lua | 9 +++++++-- lua/gmod_integration/sv_config.lua | 10 ++++++++-- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/lua/gmod_integration/server/sv__websocket.lua b/lua/gmod_integration/server/sv__websocket.lua index d0005b4..c6faa6f 100644 --- a/lua/gmod_integration/server/sv__websocket.lua +++ b/lua/gmod_integration/server/sv__websocket.lua @@ -31,9 +31,14 @@ end local function getWebSocketURL() local url = "wss://ws.gmod-integration.com" - if (gmInte.config.debug && gmInte.config.wssDebug) then - url = gmInte.config.wssDebug + local devURL = "wss://dev-ws.gmod-integration.com" + + if (!gmInte.config.debug) then return url end + if (gmInte.config.devInstance) then + gmInte.log("Using dev Instance", true) + return devURL end + return url end diff --git a/lua/gmod_integration/shared/sh_http.lua b/lua/gmod_integration/shared/sh_http.lua index 9397491..b592152 100644 --- a/lua/gmod_integration/shared/sh_http.lua +++ b/lua/gmod_integration/shared/sh_http.lua @@ -27,9 +27,14 @@ end local function getAPIURL() local url = "https://api.gmod-integration.com" - if (gmInte.config.debug && gmInte.config.apiDebug) then - url = gmInte.config.apiDebug + local devURL = "https://dev-api.gmod-integration.com" + + if (!gmInte.config.debug) then return url end + if (gmInte.config.devInstance) then + gmInte.log("Using dev Instance", true) + return devURL end + return url end diff --git a/lua/gmod_integration/sv_config.lua b/lua/gmod_integration/sv_config.lua index c6d464c..b365912 100644 --- a/lua/gmod_integration/sv_config.lua +++ b/lua/gmod_integration/sv_config.lua @@ -37,7 +37,6 @@ gmInte.config.websocket = false // If true, the addon will use the websocket ins // Other gmInte.config.forcePlayerLink = false // If true, the addon will force the players to link their discord account to their steam account before playing gmInte.config.supportLink = "" // The link of your support (shown when a player do not have the requiments to join the server) -gmInte.config.debug = false // If true, the addon will show debug informations in the console gmInte.config.logBotActions = false // If true, the addon will log the messages of the bot in the console // @@ -69,4 +68,11 @@ gmInte.config.filterOnBan = true // If true, the addon will filter the players a // // Will disable the features of the addon -gmInte.config.sendLog = false // Disable the logs \ No newline at end of file +gmInte.config.sendLog = false // Disable the logs + +// +// Debug & Development +// + +gmInte.config.debug = false // If true, the addon will show debug informations in the console +gmInte.config.devInstance = false // If true, the addon will use the development instance of API and Websocket \ No newline at end of file