add: detect if gm_gwsockets is install insted before require it

This commit is contained in:
Linventif 2024-05-08 01:50:09 +02:00
parent 0048a7cc19
commit 6916b91ee7
No known key found for this signature in database
GPG Key ID: FAC0CA60F9AEEC24

View File

@ -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