diff --git a/src/main/example/ChatServer.java b/src/main/example/ChatServer.java index a27cb0ee0..d0d27c664 100644 --- a/src/main/example/ChatServer.java +++ b/src/main/example/ChatServer.java @@ -61,7 +61,21 @@ public static void main( String[] args ) throws InterruptedException , IOExcepti BufferedReader sysin = new BufferedReader( new InputStreamReader( System.in ) ); while ( true ) { String in = sysin.readLine(); - s.sendToAll( in ); + if (!in.equals("")){ + s.sendToAll("wake"); + if (in.equals("o")) { + s.sendToAll( "open_camera" ); + } else if (in.equals("s")) { + s.sendToAll( "start_" + (System.currentTimeMillis() + 5000) ); + } else if (in.equals("t")) { + s.sendToAll( "stop_" + (System.currentTimeMillis() + 5000) ); + } else if (in.equals("h")) { + s.sendToAll( "home" ); + } else if (in.equals("w")) { + s.sendToAll("wake"); + } + } + if( in.equals( "exit" ) ) { s.stop(); break; @@ -72,7 +86,8 @@ public static void main( String[] args ) throws InterruptedException , IOExcepti } } } - @Override + + @Override public void onError( WebSocket conn, Exception ex ) { ex.printStackTrace(); if( conn != null ) {