l2topzone.com
l2topzone.com
l2topzone.com
l2topzone.com
l2topzone.com
l2topzone.com
l2topzone.com

Author Topic: Vote reward using total votes FIX  (Read 16466 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, 08:21:33 AM »
    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

    l2topzone.com
    l2topzone.com
    l2topzone.com
    l2topzone.com
    l2topzone.com

    Onlinexzone

    • Read our rules
    • Hero Member
    • *****
    • Posts: 660
    • L2topzone Votes: 52
    • Servers reviews: 159
    • Reputation: +10480/-0
      • l2topzone
    Re: Vote reward using total votes FIX
    « Reply #21 on: June 06, 2018, 12: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.

     

    Sitemap