Daemon icon indicating copy to clipboard operation
Daemon copied to clipboard

Allow multiple proxies of a cvar

Open slipher opened this issue 3 years ago • 0 comments

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 language cvar 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).

slipher avatar Sep 11 '22 02:09 slipher