Skip to content

Add :removedexnew for removing Dex GUIs from players#1877

Closed
wilsontulus wants to merge 6 commits intoEpix-Incorporated:masterfrom
wilsontulus:revokable-dex
Closed

Add :removedexnew for removing Dex GUIs from players#1877
wilsontulus wants to merge 6 commits intoEpix-Incorporated:masterfrom
wilsontulus:revokable-dex

Conversation

@wilsontulus
Copy link
Contributor

@wilsontulus wilsontulus commented Apr 8, 2025

Dex can now be removed from a player with :removedexnew and other similar commands.

This PR also includes a check for existing Dex_Client in PlayerGui when loading (and removes the old Dex_Client if found), and some code style fixes (mainly the inconsistencies of player variable naming).

Expected intended behavior

After executing :removedexnew (or other similar commands) to a player, the player is removed from the ServerNewDex.Authorized list (for security purposes), every Dex-related GUIs (listed in Variables.DexNames) are removed, and the existing Dex_Client in the player's PlayerGui on the server is also removed.

Note that the target player must have the same rank / AdminLevel or lower than the user of the command to prevent misusage (e.g. someone with HeadAdmin uses this command against an experience owner).

Proof of functionality

2025-04-08.10-55-55.mp4

Dex can now be revoked / removed with :revokedexnew and other similar commands.
Also includes a check for existing Dex_Client in PlayerGui when loading, and some code style fixes (ply -> plr)
Copy link
Contributor

@WalkerOfBacon WalkerOfBacon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This loop deletes the Dex UI for the user that ran the command even when I put another player that isn't me
image

Should be targeting the destination / selected players instead.
@wilsontulus
Copy link
Contributor Author

This loop deletes the Dex UI for the user that ran the command even when I put another player that isn't me

Sorry for the little mistake, fixed for now.

@WalkerOfBacon
Copy link
Contributor

Sorry for the little mistake, fixed for now.

All good

Only users with the same rank or lower than the source user.
This prevents certain cases when the owner is using dex but someone with HeadAdmin uses the command against the owner.
Copy link
Contributor

@P3tray P3tray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello. Old man here with some gripes!

Why on gods green earth would you make a command to prevent someone from running a command? That's what admin levels are for! Why wouldn't you allow someone to run dex, but let them run :s, :btools and other commands? The key difference between admin levels is that Admins+ can run dangerous commands. If that doesn't work for you, allow lower admins levels to run higher commands or create a custom level. This goes against Adonis's design principles.

https://www.youtube.com/watch?v=jhdFe3evXpk

@P3tray
Copy link
Contributor

P3tray commented Apr 11, 2025

If you want to remove Dex from people who have been demoted in the same session (not sure how we handle this). If they retain dex after their admin level has been lowered, then simply add a function inside server.Admin.SetLevel or whatever to clear their dex. That's much better.

@wilsontulus wilsontulus changed the title Add :revokedexnew for revoking Dex access to players Add :removedexnew for removing Dex GUIs from players Apr 11, 2025
@wilsontulus
Copy link
Contributor Author

wilsontulus commented Apr 11, 2025

Hello @P3tray , Sorry for the confusion, this command is more to removing the Dex UI rather than completely revoking the access since by executing the :dex (or :dexnew, i guess but it's now the same thing) command, the access is back for the command user. This command also removes the player from the Authorized table and the Dex_Client ScreenGUI to ensure the Dex UI and access is completely removed. This command also works in certain cases when the owner of an experience does want someone with HeadAdmin to use Dex for some reason, but with a limited time (in which case if the HeadAdmin continues to use dexnew against the owner's saying, then the owner would just demote the headadmin).

This PR is also made for this issue #1857 , which the suggester prefers the Dex UI to be removed after using it in some way. (I've also thought about adding an option in the :dex command for auto-removing the GUI after a respawn, but due to the multi-ScreenGUI design of the new Dex, this might be a little complicated since a CharacterAdded event has to be made somewhere, especially server-side).

About making a function for automatically removing the Dex inside Admin.SetLevel(player), I think i'll do it later since I'll need to find a way to read and execute functions between the Admin module and "internal plugins" properly.

@WalkerOfBacon
Copy link
Contributor

Actually it would be better if it only affected the user running the command rather than be able to remove someone's access (you cant even give dex access to someone else normally unless you run :sudo which is restricted to Creator+)

@wilsontulus
Copy link
Contributor Author

Actually it would be better if it only affected the user running the command rather than be able to remove someone's access (you cant even give dex access to someone else normally unless you run :sudo which is restricted to Creator+)

In my opinion, users with higher ranks than the minimum rank for using Dex should also have some kind of control to atleast remove the Dex UI from the lower rank (e.g. HeadAdmins).

@sheenieboy
Copy link

Crazy that a command this specific is getting merged instead of made into a plugin tbh when is anyone ever going to need to use this

@wilsontulus
Copy link
Contributor Author

Crazy that a command this specific is getting merged instead of made into a plugin tbh when is anyone ever going to need to use this

Technically the Dex itself is a plugin though, an "internal" one, due to it's third-party nature.

@WalkerOfBacon
Copy link
Contributor

yeah dex is "technically" a plugin

@Dimenpsyonal
Copy link
Member

Woah woah woah who said it's getting merged

@P3tray
Copy link
Contributor

P3tray commented Apr 13, 2025

Woah woah woah who said it's getting merged

image

@P3tray
Copy link
Contributor

P3tray commented Apr 13, 2025

Actually it would be better if it only affected the user running the command rather than be able to remove someone's access (you cant even give dex access to someone else normally unless you run :sudo which is restricted to Creator+)

In my opinion, users with higher ranks than the minimum rank for using Dex should also have some kind of control to atleast remove the Dex UI from the lower rank (e.g. HeadAdmins).

Yes.

Now, I'll vouch in favor of Wilson! A lot of our commands do have :un* versions, like :unlight and stuff. Having :undex is fine. This can be considered as a band aid fix until something's done inside Admin.SetLevel. I will also point zero other people have complained about users retaining dex after being demoted, because that very rarely happens.

Regarless, it's probably good to merge. Could you rename the cmd from :removenewdex to :undex, so it removes all dex, regardless of if it's Dex V3 or V4?.

Can someone less lazy than me read the code for malware? The diff is too big to look at on GitHub.

Thanks for your contribution, Wilson.

@Dimenpsyonal
Copy link
Member

Woah woah woah who said it's getting merged

image

The changes being approved ≠ they should be merged... It means I have reviewed the changes and believe they will work
If i thought it should be merged I would have merged it!!! That is something I can very much do

Copy link
Member

@GalacticInspired GalacticInspired left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am Saul Goodman and I approve of these changes.

…yer's rank is higher

This commit removes the unnecessary command aliases as the main task is to remove Dex from target player(s) and the old Dex is no longer bundled with current releases of Adonis.
Also adds a hint when a target player's rank is higher than the user of the command.
@wilsontulus
Copy link
Contributor Author

wilsontulus commented Apr 14, 2025

Could you rename the cmd from :removenewdex to :undex, so it removes all dex, regardless of if it's Dex V3 or V4?.

The unnecessary aliases are now removed, sorry for the inconsistencies before. IIRC Dex V3 is no longer shipped with latest releases of Adonis, though using Variables.DexNames is still a good idea.

Can someone less lazy than me read the code for malware? The diff is too big to look at on GitHub.

Yeah, unfortunately it's a common issue in working with rbxmx files like the Dex plugin due to the nature of Roblox Studio sometimes changing the signature / uniqueIds of the Instances, even when the only real change is a variable name change (which unfortunately just hit me recently with 13K additions(??!) for some reason).
A maintainer does have to look up the diffs using a real Git client due to cases like this.

@Expertcoderz Expertcoderz added the ⚡ command Specific Adonis commands label Apr 18, 2025
@ccuser44
Copy link
Contributor

@wilsontulus :clearguis does this already

@wilsontulus
Copy link
Contributor Author

@wilsontulus :clearguis does this already

The difference between :undex and :clearguis are clear enough to be a separate PR though.

This command only removes Dex GUIs, and it also removes the Dex_Client that have been put serverside (plus the similar check in :dex to prevent "double-Dex"), alongside removing the player from the Authorized list in case the owner wanted to demote a head admin with secure Dex removal without kicking.

(yes, it can also be implemented in Admin.SetLevel but since Dex is currently a plugin this is the option for now)

@wilsontulus
Copy link
Contributor Author

wilsontulus commented Apr 19, 2025

also i'm probably going to redo this at my free time. the commits are too many for such a simple change and the addition counts triggered by rbxmx saving are simply too many (and probably suspicious) for the fellow maintainers.

Edit: While experimenting a bit, setting a function inside the dex plugin for dex removal and calling it from Admin.SetLevel does work, but I'm not sure if it's a good practice though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚡ command Specific Adonis commands

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants