-
Notifications
You must be signed in to change notification settings - Fork 40
Lock “reveal” once spymaster is chosen #11
Comments
Thanks for the suggestion! I'll have to think about this one some more. I get the reasoning, but there's also usually two spymasters, so perhaps locking it to two could work? Other edge cases include refreshing the page/exiting and rejoining the game. I currently don't track connected clients, so I think having a mechanism to do that and use that for tracking the current "spymasters" could work. |
Revisiting this as it's been requested by other users, plus with the game being played virtually it would make sense to have something for tracking spymasters. My initial idea: generate client_ids on each connected client prior to joining the room (or on connect, could assign it server-side). Pass client_id with all requests, and add a channel/method for toggling spymaster. Pass a message on the toggle_spymaster channel when entering/leaving the spymaster view. On message, call Game.Info#toggle_spymaster which adds/removes the client_id from a spymasters dict/list. Add spymasters to to_json. Client-side, I envision a "spymaster count" badge on the spymaster button to show how many active spymasters there are. Also would add an additional layer of "are you sure?" buttons before switching if spymasters.count > 2. Prefer not to fully "lock" the view just in case something errors and we lose track. Additional possibilities with this method of client_id tracking:
|
Another possibility would be similar to http://syeedibnfaiz.com/codenames/ Generate a unique code for the spymaster link and only provide that link to other spymasters. Everyone else gets the non-spymaster link. The caveat is that the spymaster links are not one-time-use, so you need to at least trust the other spymasters not to give the link to their team mates. |
I've discovered simple solution. After game is regenerate button is clicked set all player into Agent mode and reset global Spymaster counter. Display this counter on bottom row. After any one goes to Spymaster mode increment counter. Every one will know about number of SpyMasters in game. |
My suggestions for solving this:
|
@serknor - I think this is a viable strategy. When new games are created, the spymasters are reset to agents so new games should work fine in that sense. I can implement this soon, I just wanted to ensure that the spymaster toggling was working well before locking user out of it just in case. Thoughts on using the # of teams as the spymaster count? There should only be one spymaster per team so it seems fine to me. |
Regarding the last sentence. Since I noticed you where taking a cautious approach to modifications, I thought that an option to set the limit manually would be less strict than having the site define it. |
That's a fair point - there are so many different situations that arise in this game that I never even think about, such as having a "spectator" watching the spymaster view. Perhaps a solution that allows the user to input the # of spymasters, but it will default to the # of teams and will be hidden behind the "advanced options" section? |
As you prefer. |
Once someone has clicked “reveal” as the spymaster, no one else should be able to reveal the map
The text was updated successfully, but these errors were encountered: