Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need way to mark CVars as "do not modify from this point" #5391

Open
PJB3005 opened this issue Aug 22, 2024 · 0 comments
Open

Need way to mark CVars as "do not modify from this point" #5391

PJB3005 opened this issue Aug 22, 2024 · 0 comments

Comments

@PJB3005
Copy link
Member

PJB3005 commented Aug 22, 2024

There are many CVars which are read once during startup and shouldn't be modified after, mostly because their effects wouldn't apply and it would be confusing if you tried.

This is especially complicated because CVars are read during various stages of game init. For example, network properties like send buffer size are read before content gets any chance to initialize (e.g. SS14 config presets), but most engine properties are read later, and many of those still fall under "can't be dynamically changed". While thinking about #5390 I realized any solution here needs to account for both of these cases.

My idea right now is that IConfigurationManager should have a "lock" function, which would be called when the CVar is read by the manager. Presumably, have a combined "read + lock" extension method that can do both in one call for brevity.

I'm not 100% sure whether this should be a hard lock or should simply print an error to console when you try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant