only respective configs if starfall or mediaplayer is on the server (#35)

* only respective configs if starfall or mediaplayer is on the server

* check for addon existence by entity file
This commit is contained in:
Pierce Lally 2023-08-27 18:31:18 -04:00 committed by GitHub
parent 609f7ea083
commit 74f9be20b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 6 deletions

View File

@ -0,0 +1,12 @@
if not file.Exists("entities/mediaplayer_tv", "LUA") then return end
AddCSLuaFile()
local config = {
version = "1",
addresses = {
["samuelmaddock.github.io"] = { allowed = true },
}
}
return config

View File

@ -0,0 +1,12 @@
if not file.Exists("entities/starfall_processor", "LUA") then return end
AddCSLuaFile()
local config = {
version = "1",
addresses = {
["thegrb93.github.io"] = { allowed = true },
}
}
return config

View File

@ -1,6 +1,6 @@
AddCSLuaFile()
---@alias WhitelistAddressOption { allowed: boolean|nil, noisy: boolean|nil, permanent: boolean|nil }
---@alias WhitelistAddressOption { allowed: boolean|nil, noisy: boolean|nil, permanent: boolean|nil, pattern: boolean|nil }
---@class WhitelistConfig
---@field version string
@ -34,7 +34,6 @@ local config = {
["api.github.com"] = { allowed = true },
["github.com"] = { allowed = true },
["thegrb93.github.io"] = { allowed = true },
-- dropbox
["dl.dropboxusercontent.com"] = { allowed = true },
@ -92,9 +91,6 @@ local config = {
["(%w+)%.keybase.pub"] = { allowed = true, pattern = true },
["tts.cyzon.us"] = { allowed = true },
-- media player
["samuelmaddock.github.io"] = { allowed = true },
["wiki.garrysmod.com"] = { allowed = true },
["en.wikipedia.org"] = { allowed = true },
["developer.mozilla.org"] = { allowed = true },

View File

@ -13,8 +13,10 @@ function CFCHTTP.loadLuaConfigs( dir )
local files = file.Find( dir .. "*.lua", "LUA" )
for _, fil in pairs( files ) do
local newConfig = include( dir .. fil )
if newConfig then
CFCHTTP.config = CFCHTTP.mergeConfigs( CFCHTTP.config, newConfig )
end
end
end
---@package