Daemon
Daemon copied to clipboard
Allow multiple proxies of a cvar
Sometimes it would be useful to have more than one module registered for updates of a cvar. For example:
- All modules use the
logs.suppression.*cvars. Currently they are requested using their string name but it would be more efficient to use the Cvar object. - Automatically update the UI when the
languagecvar changes - Cgame may want to register some sgame variables for setting them in a server config menu.
My design is to have have a priority ordering engine > sgame > cgame, and allow one registration from each module. The highest-priority module registering the cvar will control the allowed cvar values (and flags?).
I started working on this in the slipher/cvar-multi-registration branch, but it turned out really complicated. So I want to migrate all the engine cvars to use new-style cvars first, so there are less cases to handle. Also old-style cvars don't register a proxy, so the code would wrongly give control to a cgame or sgame proxy (though this can already happen in the single-proxy world).