/** * This nice little class times out the startupserver, ie unless the specified nr of players connect before the given timelimit, this Thread will commit a System.exit(1); * @author Torbjörn Nilsson * @version 1.0 */ public class Timeout extends Thread{ int time = 0; public Timeout(int secs) { time = secs; } public void run() { System.out.println("w8ing..."); try { Thread.sleep(1000*time); } catch (InterruptedException e) { System.out.println("interrupted!"); } System.out.println("Timeout, exiting...."); System.exit(1); } }