LakeYS / Dishorde

A Discord bridge bot for 7 Days to Die. Dishorde integrates a dedicated server with Discord, allowing players to access the game's chat from any device or location. Powered by discord.js.
http://lakeys.net/dishorde
MIT License
47 stars 27 forks source link

Discord messages not being sent promptly to game #121

Open trevorjd opened 2 years ago

trevorjd commented 2 years ago

Hi Lake,

I noticed this problem with our first version of 7D2D-Discord and again with the RC2 Dishorde. Messages entered in Discord are not always sent promptly to game. I got into a habit of sending a second line with just "." but I caught it in action tonight so thought I'd log an issue.

I sent a message (the reply to Jame) at 10:26pm but it wasn't sent until I sent another message just now (a few mins before midnight). I notice that it also doubled a current message. (image link has more info)

Please forgive the unkind words. It's almost midnight and I'm on the Bacardi now. May your 2022 be bug-free! (Yeah I know, but we can hope!)

https://i.imgur.com/f4Ggw5p.png

LakeYS commented 2 years ago

Will add some tests for this in the next rc build.

trevorjd commented 2 years ago

Installed 2.0.0.rc3 about 2 hrs ago. So far so good, haven't noticed any dupes. However I have noticed that the delay on sending from Discord to game is worse. Pretty much every message I send now gets "buffered" and requires me to send another to kick it through. Killing and restarting Dishorde sorts it out.

LakeYS commented 2 years ago

Can you grab any logs with debug-mode turned on when the "buffering" issue happens?

Edit: Logs were sent to me via Discord, here's the highlight:

image

This would link this problem with #118, meaning both issues may have the same root cause.

LakeYS commented 2 years ago

Have yet to encounter any more of the buffering issue, but I did manage to catch a message not going through at all. I will look into the current logs/detection accordingly.

We could possibly add a message for this. I.e. a temporary, self-deleting message that says something like "Could not send your message to the server".

trevorjd commented 2 years ago

Still happening for us. I have disable-non-player-chatmsgs set false so that we get an echo back. That's helpful as it shows us pretty quickly whether the message went through. If it doesn't, we can send a dummy line through to "flush the buffer" as it were.

Interestingly, I just tried capturing some more debug data, first time on 2.0.0. I have the three 3 debug options set true but it's not generating a log file, so that's something to look at.

I did notice that the debug info coming up on the console doesn't include any timestamps nor indication on what it's processing. Perhaps you could add a trace-discord-message option that produces a report like:

Message received from Discord Sender: Trevor#1234 Msg length: 24 Msg content: blah blah blah Delivered to game: success / failure Not practical to do it for messages coming from game though. Example of a delayed message (and the very-helpful echo!) from just now: https://i.imgur.com/Im3HvFg.png
EvilBurrito commented 2 years ago

I am having the same issue when the text is over a certain character limit. I would have to do more testing and enable debug mode to see what that limit seems to be. I only have chat messages enabled. It is only when the message is sent from Discord to the game. Other direction works fine with no issues as far as I can tell. As noted by original poster, I follow the message with any other message that is below that character limit and it sends the previous message as well as the 2nd one.