diff --git a/control/NetworkHandler.java b/control/NetworkHandler.java index 52d8bd7..759173a 100644 --- a/control/NetworkHandler.java +++ b/control/NetworkHandler.java @@ -8,6 +8,7 @@ import java.net.SocketException; import java.net.UnknownHostException; import control.button.ButtonHandler; +import control.joystick.Joystick.Position; import control.joystick.JoystickHandler; public class NetworkHandler implements Runnable{ @@ -89,19 +90,85 @@ public class NetworkHandler implements Runnable{ } catch (IOException e) { e.printStackTrace(); } - String sentence = new String( receivePacket.getData()); + String sentence = new String( receivePacket.getData()); + + if(sentence.length() != 21) + return; + System.out.println("RECEIVED: " + sentence); String[] controls = sentence.split("\\|"); + int[] control = new int[controls.length]; + for(int i=0; i listeners; Set keys; - Joystick j; + public static Joystick j = new Joystick();; public JoystickHandler() { listeners = new ArrayList(); keys = new HashSet(); - j = new Joystick(); // if(Window.ON_RASP) // addGpioListeners(); }