Resolve conflicts
This commit is contained in:
parent
281b388e39
commit
bfc193d8cd
308 changed files with 3045 additions and 3200 deletions
|
|
@ -1,22 +1,22 @@
|
|||
import $ from 'cafy';
|
||||
import Game, { pack } from '../../../models/othello-game';
|
||||
import OthelloGame, { pack } from '../../../models/othello-game';
|
||||
import Othello from '../../../../common/othello/core';
|
||||
|
||||
module.exports = (params, user) => new Promise(async (res, rej) => {
|
||||
// Get 'game_id' parameter
|
||||
const [gameId, gameIdErr] = $(params.game_id).id().$;
|
||||
if (gameIdErr) return rej('invalid game_id param');
|
||||
// Get 'gameId' parameter
|
||||
const [gameId, gameIdErr] = $(params.gameId).id().$;
|
||||
if (gameIdErr) return rej('invalid gameId param');
|
||||
|
||||
const game = await Game.findOne({ _id: gameId });
|
||||
const game = await OthelloGame.findOne({ _id: gameId });
|
||||
|
||||
if (game == null) {
|
||||
return rej('game not found');
|
||||
}
|
||||
|
||||
const o = new Othello(game.settings.map, {
|
||||
isLlotheo: game.settings.is_llotheo,
|
||||
canPutEverywhere: game.settings.can_put_everywhere,
|
||||
loopedBoard: game.settings.looped_board
|
||||
isLlotheo: game.settings.isLlotheo,
|
||||
canPutEverywhere: game.settings.canPutEverywhere,
|
||||
loopedBoard: game.settings.loopedBoard
|
||||
});
|
||||
|
||||
game.logs.forEach(log => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue