Skip to content

Commit b8dd3c8

Browse files
committed
Document v2 changes
1 parent 6a2e6b8 commit b8dd3c8

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

IMPLEMENTATION.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,31 @@ How to write your own client. The Java client will serve as an example implement
1010
* Hybi 10
1111
* Hixie 76
1212
* Hixie 75
13+
14+
## Changes v1.3 -> v2.0
15+
With the release of v2.0 many unnecessary ops were removed:
16+
17+
* `connect`
18+
* `disconnect`
19+
* `validationRes`
20+
* `isConnectedRes`
21+
* `validationReq`
22+
* `isConnectedReq`
23+
* `sendWS`
24+
25+
With Lavalink 1.x the server had the responsibility of handling Discord VOICE_SERVER_UPDATEs as well as its own internal ratelimiting.
26+
This remote handling makes things unnecessarily complicated and adds a lot og points where things could go wrong.
27+
One problem we noticed is that since JDAA is unaware of ratelimits on the bot's gateway connection, it would keep adding
28+
to the ratelimit queue to the gateway. With this update this is now the responsibility of the Lavalink client or the
29+
Discord client.
30+
31+
A voice connection is now initiated by forwarding a `voiceUpdate` (VOICE_SERVER_UPDATE) to the server. When you want to
32+
disconnect or move to a different voice channel you must send Discord a new VOICE_STATE_UPDATE. If you want to move your
33+
connection to a new Lavalink server you can simply send the VOICE_SERVER_UPDATE to the new node, and the other node
34+
will be disconnected by Discord.
35+
36+
Depending on your Discord library, it may be possible to take advantage of the library's OP 4 handling. For instance,
37+
the JDA client takes advantage of JDA's websocket write thread to send OP 4s for connects, disconnects and reconnects.
1338

1439
## Protocol
1540
### Opening a connection

0 commit comments

Comments
 (0)