Skip to content

Commit cedd535

Browse files
committed
Merge branch 'dev'
2 parents 456f6bd + 320e71c commit cedd535

File tree

3 files changed

+53
-18
lines changed

3 files changed

+53
-18
lines changed

IMPLEMENTATION.md

Lines changed: 51 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ User-Id: The user id of the bot you are playing music with
4646
```
4747

4848
### Outgoing messages
49+
50+
#### Provide a voice server update
51+
4952
Provide an intercepted voice server update. This causes the server to connect to the voice channel.
53+
5054
```json
5155
{
5256
"op": "voiceUpdate",
@@ -56,13 +60,17 @@ Provide an intercepted voice server update. This causes the server to connect to
5660
}
5761
```
5862

59-
Cause the player to play a track.
63+
#### Play a track
6064

6165
`startTime` is an optional setting that determines the number of milliseconds to offset the track by. Defaults to 0.
6266

6367
`endTime` is an optional setting that determines at the number of milliseconds at which point the track should stop playing. Helpful if you only want to play a snippet of a bigger track. By default the track plays until it's end as per the encoded data.
6468

65-
If `noReplace` is set to true, this operation will be ignored if a track is already playing or paused.
69+
`volume` is an optional setting which changes the volume if provided.
70+
71+
If `noReplace` is set to true, this operation will be ignored if a track is already playing or paused. This is an optional field.
72+
73+
If `pause` is set to true, the playback will be paused. This is an optional field.
6674

6775
```json
6876
{
@@ -71,19 +79,23 @@ If `noReplace` is set to true, this operation will be ignored if a track is alre
7179
"track": "...",
7280
"startTime": "60000",
7381
"endTime": "120000",
74-
"noReplace": false
82+
"volume": "100",
83+
"noReplace": false,
84+
"pause": false,
7585
}
7686
```
7787

78-
Cause the player to stop
88+
#### Stop a player
89+
7990
```json
8091
{
8192
"op": "stop",
8293
"guildId": "..."
8394
}
8495
```
8596

86-
Set player pause
97+
#### Pause the playback
98+
8799
```json
88100
{
89101
"op": "pause",
@@ -92,7 +104,10 @@ Set player pause
92104
}
93105
```
94106

95-
Make the player seek to a position of the track. Position is in millis
107+
#### Seek a track
108+
109+
The position is in milliseconds.
110+
96111
```json
97112
{
98113
"op": "seek",
@@ -101,7 +116,10 @@ Make the player seek to a position of the track. Position is in millis
101116
}
102117
```
103118

104-
Set player volume. Volume may range from 0 to 1000. 100 is default.
119+
#### Set player volume
120+
121+
Volume may range from 0 to 1000. 100 is default.
122+
105123
```json
106124
{
107125
"op": "volume",
@@ -110,7 +128,13 @@ Set player volume. Volume may range from 0 to 1000. 100 is default.
110128
}
111129
```
112130

113-
Using the player equalizer
131+
#### Using the player equalizer
132+
133+
There are 15 bands (0-14) that can be changed.
134+
`gain` is the multiplier for the given band. The default value is 0. Valid values range from -0.25 to 1.0,
135+
where -0.25 means the given band is completely muted, and 0.25 means it is doubled. Modifying the gain could
136+
also change the volume of the output.
137+
114138
```json
115139
{
116140
"op": "equalizer",
@@ -123,14 +147,13 @@ Using the player equalizer
123147
]
124148
}
125149
```
126-
There are 15 bands (0-14) that can be changed.
127-
`gain` is the multiplier for the given band. The default value is 0. Valid values range from -0.25 to 1.0,
128-
where -0.25 means the given band is completely muted, and 0.25 means it is doubled. Modifying the gain could
129-
also change the volume of the output.
150+
151+
#### Destroy a player
130152

131153
Tell the server to potentially disconnect from the voice server and potentially remove the player with all its data.
132154
This is useful if you want to move to a new node for a voice connection. Calling this op does not affect voice state,
133155
and you can send the same VOICE_SERVER_UPDATE to a new node.
156+
134157
```json
135158
{
136159
"op": "destroy",
@@ -203,7 +226,7 @@ Server emitted an event. See the client implementation below.
203226
* 2. TrackEndEvent
204227
* 3. TrackExceptionEvent
205228
* 4. TrackStuckEvent
206-
* <p>
229+
*
207230
* The remaining lavaplayer events are caused by client actions, and are therefore not forwarded via WS.
208231
*/
209232
private void handleEvent(JSONObject json) throws IOException {
@@ -330,15 +353,21 @@ A severity level of `COMMON` indicates that the error is non-fatal and that the
330353
```
331354

332355
---
356+
333357
### RoutePlanner API
358+
334359
Additionally there are a few REST endpoints for the ip rotation extension
335-
#### RoutePlanner Status
360+
361+
#### Get RoutePlanner status
362+
336363
```
337364
GET /routeplanner/status
338365
Host: localhost:8080
339366
Authorization: youshallnotpass
340367
```
368+
341369
Response:
370+
342371
```json
343372
{
344373
"class": "RotatingNanoIpRoutePlanner",
@@ -368,6 +397,7 @@ Fields which are always present are: `class`, `details.ipBlock` and
368397
The following classes have additional detail fields:
369398

370399
#### RotatingIpRoutePlanner
400+
371401
`details.rotateIndex` String containing the number of rotations which happened
372402
since the restart of Lavalink
373403

@@ -376,25 +406,28 @@ since the restart of Lavalink
376406
`details.currentAddress` The currently used ip address
377407

378408
#### NanoIpRoutePlanner
409+
379410
`details.currentAddressIndex` long representing the current offset in the ip
380411
block
381412

382413
#### RotatingNanoIpRoutePlanner
414+
383415
`details.blockIndex` String containing the the information in which /64 block ips
384416
are chosen. This number increases on each ban.
385417

386418
`details.currentAddressIndex` long representing the current offset in the ip
387-
block
388-
419+
block.
389420

390421
#### Unmark a failed address
422+
391423
```
392424
POST /routeplanner/free/address
393425
Host: localhost:8080
394426
Authorization: youshallnotpass
395427
```
396428

397429
Request Body:
430+
398431
```json
399432
{
400433
"address": "1.0.0.1"
@@ -406,6 +439,7 @@ Response:
406439
204 - No Content
407440

408441
#### Unmark all failed address
442+
409443
```
410444
POST /routeplanner/free/all
411445
Host: localhost:8080
@@ -461,6 +495,7 @@ queue is then emptied and the events are then replayed.
461495
* This also includes resumes
462496

463497
* If Lavalink-Server suddenly dies (think SIGKILL) the client will have to terminate any audio connections by sending this event:
498+
464499
```json
465500
{"op":4,"d":{"self_deaf":false,"guild_id":"GUILD_ID_HERE","channel_id":null,"self_mute":false}}
466501
```

LavalinkServer/src/main/java/lavalink/server/io/SocketServer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class SocketServer(
4646

4747
// userId <-> shardCount
4848
private val shardCounts = ConcurrentHashMap<String, Int>()
49-
val contextMap = HashMap<String, SocketContext>()
49+
val contextMap = ConcurrentHashMap<String, SocketContext>()
5050
@Suppress("LeakingThis")
5151
private val handlers = WebSocketHandlers(contextMap)
5252
private val resumableSessions = mutableMapOf<String, SocketContext>()

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ subprojects {
5353

5454
ext {
5555
//@formatter:off
56-
lavaplayerVersion = '1.3.53'
56+
lavaplayerVersion = '1.3.61'
5757
lavaplayerIpRotatorVersion = '0.2.3'
5858
jdaNasVersion = '1.1.0'
5959
jappVersion = '1.3.2-MINN'

0 commit comments

Comments
 (0)