Byteflux / CombatTagPlus

Stop those dirty combat loggers!
17 stars 72 forks source link

Command Issue #108

Closed CheatSupport closed 7 years ago

CheatSupport commented 7 years ago

Hi.

I have just downloaded the latest fbasics and combattagplus, and used it on my server. USING both the SAME configurations for both plugins, one for linux the other for windows, for some reason work differently.

The plugin performs differently on windows, it DOES manage to block /wild but does not manage to make use of unicode characters correctly.

LINUX: https://i.gyazo.com/7183b95837b903868b7e148308142634.png (shows it works with unicode)

Windows: https://i.gyazo.com/401ba7dab168e3fa2d0b3b3ae0b3023c.png (Unicode doesn't quite work correctly)

what I am trying to say is, is there different code for both windows and linux? Some reason using the same server but on windows - it blocks /wild, but on linux it doesn't work.

Please help, thanks. @Techcable (Also I donated some time ago to say thanks for all your projects, so please help with this one - maybe just a quick custom jar or a look at the code? I am not as good as you haha!)

CheatSupport commented 7 years ago

Just noticed, in "FBasics" there is the code: WILDERNESS(CmdWilderness.class, new String[]{"wilderness", "wild", "w"});

if it helps.

Techcable commented 7 years ago

What is CommandTagPlus?

I bet it's an issue with the config file encoding. Windows prefers UTF-16, but linux uses (the far supperior) UTF-8. If you're editing with notepad, make sure to save the file as 'UTF-8', not 'Unicode' (which is actually UTF-16).

CheatSupport commented 7 years ago

@Techcable I meant FBasics, just got confused. Yeah I have just tried editing the fbasics plugin code myself now and I will get back to you. Instead I am going to make /wild a command that is using commands.yml as part of bukkit.

Windows somehow blocks /wild and linux doesn't - using same .jars and same configurations, very odd

Techcable commented 7 years ago

Again, have you checked that the config file is saved as UTF-8 on windows? Regardless, we should probably support UTF-16 natively, since it's so common.

CheatSupport commented 7 years ago

Yeah both saved in UTF-8, still doesn't fix the /wild command issue. :(

Techcable commented 7 years ago

Actually, it looks like the problem is the opposite of what I expected. Since we don't specify a charset explicitly, Java assumes UTF-16 on windows and UTF-8 on linux. I'll fix it by using UTF-8 as default, and UTF-16 as a fallback.

CheatSupport commented 7 years ago

Thanks that will fix blocking /wild? I have been so confused haha. @Techcable

Techcable commented 7 years ago

It looks like it's actually a bug in bukkit I can't fix from inside the plugin. JavaPlugin.reloadConfig() doesn't support UTF-8 on windows, and I can't override it. However, you can't use UTF-16, since the plugin saves the file as UTF-8. Unless bukkit fixes it, you'll have to just avoid windows if you want proper unicode support.

EDIT 1: Nevermind, bukkit actually does support unicode properly. I was looking at an old version. However, it's still probably some mysterious encoding issue that's not really our fault. One more idea would be to change the default encoding to UTF-8 by adding -Dfile.encoding=UTF-8 at the command line.

CheatSupport commented 7 years ago

@Techcable I use linux, but what I'm saying is - windows is blocking /wild whereas combattagplus on linux won't. I really need to try and fix this and I can't change anything for command line. This: https://dev.bukkit.org/projects/combatlog blocks it somehow, but clearly this plugin isn't as great as combattagplus. Please help, much appreciated

Byteflux commented 7 years ago

I'm on Linux. I use FBasics. I block wild and a bunch of other commands that are provided by FBasics in combat. I can't reproduce this issue. Download the latest dev build. Remove all plugins except CombatTagPlus and FBasics. Use a fresh CombatTagPlus configuration. This issue is very clearly specific to your setup.

CheatSupport commented 7 years ago

@Techcable I indeed use linux but what I'm saying is my issue doesn't exist on windows with the /wild blocking

Techcable commented 7 years ago

@CheatSupport I'll admit that's very odd, but we still can't reproduce this issue. As @Byteflux said, we need you to check if this issue occurs with the latest FBasics and CombatTagPlus, no other plugins, and a clean configuration. Even if you can reproduce it, there's still not much we can do unless you find a way for us to reproduce it on our computers.

Relevant XKCD