summaryrefslogtreecommitdiff
path: root/src/api/stream
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-03-07 21:57:06 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-03-07 21:57:06 +0900
commit50e40ed61e8226ecbb7f1d7d53ba028fad1a9a01 (patch)
tree92c564d99f45e3fd747cae5a4007d486ca6a3a67 /src/api/stream
parentFix bug (diff)
downloadsharkey-50e40ed61e8226ecbb7f1d7d53ba028fad1a9a01.tar.gz
sharkey-50e40ed61e8226ecbb7f1d7d53ba028fad1a9a01.tar.bz2
sharkey-50e40ed61e8226ecbb7f1d7d53ba028fad1a9a01.zip
:v:
Diffstat (limited to 'src/api/stream')
-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);
}
}