mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-26 03:46:28 -08:00
Android ByteBuffer and Color fixes (#842)
This commit is contained in:
1 parent
185dc8d674
commit
3f307605cc
6 files changed
+12
-40
No files matched your search
@@ -0,0 +1,4 @@
|
||||
package java.awt;
|
||||
|
||||
public class Color {
|
||||
}
|
||||
@@ -72,7 +72,7 @@ public class OSCRouter {
|
||||
// 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);
|
||||
}
|
||||
@@ -114,10 +114,7 @@ public class OSCRouter {
|
||||
// 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(
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
package dev.slimevr.osc;
|
||||
|
||||
import com.illposed.osc.OSCSerializerAndParserBuilder;
|
||||
|
||||
|
||||
public class OSCStatic {
|
||||
public static OSCSerializerAndParserBuilder serializer;
|
||||
|
||||
static {
|
||||
// Really hacky workaround for getting the OSC library to work on
|
||||
// Android (Removes reference to java.awt.Color)
|
||||
OSCSerializerAndParserBuilder serializer = new OSCSerializerAndParserBuilder();
|
||||
serializer.setUsingDefaultHandlers(true);
|
||||
serializer.unregisterArgumentHandler('r');
|
||||
|
||||
OSCStatic.serializer = serializer;
|
||||
}
|
||||
}
|
||||
@@ -93,10 +93,7 @@ public class VMCHandler implements OSCHandler {
|
||||
// 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);
|
||||
}
|
||||
@@ -130,10 +127,7 @@ public class VMCHandler implements OSCHandler {
|
||||
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(
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
@@ -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(
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user