Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue/169 document the online games command #240

Merged
merged 2 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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