-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add getUserInfo
function at convar (fixes #1996)
#1999
Conversation
|
This reverts commit baf6719.
Is this really needed since you can already network convar value from people client to server yourself ? This could allow even if someone has disabled convar permission on their client to bypass it and get an client userinfo convar value from the server realm ignoring the client permission. |
You could do that.
No? When calling |
Looking at your code the user info perm only exist in client side so the getUserInfo used in server side will not know about this permission, also in SF client permission are not networked to server so even if it did had that permission severside it wouldn't be able to tell if the client has the permission off. |
That's the design choice being made here, no permission for owner-only (server-side). |
The is the thing, server side will run regardless of the client permission, so even if someone has their convar or userinfo permission disabled you can bypass it by using this function on server side to retrieve client side convar. |
There is no "someone", it is you. |
@ax255 |
Is the |
Also, since the |
Oh my bad that was dumb, indentation on mobile cutting thing off made me not read this thoroughly, then I guess it's good I this state. Maybe this function is not even needed to be in client side since it will always return for the local player and you can use the regular convar lib for it. |
I suppose it is necessary when using superuser (or in case chip owner has disconnected and such)? |
Right, I'd switch to |
Not sure why, and what's the difference exactly? But, also that would require adding |
It would handle the validity check / erroring for you. Adding function convar_library.getUserInfo(name)
checkluatype(name, TYPE_STRING)
if CLIENT then checkpermission(instance, name, "convar") end
return Ply_GetInfo(getply(instance.player), name)
end |
* Actually type check before check permission is better * Use `Player.GetPlayer` approach instead
Well not done yet, I forgot that |
Confirmed in-game, broken. Throws |
For those who want local tonumber = tonumber
local convar_getUserInfo = convar.getUserInfo
convar.getUserInfoNum = function(name)
return tonumber(convar_getUserInfo(name)) or 0
end |
This is a PR where
getUserInfo
is implemented atconvar
library.