From 12d7f191ee4b737281cc2e3b04f01366bc67197c Mon Sep 17 00:00:00 2001 From: Eiren Rain Date: Sat, 4 Sep 2021 09:25:16 +0300 Subject: [PATCH] Fix NPE, added bat scripts to the build --- resources/firewall.bat | 13 +++++++++++++ resources/run.bat | 1 + src/main/java/io/eiren/vr/Main.java | 2 +- src/main/java/io/eiren/vr/VRServer.java | 2 +- .../eiren/vr/processor/HumanSkeletonWithLegs.java | 5 +++++ 5 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 resources/firewall.bat create mode 100644 resources/run.bat diff --git a/resources/firewall.bat b/resources/firewall.bat new file mode 100644 index 000000000..5d6356031 --- /dev/null +++ b/resources/firewall.bat @@ -0,0 +1,13 @@ +@echo off +echo Installing firewall rules... + +rem Rotational data default port +netsh advfirewall firewall add rule name="UDP 6969 incoming" dir=in action=allow protocol=UDP localport=6969 +netsh advfirewall firewall add rule name="UDP 6969 outgoing" dir=out action=allow protocol=UDP localport=6969 + +rem Info server allowing automatic discovery +netsh advfirewall firewall add rule name="UDP 35903 incoming" dir=in action=allow protocol=UDP localport=35903 +netsh advfirewall firewall add rule name="UDP 35903 outgoing" dir=out action=allow protocol=UDP localport=35903 + +echo Done! +pause \ No newline at end of file diff --git a/resources/run.bat b/resources/run.bat new file mode 100644 index 000000000..0cf7c0255 --- /dev/null +++ b/resources/run.bat @@ -0,0 +1 @@ +@java -Xmx512M -jar slimevr.jar \ No newline at end of file diff --git a/src/main/java/io/eiren/vr/Main.java b/src/main/java/io/eiren/vr/Main.java index 6b404010c..1b8f87fbd 100644 --- a/src/main/java/io/eiren/vr/Main.java +++ b/src/main/java/io/eiren/vr/Main.java @@ -7,7 +7,7 @@ import io.eiren.util.logging.LogManager; public class Main { - public static String VERSION = "0.0.18 Test 1"; + public static String VERSION = "0.0.18 Test 2"; public static VRServer vrServer; diff --git a/src/main/java/io/eiren/vr/VRServer.java b/src/main/java/io/eiren/vr/VRServer.java index c3ce254db..e09aaa3d4 100644 --- a/src/main/java/io/eiren/vr/VRServer.java +++ b/src/main/java/io/eiren/vr/VRServer.java @@ -149,7 +149,7 @@ public class VRServer extends Thread { } @ThreadSafe - public void saveConfig() { + public synchronized void saveConfig() { List nodes = config.getNodeList("trackers", null); List> trackersConfig = new FastList<>(nodes.size()); for(int i = 0; i < nodes.size(); ++i) { diff --git a/src/main/java/io/eiren/vr/processor/HumanSkeletonWithLegs.java b/src/main/java/io/eiren/vr/processor/HumanSkeletonWithLegs.java index 236947862..e5600043c 100644 --- a/src/main/java/io/eiren/vr/processor/HumanSkeletonWithLegs.java +++ b/src/main/java/io/eiren/vr/processor/HumanSkeletonWithLegs.java @@ -8,6 +8,7 @@ import com.jme3.math.Vector3f; import io.eiren.util.ann.VRServerThread; import io.eiren.vr.VRServer; +import io.eiren.vr.trackers.ComputedTracker; import io.eiren.vr.trackers.Tracker; import io.eiren.vr.trackers.TrackerStatus; import io.eiren.vr.trackers.TrackerUtils; @@ -90,6 +91,10 @@ public class HumanSkeletonWithLegs extends HumanSkeletonWithWaist { if(t.skeletonPosition == ComputedHumanPoseTrackerPosition.RIGHT_KNEE) rkt = t; } + if(lat == null) + lat = new ComputedHumanPoseTracker(ComputedHumanPoseTrackerPosition.LEFT_FOOT); + if(rat == null) + rat = new ComputedHumanPoseTracker(ComputedHumanPoseTrackerPosition.RIGHT_FOOT); computedLeftFootTracker = lat; computedRightFootTracker = rat; computedLeftKneeTracker = lkt;