summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/othello/games
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-06-17 08:10:54 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-06-17 08:10:54 +0900
commit1ef66c962a1cea81dee4f5db32cd011feac7de44 (patch)
tree006945b7ae9d437cebb0fabc5eb5a849cff518c5 /src/server/api/endpoints/othello/games
parentAdd missing semicolon (diff)
downloadmisskey-1ef66c962a1cea81dee4f5db32cd011feac7de44.tar.gz
misskey-1ef66c962a1cea81dee4f5db32cd011feac7de44.tar.bz2
misskey-1ef66c962a1cea81dee4f5db32cd011feac7de44.zip
reversi :white_flower: :100:
Diffstat (limited to 'src/server/api/endpoints/othello/games')
-rw-r--r--src/server/api/endpoints/othello/games/show.ts32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/server/api/endpoints/othello/games/show.ts b/src/server/api/endpoints/othello/games/show.ts
deleted file mode 100644
index 6b2f5ce137..0000000000
--- a/src/server/api/endpoints/othello/games/show.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-import $ from 'cafy'; import ID from '../../../../../cafy-id';
-import OthelloGame, { pack } from '../../../../../models/othello-game';
-import Othello from '../../../../../othello/core';
-
-module.exports = (params, user) => new Promise(async (res, rej) => {
- // Get 'gameId' parameter
- const [gameId, gameIdErr] = $.type(ID).get(params.gameId);
- if (gameIdErr) return rej('invalid gameId param');
-
- 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.isLlotheo,
- canPutEverywhere: game.settings.canPutEverywhere,
- loopedBoard: game.settings.loopedBoard
- });
-
- game.logs.forEach(log => {
- o.put(log.color, log.pos);
- });
-
- const packed = await pack(game, user);
-
- res(Object.assign({
- board: o.board,
- turn: o.turn
- }, packed));
-});