TrueMB / DiscordNotify

Connects your Discord Server with your Minecraft Server!
https://www.spigotmc.org/resources/discordnotify-notifications-and-utils-for-discord.94230/
GNU General Public License v2.0
7 stars 5 forks source link

[ISSUE] #17

Closed ruk13xa closed 7 months ago

ruk13xa commented 7 months ago
[19:25:54 ERROR]: Couldn't pass ServerConnectedEvent to discordnotify
java.lang.NullPointerException: Cannot invoke "me.truemb.discordnotify.staticembed.StaticEmbedManager.updateAllEmbeds()" because the return value of "me.truemb.discordnotify.utils.DiscordManager.getStaticEmbedManager()" is null
        at me.truemb.discordnotify.listener.DiscordNotifyListener.onPlayerServerChange(DiscordNotifyListener.java:544) ~[?:?]
        at me.truemb.universal.minecraft.events.VelocityEventsListener.onServerJoinOrChange(VelocityEventsListener.java:67) ~[?:?]
        at me.truemb.universal.minecraft.events.Lmbda$38.execute(Unknown Source) ~[?:?]
        at com.velocitypowered.proxy.event.UntargetedEventHandler$VoidHandler.lambda$buildHandler$0(UntargetedEventHandler.java:56) ~[velocity-3.3.0-SNAPSHOT-351.jar:3.3.0-SNAPSHOT (git-53923ed8-b351)]
        at com.velocitypowered.proxy.event.VelocityEventManager.fire(VelocityEventManager.java:597) ~[velocity-3.3.0-SNAPSHOT-351.jar:3.3.0-SNAPSHOT (git-53923ed8-b351)]
        at com.velocitypowered.proxy.event.VelocityEventManager.lambda$fire$5(VelocityEventManager.java:478) ~[velocity-3.3.0-SNAPSHOT-351.jar:3.3.0-SNAPSHOT (git-53923ed8-b351)]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
        at java.lang.Thread.run(Thread.java:840) [?:?]

this happens when user joins the server

[19:22:54 ERROR] [net.dv8tion.jda.api.JDA]: One of the EventListeners had an uncaught exception                                                                                  
java.lang.IllegalArgumentException: Illegal group reference                                                                                                                      
        at java.util.regex.Matcher.appendExpandedReplacement(Matcher.java:1067) ~[?:?]
        at java.util.regex.Matcher.appendReplacement(Matcher.java:997) ~[?:?]
        at java.util.regex.Matcher.replaceAll(Matcher.java:1181) ~[?:?]
        at java.lang.String.replaceAll(String.java:2944) ~[?:?]
        at me.truemb.discordnotify.discord.listener.DC_ChatListener.onMessageReceived(DC_ChatListener.java:110) ~[?:?]
        at net.dv8tion.jda.api.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:446) ~[?:?]
        at net.dv8tion.jda.api.hooks.InterfacedEventManager.handle(InterfacedEventManager.java:96) ~[?:?]
        at net.dv8tion.jda.internal.hooks.EventManagerProxy.handleInternally(EventManagerProxy.java:88) ~[?:?]
        at net.dv8tion.jda.internal.hooks.EventManagerProxy.lambda$handle$0(EventManagerProxy.java:68) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
        at java.lang.Thread.run(Thread.java:840) [?:?]

second error happens when I type $verify (my minecraft name) in discord channel

server version

TrueMB commented 7 months ago

Hey, thanks for the bug report!

Could you send me the latest.log? It should include the startup, since it seems to be a problem there.

ruk13xa commented 7 months ago

Where can I find latest.log?

TrueMB commented 7 months ago

You can find it in your server files. It is in the directory "logs".

ruk13xa commented 7 months ago

latest.log sorry for late reply πŸ™πŸΌ

TrueMB commented 7 months ago

There seems to be an Issue with the loading order of the spicord bot. Try to set the delay a bit higher. This can be done in the Spicord config. [19:22:35] [pool-5-thread-1/WARN] [Spicord]: The addon with the id 'disnotify::verify' was not found. [19:22:35] [pool-5-thread-1/WARN] [Spicord]: The addon with the id 'disnotify::playerinfo' was not found.

The other error is a bug on velocity. I will create a fix tomorrow!

ruk13xa commented 7 months ago

Thanks!

ruk13xa commented 7 months ago

I set the delay a bit higher but it doesn't work still and emits The addon with the id 'disnotify::verify' was not found. again Is it right to be empty in spicord/addons folder?

TrueMB commented 7 months ago

Thanks for the Feedback!

The Spicord Addons folder is for Java Script Addons, which are only for Spicord and don't work like minecraft plugins. DiscordNotify is an own Minecraft plugin. It doesn't need to be in that folder.

I will take a look!

TrueMB commented 7 months ago

Hey, sorry for the long wait!

The first error depends on a new Spicord release. Since the loadafter config entry, wont be used on Velocity. I already told the developer about that issue.

The second error happens because of your bot prefix. $ is creating the error. But I will try to fix that.

TrueMB commented 7 months ago

DiscordNotify-3.3.5-dev1.zip This Version fixes the error with the prefix. But since the bot doesn't correctly load, we need to wait for Spicord.

ruk13xa commented 7 months ago

Thanks. I am look forward to spicord's new releaseπŸ‘πŸ‘

ruk13xa commented 7 months ago

So I think everything is fixed except "Couldn't pass ServerConnectedEvent to discordnotify"

ruk13xa commented 7 months ago

And it seems not to be a spicord error

TrueMB commented 7 months ago

This is indeed a DiscordNotify Problem, since it doesn't connect in time with Spicord. But we need to wait for the delay, so that DN got enough time to connect with Spicord. Othwise it can't boot up correctly.

ruk13xa commented 7 months ago
[22:32:45 ERROR]: Couldn't pass ServerConnectedEvent to discordnotify
java.lang.NullPointerException: Cannot invoke "me.truemb.discordnotify.staticembed.StaticEmbedManager.updateAllEmbeds()" because the return value of "me.truemb.discordnotify.utils.DiscordManager.getStaticEmbedManager()" is null
ruk13xa commented 7 months ago
image

I can see bot sending messages

ruk13xa commented 7 months ago
[22:46:05 ERROR]: Exception in thread "Thread-18" java.lang.NoSuchMethodError: 'void com.velocitypowered.api.proxy.Player.sendMessage(me.truemb.discordnotify.kyori.adventure.text.ComponentLike)'
[22:46:05 ERROR]:       at me.truemb.universal.player.VelocityPlayer.sendMessage(VelocityPlayer.java:35)
[22:46:05 ERROR]:       at me.truemb.discordnotify.database.VerifySQL$1.accept(VerifySQL.java:106)
[22:46:05 ERROR]:       at me.truemb.discordnotify.database.VerifySQL$1.accept(VerifySQL.java:67)
[22:46:05 ERROR]:       at me.truemb.discordnotify.database.connector.AsyncMySQL.lambda$prepareStatement$4(AsyncMySQL.java:90)
[22:46:05 ERROR]:       at java.base/java.lang.Thread.run(Thread.java:840)

also this error happens too

TrueMB commented 7 months ago

Could you send me the current latest.log again?

ruk13xa commented 7 months ago

latest.log

ruk13xa commented 7 months ago

And actually it says

[22:53:13 INFO] [Spicord]: Registered addon 'Disnotify PlayerInfo' (disnotify::playerinfo) by TrueMB
[22:53:13 INFO] [Spicord]: Registered addon 'Disnotify Verify' (disnotify::verify) by TrueMB

after

[22:53:12 WARN] [Spicord]: The addon with the id 'disnotify::verify' was not found.                                                                                              
[22:53:12 WARN] [Spicord]: The addon with the id 'disnotify::playerinfo' was not found.   

this error is emitted

TrueMB commented 7 months ago

Here is a Bungeecord Boot up, how it should be: image The difference: The 10sec delay.

ruk13xa commented 7 months ago

so this is velocity problem right?

TrueMB commented 7 months ago

This is a Velocity Spicord Problem. Correct. Spicord doesn't wait for external plugins on velocity.

ruk13xa commented 7 months ago

Can I change plugin loading consequence manually?

TrueMB commented 7 months ago

No, Minecraft Server boot up in synchronous, which means one plugin after another. This can only be changed by the Spicord Dev. To add an Async delayed task, so that Discordnotify can load in meantime and to register into Spicord. After that the bot needs to startup.

ruk13xa commented 7 months ago

I fixed jar and built again

ruk13xa commented 7 months ago

[23:47:47 INFO] [Spicord]: Registered addon 'Server Information' (spicord::info) by Tini
[23:47:47 INFO] [Spicord]: Registered addon 'Plugin List' (spicord::plugins) by Tini
[23:47:47 INFO] [Spicord]: Registered addon 'Player List' (spicord::players) by Tini
[23:47:47 INFO] [Spicord]: Registered addon 'Disnotify PlayerInfo' (disnotify::playerinfo) by TrueMB
[23:47:47 INFO] [Spicord]: Registered addon 'Disnotify Verify' (disnotify::verify) by TrueMB
[23:47:47 INFO] [Spicord]: Starting the bots...
[23:47:47 INFO] [Spicord]: Starting bot 'lukas'.

ruk13xa commented 7 months ago

is this right?

TrueMB commented 7 months ago

If DiscordNotify tells you it connected with the bot, then yes. But this log seems to be already fine

ruk13xa commented 7 months ago

latest.log

ruk13xa commented 7 months ago

it loads 10 seconds later but emits

[23:50:27] [Velocity Async Event Executor - #2/ERROR] [com.velocitypowered.proxy.event.VelocityEventManager]:  Couldn't pass ServerConnectedEvent to discordnotify
java.lang.NullPointerException: Cannot invoke "me.truemb.discordnotify.staticembed.StaticEmbedManager.updateAllEmbeds()" because the return value of "me.truemb.discordnotify.utils.DiscordManager.getStaticEmbedManager()" is null
    at me.truemb.discordnotify.listener.DiscordNotifyListener.onPlayerServerChange(DiscordNotifyListener.java:544) ~[?:?]
    at me.truemb.universal.minecraft.events.VelocityEventsListener.onServerJoinOrChange(VelocityEventsListener.java:67) ~[?:?]
    at me.truemb.universal.minecraft.events.Lmbda$47.execute(Unknown Source) ~[?:?]
    at com.velocitypowered.proxy.event.UntargetedEventHandler$VoidHandler.lambda$buildHandler$0(UntargetedEventHandler.java:56) ~[velocity-3.3.0-SNAPSHOT-351.jar:3.3.0-SNAPSHOT (git-53923ed8-b351)]
    at com.velocitypowered.proxy.event.VelocityEventManager.fire(VelocityEventManager.java:597) ~[velocity-3.3.0-SNAPSHOT-351.jar:3.3.0-SNAPSHOT (git-53923ed8-b351)]
    at com.velocitypowered.proxy.event.VelocityEventManager.lambda$fire$5(VelocityEventManager.java:478) ~[velocity-3.3.0-SNAPSHOT-351.jar:3.3.0-SNAPSHOT (git-53923ed8-b351)]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
    at java.lang.Thread.run(Thread.java:840) [?:?]

before spicord is loaded

TrueMB commented 7 months ago

I will take another look in few minutes. Since the plugin registers now correctly, it doesn't seem to be a Spicord Issue anymore. But there is still a log message missing from DN.

ruk13xa commented 7 months ago

sorry but what is DN??

TrueMB commented 7 months ago

DiscordNotify ^^

ruk13xa commented 7 months ago

Oh sorry for my sense πŸ™πŸΌ

TrueMB commented 7 months ago

DiscordNotify-3.3.5-dev2.zip I changed some stuff in the loading process. This should resolve your Issues.

ruk13xa commented 7 months ago

Thanks for your fast support😘

ruk13xa commented 7 months ago
02:00:28 INFO] [Spicord]: Registered addon 'Plugin List' (spicord::plugins) by Ti
ni
[02:00:28 INFO] [Spicord]: Registered addon 'Player List' (spicord::players) by Ti
ni
[02:00:28 INFO] [Spicord]: Registered addon 'Disnotify PlayerInfo' (disnotify::pla
yerinfo) by TrueMB
[02:00:28 INFO] [Spicord]: Registered addon 'Disnotify Verify' (disnotify::verify)
 by TrueMB
[02:00:28 INFO] [Spicord]: Starting the bots...
[02:00:28 INFO] [Spicord]: Starting bot 'lukas'.
[02:00:28 INFO] [Spicord]: [DEBUG] Changed JDA Status [INITIALIZING -> INITIALIZED
]
[02:00:28 INFO] [Spicord]: [DEBUG] Changed JDA Status [INITIALIZED -> LOGGING_IN]
[02:00:29 INFO] [net.dv8tion.jda.api.JDA]: Login Successful!
[02:00:29 INFO] [Spicord]: [DEBUG] Changed JDA Status [LOGGING_IN -> CONNECTING_TO
_WEBSOCKET]
[02:00:29 INFO] [net.dv8tion.jda.internal.requests.WebSocketClient]: Connected to
WebSocket
[02:00:29 INFO] [Spicord]: [DEBUG] Changed JDA Status [CONNECTING_TO_WEBSOCKET ->
IDENTIFYING_SESSION]
[02:00:29 INFO] [Spicord]: [DEBUG] Changed JDA Status [IDENTIFYING_SESSION -> AWAI
TING_LOGIN_CONFIRMATION]
[02:00:30 INFO] [Spicord]: [DEBUG] Changed JDA Status [AWAITING_LOGIN_CONFIRMATION
 -> LOADING_SUBSYSTEMS]
[02:00:30 INFO] [net.dv8tion.jda.api.JDA]: Finished Loading!
[02:00:30 INFO] [Spicord]: [DEBUG] Changed JDA Status [LOADING_SUBSYSTEMS -> CONNE
CTED]
[02:00:30 INFO] [Spicord]: [DEBUG] Cleaning up commands for bot lukas
[02:00:31 INFO] [DiscordNotify]: Loading all Chat/Staff Channel Id's.
[02:00:31 INFO] [DiscordNotify]: Chat/Staff Channel Id's are found.
[02:00:31 INFO] [DiscordNotify]: Connected with Discord BOT.

It worked πŸ‘πŸ‘πŸ‘