lykoss / lykos

Werewolf, the popular detective/social party game (a theme of Mafia)
https://werewolf.chat
Other
127 stars 63 forks source link

Server mode changes not tracked #498

Open jacob1 opened 2 years ago

jacob1 commented 2 years ago

Server mode changes are not tracked. This can lead to desyncs when net splits occur.

Noticed this today, during a netsplit: [NET SPLIT] Mon 12-06 [00:26:33] Kujou was mauled by wild animals and has died. New player count: 3 Mon 12-06 [00:26:33] iovoid was mauled by wild animals and has died. New player count: 2 [NET REJOIN] Mon 12-06 [00:27:14] osmium.libera.chat gives voice to Kujou iovoid [GAME TIMEOUT] Mon 12-06 [00:28:17] lykos removes voice from pony jacob1 Mon 12-06 [00:28:17] PING! jacob1 pony Mon 12-06 [00:28:18] The current game took too long to start and has been canceled. If you are still active, you can join again to start a new game.

Note that Kujou and iovoid were not devoiced, because it didn't think they were still voiced. Idealy they would have been devoiced during the net join though. !fsync did nothing to help the situation, I did confirm fsync itself works fine, it just wouldn't devoice those two ghost players.

The problem that this block returns before mode changes can be tracked: https://github.com/lykoss/lykos/blob/master/src/hooks.py#L444 I am fairly certain comment is stale and no longer relevant. Ideally we should fire sync_modes after tracking the modes