From 6916b91ee745d4cad6de209abd207f270b203230 Mon Sep 17 00:00:00 2001 From: Linventif Date: Wed, 8 May 2024 01:50:09 +0200 Subject: [PATCH] add: detect if gm_gwsockets is install insted before require it --- lua/gmod_integration/server/sv__websocket.lua | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lua/gmod_integration/server/sv__websocket.lua b/lua/gmod_integration/server/sv__websocket.lua index 3ad0dad..625665e 100644 --- a/lua/gmod_integration/server/sv__websocket.lua +++ b/lua/gmod_integration/server/sv__websocket.lua @@ -2,17 +2,16 @@ // WebSocket // -require("gwsockets") - -if (!GWSockets) then - timer.Simple(1, function() - if (!GWSockets) then - gmInte.logError("GWSockets is not installed! Please install it from https://github.com/FredyH/GWSockets/releases") - end +if !file.Exists("bin/gm_gwsockets.dll", "LUA") then + timer.Simple(4, function() + gmInte.logHint("GWSockets is not installed !, Syncronize feature will not work !") + gmInte.logHint("Please install it from https://github.com/FredyH/GWSockets/releases") end) return end +require("gwsockets") + local function getWebSocketURL() return "wss://" .. gmInte.config.websocketFQDN end