Releases: SamOphis/LavaClient
v3.0.0 - See Change Notes
Change Notes
-
Breaking Changes
- Changed the constant names in the
LavaClient
class so that they match the others. - Removed the
init
properties from the configuration-via-source method, they're in theglobal
section now. - Removed the deprecated constructors that accepted
overrideJson
as a parameter. - Made
destroyPlayer
not actually remove the player from the cache -- this is up to the user now. - Removed dependencies on Sentry Logback -- SLF4J API is used now, so any logger compatible with that can be used. Sentry Logback and Logback in general are compatible with SLF4J API.
- Changed the behaviour of
getBestNode
yet again -- not too important for users (returnsnull
if not found, returns the node if it's found even if it's not available).
- Changed the constant names in the
-
Non-breaking Changes/Features
- Deprecated the constructors that accepted basic cache settings. You should use the setters now.
- Added complete support for safe reconnections, meaning you can change a node/reboot it even when your bot is running without things blowing up. You can also close and open the connection to the socket manually with callbacks provided that get reset after 2 seconds of not being used to prevent old callbacks being used.
- You can completely configure the reconnection process -- the default "base" value, the maximum value, the unit to wait in and how the value expands (like 2 -> 4 -> 8 for example).
- You can now specify your own
WebSocketFactory
so, combined with theSocketInitializer
class, you can configure basically every aspect of LavaClient's connection to your nodes.
-
v3.0.1
fixes a bug where LavaClient did not automatically cap reconnect intervals, and also bases the expander off of the amount of reconnect attempts not the reconnect interval :/ -
v3.0.2
fixes placeholder bugs not being applied in certain cases and also handles intervals better. -
v3.0.3
fixes a small bug where, upon shutdown, LavaClient attempts to close connections to nodes even if a connection isn't open.
Adding LavaClient
You can add LavaClient either through JCenter or by using the binaries attached to this release.
The latest version is presented on this badge:
With Gradle, you can add LavaClient v3.0.3 through JCenter with the following code:
repositories {
jcenter()
}
dependencies {
compile 'com.github.samophis:LavaClient:3.0.3'
}
v2.5.0 -- See Change Notes
Change Notes
-
Semi-breaking changes
- Made
getSocket
return a possibly-nullWebSocket
instance now (instead of a not-null version). - Made
getBestNode
return a possibly-nullAudioNode
instance (it no longer throws). - Made the initial connection when creating an
AudioNode
no longer throw exceptions due to new connection logic. - Opening a new connection outside of the initial constructor connection attempt can throw an
IllegalStateException
or aSocketConnectionException
. - Deprecated the constructors that let you specify whether or not to set Dynamic Code Generation as the JSON Encoding/Decoding option in Jsoniter (
overrideJson
). They now are locked totrue
, same as the configuration source. This is because Jsoniter causes a stack overflow error when using reflection (overrideJson=false
). Due to be removed in the next minor/major version bump.
- Made
-
Non-breaking changes
- You can now set a
LavaPlayer
instance's connected node tonull
, which attempts to destroy the player (disconnecting it from the currently connected node). - Two new
AudioNode
methods:openConnection
andcloseConnection
, which can be used to open a new connection from LavaClient to a node and to terminate it.
- You can now set a
Adding LavaClient
As always, you can add LavaClient through JCenter with any good build tool, or you can use the binaries attached to this release. Here's a basic example on how you add LavaClient with Gradle:
repositories {
jcenter()
}
dependencies {
compile 'com.github.samophis:LavaClient:2.5.0'
}
v2.4.x -- See Change Notes
Change Notes
-
Builds:
- LavaClient is now part of the
jcenter
repository, so no more dependencies on JitPack 🤔 - New release format: I'll only post releases for every major/minor version (no more patches), and for each patch I'll just update the release it patches. The latest version is always visible on the badge on the front page:
- New group name, breaking change so please check the capitalization of the dependency, it should look like this
com.github.samophis:LavaClient:2.4.4
- LavaClient is now part of the
-
Features and Patches:
v2.4.2
now adds support for configuration via files, URLs, string content or byte array content. The expected configuration format can be found on the Wiki.v2.4.2
patches a bug where theplayingTrack
wasn't set whenever a track started. It also patches an NPE caused by providingnull
for a possibly-nullSocketInitializer
. Fixed now -- you can leave the initializer unset.v2.4.3
patches bugs fromv2.4.2
related to parsing configuration sources as well as unmodifiable collection casting and handlers not being added for nodes that were loaded from a source. It also bumps the Gradle version and updates some dependencies.v2.4.4
patches an issue withv2.4.3
where using the defaultLavaClientBuilder
constructor would not initialize it, leading to Jsoniter spazzing out.
Adding LavaClient
You can add LavaClient through JCenter or by manually using the binaries attached to this release. You can add this release with Gradle with code similar to this:
repositories {
jcenter()
}
dependencies {
compile 'com.github.samophis:LavaClient:2.4.4'
}
Version v2.3.0 -- See Change Notes
This release includes some minor patches/fixes as well as the ability to register your own SocketHandler
s, allowing users of LavaClient to easily react to custom op's from Lavalink. Made mainly to satisfy PR #119 of Lavalink (plugin system). LavaClient will override handlers which react to events such as playerUpdate
.
Additionally, this release has full support for PR #116 of Lavalink. Since LavaClient aims to be fully backwards compatible with v2 and earlier versions of Lavalink v3, trying to see the load types on those versions will usually return UNKNOWN
, however for the latest versions you can see whether the loading of tracks returned a search result, a playlist load, a track load, "no matches found" or a failed load.
More information will be posted on the Wiki later.
Adding this Release
Same as before, you can always get this release either through JitPack or through the attached binaries below. Here's a simple example of how you can grab it on JitPack with Gradle:
repositories {
maven {url 'https://jitpack.io'}
jcenter()
}
dependencies {
compile 'com.github.SamOphis:LavaClient:v2.3.0'
}
Version v2.1.0 -- Added the ability to remove players + patches
Patched a thing where LavaClient would attempt to shut-down and destroy all players regardless of state. Also added a removePlayer
method with two overloads into the LavaClient
interface (Guild ID + optional shouldDestroy
boolean).
Note: Destroying a player via the destroyPlayer
method in the LavaPlayer
interface will also call the removePlayer
method, so there's no need to call it again.
Other than that this functions exactly the same as the last version (v2.0.2). Same as before, you can grab this release from JitPack or download the attached binaries too. With Gradle, you can get this release through JitPack like so:
repositories {
jcenter()
maven {url 'https://jitpack.io'}
}
dependencies {
compile 'com.github.SamOphis:LavaClient:v2.1.0`
}
Version v2.0.2 -- Added Jackson to Build File
Fixed issue where the release on JitPack was missing Jackson but my IDE wasn't? Just added both my Jackson dependencies to the build file so JitPack doesn't complain anymore. Same stuff as before, nothing else is added.
Add this build on Gradle:
repositories {
jcenter()
maven {url 'https://jitpack.io'}
}
dependencies {
compile 'com.github.SamOphis:LavaClient:v2.0.2'
}
Or get the binaries attached below.
Version v2.0.1 -- Fixed bug where tracks on Lavalink v3 Nodes couldn't be loaded.
The bug was caused due to two things:
- Firstly, Lavalink has poor documentation and didn't show the
playlistInfo
object, meaning I was attempting to parse for aplaylistName
andselectedTrack
field inside the main object when they were actually calledname
andselectedTrack
inside theplaylistInfo
object. - Secondly, I suck with Jsoniter and I don't have the time nor the patience to write custom decoders just for track results, so I use Jackson just to parse responses from the
/loadtracks
endpoint on nodes running Lavalink v3.0.
This release should be perfectly fine to use now. As always, you can grab the binaries below or add this release through JitPack, which you can do with Gradle like this:
repositories {
jcenter()
maven {url 'https://jitpack.io'}
}
dependencies {
compile 'com.github.SamOphis:LavaClient:v2.0.1'
}
Version v2.0 -- See Change Notes
Change Notes
- Removed all global state -- say goodbye to
LavaClient.getBestNode()
and not being able to create more than oneLavaClient
instance. - Moved the connection logic from the
EventWaiter
class to theLavaPlayer
class. - Made
getPlayerByGuildId
not automatically create players if they didn't exist. - Added
newPlayer
methods to theLavaClient
class which either return pre-existing players or create new ones (roughly equivalent of whatgetPlayerByGuildId
did before this release). Please make sure to still use theEventWaiter
class as handling states and connections manually is a pretty annoying. - Added a
State
enum and thegetState
method to theLavaPlayer
class. It represents the current state the player is in. - Updated Gradle wayyyyy more than I ever had before. Credit to @natanbc.
- Increased usage of logging (still not fully done though!)
- Made the dependency on Lavaplayer compile-only, meaning users have to add Lavaplayer themselves now.
As always the binaries are attached, and you can add this build through JitPack. With Gradle it's done like this:
repositories {
jcenter()
maven {url 'https://jitpack.io'}
}
dependencies {
compile 'com.github.SamOphis:LavaClient:v2.0'
}
Version v1.3 -- See Change Notes
Change Notes
- Added callbacks to the
EventWaiter
so you can follow up avoiceUpdate
connection attempt to a node in the right order. To see the callback use thegetCallback
method in the same interface. Specifying a callback is done through overloads of the staticfrom
method which is also in the same interface. - Added the ability to shutdown the
LavaClient
instance, which destroys all players, removes all nodes and makes that client essentially resemble a new instance. Remember to create a new LavaClient instance separate from the old one if you create it again! - Added the ability to shutdown the
LavaHttpManager
, which is also called byLavaClient
upon a client shutdown. - Bumped versions of dependencies
- Deprecated the
setWsPort
method (usesetWebSocketPort
instead). This method will be removed completely in LavaClient v2, and was done to maintain consistency with the other builders.
Adding LavaClient
As always, binaries are attached but you can always add this repository through JitPack using any good build tool. Here's how you do it in Gradle:
repositories {
jcenter()
maven {url 'https://jitpack.io'}
}
dependencies {
compile 'com.github.SamOphis:LavaClient:v1.3'
}
Version v1.2 - See Change Notes
Change Notes
-
Updates LavaClient to detect if a node is running Lavalink v3 based on its reported
Lavalink-Major-Version
header added here. It's already understood that almost no one runs the latest cutting edge builds of Lavalink, so v1.2 deprecates theisUsingLavalinkVersionThree
-type methods from v1.1 and uses them as fallbacks if Lavalink v3 isn't initially detected. This way, clients can specify if one of their nodes runs an older version of v3. The deprecated methods are due to be removed upon the creation/release of LavaClient v2. -
Adds the ability to "initialize" the raw
WebSocket
instance between LavaClient and a node with theSocketInitializer
functional interface. This allows you to modify the WebSocket LavaClient creates before a connection is opened with it. It follows the same usual syntax (setting it via anAudioNodeEntryBuilder
). -
Added the
IsUsingLavalinkVersionThree
method to theAudioNode
interface/implementation, used internally (and exposed publicly) to test if a node is either reported to be using v3, if a client has set it to use v3 or if it's just v2.
Using LavaClient
As always, you can grab this version from JitPack with any good build tool or you can download the attached sources, javadoc and withDependencies binaries. Here's how you use the Gradle Build Tool to grab LavaClient v1.2 from JitPack:
repositories {
jcenter()
maven {url 'https://jitpack.io'}
}
dependencies {
compile 'com.github.SamOphis:LavaClient:v1.2'
}