l2topzone.com
l2topzone.com

Author Topic: Vote reward using total votes FIX  (Read 10128 times)

0 Members and 1 Guest are viewing this topic.

Offlinemez

  • Newbie
  • *
  • Posts: 1
  • L2topzone Votes: 21
  • Servers reviews: 0
  • Reputation: +0/-0
  • L2topzone.com
    Re: Vote reward using total votes FIX
    « Reply #20 on: June 05, 2018, 09:21:33 AM »
    l2topzone.com
    Hello. I'm using l2jserver High Five. I have this code:
    Code: [Select]
    /**
    * Get the votes of TOPZONE
    * @return
    */
    public static int getVotesTopzone()
    {
    int votes = -1;
    URL url = null;
    URLConnection urlConnection = null;
    InputStream inputStream = null;
    InputStreamReader inputStreamReader = null;
    BufferedReader bufferedReader = null;
    try
    {
    url = new URL(ConfigData.TOPZONE_URL);
    urlConnection = url.openConnection();
    urlConnection.addRequestProperty("User-Agent", "L2TopZone");
    inputStream = urlConnection.getInputStream();
    inputStreamReader = new InputStreamReader(inputStream);
    bufferedReader = new BufferedReader(inputStreamReader);
    String inputLine;
    while ((inputLine = bufferedReader.readLine()) != null)
    {
    switch (TOPZONE_VOTE_LINK_TYPE)
    {
    case 0:
    if (inputLine.contains("fa fa-fw fa-lg fa-thumbs-up"))
    {
    votes = Integer.valueOf(inputLine.split(">")[1922].replace("</span", ""));
    }
    break;
    case 1:
    if (inputLine.contains("fa fa-fw fa-lg fa-thumbs-up"))
    {
    votes = Integer.valueOf(inputLine.split(">")[1926].replace("</span", ""));
    }
    break;
    }
    }
    }
    catch (Exception e)
    {
    e.printStackTrace();
    }
    return votes;
    }
    But return total votes -1

    Onlinexzone

    • Read our rules
    • Administrator
    • Hero Member
    • *****
    • Posts: 635
    • L2topzone Votes: 22
    • Servers reviews: 150
    • Reputation: +10480/-0
      • l2topzone
    Re: Vote reward using total votes FIX
    « Reply #21 on: June 06, 2018, 01:02:17 PM »
    Hello,
    We are not supporting that vote reward system. If you want your vote reward to work check reward section you have all the info you need there. We have a dedicated server side script that support also l2jserver.


    Share via diggShare via facebookShare via linkedinShare via myspaceShare via redditShare via twitter
     


    Sitemap