✌️
This commit is contained in:
parent
88d1ac2556
commit
50e40ed61e
3 changed files with 126 additions and 20 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue