cozuya / secret-hitler

A web adaptation of the social deduction board game Secret Hitler. https://secrethitler.io
Other
814 stars 203 forks source link

Vote signalling fix #1928

Closed iounpaladin closed 2 years ago

iounpaladin commented 2 years ago

Basically, every time you unvote it waits 2s to emit it to all the clients (which resets if you spam votes). For the average user, the only effect is that there is a 2s delay between unvoting and seeing it. For vote signallers, it's now impossible to spam the spinner on the cardback because the unvote keeps getting held back by the spam. Tested and should work as intended for both normal voting and vote spamming. This was WAY easier to do like this, my original solution without timers was absolute hell.

Vigasaurus commented 2 years ago

Have you tested at all how this behaves in remakes? I know you do reset the data/interval IDs, but do we need to be clearing the intervals there too? I feel like we should, but I haven't been able to break it really.

iounpaladin commented 2 years ago

I haven't, but I'm pretty sure it'll just work, because game and seatedPlayers still point to the old game, which still exists in memory for the duration of the 2 seconds