diff --git a/docs/accept.md b/docs/accept.md new file mode 100644 index 00000000..40cb8837 --- /dev/null +++ b/docs/accept.md @@ -0,0 +1,33 @@ +# /accept + +## Description + +Accepts an invitation code to play chess online with an opponent. + +## Parameters + +| Name | Description | Required | +| ---- | ----------- | -------- | +| hash | The unique hash of the game. | Yes | + +## Usage + +### Example + +```js +ws.send('/accept 15f78c0035a719491b89522b4905a490'); +``` + +```text +{ + "/accept": { + "jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJwY2hlc3MubmV0IiwiaWF0IjoxNjk0NDQxOTcxLCJleHAiOjE2OTQ0NDU1NzEsInZhcmlhbnQiOiJjbGFzc2ljYWwiLCJzdWJtb2RlIjoiZnJpZW5kIiwiY29sb3IiOiJ3IiwibWluIjo1LCJpbmNyZW1lbnQiOjMsImZlbiI6InJuYnFrYm5yL3BwcHBwcHBwLzgvOC84LzgvUFBQUFBQUFAvUk5CUUtCTlIgdyBLUWtxIC0ifQ.POuK_cR3U_bblLa8LFyGg1AJEE5_iW_AquuNn7K4qHI", + "hash": "15f78c0035a719491b89522b4905a490", + "timer": { + "w": 300, + "b": 300 + }, + "startedAt": 1694441992 + } +} +``` diff --git a/docs/restart.md b/docs/restart.md index 04e1983d..a48b8e42 100644 --- a/docs/restart.md +++ b/docs/restart.md @@ -12,7 +12,7 @@ Allows to restart an existing game. ## Usage -### Restart a game +### Example ```js ws.send('/restart ffc536a8f44fc21b4d254e4fb85d7e33'); diff --git a/mkdocs.yml b/mkdocs.yml index d13afc73..a617ddb7 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -6,5 +6,6 @@ pages: - /play_lan: play-lan.md - /heuristics: heuristics.md - /undo: undo.md + - /accept: accept.md - /restart: restart.md theme: readthedocs