Jump to content
  • 0

Help Hopzone


szawex
 Share

Question

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

 

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • 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