DJWoodZ / Satisfactory-Discord-Bot

A Discord bot that posts Satisfactory Dedicated Server status information such as online players.
MIT License
21 stars 2 forks source link

Different Satisfactory server Timezone causes messages not being send #36

Closed Luukxt8 closed 1 month ago

Luukxt8 commented 1 month ago

Hi,

I have been troubleshooting the issue of join and unjoin messages not being send.

I have found that differences in timezone causes issues with data.timestamp >= initTime not being true. After adding RUN apk add --no-cache tzdata ENV TZ=Europe/Amsterdam to the dockerfile it started working for me.

I will try to find a way to set the timezone for your application without having to edit the dockerfile.

DJWoodZ commented 1 month ago

Hi @Luukxt8,

Thank you for raising this. It should not be necessary to set the timezone unless something has recently changed with respect to the timestamps in the Satisfactory Dedicated Server logs.

By default the Satisfactory Dedicated Server logs should contain UTC timestamps. The bot attempts to detect when an incompatible command line argument has been used for the Satisfactory Dedicated Server (e.g. -LocalLogTimes). There is some information about this in the README.

As such, the parseTimestamp function converts the log times using the Z zone designator (for UTC). Originally the bot did not do this, but this issue was fixed in #1.

It could be that the time/timezone is not correct on your Satisfactory Dedicated Server host, or in the container image - if that is how you are running the Satisfactory Dedicated Server.

Luukxt8 commented 1 month ago

Thanks for the quick reply.

I'm using wolveix/satisfactory-server (Docker), and running it in docker for windows desktop.

I will have a look at my satisfactory server config.

DJWoodZ commented 1 month ago

It would probably also be a good idea to inspect the FactoryGame.log file, as the dedicated server is running, to see if the latest timestamps match a UTC clock.

Luukxt8 commented 1 month ago

I have just checked the FactoryGame.log. It matches the UTC clock... [2024.10.18-18.12.20:447][ 65]LogNet: Join succeeded: DrogeBezem

Wierd....I don't understand why it didn't work before my change.

Luukxt8 commented 1 month ago

I reverted my changes in the docker file. It's still working :) Thanks for you help! I think it was a user error, tried to much changes at the same time to fix it i guess. Something else fixed it that I forgot about.

DJWoodZ commented 1 month ago

I wonder if it could be related to #35?

wolveix/satisfactory-server recently had an issue with logs which resulted in a similar issue where the bot would not send messages.

Perhaps you pulled the latest version, which is why it started working again?

Either way, I'm glad you got it working again. 👍