willowtreeapps / wombats-api

Wombats API
https://github.com/willowtreeapps/wombats-documentation
MIT License
10 stars 4 forks source link

Game Play Information #230

Closed dehli closed 7 years ago

dehli commented 7 years ago

Problem

When you go to a game's page, you don't get enough information sent back (current arena state if the game isn't running, game name, max players, current players, etc.).

Solution

With this change, I broadcast game info, through sockets, whenever somebody joins a game. I'm not sure that we really need to broadcast it to everyone (could probably get away with just broadcasting to the channel that joined). We'll need to think about this. I still need to send a stats-update so that the client knows which bots are in the game.

dehli commented 7 years ago

I made some changes to the PR. Now only the channel that is joining a game gets the info broadcasted to it. Additionally, I now broadcast user stats as well. @emilyseibert @oconn

I'm not super crazy about moving get-player-stats to where I did. Not really sure where it should live though.

It seems like Wombat's have 0 health unless the game is running. Is this what we want?

emilyseibert commented 7 years ago

No it should start at 100, full health.

dehli commented 7 years ago

Totally agree with you about file size. When the game ends, it looks like the existing stats functions make the hp go to 0. Will investigate 🕵️