ElgarL / GroupManager

The original permission plug-in for Spigot/Bukkit.
https://elgarl.github.io/GroupManager/
GNU General Public License v3.0
80 stars 36 forks source link

Can't /manuaddp on offline users, see logs[BUG] #30

Closed Strahilchu closed 4 years ago

Strahilchu commented 4 years ago

Describe the bug Failure and error warning shows when attempting to /manuaddp to an offline user

To Reproduce Steps to reproduce the behavior:

  1. Type "/manuaddp Player AnyPermission

Expected behavior I expect the permission to be added to the player in every world automatically (unless specific world is specified)

Please complete the following information:

Additional context

20:54:21 WARN: at org.anjocaido.groupmanager.utils.BukkitWrapper.getPlayerUUID(BukkitWrapper.java:74)(B 20:54:21 WARN: at org.anjocaido.groupmanager.commands.BaseCommand.validatePlayer(BaseCommand.java:214)(B 20:54:21 WARN: at org.anjocaido.groupmanager.commands.ManUAddP.parseCommand(ManUAddP.java:60) 20:54:21 WARN: at org.anjocaido.groupmanager.commands.BaseCommand.onCommandaseCommand.java:88)(B 20:54:21 WARN: at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45)(B 20:54:21 WARN: at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) 20:54:21 WARN: at org.bukkit.craftbukkit.v1_16_R2.CraftServer.dispatchCommand(CraftServer.java:800) 20:54:21 WARN: at net.minecraft.server.v1_16_R2.PlayerConnection.handleCommand(PlayerConnection.java:1908) 20:54:21 WARN: at net.minecraft.server.v1_16_R2.PlayerConnection.a(PlayerConnection.java:1719) 20:54:21 WARN: at net.minecraft.server.v1_16_R2.PacketPlayInChat.a(PacketPlayInChat.java:47) 20:54:21 WARN: at net.minecraft.server.v1_16_R2.PacketPlayInChat.a(PacketPlayInChat.java:5) 20:54:21 WARN: at net.minecraft.server.v1_16_R2.PlayerConnectionUtils.lambda$ensureMainThread$1(PlayerConnectionUtils.java:23) 20:54:21 WARN: at net.minecraft.server.v1_16_R2.TickTask.run(SourceFile:18) 20:54:21 WARN: at net.minecraft.server.v1_16_R2.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) 20:54:21 WARN: at net.minecraft.server.v1_16_R2.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) 20:54:21 WARN: at net.minecraft.server.v1_16_R2.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) 20:54:21 WARN: at net.minecraft.server.v1_16_R2.MinecraftServer.ba(MinecraftServer.java:1135) 20:54:21 WARN: at net.minecraft.server.v1_16_R2.MinecraftServer.executeNext(MinecraftServer.java:1128) 20:54:21 WARN: at net.minecraft.server.v1_16_R2.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) 20:54:21 WARN: at net.minecraft.server.v1_16_R2.MinecraftServer.sleepForTick(MinecraftServer.java:1089) 20:54:21 WARN: at net.minecraft.server.v1_16_R2.MinecraftServer.w(MinecraftServer.java:1003) 20:54:21 WARN: at net.minecraft.server.v1_16_R2.MinecraftServer.lambda$a$0(MinecraftServer.java:177) 20:54:21 WARN: at java.base/java.lang.Thread.run(Thread.java:834)(B

ElgarL commented 4 years ago

Um, this should be impossible. That code is looping over the list of offline players the server provides and comparing it to the name you provide in the command. I also tested it here, just now, and it works just fine with offline players.

Can you delete your config.yml and let GM create a fresh one. There is a bug in 2.7 where old configs can cause an issue when loading, but I don't see how it could cause this issue.

ElgarL commented 4 years ago

I've included a fix for this VERY rare occurrence of Bukkit returning an offline player with no name via getOfflinePlayers(). It will be in v2.8 in a few days.