From e82268db7ee9863b2eaeea64f843afa091b024f8 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 9 Mar 2018 18:29:27 +0900 Subject: :v: --- src/api/models/othello-game.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/api/models') diff --git a/src/api/models/othello-game.ts b/src/api/models/othello-game.ts index 7ae48b8aab..82c0042108 100644 --- a/src/api/models/othello-game.ts +++ b/src/api/models/othello-game.ts @@ -2,7 +2,6 @@ import * as mongo from 'mongodb'; import deepcopy = require('deepcopy'); import db from '../../db/mongodb'; import { IUser, pack as packUser } from './user'; -import { Map } from '../../common/othello/maps'; const Game = db.get('othello_games'); export default Game; @@ -79,6 +78,11 @@ export const pack = ( if (opts.detail === false) { delete _game.logs; delete _game.settings.map; + } else { + // 互換性のため + if (_game.settings.map.hasOwnProperty('size')) { + _game.settings.map = _game.settings.map.data.match(new RegExp(`.{1,${_game.settings.map.size}}`, 'g')); + } } // Populate user -- cgit v1.2.3-freya