Add wire_digitalscreen_draw_rate and wire_digitalscreen_net_bandwidth convars - #3679
Add wire_digitalscreen_draw_rate and wire_digitalscreen_net_bandwidth convars#3679AlexALX wants to merge 10 commits into
Conversation
This convar multiply all digital screen limits in sync, so wire_digitalscreen_rate 10 make it work exactly 10x faster.
|
Tell me if you don't like this way, and then i'll need create 4 separate convars for it. |
|
I guess you should limit it's max value to something like 10 because bigger values can probably cause net overflows |
| local maxBandwidth = defaultMaxBandwidth | ||
|
|
||
| local function updateBW() | ||
| dsRateValue = dsRate:GetFloat() |
There was a problem hiding this comment.
This won't get the updated value. Need to use function params. updateBW(cvar, old, new) new = tonumber(new) or default
There was a problem hiding this comment.
:Get* functions already return updated value in change callbacks
There was a problem hiding this comment.
Did gmod devs fix that? Cuz I did a refactor recently to get around that issue.
Hm, then i guess better to make two convars, one for net limit, second for draw limit. netrate / drawrate with bit different values. or not sure, will do some tests bit later |
wire_digitalscreen_draw_rate - purelly for draw rate speed wire_digitalscreen_net_bandwidth - set global bandwidth limit, individual devices always have 50% of global rate
|
So i did split this into two convars how: wire_digitalscreen_draw_rate - purelly for draw rate speed |
Astralcircle
left a comment
There was a problem hiding this comment.
Clamp convar max value and minimum value instead of using math.Clamp
|
Can this be reviewed? I did convar changes and this already works. |
|
ooops was wrong default, now fixed and ready to merge i guess |
Increased the maximum net bandwidth limit for the digital screen from 20,000 to 200,000.
| include("shared.lua") | ||
|
|
||
|
|
||
| local dsDrawRate = GetConVar("wire_digitalscreen_draw_rate") |
There was a problem hiding this comment.
You create convar only serveride, this won't work unless you in sp or you server host
There was a problem hiding this comment.
isn't FCVAR_REPLICATED mean it will be shared?
There was a problem hiding this comment.
For serverside [ConVar](https://wiki.facepunch.com/gmod/ConVar)s, it will enforce its value on all clients. The [ConVar](https://wiki.facepunch.com/gmod/ConVar) with the same name must also exist on the client!
Ah ok let me fix that then.


This convar multiply all digital screen limits in sync, so wire_digitalscreen_rate 10 make it work exactly 10x faster. Fixes #3670