Platform() { super(new ProductionApiClient(apiKey, new OkHttpClient.Builder() .connectTimeout(1, TimeUnit.SECONDS) .writeTimeout(3, TimeUnit.SECONDS) .readTimeout(3, TimeUnit.SECONDS) .build()), executorService); }
} else { getLogger().info("Validating your server key..."); ApiClient client = new ProductionApiClient(configuration.getServerKey(), httpClient, this.getLogger()); try { updateInformation(client);
} else { getLogger().info("Validating your server key..."); ApiClient client = new ProductionApiClient(configuration.getServerKey(), httpClient); try { updateInformation(client);
} else { getLogger().info("Validating your server key..."); final ApiClient client = new ProductionApiClient(configuration.getServerKey(), httpClient);
} else { getLogger().info("Validating your server key..."); final ApiClient client = new ProductionApiClient(configuration.getServerKey(), httpClient); try { updateInformation(client);
@Override public void run() { ApiClient client = new ProductionApiClient(args[0], plugin.getHttpClient()); try { plugin.updateInformation(client); } catch (IOException | ApiException e) { plugin.getLogger().log(Level.SEVERE, "Unable to verify secret", e); sender.sendMessage(ChatColor.RED + plugin.getI18n().get("secret_does_not_work")); return; } ServerInformation information = plugin.getServerInformation(); plugin.setApiClient(client); plugin.getConfiguration().setServerKey(args[0]); try { plugin.saveConfiguration(); } catch (IOException e) { sender.sendMessage(ChatColor.RED + plugin.getI18n().get("secret_cant_be_saved")); } sender.sendMessage(ChatColor.GREEN + plugin.getI18n().get("secret_success", information.getServer().getName(), information.getAccount().getName())); plugin.getProxy().getScheduler().runAsync(plugin, plugin.getDuePlayerFetcher()); } });
@Override public void run() { String currentKey = plugin.getConfiguration().getServerKey(); ApiClient client = new ProductionApiClient((String) args.getOne("secret").get(), plugin.getHttpClient()); try { plugin.updateInformation(client); } catch (IOException | ApiException e) { plugin.getLogger().error("Unable to verify secret", e); src.sendMessage(Text.builder(plugin.getI18n().get("secret_does_not_work")).color(TextColors.RED).build()); return; } ServerInformation information = plugin.getServerInformation(); plugin.setApiClient(client); plugin.getListingUpdateTask().run(); plugin.getConfiguration().setServerKey((String) args.getOne("secret").get()); try { plugin.saveConfiguration(); } catch (IOException e) { src.sendMessage(Text.builder(plugin.getI18n().get("secret_cant_be_saved")).color(TextColors.RED).build()); } src.sendMessage(Text.builder(plugin.getI18n().get("secret_success", information.getServer().getName(), information.getAccount().getName())).color(TextColors.GREEN).build()); boolean repeatChecks = false; if (currentKey == "INVALID") { repeatChecks = true; } plugin.getDuePlayerFetcher().run(repeatChecks); } });
@Override public void run() { String currentKey = plugin.getConfiguration().getServerKey(); ApiClient client = new ProductionApiClient(args[0], plugin.getHttpClient()); try { plugin.updateInformation(client); } catch (Exception e) { plugin.getLogger().log(Level.SEVERE, "Unable to verify secret", e); sender.sendMessage(ChatColor.RED + plugin.getI18n().get("secret_does_not_work")); return; } ServerInformation information = plugin.getServerInformation(); plugin.setApiClient(client); plugin.getListingUpdateTask().run(); plugin.getConfiguration().setServerKey(args[0]); try { plugin.saveConfiguration(); } catch (IOException e) { sender.sendMessage(ChatColor.RED + plugin.getI18n().get("secret_cant_be_saved")); } sender.sendMessage(ChatColor.GREEN + plugin.getI18n().get("secret_success", information.getServer().getName(), information.getAccount().getName())); boolean repeatChecks = false; if (currentKey == "INVALID") { repeatChecks = true; } plugin.getDuePlayerFetcher().run(repeatChecks); } });
@Override public void run() { String currentKey = plugin.getConfiguration().getServerKey(); ApiClient client = new ProductionApiClient(args[0], plugin.getHttpClient()); try { plugin.updateInformation(client); } catch (IOException | ApiException e) { plugin.getLogger().error("Unable to verify secret", e); sender.sendMessage(TextFormat.RED + plugin.getI18n().get("secret_does_not_work")); return; } ServerInformation information = plugin.getServerInformation(); plugin.setApiClient(client); plugin.getConfiguration().setServerKey(args[0]); try { plugin.saveConfiguration(); } catch (IOException e) { sender.sendMessage(TextFormat.RED + plugin.getI18n().get("secret_cant_be_saved")); } sender.sendMessage(TextFormat.GREEN + plugin.getI18n().get("secret_success", information.getServer().getName(), information.getAccount().getName())); boolean repeatChecks = false; if (currentKey == "INVALID") { repeatChecks = true; } plugin.getDuePlayerFetcher().run(repeatChecks); } });