#Convar sync no whitelist
1 messages · Page 1 of 1 (latest)
net.Receive( "gw_convarsync", function(len,ply) -- functions/netstrings.lua:L35
if !ply:IsAdmin() then return end
local cvar = tostring(net.ReadString())
local val = net.ReadFloat()
-- very easy fix if you don't wanna do an actual whitelist:
-- if not string.StartsWith(cvar, "gw_") then return end
if GetConVar(cvar) == nil then return end
RunConsoleCommand(cvar, tostring(val))
end)
Hi, fairly minor but you should probably add a whitelist of accepted cvar strings here otherwise Admins can manipulate any server convar, outside of your addons set. Still a very cool addon though!
Thanks! I'll add that in the next update.
Also just in general, there are an absolute shit tonne of static Vector and Colors created inside loops etc where they could be cached
the entities seem to be the main offenders, but there are just so many. Like if you look at any CloudTimer callback most of them are creating multiple Colors each.
which can memory leak in source engine sadly