hugosaintemarie / magic-maze

Online version of board game "Magic Maze"
https://magicmaze.herokuapp.com
MIT License
20 stars 11 forks source link

Restrict user actions to what they have been assigned #39

Closed rcjsuen closed 3 years ago

rcjsuen commented 3 years ago

Currently, all players can do all the actions which does not match the board game's rules. Users should only be able to perform the action that they have been assigned.

hugosaintemarie commented 3 years ago

I think this is only because debug is set to true in config.js

https://github.com/ashugeo/magic-maze/blob/61732565fc34e81104a8d121736a5007e0072773/src/client/play/js/config.js#L2

All roles are allowed when debug is true, see hero.js

https://github.com/ashugeo/magic-maze/blob/61732565fc34e81104a8d121736a5007e0072773/src/client/play/js/hero.js#L61

rcjsuen commented 3 years ago

@ashugeo Ah, that explains that.

Would you be okay with changing this to false and/or maybe adding a checkbox so that the person creating the room can decide if they want to let players do whatever they want?

hugosaintemarie commented 3 years ago

Honestly I'm not sure if the checkbox is necessary. The game doesn't suggest a variant where everyone can do whatever they want. It kind of defeats the whole purpose of the game doesn't it?

I think it was a mistake that debug: true made it into a commit 🙂 Feel free to change it to false, that's what it should be in production!

rcjsuen commented 3 years ago

Honestly I'm not sure if the checkbox is necessary. The game doesn't suggest a variant where everyone can do whatever they want. It kind of defeats the whole purpose of the game doesn't it?

That's fair. I was thinking it might be useful for people who are trying to explain how the game works. I guess we can see if someone has that as a feature request and then address it then.

I think it was a mistake that debug: true made it into a commit 🙂 Feel free to change it to false, that's what it should be in production!

Sounds good. I'll make a pull request for this soon.

Have a good weekend, @ashugeo!

rcjsuen commented 3 years ago

I've opened #42 to change the debug flag's default value.

hugosaintemarie commented 3 years ago

Thanks @rcjsuen 🙂