-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
396 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ net { | |
ip = "5.196.91.160" | ||
asset { | ||
domain = ${net.domain} | ||
version = 800 | ||
version = 801 | ||
} | ||
} | ||
play { | ||
|
Submodule chess
updated
from 8704c6 to 8a22e8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package lila.socket | ||
|
||
import chess.format.Uci | ||
import lila.common.PimpedJson._ | ||
import play.api.libs.json.JsObject | ||
|
||
case class AnaDrop( | ||
role: chess.Role, | ||
pos: chess.Pos, | ||
variant: chess.variant.Variant, | ||
fen: String, | ||
path: String) { | ||
|
||
def step: Valid[Step] = | ||
chess.Game(variant.some, fen.some).drop(role, pos) map { | ||
case (game, drop) => | ||
val movable = !game.situation.end | ||
Step( | ||
ply = game.turns, | ||
move = game.pgnMoves.lastOption.map { san => | ||
Step.Move(Uci(drop), san) | ||
}, | ||
fen = chess.format.Forsyth >> game, | ||
check = game.situation.check, | ||
dests = Some(movable ?? game.situation.destinations), | ||
drops = movable.fold(game.situation.drops, Some(Nil)), | ||
crazyData = game.situation.board.crazyData) | ||
} | ||
} | ||
|
||
object AnaDrop { | ||
|
||
def parse(o: JsObject) = for { | ||
d ← o obj "d" | ||
role ← d str "role" flatMap chess.Role.allByName.get | ||
pos ← d str "pos" flatMap chess.Pos.posAt | ||
variant = chess.variant.Variant orDefault ~d.str("variant") | ||
fen ← d str "fen" | ||
path ← d str "path" | ||
} yield AnaDrop( | ||
role = role, | ||
pos = pos, | ||
variant = variant, | ||
fen = fen, | ||
path = path) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
0 info it worked if it ends with ok | ||
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'i' ] | ||
2 info using [email protected] | ||
3 info using [email protected] | ||
4 silly loadCurrentTree Starting | ||
5 silly install loadCurrentTree | ||
6 silly install readLocalPackageData | ||
7 silly install normalizeTree | ||
8 silly loadCurrentTree Finishing | ||
9 silly loadIdealTree Starting | ||
10 silly install loadIdealTree | ||
11 silly cloneCurrentTree Starting | ||
12 silly install cloneCurrentTreeToIdealTree | ||
13 silly cloneCurrentTree Finishing | ||
14 silly loadShrinkwrap Starting | ||
15 silly install loadShrinkwrap | ||
16 silly loadShrinkwrap Finishing | ||
17 silly loadAllDepsIntoIdealTree Starting | ||
18 silly install loadAllDepsIntoIdealTree | ||
19 silly fetchOtherPackageData chessground@github:ornicar/chessground#v3.3.2 | ||
20 silly cache add args [ 'chessground@github:ornicar/chessground#v3.3.2', null ] | ||
21 verbose cache add spec chessground@github:ornicar/chessground#v3.3.2 | ||
22 silly cache add parsed spec Result { | ||
22 silly cache add raw: 'chessground@github:ornicar/chessground#v3.3.2', | ||
22 silly cache add scope: null, | ||
22 silly cache add name: 'chessground', | ||
22 silly cache add rawSpec: 'github:ornicar/chessground#v3.3.2', | ||
22 silly cache add spec: 'github:ornicar/chessground#v3.3.2', | ||
22 silly cache add type: 'hosted', | ||
22 silly cache add hosted: | ||
22 silly cache add { type: 'github', | ||
22 silly cache add ssh: '[email protected]:ornicar/chessground.git#v3.3.2', | ||
22 silly cache add sshUrl: 'git+ssh:https://[email protected]/ornicar/chessground.git#v3.3.2', | ||
22 silly cache add httpsUrl: 'git+https://github.com/ornicar/chessground.git#v3.3.2', | ||
22 silly cache add gitUrl: 'git:https://github.com/ornicar/chessground.git#v3.3.2', | ||
22 silly cache add shortcut: 'github:ornicar/chessground#v3.3.2', | ||
22 silly cache add directUrl: 'https://raw.githubusercontent.com/ornicar/chessground/v3.3.2/package.json' } } | ||
23 verbose addRemoteGit caching github:ornicar/chessground#v3.3.2 | ||
24 verbose addRemoteGit ornicar/chessground#v3.3.2 is a repository hosted by github | ||
25 silly tryGitProto attempting to clone git:https://github.com/ornicar/chessground.git#v3.3.2 | ||
26 silly tryClone cloning ornicar/chessground#v3.3.2 via git:https://github.com/ornicar/chessground.git#v3.3.2 | ||
27 verbose tryClone git-github-com-ornicar-chessground-git-v3-3-2-32da808f not in flight; caching | ||
28 info git [ 'config', '--get', 'remote.origin.url' ] | ||
29 silly validateExistingRemote ornicar/chessground#v3.3.2 remote.origin.url: git:https://github.com/ornicar/chessground.git | ||
30 verbose validateExistingRemote ornicar/chessground#v3.3.2 is updating existing cached remote /home/thib/.npm/_git-remotes/git-github-com-ornicar-chessground-git-v3-3-2-32da808f | ||
31 info git [ 'fetch', '-a', 'origin' ] | ||
32 error git fetch -a origin (git:https://github.com/ornicar/chessground.git) fatal: Unable to look up github.com (port 9418) (Name or service not known) | ||
33 silly tryHTTPS attempting to clone git+https://github.com/ornicar/chessground.git#v3.3.2 | ||
34 silly tryClone cloning ornicar/chessground#v3.3.2 via git+https://github.com/ornicar/chessground.git#v3.3.2 | ||
35 verbose tryClone git-https-github-com-ornicar-chessground-git-v3-3-2-576cb6bb not in flight; caching | ||
36 info git [ 'clone', | ||
36 info git '--template=/home/thib/.npm/_git-remotes/_templates', | ||
36 info git '--mirror', | ||
36 info git 'https://github.com/ornicar/chessground.git', | ||
36 info git '/home/thib/.npm/_git-remotes/git-https-github-com-ornicar-chessground-git-v3-3-2-576cb6bb' ] | ||
37 verbose git clone --template=/home/thib/.npm/_git-remotes/_templates --mirror https://github.com/ornicar/chessground.git /home/thib/.npm/_git-remotes/git-https-github-com-ornicar-chessground-git-v3-3-2-576cb6bb: Cloning into bare repository '/home/thib/.npm/_git-remotes/git-https-github-com-ornicar-chessground-git-v3-3-2-576cb6bb'... | ||
37 verbose git clone --template=/home/thib/.npm/_git-remotes/_templates --mirror https://github.com/ornicar/chessground.git /home/thib/.npm/_git-remotes/git-https-github-com-ornicar-chessground-git-v3-3-2-576cb6bb: fatal: unable to access 'https://github.com/ornicar/chessground.git/': Could not resolve host: github.com | ||
38 silly trySSH attempting to clone [email protected]:ornicar/chessground.git#v3.3.2 | ||
39 silly tryClone cloning ornicar/chessground#v3.3.2 via [email protected]:ornicar/chessground.git#v3.3.2 | ||
40 verbose tryClone git-github-com-ornicar-chessground-git-v3-3-2-74389233 not in flight; caching | ||
41 info git [ 'clone', | ||
41 info git '--template=/home/thib/.npm/_git-remotes/_templates', | ||
41 info git '--mirror', | ||
41 info git '[email protected]:ornicar/chessground.git', | ||
41 info git '/home/thib/.npm/_git-remotes/git-github-com-ornicar-chessground-git-v3-3-2-74389233' ] | ||
42 error git clone --template=/home/thib/.npm/_git-remotes/_templates --mirror [email protected]:ornicar/chessground.git /home/thib/.npm/_git-remotes/git-github-com-ornicar-chessground-git-v3-3-2-74389233: Cloning into bare repository '/home/thib/.npm/_git-remotes/git-github-com-ornicar-chessground-git-v3-3-2-74389233'... | ||
42 error git clone --template=/home/thib/.npm/_git-remotes/_templates --mirror [email protected]:ornicar/chessground.git /home/thib/.npm/_git-remotes/git-github-com-ornicar-chessground-git-v3-3-2-74389233: ssh: Could not resolve hostname github.com: Name or service not known | ||
42 error git clone --template=/home/thib/.npm/_git-remotes/_templates --mirror [email protected]:ornicar/chessground.git /home/thib/.npm/_git-remotes/git-github-com-ornicar-chessground-git-v3-3-2-74389233: fatal: Could not read from remote repository. | ||
42 error git clone --template=/home/thib/.npm/_git-remotes/_templates --mirror [email protected]:ornicar/chessground.git /home/thib/.npm/_git-remotes/git-github-com-ornicar-chessground-git-v3-3-2-74389233: | ||
42 error git clone --template=/home/thib/.npm/_git-remotes/_templates --mirror [email protected]:ornicar/chessground.git /home/thib/.npm/_git-remotes/git-github-com-ornicar-chessground-git-v3-3-2-74389233: Please make sure you have the correct access rights | ||
42 error git clone --template=/home/thib/.npm/_git-remotes/_templates --mirror [email protected]:ornicar/chessground.git /home/thib/.npm/_git-remotes/git-github-com-ornicar-chessground-git-v3-3-2-74389233: and the repository exists. | ||
43 silly fetchPackageMetaData Error: Command failed: git clone --template=/home/thib/.npm/_git-remotes/_templates --mirror [email protected]:ornicar/chessground.git /home/thib/.npm/_git-remotes/git-github-com-ornicar-chessground-git-v3-3-2-74389233 | ||
43 silly fetchPackageMetaData Cloning into bare repository '/home/thib/.npm/_git-remotes/git-github-com-ornicar-chessground-git-v3-3-2-74389233'... | ||
43 silly fetchPackageMetaData ssh: Could not resolve hostname github.com: Name or service not known | ||
43 silly fetchPackageMetaData fatal: Could not read from remote repository. | ||
43 silly fetchPackageMetaData | ||
43 silly fetchPackageMetaData Please make sure you have the correct access rights | ||
43 silly fetchPackageMetaData and the repository exists. | ||
43 silly fetchPackageMetaData | ||
43 silly fetchPackageMetaData at ChildProcess.exithandler (child_process.js:213:12) | ||
43 silly fetchPackageMetaData at emitTwo (events.js:87:13) | ||
43 silly fetchPackageMetaData at ChildProcess.emit (events.js:172:7) | ||
43 silly fetchPackageMetaData at maybeClose (internal/child_process.js:818:16) | ||
43 silly fetchPackageMetaData at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) | ||
43 silly fetchPackageMetaData error for chessground@github:ornicar/chessground#v3.3.2 { [Error: Command failed: git clone --template=/home/thib/.npm/_git-remotes/_templates --mirror [email protected]:ornicar/chessground.git /home/thib/.npm/_git-remotes/git-github-com-ornicar-chessground-git-v3-3-2-74389233 | ||
43 silly fetchPackageMetaData Cloning into bare repository '/home/thib/.npm/_git-remotes/git-github-com-ornicar-chessground-git-v3-3-2-74389233'... | ||
43 silly fetchPackageMetaData ssh: Could not resolve hostname github.com: Name or service not known | ||
43 silly fetchPackageMetaData fatal: Could not read from remote repository. | ||
43 silly fetchPackageMetaData | ||
43 silly fetchPackageMetaData Please make sure you have the correct access rights | ||
43 silly fetchPackageMetaData and the repository exists. | ||
43 silly fetchPackageMetaData ] | ||
43 silly fetchPackageMetaData killed: false, | ||
43 silly fetchPackageMetaData code: 128, | ||
43 silly fetchPackageMetaData signal: null, | ||
43 silly fetchPackageMetaData cmd: 'git clone --template=/home/thib/.npm/_git-remotes/_templates --mirror [email protected]:ornicar/chessground.git /home/thib/.npm/_git-remotes/git-github-com-ornicar-chessground-git-v3-3-2-74389233' } | ||
44 silly rollbackFailedOptional Starting | ||
45 silly rollbackFailedOptional Finishing | ||
46 silly runTopLevelLifecycles Starting | ||
47 silly runTopLevelLifecycles Finishing | ||
48 silly install printInstalled | ||
49 verbose stack Error: Command failed: git clone --template=/home/thib/.npm/_git-remotes/_templates --mirror [email protected]:ornicar/chessground.git /home/thib/.npm/_git-remotes/git-github-com-ornicar-chessground-git-v3-3-2-74389233 | ||
49 verbose stack Cloning into bare repository '/home/thib/.npm/_git-remotes/git-github-com-ornicar-chessground-git-v3-3-2-74389233'... | ||
49 verbose stack ssh: Could not resolve hostname github.com: Name or service not known | ||
49 verbose stack fatal: Could not read from remote repository. | ||
49 verbose stack | ||
49 verbose stack Please make sure you have the correct access rights | ||
49 verbose stack and the repository exists. | ||
49 verbose stack | ||
49 verbose stack at ChildProcess.exithandler (child_process.js:213:12) | ||
49 verbose stack at emitTwo (events.js:87:13) | ||
49 verbose stack at ChildProcess.emit (events.js:172:7) | ||
49 verbose stack at maybeClose (internal/child_process.js:818:16) | ||
49 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) | ||
50 verbose cwd /home/thib/lila/ui/analyse | ||
51 error Linux 4.0.1-1-ARCH | ||
52 error argv "/usr/bin/node" "/usr/bin/npm" "i" | ||
53 error node v5.3.0 | ||
54 error npm v3.5.2 | ||
55 error code 128 | ||
56 error Command failed: git clone --template=/home/thib/.npm/_git-remotes/_templates --mirror [email protected]:ornicar/chessground.git /home/thib/.npm/_git-remotes/git-github-com-ornicar-chessground-git-v3-3-2-74389233 | ||
56 error Cloning into bare repository '/home/thib/.npm/_git-remotes/git-github-com-ornicar-chessground-git-v3-3-2-74389233'... | ||
56 error ssh: Could not resolve hostname github.com: Name or service not known | ||
56 error fatal: Could not read from remote repository. | ||
56 error | ||
56 error Please make sure you have the correct access rights | ||
56 error and the repository exists. | ||
57 error If you need help, you may report this error at: | ||
57 error <https://github.com/npm/npm/issues> | ||
58 verbose exit [ 1, true ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
var util = require('chessground').util; | ||
var drag = require('chessground').drag; | ||
var game = require('game').game; | ||
|
||
module.exports = function(ctrl, color, e) { | ||
if (e.button !== 0) return; // only left click | ||
if (ctrl.chessground.data.movable.color !== color) return; | ||
var node = e.target.parentNode.parentNode; | ||
var role = node.getAttribute('data-role'), | ||
color = node.getAttribute('data-color'); | ||
if (!role || !color) return; | ||
e.stopPropagation(); | ||
e.preventDefault(); | ||
var key; | ||
for (var i in util.allKeys) { | ||
if (!ctrl.chessground.data.pieces[util.allKeys[i]]) { | ||
key = util.allKeys[i]; | ||
break; | ||
} | ||
} | ||
if (!key) return; | ||
var coords = util.key2pos(ctrl.chessground.data.orientation === 'white' ? key : util.invertKey(key)); | ||
var piece = { | ||
role: role, | ||
color: color | ||
}; | ||
var obj = {}; | ||
obj[key] = piece; | ||
ctrl.chessground.setPieces(obj); | ||
var bounds = ctrl.chessground.data.bounds(); | ||
var squareBounds = ctrl.vm.element.querySelector('square').getBoundingClientRect(); | ||
var rel = [ | ||
(coords[0] - 1) * squareBounds.width + bounds.left, (8 - coords[1]) * squareBounds.height + bounds.top | ||
]; | ||
ctrl.chessground.data.draggable.current = { | ||
orig: key, | ||
piece: piece.color + piece.role, | ||
rel: rel, | ||
epos: [e.clientX, e.clientY], | ||
pos: [e.clientX - rel[0], e.clientY - rel[1]], | ||
dec: [-squareBounds.width / 2, -squareBounds.height / 2], | ||
bounds: bounds, | ||
started: true, | ||
newPiece: true | ||
}; | ||
console.log(ctrl.chessground.data.draggable.current); | ||
drag.processDrag(ctrl.chessground.data); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
var game = require('game').game; | ||
|
||
module.exports = { | ||
|
||
drop: function(chessground, possibleDrops, piece, pos) { | ||
|
||
if (piece.color !== chessground.data.movable.color) return false; | ||
|
||
if (piece.role === 'pawn' && (pos[1] === '1' || pos[1] === '8')) return false; | ||
|
||
if (typeof possibleDrops === 'undefined' || possibleDrops === null) return true; | ||
|
||
var drops = possibleDrops.match(/.{2}/g) || []; | ||
|
||
return drops.indexOf(pos) !== -1; | ||
} | ||
}; |
Oops, something went wrong.