summaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/api')
-rw-r--r--src/api/stream/othello-game.ts9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/api/stream/othello-game.ts b/src/api/stream/othello-game.ts
index a5fb379e80..d086478159 100644
--- a/src/api/stream/othello-game.ts
+++ b/src/api/stream/othello-game.ts
@@ -55,9 +55,7 @@ export default function(request: websocket.request, connection: websocket.connec
let winner;
if (isEnded) {
- const blackCount = o.board.filter(s => s == 'black').length;
- const whiteCount = o.board.filter(s => s == 'white').length;
- winner = blackCount == whiteCount ? null : blackCount > whiteCount ? game.black_user_id : game.white_user_id;
+ winner = o.blackCount == o.whiteCount ? null : o.blackCount > o.whiteCount ? game.black_user_id : game.white_user_id;
}
const log = {
@@ -79,9 +77,6 @@ export default function(request: websocket.request, connection: websocket.connec
}
});
- publishOthelloGameStream(gameId, 'set', {
- color: myColor,
- pos
- });
+ publishOthelloGameStream(gameId, 'set', log);
}
}