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

Add new natives SetConsoleVarAsString, SetConsoleVarAsInt, SetConsoleVarAsFloat, SetConsoleVarAsBool. #955

Open
shierru opened this issue Aug 7, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@shierru
Copy link

shierru commented Aug 7, 2024

There are such functions as GetConsoleVarAsString, GetConsoleVarAsInt, GetConsoleVarAsFloat, GetConsoleVarAsBool.

Sometimes there is a desire to rigidly set some settings in config.json at the game mode level, so as not to restore them every time.
Yes, you can just move config.json, but sometimes from version to version new items are added to it and you have to spend time on it (although not much, but still).

I suggest to add their analogs only in reverse, which would set var: SetConsoleVarAsString, SetConsoleVarAsInt, SetConsoleVarAsFloat, SetConsoleVarAsBool.

@shierru shierru added the enhancement New feature or request label Aug 7, 2024
@NexiusTailer
Copy link
Contributor

NexiusTailer commented Aug 8, 2024

This concept probably already exist in those natives: AddServerRule, SetServerRule and RemoveServerRule (it's not covering all variables though).

@shierru
Copy link
Author

shierru commented Aug 13, 2024

I think this is a bit different.

AddServerRule, SetServerRule, RemoveServerRule affect the information that is used in Query, although they also have limitations, e.g. you can't do anything with rules like: version, allowed_clients.

If you take ConsoleVar (currently GetConsoleVarAsString, GetConsoleVarAsInt, GetConsoleVarAsFloat, GetConsoleVarAsBool), they are responsible for getting the parameters set in the configuration file.

I don't know how necessary it is to add Set analogs of these functions.

@NexiusTailer
Copy link
Contributor

Well, some rules (variables) are protected so they cannot be changed at runtime and it's intended.

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

No branches or pull requests

2 participants