lykoss / lykos

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

still prune users from state when there's no active game #513

Closed jesopo closed 1 year ago

jesopo commented 1 year ago

the code as it currently is won't clean up a user when they part the only channel they share with lykos, which means if they rejoin with different details (i.e. changed ident) there will be a version of them still in state (but in no channels!) which causes users.py::get() to find multiple potential users

fndax commented 1 year ago

This issue is testable by getting a user into this state and then attempting to join a game. For example:

  1. Connect nick!~ident@host and join the werewolf game channel
  2. PART the channel (not QUIT), then once you don't share any channels with lykos, QUIT
  3. Connect nick!~newident@host and join the werewolf game channel
  4. Attempt to !j to start a game
  5. Receive traceback

I've tested this PR on my personal bot and can confirm it fixes the above.