Skip to content

Commit

Permalink
Merge pull request schnapster#1 from MinnDevelopment/cleanup
Browse files Browse the repository at this point in the history
Add support for speaking modes and cleanup code
  • Loading branch information
MinnDevelopment authored Jan 21, 2019
2 parents 8e48753 + 0a66069 commit b369419
Show file tree
Hide file tree
Showing 27 changed files with 356 additions and 337 deletions.
59 changes: 0 additions & 59 deletions .travis.yml

This file was deleted.

92 changes: 92 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@

## Changelog

Expect breaking changes between minor versions while v1 has not been released.

### v0.9.1
- Add speaking modes
- Change transitive dependencies to proper api/implementation scopes
- Fix several javadoc errors

### v0.9.0
- Support java 8 through 10

### v0.8.3
- Fix bug with reconnecting in the same guild introduced in 0.8.2

### v0.8.2
- Idempotent handling of connection requests [\#16](https://github.com/napstr/Magma/pull/16) (thanks @Frederikam)

### v0.8.1
- Fix jitpack build

### v0.8.0
- Add a WebsocketConnectionState to report the state of the websocket connections managed by a MagmaApi

### v0.7.0
- Bump dependencies, including Java 11.

### v0.6.0
- Introduce `MagmaApi#getEventStream` that allows user code to consume events from Magma, for example when the
websocket is closed.

### v0.5.0
- Port the remaining changes of JDA 3.7 (see [\#651](https://github.com/DV8FromTheWorld/JDA/pull/651)),
notably the switch from `byte[]`s to `ByteBuffer`s in most places. This includes a backwards incompatible change to
`IPacketProvider`, marking it as a non-threadsafe class.
**Known issues:** Applications using [japp](https://github.com/Shredder121/jda-async-packetprovider)
1.2 or below have broken audio output.

### v0.4.5
- Use direct byte buffers (off heap) for Undertow

### v0.4.4
- Send our SSRC along with OP 5 Speaking updates
- Add MDC and more trace logs to enable better reporting of issues
- Update close code handling for expected 1xxx codes and warnings on suspicious closes
- Deal with Opus interpolation

### v0.4.3
- Fix 4003s closes due to sending events before identifying

### v0.4.0
- Opus conversion removed. Send handlers are expected to provide opus packets.
- Fix for a possible leak of send handlers

### v0.3.3
- Fully event based AudioConnection
- Correct Schedulers used for event processing
- Dependency updates
- Code quality improvements via SonarCloud

### v0.3.2
- Log endpoint to which the connection has been closed along with the reason
- Share a BufferPool between all connections to avoid memory leak

### v0.3.1
- Dependency updates
- Additional experimental build against Java 11

### v0.3.0
- Type and parameter safety in the Api by introducing a simple DSL

### v0.2.1
- Handle op 14 events

### v0.2.0
- Build with java 10

### v0.1.2
- Implement v4 of Discords Voice API

### v0.1.1
- Depend on opus-java through jitpack instead of a git submodule

### v0.1.0
- Ignore more irrelevant events
- Smol docs update
- Licensed as Apache 2.0
- Use IP provided by Discord instead of endpoint address for the UDP connection

### v0.0.1
- It's working, including resumes.
89 changes: 0 additions & 89 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,95 +228,6 @@ logging:
space.npstr.magma: TRACE
```
## Changelog
Expect breaking changes between minor versions while v1 has not been released.
### v0.9.0
- Support java 8 through 10
### v0.8.3
- Fix bug with reconnecting in the same guild introduced in 0.8.2
### v0.8.2
- Idempotent handling of connection requests [\#16](https://github.com/napstr/Magma/pull/16) (thanks @Frederikam)
### v0.8.1
- Fix jitpack build
### v0.8.0
- Add a WebsocketConnectionState to report the state of the websocket connections managed by a MagmaApi
### v0.7.0
- Bump dependencies, including Java 11.
### v0.6.0
- Introduce `MagmaApi#getEventStream` that allows user code to consume events from Magma, for example when the
websocket is closed.

### v0.5.0
- Port the remaining changes of JDA 3.7 (see [\#651](https://github.com/DV8FromTheWorld/JDA/pull/651)),
notably the switch from `byte[]`s to `ByteBuffer`s in most places. This includes a backwards incompatible change to
`IPacketProvider`, marking it as a non-threadsafe class.
**Known issues:** Applications using [japp](https://github.com/Shredder121/jda-async-packetprovider)
1.2 or below have broken audio output.

### v0.4.5
- Use direct byte buffers (off heap) for Undertow

### v0.4.4
- Send our SSRC along with OP 5 Speaking updates
- Add MDC and more trace logs to enable better reporting of issues
- Update close code handling for expected 1xxx codes and warnings on suspicious closes
- Deal with Opus interpolation

### v0.4.3
- Fix 4003s closes due to sending events before identifying

### v0.4.0
- Opus conversion removed. Send handlers are expected to provide opus packets.
- Fix for a possible leak of send handlers

### v0.3.3
- Fully event based AudioConnection
- Correct Schedulers used for event processing
- Dependency updates
- Code quality improvements via SonarCloud

### v0.3.2
- Log endpoint to which the connection has been closed along with the reason
- Share a BufferPool between all connections to avoid memory leak

### v0.3.1
- Dependency updates
- Additional experimental build against Java 11

### v0.3.0
- Type and parameter safety in the Api by introducing a simple DSL

### v0.2.1
- Handle op 14 events

### v0.2.0
- Build with java 10

### v0.1.2
- Implement v4 of Discords Voice API

### v0.1.1
- Depend on opus-java through jitpack instead of a git submodule

### v0.1.0
- Ignore more irrelevant events
- Smol docs update
- Licensed as Apache 2.0
- Use IP provided by Discord instead of endpoint address for the UDP connection

### v0.0.1
- It's working, including resumes.


## Dependencies:
- **JSON In Java**:
Expand Down
36 changes: 13 additions & 23 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ apply plugin: 'com.github.ben-manes.versions'


group = 'club.minnced'
version = "0.9.0"
version = '0.9.1'
archivesBaseName = project.name

sourceCompatibility = targetCompatibility = 1.8
Expand All @@ -51,6 +51,8 @@ ext {

springVersion = '5.1.1.RELEASE'
undertowVersion = '2.0.14.Final'
xnioVersion = '3.3.8.Final'
reactorVersion = '3.2.1.RELEASE'

spotbugsVersion = '3.1.8'
annotationsVersion = '0.0.1'
Expand All @@ -64,20 +66,22 @@ ext {

dependencies {
//@formatter:off
compile group: 'org.json', name: 'json', version: orgJsonVersion
compile group: 'org.slf4j', name: 'slf4j-api', version: slf4jVersion
implementation group: 'org.json', name: 'json', version: orgJsonVersion
implementation group: 'org.slf4j', name: 'slf4j-api', version: slf4jVersion

// project reactor & reactive websocket client
compile group: 'org.springframework', name: 'spring-webflux', version: springVersion
compile group: 'io.undertow', name: 'undertow-core', version: undertowVersion
implementation group: 'io.undertow', name: 'undertow-core', version: undertowVersion
api group: 'org.springframework', name: 'spring-webflux', version: springVersion
api group: 'org.jboss.xnio', name: 'xnio-nio', version: xnioVersion
api group: 'io.projectreactor', name: 'reactor-core', version: reactorVersion

// annotations
compileOnly group: 'com.github.spotbugs', name: 'spotbugs-annotations', version: spotbugsVersion
compileOnly group: 'space.npstr', name: 'annotations', version: annotationsVersion //todo replace with findBugs

// immutable objects, to pass values around
annotationProcessor group: 'org.immutables', name: 'value', version: immutablesVersion
compileOnly group: 'org.immutables', name: 'value', version: immutablesVersion, classifier: 'annotations'
annotationProcessor group: 'org.immutables', name: 'value', version: immutablesVersion

// testing
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: junitVersion
Expand Down Expand Up @@ -159,6 +163,8 @@ bintray {
}
}

defaultTasks 'build'

bintrayUpload {
dependsOn clean
dependsOn build
Expand All @@ -179,20 +185,4 @@ idea {
mainDependenciesScope = 'PROVIDED'
}
}
}

//returns either a git tag if there is one on this commit, or the commit hash, to be used as a version
@SuppressWarnings("GrMethodMayBeStatic")
String versionFromTag() {
def headTag = grgit.tag.list().find {
it.commit == grgit.head()
}

def clean = grgit.status().clean //uncommited changes? -> should be SNAPSHOT

if (headTag && clean) {
headTag.getName()
} else {
"${grgit.head().id}-SNAPSHOT"
}
}
}
3 changes: 0 additions & 3 deletions jitpack.yml

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/java/net/dv8tion/jda/core/audio/AudioPacket.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
package net.dv8tion.jda.core.audio;

import com.iwebpp.crypto.TweetNaclFast;
import edu.umd.cs.findbugs.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.Nullable;
import java.nio.ByteBuffer;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@

/**
* Factory interface for the creation of new {@link net.dv8tion.jda.core.audio.factory.IAudioSendSystem IAudioSendSystem} objects.
* <br>JDA, by default, uses {@link net.dv8tion.jda.core.audio.factory.DefaultSendFactory DefaultSendFactory} for the
* creation of its UDP audio packet sending system.
* <p>
* Implementations of this interface are provided to
* {@link net.dv8tion.jda.core.JDABuilder#setAudioSendFactory(IAudioSendFactory) JDABuilder.setAudioSendFactory(IAudioSendFactory)}.
*/
public interface IAudioSendFactory
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
* <br>This interface is provided so that developers can provide their own implementation for different management
* of thread pools, process usage, and even for forwarding to native binaries implemented in other languages like C
* to avoid problems with JVM GC StopTheWorld events.
* <br>JDA, by default, uses {@link net.dv8tion.jda.core.audio.factory.DefaultSendSystem DefaultSendSystem} for its
* UDP audio packet sending loop.
*/
public interface IAudioSendSystem
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ public interface IPacketProvider
/**
* Provides the current channel that this connection is transmitting to.
*
* @return The {@link net.dv8tion.jda.core.entities.VoiceChannel VoiceChannel} that this connection is sending to.
* @return The id of the connected channel that this connection is sending to.
*/
String getConnectedChannel();

/**
* The UDP connection for this audio connection. The {@link net.dv8tion.jda.core.audio.factory.DefaultSendSystem DefaultSendSystem}
* The UDP connection for this audio connection. The Send System
* uses this socket to send audio packets to discord, and this is also the socket used to receive audio packets from discord.
* <br>If you are implementing your own system, it is recommended that you used this connection as it is part of JDA's internal
* system that JDA monitors for errors and closures. It should be noted however that using this is not required to
Expand Down
Loading

0 comments on commit b369419

Please sign in to comment.