tachyon-protocol 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +97 -0
- package/dist/account/getToken/request.json +73 -0
- package/dist/account/getToken/response.json +91 -0
- package/dist/account/login/request.json +32 -0
- package/dist/account/login/response.json +300 -0
- package/dist/account/recover/request.json +15 -0
- package/dist/account/recover/response.json +58 -0
- package/dist/account/register/request.json +52 -0
- package/dist/account/register/response.json +78 -0
- package/dist/account/rename/request.json +33 -0
- package/dist/account/rename/response.json +66 -0
- package/dist/bot/slave/request.json +29 -0
- package/dist/bot/slave/response.json +58 -0
- package/dist/bot/unslave/request.json +15 -0
- package/dist/bot/unslave/response.json +58 -0
- package/dist/game/launch/response.json +70 -0
- package/dist/index.d.ts +923 -0
- package/dist/lobby/close/request.json +15 -0
- package/dist/lobby/close/response.json +58 -0
- package/dist/lobby/create/request.json +52 -0
- package/dist/lobby/create/response.json +66 -0
- package/dist/lobby/join/request.json +36 -0
- package/dist/lobby/join/response.json +86 -0
- package/dist/lobby/joined/response.json +256 -0
- package/dist/lobby/leave/request.json +15 -0
- package/dist/lobby/leave/response.json +62 -0
- package/dist/lobby/left/response.json +58 -0
- package/dist/lobby/list/request.json +15 -0
- package/dist/lobby/list/response.json +267 -0
- package/dist/lobby/receiveMessage/response.json +80 -0
- package/dist/lobby/sendMessage/request.json +33 -0
- package/dist/lobby/sendMessage/response.json +66 -0
- package/dist/lobby/updated/response.json +212 -0
- package/dist/matchmaking/cancel/request.json +15 -0
- package/dist/matchmaking/cancel/response.json +62 -0
- package/dist/matchmaking/found/response.json +70 -0
- package/dist/matchmaking/list/request.json +15 -0
- package/dist/matchmaking/list/response.json +105 -0
- package/dist/matchmaking/lost/response.json +58 -0
- package/dist/matchmaking/queue/request.json +31 -0
- package/dist/matchmaking/queue/response.json +66 -0
- package/dist/matchmaking/queueUpdate/response.json +70 -0
- package/dist/matchmaking/ready/request.json +15 -0
- package/dist/matchmaking/ready/response.json +62 -0
- package/dist/matchmaking/readyUpdate/response.json +74 -0
- package/dist/system/disconnect/request.json +15 -0
- package/dist/system/disconnected/response.json +58 -0
- package/dist/system/version/response.json +71 -0
- package/license.md +19 -0
- package/package.json +52 -0
package/README.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Tachyon
|
|
2
|
+
|
|
3
|
+
Tachyon is the name of the protocol designed to replace the old [Spring Lobby Protocol](https://springrts.com/dl/LobbyProtocol/ProtocolDescription.html), primarily for use in Beyond All Reason. It describes the message schema that clients should use to communicate with the master server and vice-versa. The exchange format is essentially JSON sent over a WebSocket connection. [JSONSchema](https://json-schema.org/) is used to define the structure of messages, which can be found in the [dist](dist) directory. Server and client implementations of this protocol are encouraged to use a [JSONSchema validator](https://json-schema.org/implementations.html#validators) to validate and sanitize message requests and responses.
|
|
4
|
+
|
|
5
|
+
[Schema Reference](docs/README.md)
|
|
6
|
+
|
|
7
|
+
## Connecting
|
|
8
|
+
|
|
9
|
+
When connecting to the WebSocket server, the server should send a [`system/version/response`](docs/system.md/#version) command containing the version of the Tachyon protocol that is being served. Clients should ensure their implementation is using the same version of the protocol, which can be found in this repo's [`package.json`](package.json). Once connected, follow the instructions in the [account](docs/account.md) service to register and login in order to gain authorization to the rest of the protocol.
|
|
10
|
+
|
|
11
|
+
## Terminology
|
|
12
|
+
|
|
13
|
+
| Term | Meaning |
|
|
14
|
+
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
15
|
+
| Client | A WebSocket client |
|
|
16
|
+
| Client Application | E.g. SpringLobby, Chobby, BAR Lobby |
|
|
17
|
+
| Server | The provider of the protocol and what clients connect to. i.e. the master or middleware server |
|
|
18
|
+
| Command | A JSON message relating to a specific endpoint |
|
|
19
|
+
| Command ID | The unique string which represents the message type. E.g. `user/login/request` or `lobby/join/response` |
|
|
20
|
+
| Endpoint | E.g. `register`, `login` or `join` |
|
|
21
|
+
| Service | A collection of endpoints that are categorically related, E.g. `user` or `lobby` |
|
|
22
|
+
| UserClient | Specifically a registered user who is online |
|
|
23
|
+
| Bot | An automated UserClient, marked as a bot |
|
|
24
|
+
| Autohost | A bot which is specifically intended to host battles |
|
|
25
|
+
| Lobby | A room or waiting area from which a Battle can be launched, one Lobby can have multiple Battles over the course of its lifetime |
|
|
26
|
+
| Battle | Either custom or matchmaking. Ingame status is irrelevant from a protocol perspective |
|
|
27
|
+
| Founder | The user hosting a battle. Typically these users are bots |
|
|
28
|
+
| Game | A version of the core game files, e.g. `Beyond All Reason test-22425-e6c0e37` |
|
|
29
|
+
| Engine | A version of the engine (Recoil), e.g. `105.1.1-1544-g058c8ea BAR105` |
|
|
30
|
+
| AI | User-owned game AI instances, e.g. ChickensAI. Can only exist within battles |
|
|
31
|
+
|
|
32
|
+
## Contributing
|
|
33
|
+
|
|
34
|
+
The [dist](dist) and [docs](docs) directories are automatically generated based on the files in [src](src). The source files are written in (TypeScript)[https://www.typescriptlang.org/] for [Node.js](https://nodejs.org/en), using the [TypeBox](https://github.com/sinclairzx81/typebox) library for JSONSchema generation.
|
|
35
|
+
|
|
36
|
+
A schema file looks like this:
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import { Type } from "@sinclair/typebox";
|
|
40
|
+
import { defineEndpoint } from "@/helpers";
|
|
41
|
+
|
|
42
|
+
export default defineEndpoint({
|
|
43
|
+
description: "Registers a new account.",
|
|
44
|
+
requiresLogin: false, // if omitted, defaults to true
|
|
45
|
+
request: {
|
|
46
|
+
// data property is optional
|
|
47
|
+
data: Type.Object(
|
|
48
|
+
{
|
|
49
|
+
email: Type.String({ format: "email" }), // JSONSchema supports a number of options for each data type
|
|
50
|
+
username: Type.String(),
|
|
51
|
+
hashedPassword: Type.String(),
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
// examples will be shown in the generated documentation
|
|
55
|
+
examples: [
|
|
56
|
+
{
|
|
57
|
+
email: "bob@test.com",
|
|
58
|
+
username: "bob",
|
|
59
|
+
hashedPassword: "1b311ff1a6af12fba8720bd2ce02c960",
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
},
|
|
65
|
+
response: [
|
|
66
|
+
{ status: "success" }, // can also add data here
|
|
67
|
+
{ status: "failed", reason: "email_taken" },
|
|
68
|
+
{ status: "failed", reason: "username_taken" },
|
|
69
|
+
{ status: "failed", reason: "invalid_username" },
|
|
70
|
+
],
|
|
71
|
+
});
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Endpoint Options
|
|
75
|
+
|
|
76
|
+
| Option | Type | Description |
|
|
77
|
+
| ------------- | ------- | ------------------------------------------------------------ |
|
|
78
|
+
| request | object | The request schema for this endpoint |
|
|
79
|
+
| response | object | The response schema for this endpoint |
|
|
80
|
+
| description | string | A description of what this endpoint is for |
|
|
81
|
+
| requiresLogin | boolean | Does the endpoint require the client to be logged in |
|
|
82
|
+
| requiresRole | string | If specified, only users with this role can use the endpoint |
|
|
83
|
+
| order | number | Determines the order endpoint appears in the docs |
|
|
84
|
+
|
|
85
|
+
If `request` is omitted, then this describes an endpoint of which the server can send a `response` for at any time, and the client should be ready to handle it. Similarly, if `response` is omitted, this describes an endpoint of which the client should not expect a response, however, the server may still send one, typically for failed responses.
|
|
86
|
+
|
|
87
|
+
### Responses
|
|
88
|
+
|
|
89
|
+
A response command has a `status` property which can either be `success` or `failed`. `success` responses have an optional `data` property, and `failed` responses have a `reason` string, which should be a non-whitespace code representing the reason the command failed. This allows clients to provide their own i18n text.
|
|
90
|
+
|
|
91
|
+
All `failed` responses can return one of the following `reason`, even though not explicitly defined in each command definition:
|
|
92
|
+
|
|
93
|
+
| Reason | Description |
|
|
94
|
+
| --------------- | ------------------------------------------------------------------------------------------ |
|
|
95
|
+
| unauthorized | When a client sends a request command of which they do not have the `role` required to use |
|
|
96
|
+
| internal_error | When the server fails to handle the request in some way, typically sent in a `catch` block |
|
|
97
|
+
| invalid_command | When the request command doesn't match the schema |
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "account/getToken/request",
|
|
3
|
+
"requiresLogin": false,
|
|
4
|
+
"requiresRole": false,
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"command": {
|
|
8
|
+
"const": "account/getToken/request",
|
|
9
|
+
"type": "string"
|
|
10
|
+
},
|
|
11
|
+
"data": {
|
|
12
|
+
"examples": [
|
|
13
|
+
{
|
|
14
|
+
"email": "bob@test.com",
|
|
15
|
+
"hashedPassword": "1b311ff1a6af12fba8720bd2ce02c960"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"allOf": [
|
|
19
|
+
{
|
|
20
|
+
"anyOf": [
|
|
21
|
+
{
|
|
22
|
+
"type": "object",
|
|
23
|
+
"properties": {
|
|
24
|
+
"email": {
|
|
25
|
+
"format": "email",
|
|
26
|
+
"examples": [
|
|
27
|
+
"bob@test.com"
|
|
28
|
+
],
|
|
29
|
+
"type": "string"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"required": [
|
|
33
|
+
"email"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"type": "object",
|
|
38
|
+
"properties": {
|
|
39
|
+
"username": {
|
|
40
|
+
"minLength": 3,
|
|
41
|
+
"maxLength": 20,
|
|
42
|
+
"pattern": "^[A-Za-z0-9_-]+$",
|
|
43
|
+
"examples": [
|
|
44
|
+
"Bob"
|
|
45
|
+
],
|
|
46
|
+
"type": "string"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"required": [
|
|
50
|
+
"username"
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"type": "object",
|
|
57
|
+
"properties": {
|
|
58
|
+
"hashedPassword": {
|
|
59
|
+
"type": "string"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"required": [
|
|
63
|
+
"hashedPassword"
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"required": [
|
|
70
|
+
"command",
|
|
71
|
+
"data"
|
|
72
|
+
]
|
|
73
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "account/getToken/response",
|
|
3
|
+
"requiresLogin": false,
|
|
4
|
+
"requiresRole": false,
|
|
5
|
+
"anyOf": [
|
|
6
|
+
{
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"command": {
|
|
10
|
+
"const": "account/getToken/response",
|
|
11
|
+
"type": "string"
|
|
12
|
+
},
|
|
13
|
+
"status": {
|
|
14
|
+
"const": "success",
|
|
15
|
+
"type": "string"
|
|
16
|
+
},
|
|
17
|
+
"data": {
|
|
18
|
+
"examples": [
|
|
19
|
+
{
|
|
20
|
+
"token": "d2d5135930dacad758584b2586d03426"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"type": "object",
|
|
24
|
+
"properties": {
|
|
25
|
+
"token": {
|
|
26
|
+
"type": "string"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"required": [
|
|
30
|
+
"token"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"required": [
|
|
35
|
+
"command",
|
|
36
|
+
"status",
|
|
37
|
+
"data"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"type": "object",
|
|
42
|
+
"properties": {
|
|
43
|
+
"command": {
|
|
44
|
+
"const": "account/getToken/response",
|
|
45
|
+
"type": "string"
|
|
46
|
+
},
|
|
47
|
+
"status": {
|
|
48
|
+
"const": "failed",
|
|
49
|
+
"type": "string"
|
|
50
|
+
},
|
|
51
|
+
"reason": {
|
|
52
|
+
"anyOf": [
|
|
53
|
+
{
|
|
54
|
+
"const": "no_user_found",
|
|
55
|
+
"type": "string"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"const": "unverified",
|
|
59
|
+
"type": "string"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"const": "invalid_password",
|
|
63
|
+
"type": "string"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"const": "max_attempts",
|
|
67
|
+
"type": "string"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"const": "internal_error",
|
|
71
|
+
"type": "string"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"const": "unauthorized",
|
|
75
|
+
"type": "string"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"const": "invalid_command",
|
|
79
|
+
"type": "string"
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"required": [
|
|
85
|
+
"command",
|
|
86
|
+
"status",
|
|
87
|
+
"reason"
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "account/login/request",
|
|
3
|
+
"requiresLogin": false,
|
|
4
|
+
"requiresRole": false,
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"command": {
|
|
8
|
+
"const": "account/login/request",
|
|
9
|
+
"type": "string"
|
|
10
|
+
},
|
|
11
|
+
"data": {
|
|
12
|
+
"examples": [
|
|
13
|
+
{
|
|
14
|
+
"token": "d2d5135930dacad758584b2586d03426"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"type": "object",
|
|
18
|
+
"properties": {
|
|
19
|
+
"token": {
|
|
20
|
+
"type": "string"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"required": [
|
|
24
|
+
"token"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"required": [
|
|
29
|
+
"command",
|
|
30
|
+
"data"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "account/login/response",
|
|
3
|
+
"requiresLogin": false,
|
|
4
|
+
"requiresRole": false,
|
|
5
|
+
"anyOf": [
|
|
6
|
+
{
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"command": {
|
|
10
|
+
"const": "account/login/response",
|
|
11
|
+
"type": "string"
|
|
12
|
+
},
|
|
13
|
+
"status": {
|
|
14
|
+
"const": "success",
|
|
15
|
+
"type": "string"
|
|
16
|
+
},
|
|
17
|
+
"data": {
|
|
18
|
+
"examples": [
|
|
19
|
+
{
|
|
20
|
+
"user": {
|
|
21
|
+
"battleStatus": null,
|
|
22
|
+
"userId": 123,
|
|
23
|
+
"email": "bob@test.com",
|
|
24
|
+
"username": "bob",
|
|
25
|
+
"clanId": null,
|
|
26
|
+
"friends": [
|
|
27
|
+
12,
|
|
28
|
+
34
|
|
29
|
+
],
|
|
30
|
+
"friendRequests": [
|
|
31
|
+
477
|
|
32
|
+
],
|
|
33
|
+
"icons": {
|
|
34
|
+
"rank": "silver-5"
|
|
35
|
+
},
|
|
36
|
+
"ignores": [],
|
|
37
|
+
"roles": [
|
|
38
|
+
"mentor"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"type": "object",
|
|
44
|
+
"properties": {
|
|
45
|
+
"user": {
|
|
46
|
+
"type": "object",
|
|
47
|
+
"properties": {
|
|
48
|
+
"userId": {
|
|
49
|
+
"type": "integer"
|
|
50
|
+
},
|
|
51
|
+
"username": {
|
|
52
|
+
"type": "string"
|
|
53
|
+
},
|
|
54
|
+
"clanId": {
|
|
55
|
+
"anyOf": [
|
|
56
|
+
{
|
|
57
|
+
"type": "integer"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"type": "null"
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
"icons": {
|
|
65
|
+
"type": "object",
|
|
66
|
+
"patternProperties": {
|
|
67
|
+
"^(.*)$": {
|
|
68
|
+
"type": "string"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"roles": {
|
|
73
|
+
"type": "array",
|
|
74
|
+
"items": {
|
|
75
|
+
"anyOf": [
|
|
76
|
+
{
|
|
77
|
+
"const": "admin",
|
|
78
|
+
"type": "string"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"const": "moderator",
|
|
82
|
+
"type": "string"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"const": "autohost",
|
|
86
|
+
"type": "string"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"const": "mentor",
|
|
90
|
+
"type": "string"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"const": "caster",
|
|
94
|
+
"type": "string"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"const": "tourney",
|
|
98
|
+
"type": "string"
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"battleStatus": {
|
|
104
|
+
"anyOf": [
|
|
105
|
+
{
|
|
106
|
+
"type": "object",
|
|
107
|
+
"properties": {
|
|
108
|
+
"lobbyId": {
|
|
109
|
+
"anyOf": [
|
|
110
|
+
{
|
|
111
|
+
"type": "integer"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"type": "null"
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
},
|
|
118
|
+
"inGame": {
|
|
119
|
+
"type": "boolean"
|
|
120
|
+
},
|
|
121
|
+
"away": {
|
|
122
|
+
"type": "boolean"
|
|
123
|
+
},
|
|
124
|
+
"ready": {
|
|
125
|
+
"type": "boolean"
|
|
126
|
+
},
|
|
127
|
+
"playerNumber": {
|
|
128
|
+
"anyOf": [
|
|
129
|
+
{
|
|
130
|
+
"type": "integer"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"type": "null"
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
},
|
|
137
|
+
"teamColour": {
|
|
138
|
+
"anyOf": [
|
|
139
|
+
{
|
|
140
|
+
"type": "string"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"type": "null"
|
|
144
|
+
}
|
|
145
|
+
]
|
|
146
|
+
},
|
|
147
|
+
"isPlayer": {
|
|
148
|
+
"type": "boolean"
|
|
149
|
+
},
|
|
150
|
+
"bonus": {
|
|
151
|
+
"type": "number"
|
|
152
|
+
},
|
|
153
|
+
"sync": {
|
|
154
|
+
"type": "object",
|
|
155
|
+
"properties": {
|
|
156
|
+
"engine": {
|
|
157
|
+
"type": "number"
|
|
158
|
+
},
|
|
159
|
+
"game": {
|
|
160
|
+
"type": "number"
|
|
161
|
+
},
|
|
162
|
+
"map": {
|
|
163
|
+
"type": "number"
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
"required": [
|
|
167
|
+
"engine",
|
|
168
|
+
"game",
|
|
169
|
+
"map"
|
|
170
|
+
]
|
|
171
|
+
},
|
|
172
|
+
"partyId": {
|
|
173
|
+
"anyOf": [
|
|
174
|
+
{
|
|
175
|
+
"type": "integer"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"type": "null"
|
|
179
|
+
}
|
|
180
|
+
]
|
|
181
|
+
},
|
|
182
|
+
"muted": {
|
|
183
|
+
"type": "boolean"
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
"required": [
|
|
187
|
+
"lobbyId",
|
|
188
|
+
"inGame",
|
|
189
|
+
"away",
|
|
190
|
+
"ready",
|
|
191
|
+
"playerNumber",
|
|
192
|
+
"teamColour",
|
|
193
|
+
"isPlayer",
|
|
194
|
+
"bonus",
|
|
195
|
+
"sync",
|
|
196
|
+
"partyId",
|
|
197
|
+
"muted"
|
|
198
|
+
]
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"type": "null"
|
|
202
|
+
}
|
|
203
|
+
]
|
|
204
|
+
},
|
|
205
|
+
"email": {
|
|
206
|
+
"format": "email",
|
|
207
|
+
"type": "string"
|
|
208
|
+
},
|
|
209
|
+
"friends": {
|
|
210
|
+
"type": "array",
|
|
211
|
+
"items": {
|
|
212
|
+
"type": "integer"
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
"friendRequests": {
|
|
216
|
+
"type": "array",
|
|
217
|
+
"items": {
|
|
218
|
+
"type": "integer"
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
"ignores": {
|
|
222
|
+
"type": "array",
|
|
223
|
+
"items": {
|
|
224
|
+
"type": "integer"
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
"required": [
|
|
229
|
+
"userId",
|
|
230
|
+
"username",
|
|
231
|
+
"clanId",
|
|
232
|
+
"icons",
|
|
233
|
+
"roles",
|
|
234
|
+
"battleStatus",
|
|
235
|
+
"email",
|
|
236
|
+
"friends",
|
|
237
|
+
"friendRequests",
|
|
238
|
+
"ignores"
|
|
239
|
+
]
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
"required": [
|
|
243
|
+
"user"
|
|
244
|
+
]
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
"required": [
|
|
248
|
+
"command",
|
|
249
|
+
"status",
|
|
250
|
+
"data"
|
|
251
|
+
]
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"type": "object",
|
|
255
|
+
"properties": {
|
|
256
|
+
"command": {
|
|
257
|
+
"const": "account/login/response",
|
|
258
|
+
"type": "string"
|
|
259
|
+
},
|
|
260
|
+
"status": {
|
|
261
|
+
"const": "failed",
|
|
262
|
+
"type": "string"
|
|
263
|
+
},
|
|
264
|
+
"reason": {
|
|
265
|
+
"anyOf": [
|
|
266
|
+
{
|
|
267
|
+
"const": "invalid_token",
|
|
268
|
+
"type": "string"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"const": "expired_token",
|
|
272
|
+
"type": "string"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"const": "banned",
|
|
276
|
+
"type": "string"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"const": "internal_error",
|
|
280
|
+
"type": "string"
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
"const": "unauthorized",
|
|
284
|
+
"type": "string"
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"const": "invalid_command",
|
|
288
|
+
"type": "string"
|
|
289
|
+
}
|
|
290
|
+
]
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
"required": [
|
|
294
|
+
"command",
|
|
295
|
+
"status",
|
|
296
|
+
"reason"
|
|
297
|
+
]
|
|
298
|
+
}
|
|
299
|
+
]
|
|
300
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "account/recover/response",
|
|
3
|
+
"requiresLogin": false,
|
|
4
|
+
"requiresRole": false,
|
|
5
|
+
"anyOf": [
|
|
6
|
+
{
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"command": {
|
|
10
|
+
"const": "account/recover/response",
|
|
11
|
+
"type": "string"
|
|
12
|
+
},
|
|
13
|
+
"status": {
|
|
14
|
+
"const": "success",
|
|
15
|
+
"type": "string"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"required": [
|
|
19
|
+
"command",
|
|
20
|
+
"status"
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"type": "object",
|
|
25
|
+
"properties": {
|
|
26
|
+
"command": {
|
|
27
|
+
"const": "account/recover/response",
|
|
28
|
+
"type": "string"
|
|
29
|
+
},
|
|
30
|
+
"status": {
|
|
31
|
+
"const": "failed",
|
|
32
|
+
"type": "string"
|
|
33
|
+
},
|
|
34
|
+
"reason": {
|
|
35
|
+
"anyOf": [
|
|
36
|
+
{
|
|
37
|
+
"const": "internal_error",
|
|
38
|
+
"type": "string"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"const": "unauthorized",
|
|
42
|
+
"type": "string"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"const": "invalid_command",
|
|
46
|
+
"type": "string"
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"required": [
|
|
52
|
+
"command",
|
|
53
|
+
"status",
|
|
54
|
+
"reason"
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|