webidor/src/main/java/cz/xelfi/quoridor/webidor/resources/Quoridor.java
changeset 123 4529cb22ff7d
parent 121 95dfb04fcee1
child 124 90371f3eb106
     1.1 --- a/webidor/src/main/java/cz/xelfi/quoridor/webidor/resources/Quoridor.java	Sun Oct 11 14:20:19 2009 +0200
     1.2 +++ b/webidor/src/main/java/cz/xelfi/quoridor/webidor/resources/Quoridor.java	Sun Oct 11 19:32:48 2009 +0200
     1.3 @@ -120,7 +120,7 @@
     1.4      // start the server
     1.5      //
     1.6  
     1.7 -    public static void main(String[] args) throws IOException {
     1.8 +    public static void main(String[] args) throws IOException, InterruptedException {
     1.9          int port = 9222;
    1.10          try {
    1.11              port = Integer.parseInt(args[0]);
    1.12 @@ -131,6 +131,14 @@
    1.13          System.out.println(
    1.14              "Quoridor started at port " + port + "\n" + "Hit enter to stop it..."
    1.15          );
    1.16 +        if (args.length < 2 || !args[args.length - 1].equals("--kill")) {
    1.17 +            System.out.println("Hit enter to stop it...");
    1.18 +            System.in.read();
    1.19 +        } else {
    1.20 +            synchronized (Quoridor.class) {
    1.21 +                Quoridor.class.wait();
    1.22 +            }
    1.23 +        }
    1.24          System.in.read();
    1.25          s.stop(0);
    1.26          System.exit(0);