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

Support for custom enum name #25

Open
Ifera opened this issue Apr 29, 2020 · 11 comments
Open

Support for custom enum name #25

Ifera opened this issue Apr 29, 2020 · 11 comments
Labels
enhancement New feature or request

Comments

@Ifera
Copy link
Contributor

Ifera commented Apr 29, 2020

Currently commando would set a random enum name. How about it only sets it if the enumName is not set or is equal to "" or if two enums with the same name exist. Ideally it should throw an exception if two enums have same name. Reason being that those random letters look really weird and can confuse the users. Plus servers which have their own plugins can easily cater for the enum mess. So having the ability to set enum names on our own would be greatly appreciated.

@CortexPE
Copy link
Owner

CortexPE commented Apr 29, 2020 via email

@inxomnyaa
Copy link
Collaborator

Same issue exists in BDS, registering a new enum with the same name will override it. I'd just stick with the vanilla behavior, thus i support Jacks idea

@CortexPE
Copy link
Owner

CortexPE commented Apr 29, 2020 via email

@inxomnyaa
Copy link
Collaborator

Or register enums with a plugin-name prefix maybe? Similar to commands in pmmp with fallbackPrefix

@CortexPE
Copy link
Owner

CortexPE commented Apr 30, 2020 via email

@Ifera
Copy link
Contributor Author

Ifera commented Apr 30, 2020 via email

@lukeeey
Copy link

lukeeey commented Apr 30, 2020

Just do what jack suggested ffs lol

@inxomnyaa
Copy link
Collaborator

Maybe only display the prefix to the client if the enum collides or actually don't display it at all because probably it will have only one unique enum in one command at a time

@CortexPE
Copy link
Owner

How about if we make it mandatory to supply fallback prefix and then only use it when two enum names collide?

Would be a BC-Breaking change but that would work... Just need some way to track what enum name is used and what enum name isn't used across virion instances.

Virions are a complicated mess and when injected properly as intended they have shaded namespaces. A singleton tracking which enum names are used wouldn't cut it in this situation.

@CortexPE
Copy link
Owner

An issue is because of how Virions are injected, the namespaces are changing.

Therefore using a singleton to track the enum names that have been used would be ineffective on shaded builds.

@CortexPE
Copy link
Owner

sAvE iT iNtO a FiLe InStEaD aNd ThEn ChEcK tHaT

@CortexPE CortexPE assigned CortexPE and unassigned CortexPE May 20, 2020
@CortexPE CortexPE added the enhancement New feature or request label May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants