Skip to content

Commit

Permalink
Fix 'Event Type' documentation generator
Browse files Browse the repository at this point in the history
  • Loading branch information
p2004a committed Sep 23, 2024
1 parent d74e7fe commit 6fa1078
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
18 changes: 9 additions & 9 deletions docs/schema/autohost.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Autohosts used for custom games should use the dedicated mode as lots of pregame

Request to add a new player to the battle.

- Endpoint Type: **Event**
- Endpoint Type: **Request** -> **Response**
- Source: **Server**
- Target: **Autohost**
- Required Scopes: `tachyon.lobby`
Expand Down Expand Up @@ -220,7 +220,7 @@ Possible Failed Reasons: `internal_error`, `unauthorized`, `invalid_request`, `c

Kick a player from a battle.

- Endpoint Type: **Event**
- Endpoint Type: **Request** -> **Response**
- Source: **Server**
- Target: **Autohost**
- Required Scopes: `tachyon.lobby`
Expand Down Expand Up @@ -371,7 +371,7 @@ Possible Failed Reasons: `internal_error`, `unauthorized`, `invalid_request`, `c

Request to kill a battle.

- Endpoint Type: **Event**
- Endpoint Type: **Request** -> **Response**
- Source: **Server**
- Target: **Autohost**
- Required Scopes: `tachyon.lobby`
Expand Down Expand Up @@ -517,7 +517,7 @@ Possible Failed Reasons: `internal_error`, `unauthorized`, `invalid_request`, `c

Mute a player in a battle.

- Endpoint Type: **Event**
- Endpoint Type: **Request** -> **Response**
- Source: **Server**
- Target: **Autohost**
- Required Scopes: `tachyon.lobby`
Expand Down Expand Up @@ -674,7 +674,7 @@ Possible Failed Reasons: `internal_error`, `unauthorized`, `invalid_request`, `c

Send a custom command for the autohost to execute.

- Endpoint Type: **Event**
- Endpoint Type: **Request** -> **Response**
- Source: **Server**
- Target: **Autohost**
- Required Scopes: `tachyon.lobby`
Expand Down Expand Up @@ -825,7 +825,7 @@ Possible Failed Reasons: `internal_error`, `unauthorized`, `invalid_request`, `c

Send a message for the autohost to display to players.

- Endpoint Type: **Event**
- Endpoint Type: **Request** -> **Response**
- Source: **Server**
- Target: **Autohost**
- Required Scopes: `tachyon.lobby`
Expand Down Expand Up @@ -974,7 +974,7 @@ Possible Failed Reasons: `internal_error`, `unauthorized`, `invalid_request`, `c

Force players to become spectators in a battle.

- Endpoint Type: **Event**
- Endpoint Type: **Request** -> **Response**
- Source: **Server**
- Target: **Autohost**
- Required Scopes: `tachyon.lobby`
Expand Down Expand Up @@ -1130,7 +1130,7 @@ Possible Failed Reasons: `internal_error`, `unauthorized`, `invalid_request`, `c

Tell the autohost client to launch the game server (spring-dedicated.exe or spring-headless.exe) with the given script data.

- Endpoint Type: **Event**
- Endpoint Type: **Request** -> **Response**
- Source: **Server**
- Target: **Autohost**
- Required Scopes: `tachyon.lobby`
Expand Down Expand Up @@ -1531,7 +1531,7 @@ export interface AutohostStatusEventData {

Ask the autohost to send us updates about its battles.

- Endpoint Type: **Event**
- Endpoint Type: **Request** -> **Response**
- Source: **Server**
- Target: **Autohost**
- Required Scopes: `tachyon.lobby`
Expand Down
2 changes: 1 addition & 1 deletion docs/schema/battle.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

When a user client receives this response it should launch the game (spring.exe) with the start script.

- Endpoint Type: **Event**
- Endpoint Type: **Request** -> **Response**
- Source: **Server**
- Target: **User**
- Required Scopes: `tachyon.lobby`
Expand Down
8 changes: 4 additions & 4 deletions docs/schema/matchmaking.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The server may send [matchmaking/cancelled](#cancelled) event at any point after

Cancel queueing for matchmaking.

- Endpoint Type: **Event**
- Endpoint Type: **Request** -> **Response**
- Source: **User**
- Target: **Server**
- Required Scopes: `tachyon.lobby`
Expand Down Expand Up @@ -394,7 +394,7 @@ export interface MatchmakingFoundUpdateEventData {

Returns all available matchmaking playlists.

- Endpoint Type: **Event**
- Endpoint Type: **Request** -> **Response**
- Source: **User**
- Target: **Server**
- Required Scopes: `tachyon.lobby`
Expand Down Expand Up @@ -656,7 +656,7 @@ export interface MatchmakingLostEvent {

Queue up for matchmaking. Should cancel the previous queue if already in one.

- Endpoint Type: **Event**
- Endpoint Type: **Request** -> **Response**
- Source: **User**
- Target: **Server**
- Required Scopes: `tachyon.lobby`
Expand Down Expand Up @@ -881,7 +881,7 @@ export interface MatchmakingQueueUpdateEventData {

Clients should send this when they are ready to proceed with the found match. If not sent within 10s of the [found](#found) response then queue should be cancelled.

- Endpoint Type: **Event**
- Endpoint Type: **Request** -> **Response**
- Source: **User**
- Target: **Server**
- Required Scopes: `tachyon.lobby`
Expand Down
4 changes: 2 additions & 2 deletions docs/schema/system.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

Ask the server to terminate the connection.

- Endpoint Type: **Event**
- Endpoint Type: **Request** -> **Response**
- Source: **User**
- Target: **Server**
- Required Scopes: `tachyon.lobby`
Expand Down Expand Up @@ -154,7 +154,7 @@ Possible Failed Reasons: `internal_error`, `unauthorized`, `invalid_request`, `c

Get server stats such as user count.

- Endpoint Type: **Event**
- Endpoint Type: **Request** -> **Response**
- Source: **User**
- Target: **Server**
- Required Scopes: `tachyon.lobby`
Expand Down
2 changes: 1 addition & 1 deletion src/generate-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export async function generateEndpointMarkdown(

markdown += `- Endpoint Type: `;

if ("request" in commandConfig) {
if (commandConfig.type === "requestResponse") {
markdown += `**Request** -> **Response**\n`;
} else {
markdown += `**Event**\n`;
Expand Down

0 comments on commit 6fa1078

Please sign in to comment.