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

Add matchmaking cancelled timeout reason #35

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
20 changes: 17 additions & 3 deletions docs/schema/matchmaking.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ The matchmaking cycle works as follows:
9. Once the autohost has successfully started the battle, the server should then send [battle/battleStart](#battle/battleStart) requests to the users.

The server may send [matchmaking/cancelled](#cancelled) event at any point after the client sent a [queue](#queue) request with a reason. This means the client has been booted out the matchmaking system. It can happen for example when a party member leaves, or in case of a server error that needs to reset the matchmaking state. This event is also sent after a successful [cancel](#cancel) request.

[matchmaking/cancelled](#cancelled) can have the following reasons:
* `intentional`: the player left matchmaking
* `server_error`: something bad happended and the server couldn't maintain
state so it booted the player out. Retrying may fix the issue.
* `party_user_left`: a member of the player's party left matchmaking, thus
forcing the entire party to withdraw
* `ready_timeout`: The player failed to accept a match within the given
time window and is thus removed from the matchmaking system.

---
- [cancel](#cancel)
Expand Down Expand Up @@ -193,7 +202,12 @@ Server may send this event at any point when the user is queuing to indicate tha
"type": "object",
"properties": {
"reason": {
"enum": ["intentional", "server_error", "party_user_left"]
"enum": [
"intentional",
"server_error",
"party_user_left",
"ready_timeout"
]
}
},
"required": ["reason"]
Expand All @@ -214,7 +228,7 @@ Server may send this event at any point when the user is queuing to indicate tha
"messageId": "voluptate ullamco",
"commandId": "matchmaking/cancelled",
"data": {
"reason": "intentional"
"reason": "server_error"
}
}
```
Expand All @@ -229,7 +243,7 @@ export interface MatchmakingCancelledEvent {
data: MatchmakingCancelledEventData;
}
export interface MatchmakingCancelledEventData {
reason: "intentional" | "server_error" | "party_user_left";
reason: "intentional" | "server_error" | "party_user_left" | "ready_timeout";
}
```
---
Expand Down
3 changes: 2 additions & 1 deletion schema/compiled.json
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,8 @@
"enum": [
"intentional",
"server_error",
"party_user_left"
"party_user_left",
"ready_timeout"
]
}
},
Expand Down
7 changes: 6 additions & 1 deletion schema/matchmaking/cancelled/event.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
"type": "object",
"properties": {
"reason": {
"enum": ["intentional", "server_error", "party_user_left"]
"enum": [
"intentional",
"server_error",
"party_user_left",
"ready_timeout"
]
}
},
"required": ["reason"]
Expand Down
9 changes: 9 additions & 0 deletions src/schema/matchmaking/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,12 @@ The matchmaking cycle works as follows:
9. Once the autohost has successfully started the battle, the server should then send [battle/battleStart](#battle/battleStart) requests to the users.

The server may send [matchmaking/cancelled](#cancelled) event at any point after the client sent a [queue](#queue) request with a reason. This means the client has been booted out the matchmaking system. It can happen for example when a party member leaves, or in case of a server error that needs to reset the matchmaking state. This event is also sent after a successful [cancel](#cancel) request.

[matchmaking/cancelled](#cancelled) can have the following reasons:
* `intentional`: the player left matchmaking
* `server_error`: something bad happended and the server couldn't maintain
state so it booted the player out. Retrying may fix the issue.
* `party_user_left`: a member of the player's party left matchmaking, thus
forcing the entire party to withdraw
* `ready_timeout`: The player failed to accept a match within the given
time window and is thus removed from the matchmaking system.
2 changes: 1 addition & 1 deletion src/schema/matchmaking/cancelled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default defineEndpoint({
"Server may send this event at any point when the user is queuing to indicate that the user has been booted out the matchmaking system.",
event: {
data: Type.Object({
reason: UnionEnum(["intentional", "server_error", "party_user_left"]),
reason: UnionEnum(["intentional", "server_error", "party_user_left", "ready_timeout"]),
}),
},
});