banool / codenames-pictures

Play Codenames Pictures using a TV or computer for the board
https://codenames-pictures.dport.me
22 stars 18 forks source link

Support for user supplied images 📷 #15

Closed banool closed 6 years ago

banool commented 6 years ago

This adds support for user supplied images. When creating a game in the lobby, there is now an extra field to supply the link to your images. The readme has been updated to include information on how to do this, and there is a link to this readme in the lobby.

Definitely read the readme to know what kind of links are supported. Support for the text files is pretty solid, but the directory reading thing is janky at best. In general though this worked out better than I expected!

If the user enters an invalid link, it would originally just launch into the game with the standard images on the server. Now a message will be printed in the lobby saying that the link was invalid.

The other janky thing I do here is two POST requests, one to supply the link to the server and then the next to transition to the game screen if the link was valid. It's only a bit janky though, this seems like a reasonable thing to do, but you could probably do it all in one request.

We learning about them React components and callbacks and Go stuff though !!

banool commented 6 years ago

Closing #4 following this.