Skip to content

Commit

Permalink
Merge pull request #373 from Frederikam/dev
Browse files Browse the repository at this point in the history
Release v3.3.2
  • Loading branch information
freyacodes authored Oct 24, 2020
2 parents 88094cf + 8b882e3 commit 644b8c9
Show file tree
Hide file tree
Showing 29 changed files with 502 additions and 313 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ build/*
.project
.classpath
.settings
/Testbot/build/
/Testbot/out/
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,28 @@
Each release usually includes various fixes and improvements.
The most noteworthy of these, as well as any features and breaking changes, are listed here.

## v3.3.2
* Replaced Magma with Koe.
* Finally implemented `stopTime` for `play` op.
* Added `playerUpdateInterval` config option.
* Added `environment` to Sentry config.
* Fixed #332
* Updated IP rotator.
* Update lavaplayer to `1.3.59` from devoxin's fork.
* Added a Testbot for development.

Contributors:
[@Frederikam](https://github.com/Frederikam),
[@Thewsomeguy](https://github.com/Thewsomeguy),
[@Neuheit](https://github.com/Neuheit),
[@Sangoon_Is_Noob](https://github.com/Sangoon_Is_Noob),
[@TheEssem](https://github.com/Essem), and
[@Devoxin](https://github.com/Devoxin)

## v3.3.1.4
* Update lavaplayer to `1.3.54.3` from devoxin's fork.


## v3.3.1.3
* Update lavaplayer to `1.3.53` from devoxin's fork.

Expand Down
2 changes: 2 additions & 0 deletions LavalinkServer/application.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ lavalink:
local: false
bufferDurationMs: 400
youtubePlaylistLoadLimit: 6 # Number of pages at 100 each
playerUpdateInterval: 5 # How frequently to send player updates to clients, in seconds
youtubeSearchEnabled: true
soundcloudSearchEnabled: true
gc-warnings: true
Expand All @@ -32,6 +33,7 @@ metrics:

sentry:
dsn: ""
environment: ""
# tags:
# some_key: some_value
# another_key: another_value
Expand Down
12 changes: 6 additions & 6 deletions LavalinkServer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ bootRun {
}

dependencies {
compile group: 'space.npstr.Magma', name: 'magma', version: magmaVersion
compile (group: 'moe.kyokobot.koe', name: 'core', version: koeVersion) {
// This version of SLF4J does not recognise Logback 1.2.3
exclude group: "org.slf4j", module: "slf4j-api"
}
compile group: 'moe.kyokobot.koe', name: 'ext-udpqueue', version: koeVersion
//compile group: 'com.sedmelluq', name: 'lavaplayer', version: lavaplayerVersion
compile group: 'com.github.devoxin', name: 'lavaplayer', version: '1.3.54.3'
compile group: 'com.github.devoxin', name: 'lavaplayer', version: '1.3.59'
compile group: 'com.sedmelluq', name: 'lavaplayer-ext-youtube-rotator', version: lavaplayerIpRotatorVersion
compile group: 'com.sedmelluq', name: 'jda-nas', version: jdaNasVersion
compile group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: kotlinVersion

compile group: 'com.github.shredder121', name: 'jda-async-packetprovider', version: jappVersion
//required by japp
compile group: 'org.apache.commons', name: 'commons-lang3', version: commonsLangVersion
compile group: 'org.springframework', name: 'spring-websocket', version: springWebSocketVersion
compile group: 'ch.qos.logback', name: 'logback-classic', version: logbackVersion
compile group: 'io.sentry', name: 'sentry-logback', version: sentryLogbackVersion
Expand Down
1 change: 1 addition & 0 deletions LavalinkServer/src/main/java/lavalink/server/Launcher.kt
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,6 @@ object Launcher {
}
)
sa.run(*args)
log.info("You can safely ignore the big red warning about illegal reflection. See https://github.com/Frederikam/Lavalink/issues/295")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import com.sedmelluq.discord.lavaplayer.source.soundcloud.SoundCloudAudioSourceM
import com.sedmelluq.discord.lavaplayer.source.twitch.TwitchStreamAudioSourceManager
import com.sedmelluq.discord.lavaplayer.source.vimeo.VimeoAudioSourceManager
import com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager
import com.sedmelluq.lava.extensions.youtuberotator.YoutubeIpRotator
import com.sedmelluq.lava.extensions.youtuberotator.YoutubeIpRotatorSetup
import com.sedmelluq.lava.extensions.youtuberotator.planner.AbstractRoutePlanner
import com.sedmelluq.lava.extensions.youtuberotator.planner.BalancingIpRoutePlanner
import com.sedmelluq.lava.extensions.youtuberotator.planner.NanoIpRoutePlanner
Expand Down Expand Up @@ -50,9 +50,9 @@ class AudioPlayerConfiguration {
if (routePlanner != null) {
val retryLimit = serverConfig.ratelimit?.retryLimit ?: -1
when {
retryLimit < 0 -> YoutubeIpRotator.setup(youtube, routePlanner)
retryLimit == 0 -> YoutubeIpRotator.setup(youtube, routePlanner, Int.MAX_VALUE)
else -> YoutubeIpRotator.setup(youtube, routePlanner, retryLimit)
retryLimit < 0 -> YoutubeIpRotatorSetup(routePlanner).forSource(youtube).setup()
retryLimit == 0 -> YoutubeIpRotatorSetup(routePlanner).forSource(youtube).withRetryLimit(Int.MAX_VALUE).setup()
else -> YoutubeIpRotatorSetup(routePlanner).forSource(youtube).withRetryLimit(retryLimit).setup()

}
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package lavalink.server.config

import moe.kyokobot.koe.KoeOptions
import moe.kyokobot.koe.codec.udpqueue.UdpQueueFramePollerFactory
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

@Configuration
class KoeConfiguration(val serverConfig: ServerConfig) {

private val log: Logger = LoggerFactory.getLogger(KoeConfiguration::class.java)

@Bean
fun koeOptions(): KoeOptions = KoeOptions.builder().apply {
log.info("OS: " + System.getProperty("os.name") + ", Arch: " + System.getProperty("os.arch"))
val os = System.getProperty("os.name")
val arch = System.getProperty("os.arch")

// Maybe add Windows natives back?
val nasSupported = os.contains("linux", ignoreCase = true)
&& arch.equals("amd64", ignoreCase = true)

if (nasSupported) {
log.info("Enabling JDA-NAS")
var bufferSize = serverConfig.bufferDurationMs ?: UdpQueueFramePollerFactory.DEFAULT_BUFFER_DURATION
if (bufferSize <= 0) {
log.warn("Buffer size of {}ms is illegal. Defaulting to {}",
bufferSize, UdpQueueFramePollerFactory.DEFAULT_BUFFER_DURATION)
bufferSize = UdpQueueFramePollerFactory.DEFAULT_BUFFER_DURATION
}
setFramePollerFactory(UdpQueueFramePollerFactory(bufferSize, Runtime.getRuntime().availableProcessors()))
} else {
log.warn("This system and architecture appears to not support native audio sending! "
+ "GC pauses may cause your bot to stutter during playback.")
}
}.create()
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package lavalink.server.config

import org.springframework.boot.context.properties.ConfigurationProperties
import org.springframework.stereotype.Component
import java.util.*

/**
* Created by napster on 20.05.18.
*/
@Component
@ConfigurationProperties(prefix = "sentry")
class SentryConfigProperties {
var dsn = ""
var environment = ""
var tags: Map<String, String> = HashMap()
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public SentryConfiguration(ServerConfig serverConfig, SentryConfigProperties sen
}

if (dsn != null && !dsn.isEmpty()) {
turnOn(dsn, sentryConfig.getTags());
turnOn(dsn, sentryConfig.getTags(), sentryConfig.getEnvironment());
if (warnDeprecatedDsnConfig) {
log.warn("Please update the location of the sentry dsn in lavalinks config file / your environment "
+ "vars, it is now located under 'sentry.dsn' instead of 'lavalink.server.sentryDsn'.");
Expand All @@ -47,9 +47,10 @@ public SentryConfiguration(ServerConfig serverConfig, SentryConfigProperties sen
}


public void turnOn(String dsn, Map<String, String> tags) {
public void turnOn(String dsn, Map<String, String> tags, String environment) {
log.info("Turning on sentry");
SentryClient sentryClient = Sentry.init(dsn);
if (!environment.isBlank()) sentryClient.setEnvironment(environment);

if (tags != null) {
tags.forEach(sentryClient::addTag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class ServerConfig {
var sentryDsn = ""
var bufferDurationMs: Int? = null
var youtubePlaylistLoadLimit: Int? = null
var playerUpdateInterval: Int? = 5
var isGcWarnings = true
var isYoutubeSearchEnabled = true
var isSoundcloudSearchEnabled = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ class RoutePlannerRestHandler(private val routePlanner: AbstractRoutePlanner?) {
* Removes a single address from the addresses which are currently marked as failing
*/
@PostMapping("/routeplanner/free/address")
fun freeSingleAddress(request: HttpServletRequest, @RequestBody requestBody: JSONObject): ResponseEntity<Void> {
fun freeSingleAddress(request: HttpServletRequest, @RequestBody requestBody: String): ResponseEntity<Void> {
routePlanner ?: throw RoutePlannerDisabledException()
try {
val address = InetAddress.getByName(requestBody.getString("address"))
val jsonObject = JSONObject(requestBody)
val address = InetAddress.getByName(jsonObject.getString("address"))
routePlanner.freeAddress(address)
return ResponseEntity.noContent().build()
} catch (exception: UnknownHostException) {
Expand All @@ -65,7 +66,7 @@ class RoutePlannerRestHandler(private val routePlanner: AbstractRoutePlanner?) {
*/
private fun getDetailBlock(planner: AbstractRoutePlanner): IRoutePlannerStatus {
val ipBlock = planner.ipBlock
val ipBlockStatus = IpBlockStatus(ipBlock.type.simpleName, ipBlock.size.toString() ?: "0")
val ipBlockStatus = IpBlockStatus(ipBlock.type.simpleName, ipBlock.size.toString())

val failingAddresses = planner.failingAddresses
val failingAddressesStatus = failingAddresses.entries.map {
Expand Down
Loading

0 comments on commit 644b8c9

Please sign in to comment.