Skip to content

Commit 49379fa

Browse files
authored
Merge pull request #741 from freyacodes/dev
release v3.5.1
2 parents ef59de9 + b2199f9 commit 49379fa

File tree

6 files changed

+30
-21
lines changed

6 files changed

+30
-21
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,19 @@ on:
66
paths-ignore: [ '**.md' ]
77
workflow_call:
88
secrets:
9-
DOCKERHUB_USERNAME:
10-
DOCKERHUB_TOKEN:
9+
DOCKER_USERNAME:
10+
DOCKER_TOKEN:
11+
DOCKER_REGISTRY:
12+
DOCKER_IMAGE:
1113

1214
jobs:
1315
build:
1416
runs-on: ubuntu-latest
1517
env:
16-
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
17-
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
18+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
19+
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
20+
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }}
21+
DOCKER_IMAGE: ${{ secrets.DOCKER_IMAGE }}
1822
steps:
1923
- name: Checkout
2024
uses: actions/checkout@v3
@@ -39,35 +43,35 @@ jobs:
3943
path: LavalinkServer/build/libs/Lavalink.jar
4044

4145
- name: Docker Meta
42-
if: env.DOCKERHUB_USERNAME && env.DOCKERHUB_TOKEN
46+
if: env.DOCKER_USERNAME && env.DOCKER_TOKEN && env.DOCKER_REGISTRY && env.DOCKER_IMAGE
4347
id: meta
4448
uses: docker/metadata-action@v4
4549
with:
46-
images: |
47-
fredboat/lavalink
50+
images: ${{ env.DOCKER_IMAGE }}
4851
tags: |
4952
type=ref,event=branch
5053
type=ref,event=tag
5154
type=ref,event=pr
5255
type=sha,prefix=
5356
5457
- name: Set up QEMU
55-
if: env.DOCKERHUB_USERNAME && env.DOCKERHUB_TOKEN
58+
if: env.DOCKER_USERNAME && env.DOCKER_TOKEN && env.DOCKER_REGISTRY && env.DOCKER_IMAGE
5659
uses: docker/setup-qemu-action@v2
5760

5861
- name: Set up Docker Buildx
59-
if: env.DOCKERHUB_USERNAME && env.DOCKERHUB_TOKEN
62+
if: env.DOCKER_USERNAME && env.DOCKER_TOKEN && env.DOCKER_REGISTRY && env.DOCKER_IMAGE
6063
uses: docker/setup-buildx-action@v2
6164

62-
- name: Login to DockerHub
63-
if: env.DOCKERHUB_USERNAME && env.DOCKERHUB_TOKEN
65+
- name: Log in to docker registry
66+
if: env.DOCKER_USERNAME && env.DOCKER_TOKEN && env.DOCKER_REGISTRY && env.DOCKER_IMAGE
6467
uses: docker/login-action@v2
6568
with:
66-
username: ${{ env.DOCKERHUB_USERNAME }}
67-
password: ${{ env.DOCKERHUB_TOKEN }}
69+
registry: ${{ env.DOCKER_REGISTRY }}
70+
username: ${{ env.DOCKER_USERNAME }}
71+
password: ${{ env.DOCKER_TOKEN }}
6872

6973
- name: Build and Push
70-
if: env.DOCKERHUB_USERNAME && env.DOCKERHUB_TOKEN
74+
if: env.DOCKER_USERNAME && env.DOCKER_TOKEN && env.DOCKER_REGISTRY && env.DOCKER_IMAGE
7175
uses: docker/build-push-action@v3
7276
with:
7377
file: LavalinkServer/docker/Dockerfile

.github/workflows/release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ jobs:
88
build:
99
uses: ./.github/workflows/build.yml
1010
secrets:
11-
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
12-
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
11+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
12+
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
13+
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }}
14+
DOCKER_IMAGE: ${{ secrets.DOCKER_IMAGE }}
1315

1416
release:
1517
needs: build

IMPLEMENTATION.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,14 +251,16 @@ This event includes:
251251
* Unix timestamp in milliseconds.
252252
* Track position in milliseconds. Omitted if not playing anything.
253253
* `connected` is true when connected to the voice gateway.
254+
* `ping` represents the number of milliseconds between heartbeat and ack. Could be `-1` if not connected.
254255
```json
255256
{
256257
"op": "playerUpdate",
257258
"guildId": "...",
258259
"state": {
259260
"time": 1500467109,
260261
"position": 60000,
261-
"connected": true
262+
"connected": true,
263+
"ping": 0
262264
}
263265
}
264266
```

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ class SocketServer(
6161
val json = JSONObject()
6262

6363
val state = player.state
64-
val connected = socketContext.getMediaConnection(player).gatewayConnection?.isOpen == true
65-
state.put("connected", connected)
64+
val connection = socketContext.getMediaConnection(player).gatewayConnection
65+
state.put("connected", connection?.isOpen == true)
66+
state.put("ping", connection?.ping ?: -1)
6667

6768
json.put("op", "playerUpdate")
6869
json.put("guildId", player.guildId.toString())

LavalinkServer/src/main/java/lavalink/server/player/Player.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public long getGuildId() {
103103

104104
@Override
105105
public ISocketContext getSocketContext() {
106-
return null;
106+
return socketContext;
107107
}
108108

109109
public void seekTo(long position) {

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ fun VersionCatalogBuilder.voice() {
4545
library("koe", "moe.kyokobot.koe", "core").version("2.0.0-rc1")
4646
library("koe-udpqueue", "moe.kyokobot.koe", "ext-udpqueue").version("2.0.0-rc1")
4747

48-
version("udpqueue", "0.2.4")
48+
version("udpqueue", "0.2.5")
4949
val platforms = listOf("linux-x86-64", "linux-x86", "linux-aarch64", "linux-arm", "win-x86-64", "win-x86", "darwin")
5050
platforms.forEach {
5151
library("udpqueue-native-$it", "club.minnced", "udpqueue-native-$it").versionRef("udpqueue")

0 commit comments

Comments
 (0)