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

Author Topic: Individual Vote Reward.  (Read 2740 times)

0 Members and 1 Guest are viewing this topic.

Offlinemarciox25

  • Newbie
  • *
  • Posts: 3
  • L2topzone Votes: 19
  • Servers reviews: 0
  • Reputation: +0/-0
  • L2topzone.com
    Individual Vote Reward.
    « on: November 20, 2016, 05:26:16 AM »
    Hello, I'm having some problems, or I think Im. Last time when I had the server running, it was working perfectly.
    and on the config it should be like this
    TopzoneUrl = https://l2topzone.com/lineage/server-info/IDSERVER/L2NAMESERVER
    (Name and ID censored soon avaible for public). and now I went and test it again and it simply didnt worked.
    I saw a thing on the my home space, and saw a API related part. Do I need to put the API link in the URL now?

    Any Help? Thank you!
    Code: [Select]
    protected static int getTopZoneVotes()
    {
    int votes = -1;
    URL url = null;
    URLConnection con = null;
    InputStream is = null;
    InputStreamReader isr = null;
    BufferedReader in = null;
    try
    {
    url = new URL(Config.VOTE_LINK_TOPZONE);
    con = url.openConnection();
    con.addRequestProperty("User-Agent", "L2TopZone");
    is = con.getInputStream();
    isr = new InputStreamReader(is);
    in = new BufferedReader(isr);

    String inputLine;
    while ((inputLine = in.readLine()) != null)
    {

    if (inputLine.contains("</span></small>"))
    {
    votes = Integer.valueOf(inputLine.split(">")[9].replace("</span", ""));
    return votes;
    }
    }


    }
    catch (Exception e)
    {
    e.printStackTrace();
    }
    return votes;
    }



    Linkback: https://l2topzone.com/forum/index.php?topic=26739.0
    « Last Edit: November 20, 2016, 05:26:53 AM by marciox25 »

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

    Offlinexzone

    • Read our rules
    • Hero Member
    • *****
    • Posts: 663
    • L2topzone Votes: 52
    • Servers reviews: 159
    • Reputation: +10480/-0
      • l2topzone

    Offlinemarciox25

    • Newbie
    • *
    • Posts: 3
    • L2topzone Votes: 19
    • Servers reviews: 0
    • Reputation: +0/-0
    • L2topzone.com
      Re: Individual Vote Reward.
      « Reply #2 on: November 20, 2016, 08:43:02 AM »
      Hey, thank you for your answer. Ive read them but I havent seen any instructions of how to properly put the API in the code...

      //edit

      Found it , will take a look and if needed will addapt the code, thx
      « Last Edit: November 20, 2016, 08:47:06 AM by marciox25 »

       

      Sitemap