CortexPE / Commando

A Command Framework virion for PocketMine-MP
GNU Lesser General Public License v3.0
70 stars 51 forks source link

Implement arguments for specific permissions #11

Closed lukeeey closed 5 years ago

lukeeey commented 5 years ago

Sometimes we have arguments which require a special permission to be used. This library should add a way to completely omit the arguments from the command if the player does not have permission to use them.

CortexPE commented 5 years ago

again, why not just implement it yourself? Adding this would add more complexity and/or unintended behavior to argument parsing because you can have different argument types

And this already applies to SubCommands

lukeeey commented 5 years ago

How would i implement it myself then

CortexPE commented 5 years ago

If statements

Just check if the argument is set and the player has permissions...

On Wed, Jun 5, 2019, 1:00 AM Luke notifications@github.com wrote:

How would i implement it myself then

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/CortexPE/Commando/issues/11?email_source=notifications&email_token=AEHQQFBDBOKJFILEILFXFRDPY2NS3A5CNFSM4HS45LMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODW5G52I#issuecomment-498757353, or mute the thread https://github.com/notifications/unsubscribe-auth/AEHQQFED4SHUMU5LYICF3VLPY2NS3ANCNFSM4HS45LMA .

lukeeey commented 5 years ago

But i dont want the player to see the arguments they cant access on the client

CortexPE commented 5 years ago

Might implement something like BaseArgument->isVisibleTo(CommandSender $sender): bool;

On Wed, Jun 5, 2019, 1:21 AM Luke notifications@github.com wrote:

But i dont want the player to see the arguments they cant access on the client

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/CortexPE/Commando/issues/11?email_source=notifications&email_token=AEHQQFC5SY4NLZDTWKCQDS3PY2QCRA5CNFSM4HS45LMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODW5IXUI#issuecomment-498764753, or mute the thread https://github.com/notifications/unsubscribe-auth/AEHQQFBYLXBHRPGBU26XX7DPY2QCRANCNFSM4HS45LMA .

CortexPE commented 5 years ago

or just "isUsableBy" because it would affect it anyway

On Wed, Jun 5, 2019, 1:23 AM CortexPE mcpe4life62@gmail.com wrote:

Might implement something like BaseArgument->isVisibleTo(CommandSender $sender): bool;

On Wed, Jun 5, 2019, 1:21 AM Luke notifications@github.com wrote:

But i dont want the player to see the arguments they cant access on the client

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/CortexPE/Commando/issues/11?email_source=notifications&email_token=AEHQQFC5SY4NLZDTWKCQDS3PY2QCRA5CNFSM4HS45LMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODW5IXUI#issuecomment-498764753, or mute the thread https://github.com/notifications/unsubscribe-auth/AEHQQFBYLXBHRPGBU26XX7DPY2QCRANCNFSM4HS45LMA .

rjworks commented 4 years ago

is there a way to do this now