commit acbff37fc9a8f188b6dc956804f2985ca43ce75b (patch)
parent a48d214ef34111d82dd31bfa8efd21dfd71abb44
Author: Alex Karle <alex@karle.co>
Date: Wed, 6 May 2020 00:07:14 -0400
Euchre::Dealer: Add table_id to broadcast_gamestate
Previously, this was game.id, but Games don't have the Table name any
more (why should they)? Clients may still want to know which Table they
are at though
Diffstat:
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/API.md b/API.md
@@ -181,6 +181,7 @@ The response looks like this:
}
"hand": [ "TH", "JD", "KD", ... ],
"is_spectator": 0,
+ "table_id": "The Cool Kids Table",
}
```
diff --git a/lib/Euchre/Dealer.pm b/lib/Euchre/Dealer.pm
@@ -200,6 +200,7 @@ sub broadcast_gamestate {
msg_type => 'game_state',
game => $msg,
is_spectator => $p->is_spectator ? 1 : 0,
+ table_id => $self->id,
};
if (!$p->is_spectator) {
diff --git a/public/debug.html b/public/debug.html
@@ -22,7 +22,7 @@
if (msg.msg_type === 'game_state') {
GAME_PHASE = msg.game.phase;
- gameState = '<br>Game: ' + msg.game.id + '<br>' +
+ gameState = '<br>Game: ' + msg.table_id + '<br>' +
'Players: ' + msg.game.players + '<br>' +
'Spectators: ' + msg.game.spectators + '<br>' +
'Game Phase: ' + msg.game.phase + '<br>' +