From 5f23a15fd029fcc0ec8a87b8e5ba629a4d464dff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?To=CF=80Senpai?= <15636011+TopiSenpai@users.noreply.github.com> Date: Tue, 27 Sep 2022 15:13:02 +0100 Subject: [PATCH 1/5] removed last mention of build number (#754) --- .../src/main/java/lavalink/server/info/AppInfo.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/LavalinkServer/src/main/java/lavalink/server/info/AppInfo.java b/LavalinkServer/src/main/java/lavalink/server/info/AppInfo.java index 1d61c257a..b2898fd42 100644 --- a/LavalinkServer/src/main/java/lavalink/server/info/AppInfo.java +++ b/LavalinkServer/src/main/java/lavalink/server/info/AppInfo.java @@ -21,7 +21,6 @@ public class AppInfo { private final String version; private final String groupId; private final String artifactId; - private final String buildNumber; private final long buildTime; public AppInfo() { @@ -35,7 +34,6 @@ public AppInfo() { this.version = prop.getProperty("version"); this.groupId = prop.getProperty("groupId"); this.artifactId = prop.getProperty("artifactId"); - this.buildNumber = prop.getProperty("buildNumber"); long bTime = -1L; try { bTime = Long.parseLong(prop.getProperty("buildTime")); @@ -55,15 +53,11 @@ public String getArtifactId() { return this.artifactId; } - public String getBuildNumber() { - return this.buildNumber; - } - public long getBuildTime() { return this.buildTime; } public String getVersionBuild() { - return this.version + "_" + this.buildNumber; + return this.version; } } From 4524f67203f971e0bfafe3a2ababd384c08f032e Mon Sep 17 00:00:00 2001 From: Gino Date: Wed, 12 Oct 2022 04:55:30 -0700 Subject: [PATCH 2/5] feat(plugin-api): userId & clientName getters (#743) * feat(plugin-api): userId & clientName getters * fix: remove trailing space from javadoc * chore: convert user id to long in getter --- .../main/java/lavalink/server/io/SocketContext.kt | 11 ++++++++++- .../src/main/java/lavalink/server/io/SocketServer.kt | 3 ++- .../dev/arbjerg/lavalink/api/ISocketContext.java | 12 ++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/LavalinkServer/src/main/java/lavalink/server/io/SocketContext.kt b/LavalinkServer/src/main/java/lavalink/server/io/SocketContext.kt index 83bc3528d..4d02b3df2 100644 --- a/LavalinkServer/src/main/java/lavalink/server/io/SocketContext.kt +++ b/LavalinkServer/src/main/java/lavalink/server/io/SocketContext.kt @@ -55,7 +55,8 @@ class SocketContext( val serverConfig: ServerConfig, private var session: WebSocketSession, private val socketServer: SocketServer, - val userId: String, + private val userId: String, + private val clientName: String?, val koe: KoeClient, eventHandlers: Collection, webSocketExtensions: List, @@ -105,6 +106,14 @@ class SocketContext( fun getPlayer(guildId: String) = getPlayer(guildId.toLong()) + override fun getUserId(): Long { + return userId.toLong() + } + + override fun getClientName(): String? { + return clientName + } + override fun getPlayer(guildId: Long) = players.computeIfAbsent(guildId) { val player = Player(this, guildId, audioPlayerManager, serverConfig) eventEmitter.onNewPlayer(player) diff --git a/LavalinkServer/src/main/java/lavalink/server/io/SocketServer.kt b/LavalinkServer/src/main/java/lavalink/server/io/SocketServer.kt index 8de678287..1f7a51ddc 100644 --- a/LavalinkServer/src/main/java/lavalink/server/io/SocketServer.kt +++ b/LavalinkServer/src/main/java/lavalink/server/io/SocketServer.kt @@ -99,6 +99,7 @@ class SocketServer( session, this, userId, + clientName, koe.newClient(userId.toLong()), eventHandlers, webSocketExtensions, @@ -176,4 +177,4 @@ class SocketServer( } internal fun canResume(key: String) = resumableSessions[key]?.stopResumeTimeout() ?: false -} \ No newline at end of file +} diff --git a/plugin-api/src/main/java/dev/arbjerg/lavalink/api/ISocketContext.java b/plugin-api/src/main/java/dev/arbjerg/lavalink/api/ISocketContext.java index 902f4f37c..825304625 100644 --- a/plugin-api/src/main/java/dev/arbjerg/lavalink/api/ISocketContext.java +++ b/plugin-api/src/main/java/dev/arbjerg/lavalink/api/ISocketContext.java @@ -1,6 +1,7 @@ package dev.arbjerg.lavalink.api; import org.json.JSONObject; +import org.springframework.lang.Nullable; import java.util.Map; @@ -8,6 +9,17 @@ * Represents a WebSocket connection */ public interface ISocketContext { + /** + * @return the User ID of the Client. + */ + long getUserId(); + + /** + * @return the name of the Client, or null if it was not specified. + */ + @Nullable + String getClientName(); + /** * Returns the player of a guild. Never returns null. * From c60c37d60bdfc6deb9ab70fba4f484741b25dc01 Mon Sep 17 00:00:00 2001 From: Freya Arbjerg Date: Wed, 12 Oct 2022 14:19:30 +0200 Subject: [PATCH 3/5] Set plugin API version to 3.6.0 --- plugin-api/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin-api/build.gradle.kts b/plugin-api/build.gradle.kts index e981f3af2..dd6e41e95 100644 --- a/plugin-api/build.gradle.kts +++ b/plugin-api/build.gradle.kts @@ -7,7 +7,7 @@ plugins { val archivesBaseName = "plugin-api" group = "dev.arbjerg.lavalink" -version = "0.9.0" +version = "3.6.0" dependencies { compileOnly(libs.spring.boot) From 2c854364b9ea107706f7fc22b4ef7f7a0bd11871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?To=CF=80Senpai?= <15636011+TopiSenpai@users.noreply.github.com> Date: Wed, 12 Oct 2022 14:25:26 +0200 Subject: [PATCH 4/5] update release notes --- CHANGELOG.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94acaf81f..ef8c5b3ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,51 @@ Each release usually includes various fixes and improvements. The most noteworthy of these, as well as any features and breaking changes, are listed here. +## 3.6.0 +* new userId & clientName getters in the plugin-api. For more info see [here](https://github.com/freyacodes/Lavalink/pull/743). + +## 3.5.1 +* update udpqueue.rs to `0.2.5` which fixes crashes when ipv6 is disabled +* fix null socketContext in `IPlayer` for plugins +* new `ping` field in player update. see https://github.com/freyacodes/Lavalink/pull/738 for more info + +Contributors: +[@TopiSenpai](https://github.com/TopiSenpai), +[@Devoxin](https://github.com/Devoxin), and +[@freyacodes](https://github.com/freyacodes) + +## 3.5 +* New plugin system. For more info see [here](https://github.com/freyacodes/Lavalink/blob/master/PLUGINS.md). +* Add support for HTTP proxying via httpConfig. For more info see [here](https://github.com/freyacodes/Lavalink/pull/595). +* Update koe version to 2.0.0-rc1. + - this fixes the WebSocketClosedEvent with code 1006 problem. +* Fix error when enabling timescale and lowpass filters. +* Fix player not playing after moving between voice chats or changing regions. +* Fix guild ids sent as numbers in json. +* Fix missing timescale natives. +* Fix setting endMarkerHit to correctly set FINISHED as the reason. +* Undeprecation of the `volume` property in the `play` OP. +* Configurable track stuck threshold. For more info see [here](https://github.com/freyacodes/Lavalink/pull/676). +* Add JDA-NAS support for more CPU Architectures. For more info see [here](https://github.com/freyacodes/Lavalink/pull/692). Big thanks goes to @MinnDevelopment here. +* Update lavaplayer to [`1.3.98.4`](https://github.com/Walkyst/lavaplayer-fork/releases/tag/1.3.98.4) which fixes the latest yt cipher issues and age restricted tracks + +Contributors: +[@freyacodes](https://github.com/freyacodes), +[@davidffa](https://github.com/davidffa), +[@Walkyst](https://github.com/Walkyst), +[@TopiSenpai](https://github.com/TopiSenpai), +[@duncte123](https://github.com/duncte123), +[@Kodehawa](https://github.com/Kodehawa), +[@Devoxin](https://github.com/Devoxin), +[@Muh9049](https://github.com/Muh9049), +[@melike2d](https://github.com/melike2d), +[@ToxicMushroom](https://github.com/ToxicMushroom), +[@mooner1022](https://github.com/mooner1022), +[@rohank05](https://github.com/rohank05), +[@Fabricio20](https://github.com/Fabricio20), +[@TheEssemm](https://github.com/TheEssemm), and +[@jack1142](https://github.com/jack1142) + ## 3.4 * New filters system * Deprecation of `TrackExceptionEvent.error`, replaced by `TrackExceptionEvent.exception` From 47e5901cae0eb01be8672487b5f852a3d1240293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?To=CF=80Senpai?= <15636011+TopiSenpai@users.noreply.github.com> Date: Wed, 12 Oct 2022 14:34:05 +0200 Subject: [PATCH 5/5] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef8c5b3ba..82eb18dab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ The most noteworthy of these, as well as any features and breaking changes, are ## 3.6.0 * new userId & clientName getters in the plugin-api. For more info see [here](https://github.com/freyacodes/Lavalink/pull/743). +Contributors: +[@melike2d](https://github.com/melike2d) + ## 3.5.1 * update udpqueue.rs to `0.2.5` which fixes crashes when ipv6 is disabled * fix null socketContext in `IPlayer` for plugins