Author Topic: Darn you, convars! Darn you to heck!  (Read 1434 times)

0 Members and 1 Guest are viewing this topic.

Offline Buzzkill

  • Respected Community Member
  • Full Member
  • *****
  • Posts: 176
  • Karma: 59
    • The Hundred Acre Bloodbath
Darn you, convars! Darn you to heck!
« on: January 19, 2015, 10:10:52 AM »
I've discovered that what's old is new again.  A long time ago in a galaxy far, far away I wrote an addon to Metamod called NoSeeVar, which was designed to hide certain cvars from clients  Originally this was to fix an issue with phpUA, a web-based viewer for live games, but it turned into something more of a band-aid for situations where servers had too many visible cvars and caused conflicts with things like game server monitors and such.

I'm finding that gmod has a limit on the number of cvars it can deliver to a client during initial connection (2973 seems to be my current limit, but I'm sure it varies somewhere depending).  I can mitigate this by tracking down cvars in addons that declare FCVAR_REPLICATED and turning replication off where it provides no value  (FPP is a good example of this -- it creates hundreds of cvars to house settings that only serve the admin menu).

If I wanted to build something that would actually change a cvar flag *after* the server had started, what are my options?  I'm looking through the GMod api and only see value setters/getters -- nothing around flags.  Seems like a binary module might be required (similar to what I did under MetaMod), assuming that the GMod C++ api exposes some flag manipulation functions.

Thanks,
Buzz

(to clarify what I mean by after server startup, I mean during cvar creation or some level of pre-init.  Some way of managing it centrally without having to visit each addon adjusting their individual cvar creation calls. Obviously I can't change the cvar flags late into the server's life without creating a lot of chaos).
« Last Edit: January 19, 2015, 11:16:03 AM by Buzzkill-THABB »