mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-25 20:21:02 +00:00
feat!: big feature changes
BREAKING CHANGES: - Heartbeating removed - `config.consoleLogLevel` -> `config.logLevel` NEW FEATURES: - Training messages - Sequence number system - WebSocket close codes used instead of disconnect packets FIXES: - Improved error handling - Some performance improvements - Made code more clean - Updated dependencies
This commit is contained in:
@@ -19,15 +19,13 @@ Operation codes are numbers that communicate an action.
|
||||
|
||||
Data fields include additional information for the server to process. They are **either an object with specific fields or just `null`**.
|
||||
|
||||
### `packet.s` (server packets)
|
||||
|
||||
A sequence number, exclusively for server packets. The WebSocket server contacts other APIs and they may not be reliable at all times, this makes race conditions. A sequence number cleanly solves this issue by letting the client know what the next packet sequence number would be by giving the current number.
|
||||
|
||||
#### 📦 Schemas and constants
|
||||
|
||||
Schemas for packets and their respective data[^1], and the list of possible operation codes[^2] can be found in the `@revanced/bot-shared` package, with typings as well.
|
||||
|
||||
[^1]: [`@revanced/bot-shared/src/schemas/Packet.ts`](../../../packages/shared/src/schemas/Packet.ts)
|
||||
[^2]: [`@revanced/bot-shared/src/constants/Operation`](../../../packages/shared/src/constants/Operation.ts)
|
||||
|
||||
## 💓 Heartbeating
|
||||
|
||||
Heartbeating is a process where the client regularly send each other signals to confirm that they are still connected and functioning. If the server doesn't receive a heartbeat from the client within a specified timeframe, it assume the client has disconnected and closes the socket.
|
||||
|
||||
You can configure the interval in the configuration file. See [**📝 Configuration > `config.clientHeartbeatInterval`**](./1_configuration.md#configclientheartbeatinterval).
|
||||
|
||||
Reference in New Issue
Block a user