refactor progress

This commit is contained in:
Hampus Kraft
2026-02-17 12:22:36 +00:00
parent cb31608523
commit d5abd1a7e4
8257 changed files with 1190207 additions and 761040 deletions

View File

@@ -0,0 +1,23 @@
---
title: 'Close codes'
description: 'WebSocket close codes used by the Fluxer gateway.'
---
When the gateway closes a connection, it sends a close code indicating why. Some close codes are recoverable (the client should reconnect), while others are not.
## Close code reference
| Code | Name | Description | Reconnect |
|------|------|-------------|----------|
| `4000` | `UNKNOWN_ERROR` | Unknown error occurred | Yes |
| `4001` | `UNKNOWN_OPCODE` | Sent an invalid gateway opcode | Yes |
| `4002` | `DECODE_ERROR` | Sent an invalid payload | Yes |
| `4003` | `NOT_AUTHENTICATED` | Sent a payload before identifying | Yes |
| `4004` | `AUTHENTICATION_FAILED` | Account token is invalid | No |
| `4005` | `ALREADY_AUTHENTICATED` | Sent more than one identify payload | Yes |
| `4007` | `INVALID_SEQ` | Sent an invalid sequence when resuming | Yes |
| `4008` | `RATE_LIMITED` | Sending payloads too quickly | Yes |
| `4009` | `SESSION_TIMEOUT` | Session timed out; reconnect and start a new one | Yes |
| `4010` | `INVALID_SHARD` | Sent an invalid shard when identifying | No |
| `4011` | `SHARDING_REQUIRED` | Session would have handled too many guilds; sharding is required | No |
| `4012` | `INVALID_API_VERSION` | Sent an invalid gateway version | No |

View File

@@ -0,0 +1,6 @@
---
title: 'Connection lifecycle'
description: 'Connect, identify, stay connected, and recover from disconnects.'
---
TBD

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,25 @@
---
title: 'Opcodes'
description: 'Gateway opcodes used for communication between client and server.'
---
Gateway opcodes indicate the type of payload being sent or received. Clients send and receive different opcodes depending on their role in the connection lifecycle.
## Opcode reference
| Opcode | Name | Description | Client Action |
|--------|------|-------------|---------------|
| `0` | `DISPATCH` | Dispatches an event to the client | Receive |
| `1` | `HEARTBEAT` | Fired periodically to keep the connection alive | Send/Receive |
| `2` | `IDENTIFY` | Starts a new session during the initial handshake | Send |
| `3` | `PRESENCE_UPDATE` | Updates the client presence | Send |
| `4` | `VOICE_STATE_UPDATE` | Joins, moves, or disconnects from a voice channel | Send |
| `5` | `VOICE_SERVER_PING` | Pings the voice server | Send |
| `6` | `RESUME` | Resumes a previous session after a disconnect | Send |
| `7` | `RECONNECT` | Indicates the client should reconnect to the gateway | Receive |
| `8` | `REQUEST_GUILD_MEMBERS` | Requests members for a guild | Send |
| `9` | `INVALID_SESSION` | Session has been invalidated; client should reconnect and identify | Receive |
| `10` | `HELLO` | Sent immediately after connecting; contains heartbeat interval | Receive |
| `11` | `HEARTBEAT_ACK` | Acknowledgement of a heartbeat | Receive |
| `12` | `GATEWAY_ERROR` | Indicates an error occurred while processing a gateway message | Receive |
| `14` | `LAZY_REQUEST` | Requests lazy-loaded guild data | Send |

View File

@@ -0,0 +1,6 @@
---
title: 'Gateway overview'
description: 'How Fluxer gateway connections work at a high level.'
---
TBD