private void version_reload_client_enabled(String[] cmd) throws IOException { if (cmd.length == 1) { if (logged) { VersionCheck.getInstance().loadFile(); OutputWrite("version_reload_client_enabled=OK"); } else { OutputWrite("version_reload_client_enabled=error"); } } else { OutputWrite("version_reload_client_enabled=error"); } }
private void version_getVersioniAbilitate(String[] cmd) throws IOException { if (cmd.length == 1) { if (logged) { ArrayList<Integer> v = VersionCheck.getInstance().getValidVersions(); StringBuilder str = new StringBuilder("version_get_client_enabled=OK"); for (int i = 0; i < v.size(); i++) { str.append(";version=" + v.get(i)); } OutputWrite(str.toString()); } else { OutputWrite("version_get_client_enabled=error"); } } else { OutputWrite("version_get_client_enabled=error"); } }
private void version_add_client_enabled(String[] cmd) throws IOException { if (cmd.length == 2) { if (logged) { try { Integer i = Integer.parseInt(cmd[1]); boolean b = VersionCheck.getInstance().aggiungiVersione(i); OutputWrite("version_add_client_enabled=" + (b ? "OK" : "error")); } catch (NumberFormatException e) { OutputWrite("version_add_client_enabled=error"); } } else { OutputWrite("version_add_client_enabled=error"); } } else { OutputWrite("version_add_client_enabled=error"); } }