Skip to content

Commit

Permalink
Tidy up dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
rtm516 committed Aug 21, 2024
1 parent 1133152 commit 2776de7
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 225 deletions.
12 changes: 1 addition & 11 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,8 @@ dependencies {
api(libs.minecraftauth)
api(libs.bundles.protocol)

implementation("dev.onvoid.webrtc:webrtc-java:0.8.0")
implementation("dev.onvoid.webrtc", "webrtc-java", "0.8.0", classifier = "windows-x86_64")
implementation("dev.onvoid.webrtc", "webrtc-java", "0.8.0", classifier = "macos-x86_64")
implementation("dev.onvoid.webrtc", "webrtc-java", "0.8.0", classifier = "macos-aarch64")
implementation("dev.onvoid.webrtc", "webrtc-java", "0.8.0", classifier = "linux-x86_64")
implementation("dev.onvoid.webrtc", "webrtc-java", "0.8.0", classifier = "linux-aarch64")
implementation("dev.onvoid.webrtc", "webrtc-java", "0.8.0", classifier = "linux-aarch32")

api("org.jitsi:ice4j:3.0-72-g824cd4b")
api("org.bouncycastle:bcprov-jdk18on:1.78.1")
api("org.bouncycastle:bctls-jdk18on:1.78.1")
api("org.bouncycastle:bcpkix-jdk18on:1.78.1")
api(libs.bundles.bouncycastle)

// Needs https://github.com/steely-glint/srtplight and https://github.com/pipe/sctp4j to be installed locally
api("pe.pi:sctp4j:1.0.7-SNAPSHOT")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void onMessage(String message) {
connectionId = ((Map<String, String>) parts[4]).get("ConnectionId");
firstConnectionId = false;
} else {
logger.debug("Websocket message: " + message);
logger.debug("RTA Websocket message: " + message);
}
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import com.rtm516.mcxboxbroadcast.core.Logger;
import com.rtm516.mcxboxbroadcast.core.models.ws.WsFromMessage;
import com.rtm516.mcxboxbroadcast.core.models.ws.WsToMessage;
import dev.onvoid.webrtc.PeerConnectionFactory;
import dev.onvoid.webrtc.RTCConfiguration;
import io.jsonwebtoken.lang.Collections;
import java.io.IOException;
import java.math.BigInteger;
Expand Down Expand Up @@ -60,12 +58,8 @@ public class RtcWebsocketClient extends WebSocketClient {
private final Logger logger;
private final ScheduledExecutorService scheduledExecutorService;

private RTCConfiguration rtcConfig;
public PeerConnectionFactory peerFactory;
private Agent agent;
private Component component;
private Map<String, PeerSession> activeSessions = new HashMap<>();
private PeerSession pendingSession;
private ScheduledFuture<?> heartbeatFuture;

/**
Expand All @@ -83,12 +77,10 @@ public RtcWebsocketClient(String authenticationToken, ExpandedSessionInfo sessio

this.logger = logger;
this.scheduledExecutorService = scheduledExecutorService;

this.peerFactory = new PeerConnectionFactory();
}

/**
* When the web socket connects send the request for the connection ID
* When the web socket connects start the heartbeat to keep the connection alive
*
* @see WebSocketClient#onOpen(ServerHandshake)
*
Expand All @@ -103,17 +95,16 @@ public void onOpen(ServerHandshake serverHandshake) {
}

/**
* When we get a message check if it's a connection ID message
* and handle otherwise ignore it
* When we get a message parse its json and handle it
*
* @see WebSocketClient#onMessage(String)
*
* @param data The UTF-8 decoded message that was received.
* @param message The UTF-8 decoded message that was received.
*/
@Override
public void onMessage(String data) {
logger.info(data);
var messageWrapper = Constants.GSON.fromJson(data, WsFromMessage.class);
public void onMessage(String message) {
logger.debug("RTC Websocket message: " + message);
var messageWrapper = Constants.GSON.fromJson(message, WsFromMessage.class);

if (messageWrapper.Type() == 2) {
initialize(messageWrapper.message());
Expand Down
10 changes: 10 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ spring-security-test = "6.3.1"
junit = "1.10.2"
spring-dependency = "1.1.5" # Spring Dependency Management Plugin
guava = "33.2.1-jre"
bouncycastle = "1.78.1"

shadow = "8.1.1"
indra = "3.1.3"
Expand Down Expand Up @@ -68,6 +69,10 @@ junit-platform-launcher = { group = "org.junit.platform", name = "junit-platform

guava = { group = "com.google.guava", name = "guava", version.ref = "guava" }

bouncycastle-prov = { group = "org.bouncycastle", name = "bcprov-jdk18on", version.ref = "bouncycastle" }
bouncycastle-tls = { group = "org.bouncycastle", name = "bctls-jdk18on", version.ref = "bouncycastle" }
bouncycastle-pkix = { group = "org.bouncycastle", name = "bcpkix-jdk18on", version.ref = "bouncycastle" }

[bundles]
jackson = [
"jackson-core",
Expand Down Expand Up @@ -103,6 +108,11 @@ protocol = [
"protocol-codec",
"protocol-connection"
]
bouncycastle = [
"bouncycastle-prov",
"bouncycastle-tls",
"bouncycastle-pkix"
]

[plugins]
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }
Expand Down

0 comments on commit 2776de7

Please sign in to comment.