Jump to content
  • 0

Question

Posted

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;
    }

 

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock