A while ago i wanted to nerf codelocks by making it so, on death, a mod would loop through all the codelocks and tool cupboards on the server and deauth the dead player.
The idea was that when you respawn you would be a "new you" and would have forgotten the codes.
So you can't just punch a random number and forget about it, either you would use numbers you can remember, or you write them down somewhere. More codes = more security = more work to keep track of them essentially.
Has anyone found a way to access the authlist of a codelock and if no, any chance for oxide to work around that in the future?
Solved Removing a single player from a codelock authlist?
Discussion in 'Rust Development' started by Kyrah Abattoir, May 6, 2016.
-
Code:
FieldInfo codelist = typeof(CodeLock).GetField("whitelistPlayers", (BindingFlags.Instance | BindingFlags.NonPublic)); var codeListInst = (List<ulong>)codelist.GetValue(slotlock);
EDIT: Also worth noting I think this is essentially the same for regular locks, but not 100% sure -
Alright, i've never accessed anything this way, i couldn't find how to read it because it's marked as internal. I'll try that as soon as possible.
what's the slotlock variable that you are referencing?Last edited by a moderator: May 6, 2016 -
-
Right!
I've never used reflection before so i'm not familiar with the syntax.
to get the codelocks i'm currently using unity's FindObjectsOfType, is there a less "overkill" method to do so?
I was thinking about only doing so when the server starts and then maintain my own list of locks as they get added/removed. -
-
Yeah it appears to just "work", I'm just referring to the unity recommendation of "Please don't use Find* trivially", but maybe they ment "don't use it every frame"
I've no clue how many codelocks are used on a busy server, on average. -
-
yup, altho codelocks are not calling on entitydeath it seems, so i have a removeall() clearing up null entries in the list before flushing player codes.