Skip to content

Commit

Permalink
Android ByteBuffer and Color fixes (#842)
Browse files Browse the repository at this point in the history
  • Loading branch information
ButterscotchV committed Sep 16, 2023
1 parent 185dc8d commit 3f30760
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 40 deletions.
4 changes: 4 additions & 0 deletions server/android/src/main/java/java/awt/Color.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package java.awt;

public class Color {
}
7 changes: 2 additions & 5 deletions server/core/src/main/java/dev/slimevr/osc/OSCRouter.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void refreshSettings(boolean refreshHandlersSettings) {
// Else, create our own OSC receiver
if (oscReceiver == null) {
try {
oscReceiver = new OSCPortIn(OSCStatic.serializer, portIn);
oscReceiver = new OSCPortIn(portIn);
if (lastPortIn != portIn || !wasListening) {
LogManager.info("[OSCRouter] Listening to port " + portIn);
}
Expand Down Expand Up @@ -114,10 +114,7 @@ public void refreshSettings(boolean refreshHandlersSettings) {
// Else, create our own OSC sender
if (oscSender == null) {
try {
oscSender = new OSCPortOut(
OSCStatic.serializer,
new InetSocketAddress(address, portOut)
);
oscSender = new OSCPortOut(new InetSocketAddress(address, portOut));
if ((lastPortOut != portOut && lastAddress != address) || !wasConnected) {
LogManager
.info(
Expand Down
18 changes: 0 additions & 18 deletions server/core/src/main/java/dev/slimevr/osc/OSCStatic.java

This file was deleted.

10 changes: 2 additions & 8 deletions server/core/src/main/java/dev/slimevr/osc/VMCHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,7 @@ public void refreshSettings(boolean refreshRouterSettings) {
// Instantiates the OSC receiver
try {
int port = config.getPortIn();
oscReceiver = new OSCPortIn(
OSCStatic.serializer,
port
);
oscReceiver = new OSCPortIn(port);
if (lastPortIn != port || !wasListening) {
LogManager.info("[VMCHandler] Listening to port " + port);
}
Expand Down Expand Up @@ -130,10 +127,7 @@ public void refreshSettings(boolean refreshRouterSettings) {
try {
InetAddress address = InetAddress.getByName(config.getAddress());
int port = config.getPortOut();
oscSender = new OSCPortOut(
OSCStatic.serializer,
new InetSocketAddress(address, port)
);
oscSender = new OSCPortOut(new InetSocketAddress(address, port));
if ((lastPortOut != port && lastAddress != address) || !wasConnected) {
LogManager
.info(
Expand Down
10 changes: 2 additions & 8 deletions server/core/src/main/java/dev/slimevr/osc/VRCOSCHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,7 @@ class VRCOSCHandler(
// Instantiates the OSC receiver
try {
val port = config.portIn
oscReceiver = OSCPortIn(
OSCStatic.serializer,
port
)
oscReceiver = OSCPortIn(port)
if (lastPortIn != port || !wasListening) {
LogManager.info("[VRCOSCHandler] Listening to port $port")
}
Expand Down Expand Up @@ -142,10 +139,7 @@ class VRCOSCHandler(
try {
val address = InetAddress.getByName(config.address)
val port = config.portOut
oscSender = OSCPortOut(
OSCStatic.serializer,
InetSocketAddress(address, port)
)
oscSender = OSCPortOut(InetSocketAddress(address, port))
if (lastPortOut != port && lastAddress !== address || !wasConnected) {
LogManager
.info(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ class UDPProtocolParser {
if (bundlePacketLen == 0) continue

val bundlePacketStart = buf.position()
val bundleBuf = buf.slice(bundlePacketStart, bundlePacketLen)
val bundleBuf = buf.slice()
bundleBuf.limit(bundlePacketLen)
val bundlePacketId = bundleBuf.int
val newPacket = getNewPacket(bundlePacketId)
newPacket?.let {
Expand Down

0 comments on commit 3f30760

Please sign in to comment.