Add custom ConVar whitelist & cfg parser systems - #456
Open
Vauff wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Until now, we've been unable to use Valve's ConVar whitelist system both due to a lack of customization (the config is packed in game vpk's), and because of a bug where non-map server cfg's also got subjected to whitelist limitations. This PR solves both of these problems, and now allows for running servers properly without the
-disable_workshop_command_filteringstartup parameter for protection against malicious/overbearing workshop maps.Custom ConVar Whitelist
For the most part, this behaves similarly to Valve's own whitelist system, especially since we hook into it for blocking/allowing commands.
cs2f_cvarwhitelist_enablemust be enabled &configs/cvar_whitelist.jsoncneeds to have.exampleremoved from the filename.While Valve's original
workshop_cvar_whitelist.txthas been copied into the config file, we've taken the liberty of customizing it for a better out of the box experience for dedicated server/Zombie Escape environments. However, you can still customize it for your own use cases.One additional feature we've implemented is the ability to set up map specific overrides like so:
In this example config, most maps would only be able to execute
sv_airaccelerate. While ze_my_first_ze_map can only executesv_noclipspeed, and ze_last_man_standing_p can execute bothsv_airaccelerateandzr_infect_spawn_mz_ratio.Custom CFG Parser
Plugin cfg's have been switched to use this new parser, which is effectively just passing each line of the supplied
.cfgintoServerCommand. This method bypasses the ConVar whitelist for server cfg's.cfg/cs2fixes/server.cfghas also been introduced as a replacement forcfg/server.cfg, which became basically useless due to the server cfg whitelist bug. If you have additional cfg's beyond server.cfg, you can also execute these by adding lines such asexec_custom gamemode_casual_custominto the cfg.exec_customis not whitelisted and thus can't be included in cfg's executed by the game.