Skip to content
Open
Show file tree
Hide file tree
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
38 changes: 38 additions & 0 deletions action/darkmatch.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//
// DO NOT CHANGE THIS FILE ON YOUR LOCAL SERVER, IT IS KEPT UPDATED AUTOMATICALLY
// BY Q2ADMIN PLUGIN cvarbans.lua and AND YOUR CHANGES MIGHT GET OVERWRITTEN
//
// [ ! IMPORTANT !]
// THIS FILE IS JUST FOR TESTING AT MOMENT AND IS NOT READY FOR PRODUCTION, PROPER VALUES AND
// ACTIONS FOR CVARS NEEDS TO BE DISUSSED AND SET!!!
//
// usage:
// addcvarban [cvar] [match] KICK [comment]
// or
// addcvarban [cvar] [match] STUFF [comment]${sc}_echo -c red [MESSAGE TO CLIENT]${sc}cvarbanlog-> [logmessage to server]
//
//
// if you need to add other settings, do so in other configs
//

// set current version
sets cvarbans_version "2023-12-04"

// VISUALS
addcvarban gl_modulate >5 STUFF gl_modulate 5${sc}_echo -c red gl_modulate is not allowed to be HIGHER than 5, fixing that for you sir${sc}cvarbanlog-> gl_modulate
addcvarban gl_modulate_world >5 STUFF gl_modulate_world 5${sc}_echo -c red gl_modulate_world is not allowed to be HIGHER than 5, fixing that for you sir${sc}cvarbanlog-> gl_modulate_world
addcvarban gl_modulate_entities >4 STUFF gl_modulate_entities 4${sc}_echo -c red gl_modulate_entities is not allowed to be HIGHER than 4, fixing that for you sir${sc}cvarbanlog-> gl_modulate_entities
addcvarban gl_saturation <0.5 STUFF gl_saturation 0.5${sc}_echo -c red gl_saturation is not allowed to be LOWER than 0.5, fixing that for you sir${sc}cvarbanlog-> gl_saturation_low
addcvarban gl_saturation >1 STUFF gl_saturation 1${sc}_echo -c red gl_saturation is not allowed to be HIGHER than 1, fixing that for you sir${sc}cvarbanlog-> gl_saturation_high
addcvarban gl_picmip >2 STUFF gl_picmip 2${sc}_echo -c red gl_picmip is not allowed to be HIGHER than 2, fixing that for you sir${sc}cvarbanlog-> gl_picmip
addcvarban gl_lockpvs !=0 KICK gl_lockpvs MUST be set to 0
addcvarban gl_clear !=0 KICK gl_clear MUST be set to 0
addcvarban gl_brightness !=0 STUFF gl_brightness 0${sc}_echo -c red gl_brightness must be 0 for darkmatch, fixing that for you sir${sc}cvarbanlog-> gl_brightness
addcvarban gl_novis !=1 STUFF gl_novis 1${sc}_echo -c yellow gl_novis MUST be set to 1, fixing that for you sir${sc}cvarbanlog-> gl_novis
addcvarban vid_gamma <0 STUFF vid_gamma 0${sc}_echo -c red vid_gamma is not allowed to be LOWER than 0, fixing that for you sir${sc}cvarbanlog-> vid_gamma_low
addcvarban vid_gamma >1 STUFF vid_gamma 1${sc}_echo -c red vid_gamma is not allowed to be HIGHER than 1, fixing that for you sir${sc}cvarbanlog-> vid_gamma_high
addcvarban intensity <1 STUFF intensity 1${sc}_echo -c red intensity is not allowed to be LOWER than 1, fixing that for you sir${sc}cvarbanlog-> intensity_low
addcvarban intensity >2 STUFF intensity 2${sc}_echo -c red intensity is not allowed to be HIGHER than 2, fixing that for you sir${sc}cvarbanlog-> intensity_high
addcvarban r_hwGamma !=0 STUFF r_hwGamma 0${sc}_echo -c red r_hwGamma MUST be set to 0, fixing that for you sir${sc}cvarbanlog-> r_hwGamma

// EOL
23 changes: 23 additions & 0 deletions action/force_xerp.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// DO NOT CHANGE THIS FILE ON YOUR LOCAL SERVER, IT IS KEPT UPDATED AUTOMATICALLY
// BY Q2ADMIN PLUGIN cvarbans.lua and AND YOUR CHANGES MIGHT GET OVERWRITTEN
//
// [ ! IMPORTANT !]
// THIS FILE IS JUST FOR TESTING AT MOMENT AND IS NOT READY FOR PRODUCTION, PROPER VALUES AND
// ACTIONS FOR CVARS NEEDS TO BE DISUSSED AND SET!!!
//
// usage:
// addcvarban [cvar] [match] KICK [comment]
// or
// addcvarban [cvar] [match] STUFF [comment]${sc}_echo -c red [MESSAGE TO CLIENT]${sc}cvarbanlog-> [logmessage to server]
//
//
// if you need to add other settings, do so in other configs
//

// set current version
sets cvarbans_version "2023-12-04"

addcvarban cl_xerp =1 STUFF cl_xerp 2${sc}_echo -c red cl_xerp is not allowed to be set to 1, fixing that for you sir${sc}cvarbanlog-> cl_xerp

// EOL
4 changes: 1 addition & 3 deletions action/h_cvarbans.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// or
// addcvarban [cvar] [match] STUFF [comment]${sc}_echo -c red [MESSAGE TO CLIENT]${sc}cvarbanlog-> [logmessage to server]
//
// If you want to add custom settings, create a file called h_cvarbans_costum.cfg
// If you want to add custom settings, create a file called h_cvarbans_custom.cfg
// and store your custom settings there
//
// if you need to add other settings, do so in other configs
Expand Down Expand Up @@ -46,6 +46,4 @@ addcvarban cl_testblend !=0 STUFF 0${sc}_echo -c red cl_testblend MUST be set to
addcvarban cl_blend !=1 STUFF cl_blend 1${sc}_echo -c red cl_blend MUST be set to 1, fixing that for you sir${sc}cvarbanlog-> cl_blend
addcvarban cl_pitchspeed !=150 STUFF cl_pitchspeed 150${sc}_echo -c red cl_pitchspeed MUST be set to 150, fixing that for you sir${sc}cvarbanlog-> cl_pitchspeed

// store your own cvarbans in this file!!!
exec h_cvarbans_costum.cfg
// EOL
23 changes: 21 additions & 2 deletions plugins/cvarbans.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ end

function checkcvarbans()
gi.AddCommandString("checkcvarbans\n")
gi.dprintf("checking all clients cvars\n")
--gi.dprintf("checking all clients cvars\n")
end

-- log illegal cvar settings
Expand All @@ -82,6 +82,7 @@ function q2a_load(config)

root_dir = config.root_dir
url = config.url
check_interval = config.check_interval or 10 -- default 10 seconds
if root_dir == nil then
gi.dprintf("cvarbans.lua q2a_load(): 'root_dir' not defined in the config.lua file... aborting\n")
return 0
Expand All @@ -90,8 +91,26 @@ function q2a_load(config)
gi.dprintf("cvarbans.lua q2a_load(): 'url' not defined in the config.lua file... aborting\n")
return 0
end
if check_interval == nil then
gi.dprintf("cvarbans.lua q2a_load(): 'check_interval' not defined in the config.lua file... using default 10 seconds\n")
elseif check_interval == '0' or tonumber(check_interval) == 0 then
gi.dprintf("cvarbans.lua q2a_load(): 'check_interval' set to 0 seconds... disabling automatic cvarbans checking\n")
else
gi.dprintf("cvarbans.lua q2a_load(): 'check_interval' set to "..check_interval.." seconds\n")
end

gi.dprintf("cvarbans.lua q2a_load(): Checking/Downloading new cvarbans... ")
cvarbans_update = root_dir..'plugins/cvarbans_update.sh "'..url..'" "'..game..'"'
cvarbans_os_exec(cvarbans_update) -- check for updated cvarbanlist on load
end
end

local last_check = os.time()

function RunFrame()
local now = os.time()

if tonumber(check_interval) > 0 and now - last_check >= tonumber(check_interval) then
checkcvarbans()
last_check = now
end
end