Allow configuring center_projectiles clientpref from site settings #536
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.
Part of #373
Allows configuring tf2centerprojectiles from the user settings page.
The visual UI changes and new DB queries are both gated behind a new config flag, as this requires some annoying sourcemod setup... we may need some amendments to this if you are segmenting your sourcemod tables in a different db schema.
The queries are a bit icky but are intended to be easy to add support for more clientprefs down the line (ie #520)
Tested: with the new config flag disabled, the settings page looks the same as on master. With the new config flag, there is a new accordion+checkbox which reads/updates the sm_cookie_cache table correctly. Updating the setting then joining a server results in the client getting the new setting.
Clientprefs sql init does create an SQL function for updating cookies. I avoided it because A) my query seems simpler and maybe faster when updating multiple cookies and B) there is no similar function for reading cookie values, so we have to interact with the tables directly anyways.
My biggest annoyance with this feature is that sourcemod caches cookies locally and delays writing updates to cookies. So a user who is ingame won't see a change to the website take effect right away. And trying to change the same setting ingame+on the website at the same time will be full of race conditions.