@Override public String execute(String[] params) { String tmp = UserDATABASE.getInstance().getClientList(); BufferedReader bufReader = new BufferedReader(new StringReader(tmp)); String line = null; int c = 0; try { connection.print("!ack-getClientList"); while ((line = bufReader.readLine()) != null) { c++; connection.print("!userlist-item " + line); } } catch (IOException e) { System.out.println("Userlist was requested but could not be created!"); } if (c == 0) { return "!print" + " There are no other active users!"; } return ""; // "!print "+AuctionDATABASE.getInstance().getList(); }
@Override public String execute(String[] params) { String message = params[0]; UserDATABASE.getInstance().notifyLoggedInUsers("!print " + message); return ""; }