ErdbeerbaerLP / DiscordIntegration-Forge

Forge version of the Discord Integration mod
https://modrinth.com/plugin/dcintegration
MIT License
99 stars 56 forks source link

[Bug-1.18.1]: Server doesn't stop when stopping & can't send messages in console. (errors) #376

Open Gbergz opened 2 years ago

Gbergz commented 2 years ago

What happened?

When stopping the server, server still stays adn then errors.

Forge: 39.0.5 DCIntegration: dcintegration-forge-2.3.5-1.18.jar

Game Version

1.18.1

What platform are you using?

Forge

Config File

https://gist.githubusercontent.com/Gbergz/bfc130dc35bda5084a6e9c37dd8aaf43/raw/ad61d62c15bf3fc2f3cc7d6afcc708443b7f2927/gistfile1.txt

Stop server errors

https://gist.github.com/Gbergz/6f6289775b9bacb92dc077e0786a652a

Errors in console when typing lets say "list" / any command.

https://gist.github.com/Gbergz/8d241848076fd9b55c052521f6343aaa

Edit:

Also when typing in chat this gets printed to console:

Generating embed... JSON: {"translate":"chat.type.text","with":[{"insertion":"Gbergz","clickEvent":{"action":"suggest_command","value":"/tell Gbergz "},"hoverEvent":{"action":"show_entity","contents":{"type":"minecraft:player","id":"ec3fbd50-08b1-441b-b457-99f13a711017","name":{"text":"Gbergz"}}},"extra":[{"text":"Gbergz"}],"text":""},"sfd"]} [12:19:15] [Server thread/INFO]: sfd

EDIT: All of this is reproducable in an empty server w/ just dcintegration setup.

Hopefully this can be fixed. - Gbergz.

ErdbeerbaerLP commented 2 years ago

Generating embed...

That is meant for debugging, will remove next update

Will investigate thoose errors tho

CDAGaming commented 2 years ago

Have also encountered this issue, had to remove this after several subsequent failed server stops.

mica-alex commented 2 years ago

I am encountering a very similar or identical issue right now with the MC 1.12 version. Server hangs on shutdown with this mod installed

BONNe commented 1 year ago

This issue happens because of this line: https://github.com/ErdbeerbaerLP/DiscordIntegration-Forge/blob/853c0a9ea5caa001c22f758500893f28f48df59c/src/main/java/de/erdbeerbaerlp/dcintegration/forge/DiscordIntegration.java#L302

It happens because discord_instance.stopThreads(); stops the active threads, and later in the same method there is a discord_instance.kill(); which also tries to stop all active threads.

I suspect that it is the reason why on some machines the server hangs. I removed that line from my implementation, and everything works correctly.