Drithyl / MrClockwork-v4

Discord Bot for hosting Dominions 5 games, now refactored from the ground up.
17 stars 7 forks source link

Stales message is no longer being sent to the game's channel with the new turn announcement #92

Open Drithyl opened 2 years ago

Drithyl commented 2 years ago

In the spirit of making the repository a bit more collaborative, and since I've been focusing on my school project, I figured I'd start posting issues for people to work on.

As of this commit and the others that followed the same day, the bot stopped sending stale information on new turns.

Those commits changed the way that the isTurnProcessing flag is set for games, which affects several of the game event handler modules directly (new_turn.js, all_turns_done.js, etc). The information on whether a turn is processing is now sent directly by the slave servers via an HTTP request that is executed during Dominions 5's pre and post-exec flags.

I have not yet looked at the issue, but in all likelihood this is just the case of one or more lines of code deleted by accident during the changes commit the 15th May.

Drithyl commented 2 years ago

This problem was actually caused by Illwinter's last update. The statusdump file now changes each nation's turn status to an arbitrary value of 9 (for "unknown") when the turn starts processing; before the preprocessing flags kick in to check those values for stales.

Basically, a completely different way to check stales is needed now, like checking the pretender files' last modified time on a new turn and comparing it to the last modified time of the ftherlnd file. This is no longer a good first issue as it requires bigger code changes, and the changes should be made in the Slave repository, not here.