Skip to content

Commit

Permalink
Remove matchmaking/readyUpdate event (#36)
Browse files Browse the repository at this point in the history
It is redundant with foundUpdate, and the client should already have the
expected number of player for each queues.
  • Loading branch information
geekingfrog authored Sep 23, 2024
1 parent 4af2fcf commit e475c36
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 176 deletions.
77 changes: 1 addition & 76 deletions docs/schema/matchmaking.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The matchmaking cycle works as follows:
2. Clients should then queue for one or more of these queues by sending an array of the queue ids in a [queue](#queue) request.
3. The server can send periodic updates about the status of the search as a [queueUpdate](#queueupdate) event.
4. When a match is found, the server should send a [found](#found) event along with the id of the queue of the found match.
5. Clients can then ready up by sending a [ready](#ready) request. The number of readied players should be sent to clients via the [readyUpdate](#readyupdate) event.
5. Clients can then ready up by sending a [ready](#ready) request. The number of readied players should be sent to clients via the [foundUpdate](#foundupdate) event.
6. To cancel queueing, or to decline a found match, clients should send a [cancel](#cancel) request. After a successful `cancel` response, the server will also send a [cancelled](#cancelled) event.
7. If a client fails to ready up for a found match, the server should send a [lost](#lost) event, and the queueing phase should resume.
8. Once all players are ready, the server should send a [autohost/battleStart](#autohost/battleStart) request to a suitable autohost client. If the autohost doesn't respond quickly, or if it sends a failed response, the server should repeat this step.
Expand All @@ -35,7 +35,6 @@ The server may send [matchmaking/cancelled](#cancelled) event at any point after
- [queue](#queue)
- [queueUpdate](#queueupdate)
- [ready](#ready)
- [readyUpdate](#readyupdate)
---

## Cancel
Expand Down Expand Up @@ -1008,77 +1007,3 @@ export interface MatchmakingReadyOkResponse {
```
Possible Failed Reasons: `no_match`, `internal_error`, `unauthorized`, `invalid_request`, `command_unimplemented`

---

## ReadyUpdate

Sent when a client in a found match readies up.

- Endpoint Type: **Event**
- Source: **Server**
- Target: **User**
- Required Scopes: `tachyon.lobby`

### Event

<details>
<summary>JSONSchema</summary>

```json
{
"title": "MatchmakingReadyUpdateEvent",
"tachyon": {
"source": "server",
"target": "user",
"scopes": ["tachyon.lobby"]
},
"type": "object",
"properties": {
"type": { "const": "event" },
"messageId": { "type": "string" },
"commandId": { "const": "matchmaking/readyUpdate" },
"data": {
"title": "MatchmakingReadyUpdateEventData",
"type": "object",
"properties": {
"readyMax": { "type": "integer" },
"readyCurrent": { "type": "integer" }
},
"required": ["readyMax", "readyCurrent"]
}
},
"required": ["type", "messageId", "commandId", "data"]
}

```
</details>

<details>
<summary>Example</summary>

```json
{
"type": "event",
"messageId": "Duis Lorem",
"commandId": "matchmaking/readyUpdate",
"data": {
"readyMax": -28000000,
"readyCurrent": -28000000
}
}
```
</details>

#### TypeScript Definition
```ts
export interface MatchmakingReadyUpdateEvent {
type: "event";
messageId: string;
commandId: "matchmaking/readyUpdate";
data: MatchmakingReadyUpdateEventData;
}
export interface MatchmakingReadyUpdateEventData {
readyMax: number;
readyCurrent: number;
}
```
12 changes: 6 additions & 6 deletions docs/schema/system.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ Ask the server to terminate the connection.
```json
{
"type": "request",
"messageId": "consequat Lorem",
"messageId": "Duis Lorem",
"commandId": "system/disconnect",
"data": {
"reason": "consequat Lorem"
"reason": "Duis Lorem"
}
}
```
Expand Down Expand Up @@ -130,7 +130,7 @@ export interface SystemDisconnectRequestData {
```json
{
"type": "response",
"messageId": "commodo Lorem",
"messageId": "consequat Lorem",
"commandId": "system/disconnect",
"status": "success"
}
Expand Down Expand Up @@ -190,7 +190,7 @@ Get server stats such as user count.
```json
{
"type": "request",
"messageId": "ut Lorem",
"messageId": "commodo Lorem",
"commandId": "system/serverStats"
}
```
Expand Down Expand Up @@ -267,11 +267,11 @@ export interface SystemServerStatsRequest {
```json
{
"type": "response",
"messageId": "occaecat Lorem in",
"messageId": "ut Lorem",
"commandId": "system/serverStats",
"status": "success",
"data": {
"userCount": -20000000
"userCount": -22000000
}
}
```
Expand Down
56 changes: 28 additions & 28 deletions docs/schema/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,59 +120,59 @@ Sent by the server to inform the client when subscribed users get updated in som
```json
{
"type": "event",
"messageId": "pariatur Lorem reprehenderit",
"messageId": "occaecat Lorem in",
"commandId": "user/updated",
"data": {
"users": [
{
"pariaturff": -17999999.999999955,
"occaecatff": -19999999.999999955,
"userId": "f47a7e1e-4b2f-4d3d-3f3c-1f0f0e4b7e1e",
"username": "pariatur Lorem reprehenderit",
"username": "occaecat Lorem in",
"scopes": [
"pariatur Lorem reprehenderit",
"pariatur Lorem reprehenderit",
"pariatur Lorem reprehenderit"
"occaecat Lorem in",
"occaecat Lorem in",
"occaecat Lorem in"
],
"countryCode": "pariatur Lorem reprehenderit",
"countryCode": "occaecat Lorem in",
"status": "menu",
"outgoingFriendRequestIds": [
"pariatur Lorem reprehenderit",
"pariatur Lorem reprehenderit",
"pariatur Lorem reprehenderit"
"occaecat Lorem in",
"occaecat Lorem in",
"occaecat Lorem in"
]
},
{
"pariaturff": -17999999.999999955,
"occaecatff": -19999999.999999955,
"userId": "f47a7e1e-4b2f-4d3d-3f3c-1f0f0e4b7e1e",
"username": "pariatur Lorem reprehenderit",
"username": "occaecat Lorem in",
"scopes": [
"pariatur Lorem reprehenderit",
"pariatur Lorem reprehenderit",
"pariatur Lorem reprehenderit"
"occaecat Lorem in",
"occaecat Lorem in",
"occaecat Lorem in"
],
"countryCode": "pariatur Lorem reprehenderit",
"countryCode": "occaecat Lorem in",
"status": "menu",
"outgoingFriendRequestIds": [
"pariatur Lorem reprehenderit",
"pariatur Lorem reprehenderit",
"pariatur Lorem reprehenderit"
"occaecat Lorem in",
"occaecat Lorem in",
"occaecat Lorem in"
]
},
{
"pariaturff": -17999999.999999955,
"occaecatff": -19999999.999999955,
"userId": "f47a7e1e-4b2f-4d3d-3f3c-1f0f0e4b7e1e",
"username": "pariatur Lorem reprehenderit",
"username": "occaecat Lorem in",
"scopes": [
"pariatur Lorem reprehenderit",
"pariatur Lorem reprehenderit",
"pariatur Lorem reprehenderit"
"occaecat Lorem in",
"occaecat Lorem in",
"occaecat Lorem in"
],
"countryCode": "pariatur Lorem reprehenderit",
"countryCode": "occaecat Lorem in",
"status": "menu",
"outgoingFriendRequestIds": [
"pariatur Lorem reprehenderit",
"pariatur Lorem reprehenderit",
"pariatur Lorem reprehenderit"
"occaecat Lorem in",
"occaecat Lorem in",
"occaecat Lorem in"
]
}
]
Expand Down
24 changes: 0 additions & 24 deletions schema/compiled.json
Original file line number Diff line number Diff line change
Expand Up @@ -1690,30 +1690,6 @@
}
]
},
{
"title": "MatchmakingReadyUpdateEvent",
"tachyon": {
"source": "server",
"target": "user",
"scopes": ["tachyon.lobby"]
},
"type": "object",
"properties": {
"type": { "const": "event" },
"messageId": { "type": "string" },
"commandId": { "const": "matchmaking/readyUpdate" },
"data": {
"title": "MatchmakingReadyUpdateEventData",
"type": "object",
"properties": {
"readyMax": { "type": "integer" },
"readyCurrent": { "type": "integer" }
},
"required": ["readyMax", "readyCurrent"]
}
},
"required": ["type", "messageId", "commandId", "data"]
},
{
"title": "SystemDisconnectRequest",
"tachyon": {
Expand Down
26 changes: 0 additions & 26 deletions schema/matchmaking/readyUpdate/event.json

This file was deleted.

2 changes: 1 addition & 1 deletion src/schema/matchmaking/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The matchmaking cycle works as follows:
2. Clients should then queue for one or more of these queues by sending an array of the queue ids in a [queue](#queue) request.
3. The server can send periodic updates about the status of the search as a [queueUpdate](#queueupdate) event.
4. When a match is found, the server should send a [found](#found) event along with the id of the queue of the found match.
5. Clients can then ready up by sending a [ready](#ready) request. The number of readied players should be sent to clients via the [readyUpdate](#readyupdate) event.
5. Clients can then ready up by sending a [ready](#ready) request. The number of readied players should be sent to clients via the [foundUpdate](#foundupdate) event.
6. To cancel queueing, or to decline a found match, clients should send a [cancel](#cancel) request. After a successful `cancel` response, the server will also send a [cancelled](#cancelled) event.
7. If a client fails to ready up for a found match, the server should send a [lost](#lost) event, and the queueing phase should resume.
8. Once all players are ready, the server should send a [autohost/battleStart](#autohost/battleStart) request to a suitable autohost client. If the autohost doesn't respond quickly, or if it sends a failed response, the server should repeat this step.
Expand Down
15 changes: 0 additions & 15 deletions src/schema/matchmaking/readyUpdate.ts

This file was deleted.

0 comments on commit e475c36

Please sign in to comment.