Hi. J have 1 problem with HopZone not work, TopZone is work. L2jFrozen rev 1004. This is code :
protected int getHopZoneVotes() {
int votes = -1;
URL url = null;
URLConnection con = null;
InputStream is = null;
InputStreamReader isr = null;
BufferedReader in = null;
try {
url = new URL(PowerPakConfig.VOTES_SITE_HOPZONE_URL);
con = url.openConnection();
con.addRequestProperty("User-Agent", "Mozilla/4.76");
is = con.getInputStream();
isr = new InputStreamReader(is);
in = new BufferedReader(isr);
String inputLine;
while ((inputLine = in.readLine()) != null) {
if (inputLine.contains("rank anonymous tooltip")) {
votes = Integer.valueOf(inputLine.split(">")[2].replace("</span", ""));
break;
}
}
} catch (Exception e) {
_log.info("HOPZONE : is offline or something is wrong in link");
Announcements.getInstance().gameAnnounceToAll("HOPZONE : is offline. We will check reward as it will be online again");
//e.printStackTrace();
} finally {
if (in != null) {
try {
in.close();
} catch (IOException e1) {
_log.info("unhandled exception");
}
}
if (isr != null) {
try {
isr.close();
} catch (IOException e1) {
_log.info("unhandled exception");
}
}
if (is != null) {
try {
is.close();
} catch (IOException e1) {
_log.info("unhandled exception");
}
}
}
return votes;
}