AuthMe / AuthMeReloaded

The best authentication plugin for the Bukkit/Spigot API!
https://www.spigotmc.org/resources/authmereloaded.6269/
GNU General Public License v3.0
628 stars 516 forks source link

delayJoinMessage crash the plugin on login #2359

Closed wfjsw closed 3 years ago

wfjsw commented 3 years ago

Before reporting an issue make sure you are running the latest build of the plugin and checked for duplicate issues!

What behaviour is observed:

What happened?

When delayJoinMessage is true AuthMe crashed on join

Steps/models to reproduce:

The actions that cause the issue

turn delayJoinMessage on and join

Plugin list:

This can be found by running /pl

> pl
[13:22:59 INFO]: Plugins (6): AuthMe, Essentials, FastLogin, Geyser-Spigot, ProtocolLib, SkinsRestorer

Environment description

Standalone server/Bungeecord network, SQLite/MySql, ...

Standalone Paper 1.16.5 #778 SQLite with FastLogin

AuthMe build number:

This can be found by running /authme version

> authme version
[13:21:55 INFO]: ==========[ AuthMeReloaded ABOUT ]==========
[13:21:55 INFO]: Version: AuthMeReloaded v5.6.0-beta2 (build: 2453)
[13:21:55 INFO]: Developers:
[13:21:55 INFO]:  Alexandre Vanhecke // xephi59 (Original Author)
[13:21:55 INFO]:  Lucas J. // ljacqu (Main Developer)
[13:21:55 INFO]:  Gnat008 // gnat008 (Developer)
[13:21:55 INFO]:  DNx5 // DNx5 (Developer)
[13:21:55 INFO]:  games647 // games647 (Developer)
[13:21:55 INFO]:  Tim Visee // timvisee (Developer)
[13:21:55 INFO]:  Gabriele C. // sgdc3 (Project manager, Contributor)
[13:21:55 INFO]: Website: http://dev.bukkit.org/bukkit-plugins/authme-reloaded/
[13:21:55 INFO]: License: GNU GPL v3.0 (See LICENSE file)
[13:21:55 INFO]: Copyright: Copyright (c) AuthMe-Team 2019. Released under GPL v3 License.

Error Log:

Pastebin/Hastebin/Gist link of the error log or stacktrace (if any)

[13:15:57 INFO]: [FastLogin] Handling player *** 
[13:15:57 INFO]: [FastLogin] Requesting premium login for registered player: ***
[13:15:59 INFO]: [FastLogin] Profile Xian_Sheng has a verified premium account: Verification{id=***, name='***', properties=[SkinProperty{value='', signature=''}]}
[13:15:59 INFO]: UUID of player *** is ***
[13:15:59 INFO]: Xian_Sheng[/***] logged in with entity id 1306 at ([world]-20542.988914121644, 72.87208890136314, 1253.1938853881254)
[13:15:59 INFO]: [FastLogin] Logging player *** in
[13:15:59 INFO]: [AuthMe] *** logged in ***
[13:15:59 INFO]: *** joined the game
[13:15:59 WARN]: [AuthMe] Task #9117 for AuthMe v5.6.0-beta2-b2453 generated an exception
java.lang.NullPointerException: null
        at org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer.sendMessage(CraftPlayer.java:2132) ~[patched_1.16.5.jar:git-Paper-778]
        at net.kyori.adventure.audience.Audience.sendMessage(Audience.java:207) ~[patched_1.16.5.jar:git-Paper-778]
        at net.kyori.adventure.audience.Audience.sendMessage(Audience.java:183) ~[patched_1.16.5.jar:git-Paper-778]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.broadcast(CraftServer.java:1592) ~[patched_1.16.5.jar:git-Paper-778]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.broadcast(CraftServer.java:1564) ~[patched_1.16.5.jar:git-Paper-778]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.broadcastMessage(CraftServer.java:600) ~[patched_1.16.5.jar:git-Paper-778]
        at org.bukkit.Bukkit.broadcastMessage(Bukkit.java:308) ~[patched_1.16.5.jar:git-Paper-778]
        at fr.xephi.authme.service.BukkitService.broadcastMessage(BukkitService.java:184) ~[?:?]
        at fr.xephi.authme.service.JoinMessageService.sendMessage(JoinMessageService.java:42) ~[?:?]
        at fr.xephi.authme.process.login.ProcessSyncPlayerLogin.processPlayerLogin(ProcessSyncPlayerLogin.java:95) ~[?:?]
        at fr.xephi.authme.process.SyncProcessManager.lambda$processSyncPlayerLogin$3(SyncProcessManager.java:52) ~[?:?]
        at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:100) ~[patched_1.16.5.jar:git-Paper-778]
        at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:468) ~[patched_1.16.5.jar:git-Paper-778]
        at net.minecraft.server.v1_16_R3.MinecraftServer.b(MinecraftServer.java:1427) ~[patched_1.16.5.jar:git-Paper-778]
        at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:436) ~[patched_1.16.5.jar:git-Paper-778]
        at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1342) ~[patched_1.16.5.jar:git-Paper-778]
        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1130) ~[patched_1.16.5.jar:git-Paper-778]
        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~[patched_1.16.5.jar:git-Paper-778]

Configuration:

Pastebin/Hastebin/Gist link of your config.yml file (remember to delete any sensitive data)

https://gist.github.com/wfjsw/da8ed0022528a8be7c3d520a9476d426

games647 commented 3 years ago

The issue is about broadcasting the message to an offline player. The broadcasting is handled by the server implementation, so not a bug on our side.

this.getHandle().playerConnection.sendPacket(packet); (CraftPlayer.java:2132)

wfjsw commented 3 years ago

Hmm but the player is not offlined?

games647 commented 3 years ago

Broadcast sends a message to all players. The error occurs if a single or more one went offline.

wfjsw commented 3 years ago

I see. This is a weird behavior. But it's a hmm... CraftBukkit issue?

games647 commented 3 years ago

CraftBukkit, Spigot, Paper, etc.

games647 commented 3 years ago

Fixed in Paper: https://github.com/PaperMC/Paper/commit/2103ad2f8188a3a86783f4ff886f14b1b9047462