Skip to content
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

E2 Permissions Escalation Fix and @disabled rework #2443

Merged
merged 9 commits into from
Oct 11, 2022

Conversation

Derpius
Copy link
Contributor

@Derpius Derpius commented Oct 7, 2022

This reimplements my original perms escalation fix from last year, and improves upon @disabled by turning it into a preprocessor form of error().

It also adds the directive when an E2 is pasted from a dupe that has code authored by someone other than the player duplicating.

Additionally, I saw that :SetPlayer() wasn't being called from the Wire_Expression2_Player_Authed hook while I was searching for all instances of setting chip.player so I've added a call to it there.

Still a draft as I need to implement the two owners into both the tooltip and remote uploader, and I need to test the dupe protection in multiplayer

Reimplement changing owner on code upload

Add `@disabled` when pasting a duped E2 with 3rd party code

Remove now unused friendwrite convar

Use new `@disabled` functionality for duped chips with compile errors
@Derpius
Copy link
Contributor Author

Derpius commented Oct 7, 2022

@Anticept should the world overlay even display the CPPI owner?

All prop protection addons I've used have some form of HUD overlay already

@InfHorus

This comment was marked as off-topic.

@Derpius

This comment was marked as off-topic.

@Anticept
Copy link
Member

Anticept commented Oct 7, 2022

@Anticept should the world overlay even display the CPPI owner?

All prop protection addons I've used have some form of HUD overlay already

Part of the reason I suggest this is to communicate to everyone that it is possible for the owner of a chip, and the owner of the code that runs on the chip, to be different. Thus this helps people understand what might be going on.

As it stands right now, nothing does this in wiremod, so it's a paradigm shift.

If someone uploads code to an E2, certain things might act on them instead of the chip owner right? Prop protection or not, this is another way to help people understand what is going on. So yes, please include showing on the world overlay.

@Derpius
Copy link
Contributor Author

Derpius commented Oct 7, 2022

This will mean updating the base world overlay to use CPPI owner with a fallback to sandbox's GetPlayer
I could put the CPPI owner in the E2 specific overlay and have the base owner name be the code author, but given it's next to the entity name that would probably cause confusion

This is just setName but it's what I had in mind
image

Might move the author to the central panel but the code that calculates the size and performs the layout of that is god awful so I'd rather avoid it

@Derpius
Copy link
Contributor Author

Derpius commented Oct 7, 2022

One other thing, I'm going to rename @disabled to @error cause I noticed that it works as a compile time error directive now, even showing in editor
image

@Vurv78 has informed me of preprocessor commands, which are a better fit for this than directives

@Derpius
Copy link
Contributor Author

Derpius commented Oct 7, 2022

Just tested in multiplayer, all works

@Derpius
Copy link
Contributor Author

Derpius commented Oct 7, 2022

Replaced @disabled directive with #error and improved the syntax highlighting of preprocessor commands to boot (personally not a fan of the hot pink for the default colour but left it as is)
image

This also allows for easy addition of #warning when @Vurv78 gets around to adding warnings to the preprocessor

Display CPPI owner when available on base wire entity overlay
@Derpius
Copy link
Contributor Author

Derpius commented Oct 7, 2022

Tested the UI in singleplayer and multiplayer both with and without CPPI implementing addons

@Derpius Derpius marked this pull request as ready for review October 7, 2022 22:54
@Vurv78 Vurv78 merged commit c3fe464 into wiremod:master Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants