EssentialsX

EssentialsX

2M Downloads

Disable people paying negative values request

Elgorond opened this issue ยท 6 comments

commented

If players with the normal essentials.pay permission do /pay player -1 for instance, it will just function as /pay player 1. This isn't a big deal, but players can trick "noobs" into thinking paying negative will give them money...

commented

Yes, this shouldn't be possible

commented

@SupaHam since you already have the setup, could you fix this very quickly by, a) adding '-' to the regex (not replacing it) here and b) checking if BigDecimal is negative here. It would also be nice if you could automatically add a replace for "," to ".", since comma is the default decimal format in many countries. I'd do it myself but it is a bigger hassle to set it up right now.

commented

@Kakifrucht Replacing comma could introduce more issues than it would solve. By replacing comma with fullstops we would not be accommodating the greater part of the world. It would need to be discussed further.

commented

This has been fixed in e5b5994. You can grab the fix from build 443 on the CI server.

commented

@Kakifrucht @SupaHam Here's an idea: load the regex from the localisation file. I know that its current purpose is for custom messages, but this is something which varies greatly across the world and would benefit from being localisable.

commented

Please discuss this in a separate issue.