Remove debug code

This commit is contained in:
games647
2016-07-20 20:03:17 +02:00
parent f7626ab969
commit dc395cdc3f

View File

@ -83,37 +83,37 @@ public abstract class MojangApiConnector {
*/ */
public UUID getPremiumUUID(String playerName) { public UUID getPremiumUUID(String playerName) {
//check if it's a valid playername //check if it's a valid playername
// if (playernameMatcher.matcher(playerName).matches()) { if (playernameMatcher.matcher(playerName).matches()) {
//only make a API call if the name is valid existing mojang account // only make a API call if the name is valid existing mojang account
// if (requests.size() >= rateLimit || System.currentTimeMillis() - lastRateLimit < 1_000 * 60 * 10) { if (requests.size() >= rateLimit || System.currentTimeMillis() - lastRateLimit < 1_000 * 60 * 10) {
// plugin.getLogger().fine("STILL WAITING FOR RATE_LIMIT - TRYING Third-party API"); // plugin.getLogger().fine("STILL WAITING FOR RATE_LIMIT - TRYING Third-party API");
return getUUIDFromAPI(playerName); return getUUIDFromAPI(playerName);
// } }
// requests.put(new Object(), new Object()); requests.put(new Object(), new Object());
//
// try { try {
// HttpsURLConnection connection = getConnection(UUID_LINK + playerName); HttpsURLConnection connection = getConnection(UUID_LINK + playerName);
// if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) { if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {
// BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
// String line = reader.readLine(); String line = reader.readLine();
// if (line != null && !line.equals("null")) { if (line != null && !line.equals("null")) {
// return getUUIDFromJson(line); return getUUIDFromJson(line);
// } }
// } else if (connection.getResponseCode() == RATE_LIMIT_CODE) { } else if (connection.getResponseCode() == RATE_LIMIT_CODE) {
// logger.info("RATE_LIMIT REACHED - TRYING THIRD-PARTY API"); logger.info("RATE_LIMIT REACHED - TRYING THIRD-PARTY API");
// lastRateLimit = System.currentTimeMillis(); lastRateLimit = System.currentTimeMillis();
// return getUUIDFromAPI(playerName); return getUUIDFromAPI(playerName);
// } }
// //204 - no content for not found //204 - no content for not found
// } catch (Exception ex) { } catch (Exception ex) {
// logger.log(Level.SEVERE, "Failed to check if player has a paid account", ex); logger.log(Level.SEVERE, "Failed to check if player has a paid account", ex);
// } }
// //this connection doesn't need to be closed. So can make use of keep alive in java //this connection doesn't need to be closed. So can make use of keep alive in java
// } }
//
// return null; return null;
} }
public UUID getUUIDFromAPI(String playerName) { public UUID getUUIDFromAPI(String playerName) {