Skip to content

Commit

Permalink
Merge pull request #240 from chesslablab/issue/169-Document-the-onlin…
Browse files Browse the repository at this point in the history
…e_games-command

Issue/169 document the online games command
  • Loading branch information
programarivm authored Jan 11, 2024
2 parents dca393d + 9b03798 commit 0a8f6d3
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
55 changes: 55 additions & 0 deletions docs/online-games.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# /online_games

Returns the online games waiting to be accepted.

## Usage

### Example

```js
ws.send('/online_games');
```

```text
{
"/online_games": [
{
"iss": "chesslablab.net",
"iat": 1704983331,
"exp": 1704986931,
"variant": "classical",
"submode": "online",
"color": "b",
"min": 5,
"increment": 1,
"fen": "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq -",
"hash": "84a4e20138e54e1869b9b79e7d3111f1"
},
{
"iss": "chesslablab.net",
"iat": 1704983347,
"exp": 1704986947,
"variant": "960",
"submode": "online",
"color": "w",
"min": 10,
"increment": 5,
"fen": "bqrnnbkr/pppppppp/8/8/8/8/PPPPPPPP/BQRNNBKR w KQkq -",
"startPos": "BQRNNBKR",
"hash": "c6b79ac68055766c2a33364f69c72e4c"
},
{
"iss": "chesslablab.net",
"iat": 1704983367,
"exp": 1704986967,
"variant": "capablanca",
"submode": "online",
"color": "b",
"min": 30,
"increment": 10,
"fen": "rnabqkbcnr/pppppppppp/10/10/10/10/PPPPPPPPPP/RNABQKBCNR w KQkq -",
"hash": "076bafad0559def2db7866609680074c"
}
]
}
```
18 changes: 18 additions & 0 deletions docs/start.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,24 @@ ws.send('/start classical stockfish b');
}
```

### Start a classical game to play online

```js
ws.send('/start classical play {"min":5,"increment":3,"color":"b","submode":"online"}');
```

```text
{
"/start": {
"variant": "classical",
"mode": "play",
"fen": "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq -",
"jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJjaGVzc2xhYmxhYi5uZXQiLCJpYXQiOjE3MDQ5ODM1NzUsImV4cCI6MTcwNDk4NzE3NSwidmFyaWFudCI6ImNsYXNzaWNhbCIsInN1Ym1vZGUiOiJvbmxpbmUiLCJjb2xvciI6ImIiLCJtaW4iOjUsImluY3JlbWVudCI6MywiZmVuIjoicm5icWtibnIvcHBwcHBwcHAvOC84LzgvOC9QUFBQUFBQUC9STkJRS0JOUiB3IEtRa3EgLSJ9.DMIDU7I52Reuz0VNHTXlGn6FLv3dc6KMEZRf9ephh1k",
"hash": "3d5f1b067edae5a59a2a9595e96bde54"
}
}
```

### Create an invite code to play a classical game

| Name | Description | Required |
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ pages:
- /inbox: inbox.md
- /stockfish: stockfish.md
- /stockfish_eval: stockfish-eval.md
- /online_games: online-games.md
theme: readthedocs

0 comments on commit 0a8f6d3

Please sign in to comment.