ucchyocean / LunaChat

Channel Chat Plugin for CraftBukkit
GNU Lesser General Public License v3.0
72 stars 51 forks source link

tellコマンドでのバグ #225

Closed ghost closed 2 years ago

ghost commented 2 years ago

Describe the bug/バグの概要 tellコマンドで存在しないプレーヤーを連続で指定した場合、Lunachatがエラーを出します。

Server and version/サーバーとバージョン

To Reproduce/再現手順 Steps to reproduce the behavior:

  1. 切り返し /tell notexist を打つ
  2. このエラーが表示される 10:13:01 ERROR: --- DO NOT REPORT THIS TO PAPER - THIS IS NOT A BUG OR A CRASH - git-Paper-408 (MC: 1.17.1) --- 10:13:01 ERROR: The server has not responded for 10 seconds! Creating thread dump 10:13:01 ERROR: Server thread dump (Look for plugins here before reporting to Paper!): 10:13:01 ERROR: Current Thread: Server thread 10:13:01 ERROR: PID: 25 | Suspended: false | Native: true | State: RUNNABLE 10:13:01 ERROR: java.base@16/sun.nio.ch.Net.poll(Native Method) 10:13:01 ERROR: app//net.minecraft.server.MinecraftServer$$Lambda$3667/0x00000008013c7c18.run(Unknown Source) 10:13:01 ERROR: --- DO NOT REPORT THIS TO PAPER - THIS IS NOT A BUG OR A CRASH ---

(Can't keep up! Is the server overloaded? Running 10973ms or 219 ticks behind)

Expected behavior/期待する結果 バグの解消をお願いします。

Additional context/備考 member.ChannelMemberPlayer.getChannelMemberが怪しいと思いますので、その部分を拝見させて頂きました。 Bukkit.getOfflinePlayer使ってましたね。nullチェックされていますが確かnullを返さないのでそのままuuidが返されますし、Bukkit.getOfflinePlayer(String name)はスレッドを停止させるので、Bukkit.getPlayerExact()等を使うのをお勧めします。 (UUIDの場合は大丈夫だと思います あとよく見るとyggdrasilつかって多分認証サーバーにリクエ投げてるんですね。初めて知りました()認証サーバーにリクエ投げつけると仮定すると、APIのレート制限ですかね?)

見てくれてありがとうございました! 修正頑張ってください! <3

追記: 他の方も書いてましたね。恐らくこの原因と同じメソッドを使ってる方だと思います。( com.github.ucchyocean.lc3.util.UtilBukkitのgetOnlinePlayer)