mbax / VanishNoPacket

Invisibility for sexy people.
http://dev.bukkit.org/projects/vanish/
GNU General Public License v3.0
135 stars 113 forks source link

PermissionsEX - prefix / suffix #294

Closed FireZtreaM closed 11 years ago

FireZtreaM commented 12 years ago

Well, I would just like to request the option to use PermissionsEX prefixes and suffixes when I use Fakejoin and Fakequit. Just like there is an option to use bPermissions prefixes and suffixes.

mbax commented 12 years ago

If anything I would add Vault support. PermissionsEx is a broken plugin so I see no reason to support it directly.

FireZtreaM commented 12 years ago

Broken? Doesn't seem to be broken to me. In what way do you mean it's broken? I do hear some ppl claiming that PEX are broken and that PEX have issues, but no one seems to be able to point out anything that's really wrong with PEX.

Not to be an asshole, but i do see a lot of ppl who doesn't know how to use it. Like all those idiots that are using the * permissions and then blame other permissions when it doesn't work. But that's a user error, not a plugin error. I've been using PEX for like one and a half year now, and i have never had any problems with it.

But to the point, plugins like MCdocs for example, have support for all those big permission-plugins. I do belive MCdocs uses vault even if it doesn't say anything about it on either MCdocs site or vaults site. At least it seems so when i look "here". But vault support shouldn't be that hard to implement. Should it? Vault-support would be really great anyway! :) Thank you for your time. It's a really great plugin you've got!

Regards, FireZtreaM

bitfreeze commented 12 years ago

It is, trust me. I was prompt to defend PEX but then mbax helped me to see some nasty issues of it that don't occur on other permission handling plugins. Mr Baxter should have the proper link to a simple test plugin that breaks PEX and reveals the flaws, if you bother testing it thyself. Since then, I've moved to bPerms, and wrote some layers of codes to customize the staff interface to it with shortcuts to commonly used commands.

mbax commented 12 years ago

Why's it broken? Here's a good start :dancer: https://docs.google.com/document/d/1BIgAU7senSG1hY0BjQAQFAnbuOqFhpln7ffN6pkOp4s/edit?pli=1

Check out the document. This is for your own good, not related to adding pex support to vanishnopacket. Before you say "You're just not setting it up right" please check out the section where I link to an example plugin. Please try to prove me wrong. I've had this document up since June and nobody is able to make the example plugin work on PEX. (And the plugin doesn't have any "if PEX, break" code :P)

FireZtreaM commented 11 years ago

Just a question. I may have missed something, but i belive that there is still no setting for prefixes that uses Vault. Still only %up for bPermissions prefixes that i guess point directly to bPermissions instead of Vault. Or have i missed something? :P I think you should make it so that %up setting uses prefixes from any permission-plugin that have vault-support. I hope you understand what i mean. :)

mbax commented 11 years ago

%up and %us use Vault.

FireZtreaM commented 11 years ago

Hmm. Guess i must have done something wrong then. :S I'll try it again! :) Thank you for this superfast answer! :D

FireZtreaM commented 11 years ago

I have a few problems.

First, it seems that both %up and %us are pointing to the suffix. It doesn't matter if i use %up or %us. I doesn't matter what i use, both shows my suffix.

Second, it seems to be some problem with the color-code translation. I tried to set my suffix to be "test" with grey color, but ingame it shows "&7 test" when i use fakejoin or fakequit.

mbax commented 11 years ago

Hmm. Which plugin?

FireZtreaM commented 11 years ago

I know you're not going to like this, but i'm still using Pex as permissionsplugin if that's what you're asking me. ;) However, the prefix problem must have something to do with your plugin since no other plugin that uses Vault to get my prefixes have this problem. :)

FireZtreaM commented 11 years ago

I think i see part of the problem now. Check line 33. Could that be the problem?

https://github.com/mbax/VanishNoPacket/blob/master/src/main/java/org/kitteh/vanish/hooks/plugins/VaultHook.java

However, i don't anything about that colorcode translation since you use double &. :S Got any idéas?

mbax commented 11 years ago

Prefix derp is fixed in dev builds (whoops). Color code thing is a Vault issue, returning the wrong info for PEX.

FireZtreaM commented 11 years ago

Hehe, shit happens! ;D Where can i get the latest dev build then? :) And, what is it that is wrong with Vault? I mean, what should it return and what does it return?

mbax commented 11 years ago

http://ci.kitteh.org And Vault should be returning the value as the actual in-game String, not the config String. As in, it should show up with color with my code.

FireZtreaM commented 11 years ago

Well, i am kind of a noob when it comes to this. ;) But i guess you mean it should translate it to something like "ChatColor.AQUA" instead of &b and so on?

Just a question, why do you use && instead of & as everyone else in your config? Just curious. :)

mbax commented 11 years ago

I had people wanting to write out stuff like "Meow&Meow" which would get translated into a format using the single & system. So I figured && is much less likely to be a concern.

And yes, I mean converting the &b into the section sign plus b that the game interprets as a color

bitfreeze commented 11 years ago

Escape characters are usually nullified by doubling them, not the opposite. Take the back slash in C/Java for instance.

Following that line of thought, you would use normal & as the color escape codes (add most plugins out there use) and the exceptions of & contained in strings would be written as in Meow&&Meow. On 18 Sep 2013 13:38, "Matt Baxter" notifications@github.com wrote:

I had people wanting to write out stuff like "Meow&Meow" which would get translated into a format using the single & system. So I figured && is much less likely to be a concern.

And yes, I mean converting the &b into the section sign plus b that the game interprets as a color

— Reply to this email directly or view it on GitHubhttps://github.com/mbax/VanishNoPacket/issues/294#issuecomment-24679092 .

FireZtreaM commented 11 years ago

I have seen that in some other plugins. If you want to use & as an character instead of using it as an colorcode you have to do just that. Write double &&. It does make sense.

However, i got an answer from Vault-devs about this, and they say that there's nothing wrong on their side. Vault does exactly what it should do. And since i said Vanish was one of the plugins that didn't work as it should because of this, i got this at the end...

Quoting Sleaker: @mbax If a plugin developer is confused on how to handle color codes through Vault I suggest taking a look at my other project, WhosThere, which handles them just fine. Here's some example code: https://github.com/MilkBowl/WhosThere/blob/master/src/com/sleaker/WhosThere/WhosThere.java#L414

EDIT: The more i think about what bitfreeze said, the more i feel that you should change your code.

I mean, let's say that i actually want to write "Meow&&Meow". With your code right now, that's impossible. You can't write more than one & as it is right now or else your plugin would consider that a colorcode. If you do as bitfreeze said, you could write as many & as you want, and it would still work if i got this right.

And also, if you do it like that, regular colorcodes from all other plugins would work just as they are.

FireZtreaM commented 11 years ago

Just another note.. This really is a problem with Vanish. Just tried some other permissionplugins that uses Vault on my dev-server. Same problem. It does work well with other plugins that imports the prefix from Vault. No problem at all. But with Vanish it just shows all my colorcodes in plain text.

EDIT: I DO feel kind of evil right now! ;) I've finally realised that you've implemented that Vault-support, and now i just find issues and complains about it! :P Well, it IS bugs, so i guess i shouldn't feel like that, but anyways. ^^