Repository navigation
Check prop protection before sockets weld to plugs - #3761
Merged
Astralcircle merged 4 commits intoNov 15, 2026
Merged
Conversation
A socket welded to any matching plug nearby without checking either owner's tool permission, so a player could weld their plug into someone else's socket and copy the build with AdvDupe2. CanLink now checks WireLib.CanTool both ways on the server.
Without the plug owner check, a player can add the socket's owner as a buddy and their plug still welds into that socket. WireLib.GetOwner and WireLib.CanTool only exist on the server, but CanLink also runs on the client for the helper line. A socket or plug with no owner only has the other side checked, so map-spawned sockets link again.
Contributor
Author
|
Thanks for taking a look, @Astralcircle! I pushed a small follow-up on top of your commit that checks the plug's owner too since without it someone can add the socket's owner as a buddy and their plug still welds into that socket. It also returns early on the client, because |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sockets now check prop protection before they weld to a plug, so a player can't plug into someone else's socket and copy their whole build with AdvDupe2. This closes #2973.
The check goes in
ENT:CanLinkand usesWireLib.CanToolthe same way the Wire Grabber does, so it works with whatever prop protection the server uses. The socket's owner has to be allowed to weld the plug, and the plug's owner has to be allowed to weld the socket. It's a server-side check sinceWireLib.CanToolonly exists on the server. Data sockets are covered too since they use the sameCanLink, and if a socket or plug has no owner (like one a map spawned), only the other owner is checked.I tested it on a local dedicated server with FPP and two bots. Before the change, one bot's plug linked into the other bot's socket even though neither could touch the other's props. With this change, it only linked once both bots had added each other as buddies. A player's own socket and plug still link like before, and without a prop protection addon nothing changes. I used AI to assist but understand/reviewed the code myself.